Disable or hide all unnecessary functions in Layout mode.
--HG-- branch : feature
This commit is contained in:
parent
80d7c39a92
commit
7a7753e3f1
|
@ -1229,8 +1229,17 @@ void MainWindow::ActionDraw(bool checked)
|
||||||
ui->actionHistory->setEnabled(true);
|
ui->actionHistory->setEnabled(true);
|
||||||
ui->actionOptionDraw->setEnabled(true);
|
ui->actionOptionDraw->setEnabled(true);
|
||||||
ui->actionNewDraw->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);
|
||||||
|
|
||||||
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
|
{
|
||||||
ui->toolBarOption->setVisible(true);
|
ui->toolBarOption->setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
ui->dockWidgetLayoutPages->setVisible(false);
|
ui->dockWidgetLayoutPages->setVisible(false);
|
||||||
ui->dockWidgetToolOptions->setVisible(true);
|
ui->dockWidgetToolOptions->setVisible(true);
|
||||||
|
@ -1277,11 +1286,22 @@ void MainWindow::ActionDetails(bool checked)
|
||||||
ui->actionHistory->setEnabled(false);
|
ui->actionHistory->setEnabled(false);
|
||||||
ui->actionOptionDraw->setEnabled(false);
|
ui->actionOptionDraw->setEnabled(false);
|
||||||
ui->actionNewDraw->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->dockWidgetLayoutPages->setVisible(false);
|
||||||
ui->dockWidgetToolOptions->setVisible(true);
|
ui->dockWidgetToolOptions->setVisible(true);
|
||||||
|
|
||||||
|
helpLabel->setText("");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1333,8 +1353,18 @@ void MainWindow::ActionLayout(bool checked)
|
||||||
ui->actionHistory->setEnabled(false);
|
ui->actionHistory->setEnabled(false);
|
||||||
ui->actionOptionDraw->setEnabled(false);
|
ui->actionOptionDraw->setEnabled(false);
|
||||||
ui->actionNewDraw->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("");
|
||||||
|
|
||||||
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
|
{
|
||||||
ui->toolBarOption->setVisible(false);
|
ui->toolBarOption->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
ui->dockWidgetLayoutPages->setVisible(true);
|
ui->dockWidgetLayoutPages->setVisible(true);
|
||||||
ui->dockWidgetToolOptions->setVisible(false);
|
ui->dockWidgetToolOptions->setVisible(false);
|
||||||
|
@ -1345,6 +1375,8 @@ void MainWindow::ActionLayout(bool checked)
|
||||||
{
|
{
|
||||||
ui->toolButtonLayoutSettings->click();
|
ui->toolButtonLayoutSettings->click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
helpLabel->setText("");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2295,13 +2327,13 @@ void MainWindow::CreateMenus()
|
||||||
UpdateRecentFileActions();
|
UpdateRecentFileActions();
|
||||||
|
|
||||||
//Add Undo/Redo actions.
|
//Add Undo/Redo actions.
|
||||||
QAction *undoAction = qApp->getUndoStack()->createUndoAction(this, tr("&Undo"));
|
undoAction = qApp->getUndoStack()->createUndoAction(this, tr("&Undo"));
|
||||||
undoAction->setShortcuts(QKeySequence::Undo);
|
undoAction->setShortcuts(QKeySequence::Undo);
|
||||||
undoAction->setIcon(QIcon::fromTheme("edit-undo"));
|
undoAction->setIcon(QIcon::fromTheme("edit-undo"));
|
||||||
ui->menuPatternPiece->insertAction(ui->actionLast_tool, undoAction);
|
ui->menuPatternPiece->insertAction(ui->actionLast_tool, undoAction);
|
||||||
ui->toolBarTools->addAction(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->setShortcuts(QKeySequence::Redo);
|
||||||
redoAction->setIcon(QIcon::fromTheme("edit-redo"));
|
redoAction->setIcon(QIcon::fromTheme("edit-redo"));
|
||||||
ui->menuPatternPiece->insertAction(ui->actionLast_tool, redoAction);
|
ui->menuPatternPiece->insertAction(ui->actionLast_tool, redoAction);
|
||||||
|
@ -2312,7 +2344,8 @@ void MainWindow::CreateMenus()
|
||||||
ui->menuPatternPiece->insertAction(ui->actionPattern_properties, separatorAct);
|
ui->menuPatternPiece->insertAction(ui->actionPattern_properties, separatorAct);
|
||||||
|
|
||||||
//Add dock
|
//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 = new QAction(this);
|
||||||
separatorAct->setSeparator(true);
|
separatorAct->setSeparator(true);
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>105</width>
|
<width>100</width>
|
||||||
<height>272</height>
|
<height>272</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -337,7 +337,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>105</width>
|
<width>100</width>
|
||||||
<height>58</height>
|
<height>58</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -413,7 +413,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>105</width>
|
<width>100</width>
|
||||||
<height>156</height>
|
<height>156</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -567,7 +567,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>105</width>
|
<width>100</width>
|
||||||
<height>104</height>
|
<height>104</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -741,6 +741,14 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="page_6">
|
<widget class="QWidget" name="page_6">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>87</width>
|
||||||
|
<height>58</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
<string>Layout</string>
|
<string>Layout</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
@ -754,7 +762,9 @@
|
||||||
<string>Settings</string>
|
<string>Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset theme="emblem-system"/>
|
<iconset theme="emblem-system">
|
||||||
|
<normaloff/>
|
||||||
|
</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
|
@ -1474,6 +1484,9 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionLast_tool">
|
<action name="actionLast_tool">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Last Tool</string>
|
<string>Last Tool</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -42,7 +42,8 @@
|
||||||
MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
|
MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
|
||||||
: QMainWindow(parent), listDetails(QVector<VLayoutDetail>()), currentScene(nullptr), tempSceneLayout(nullptr),
|
: QMainWindow(parent), listDetails(QVector<VLayoutDetail>()), currentScene(nullptr), tempSceneLayout(nullptr),
|
||||||
pattern(new VContainer()), papers(QList<QGraphicsItem *>()), shadows(QList<QGraphicsItem *>()),
|
pattern(new VContainer()), papers(QList<QGraphicsItem *>()), shadows(QList<QGraphicsItem *>()),
|
||||||
scenes(QList<QGraphicsScene *>()), details(QList<QList<QGraphicsItem *> >())
|
scenes(QList<QGraphicsScene *>()), details(QList<QList<QGraphicsItem *> >()), undoAction(nullptr),
|
||||||
|
redoAction(nullptr), actionDockWidgetToolOptions(nullptr)
|
||||||
{
|
{
|
||||||
InitTempLayoutScene();
|
InitTempLayoutScene();
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,10 @@ protected:
|
||||||
QList<QGraphicsScene *> scenes;
|
QList<QGraphicsScene *> scenes;
|
||||||
QList<QList<QGraphicsItem *> > details;
|
QList<QList<QGraphicsItem *> > details;
|
||||||
|
|
||||||
|
QAction *undoAction;
|
||||||
|
QAction *redoAction;
|
||||||
|
QAction *actionDockWidgetToolOptions;
|
||||||
|
|
||||||
void PrepareDetailsForLayout(const QHash<quint32, VDetail> *details);
|
void PrepareDetailsForLayout(const QHash<quint32, VDetail> *details);
|
||||||
|
|
||||||
void InitTempLayoutScene();
|
void InitTempLayoutScene();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user