diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp
index efe78ec7c..0aff6c557 100644
--- a/src/app/mainwindow.cpp
+++ b/src/app/mainwindow.cpp
@@ -1229,8 +1229,17 @@ void MainWindow::ActionDraw(bool checked)
ui->actionHistory->setEnabled(true);
ui->actionOptionDraw->setEnabled(true);
ui->actionNewDraw->setEnabled(true);
+ ui->actionTable->setEnabled(true);
+ ui->actionArrowTool->setEnabled(true);
+ ui->actionShowCurveDetails->setEnabled(true);
+ actionDockWidgetToolOptions->setEnabled(true);
+ undoAction->setEnabled(true);
+ redoAction->setEnabled(true);
- ui->toolBarOption->setVisible(true);
+ if (qApp->patternType() == MeasurementsType::Standard)
+ {
+ ui->toolBarOption->setVisible(true);
+ }
ui->dockWidgetLayoutPages->setVisible(false);
ui->dockWidgetToolOptions->setVisible(true);
@@ -1277,11 +1286,22 @@ void MainWindow::ActionDetails(bool checked)
ui->actionHistory->setEnabled(false);
ui->actionOptionDraw->setEnabled(false);
ui->actionNewDraw->setEnabled(false);
+ ui->actionTable->setEnabled(false);
+ ui->actionArrowTool->setEnabled(true);
+ ui->actionShowCurveDetails->setEnabled(false);
+ actionDockWidgetToolOptions->setEnabled(true);
+ undoAction->setEnabled(true);
+ redoAction->setEnabled(true);
- ui->toolBarOption->setVisible(false);
+ if (qApp->patternType() == MeasurementsType::Standard)
+ {
+ ui->toolBarOption->setVisible(true);
+ }
ui->dockWidgetLayoutPages->setVisible(false);
ui->dockWidgetToolOptions->setVisible(true);
+
+ helpLabel->setText("");
}
else
{
@@ -1333,8 +1353,18 @@ void MainWindow::ActionLayout(bool checked)
ui->actionHistory->setEnabled(false);
ui->actionOptionDraw->setEnabled(false);
ui->actionNewDraw->setEnabled(false);
+ ui->actionArrowTool->setEnabled(false);
+ ui->actionTable->setEnabled(false);
+ ui->actionShowCurveDetails->setEnabled(false);
+ actionDockWidgetToolOptions->setEnabled(false);
+ undoAction->setEnabled(false);
+ redoAction->setEnabled(false);
+ mouseCoordinate->setText("");
- ui->toolBarOption->setVisible(false);
+ if (qApp->patternType() == MeasurementsType::Standard)
+ {
+ ui->toolBarOption->setVisible(false);
+ }
ui->dockWidgetLayoutPages->setVisible(true);
ui->dockWidgetToolOptions->setVisible(false);
@@ -1345,6 +1375,8 @@ void MainWindow::ActionLayout(bool checked)
{
ui->toolButtonLayoutSettings->click();
}
+
+ helpLabel->setText("");
}
else
{
@@ -2295,13 +2327,13 @@ void MainWindow::CreateMenus()
UpdateRecentFileActions();
//Add Undo/Redo actions.
- QAction *undoAction = qApp->getUndoStack()->createUndoAction(this, tr("&Undo"));
+ undoAction = qApp->getUndoStack()->createUndoAction(this, tr("&Undo"));
undoAction->setShortcuts(QKeySequence::Undo);
undoAction->setIcon(QIcon::fromTheme("edit-undo"));
ui->menuPatternPiece->insertAction(ui->actionLast_tool, undoAction);
ui->toolBarTools->addAction(undoAction);
- QAction *redoAction = qApp->getUndoStack()->createRedoAction(this, tr("&Redo"));
+ redoAction = qApp->getUndoStack()->createRedoAction(this, tr("&Redo"));
redoAction->setShortcuts(QKeySequence::Redo);
redoAction->setIcon(QIcon::fromTheme("edit-redo"));
ui->menuPatternPiece->insertAction(ui->actionLast_tool, redoAction);
@@ -2312,7 +2344,8 @@ void MainWindow::CreateMenus()
ui->menuPatternPiece->insertAction(ui->actionPattern_properties, separatorAct);
//Add dock
- ui->menuPatternPiece->insertAction(ui->actionPattern_properties, ui->dockWidgetToolOptions->toggleViewAction());
+ actionDockWidgetToolOptions = ui->dockWidgetToolOptions->toggleViewAction();
+ ui->menuPatternPiece->insertAction(ui->actionPattern_properties, actionDockWidgetToolOptions);
separatorAct = new QAction(this);
separatorAct->setSeparator(true);
diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui
index f5b72fcfb..b502d1349 100644
--- a/src/app/mainwindow.ui
+++ b/src/app/mainwindow.ui
@@ -50,7 +50,7 @@
0
0
- 105
+ 100
272
@@ -337,7 +337,7 @@
0
0
- 105
+ 100
58
@@ -413,7 +413,7 @@
0
0
- 105
+ 100
156
@@ -567,7 +567,7 @@
0
0
- 105
+ 100
104
@@ -741,6 +741,14 @@
+
+
+ 0
+ 0
+ 87
+ 58
+
+
Layout
@@ -754,7 +762,9 @@
Settings
-
+
+
+
@@ -1474,6 +1484,9 @@
+
+ false
+
Last Tool
diff --git a/src/app/mainwindowsnogui.cpp b/src/app/mainwindowsnogui.cpp
index 08b06c8de..fdbf6360f 100644
--- a/src/app/mainwindowsnogui.cpp
+++ b/src/app/mainwindowsnogui.cpp
@@ -42,7 +42,8 @@
MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
: QMainWindow(parent), listDetails(QVector()), currentScene(nullptr), tempSceneLayout(nullptr),
pattern(new VContainer()), papers(QList()), shadows(QList()),
- scenes(QList()), details(QList >())
+ scenes(QList()), details(QList >()), undoAction(nullptr),
+ redoAction(nullptr), actionDockWidgetToolOptions(nullptr)
{
InitTempLayoutScene();
}
diff --git a/src/app/mainwindowsnogui.h b/src/app/mainwindowsnogui.h
index 4a426f86e..0716d0382 100644
--- a/src/app/mainwindowsnogui.h
+++ b/src/app/mainwindowsnogui.h
@@ -62,6 +62,10 @@ protected:
QList scenes;
QList > details;
+ QAction *undoAction;
+ QAction *redoAction;
+ QAction *actionDockWidgetToolOptions;
+
void PrepareDetailsForLayout(const QHash *details);
void InitTempLayoutScene();