Disable or hide all unnecessary functions in Layout mode.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-05-13 13:23:57 +03:00
parent 80d7c39a92
commit 7a7753e3f1
4 changed files with 63 additions and 12 deletions

View File

@ -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);

View File

@ -50,7 +50,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>105</width>
<width>100</width>
<height>272</height>
</rect>
</property>
@ -337,7 +337,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>105</width>
<width>100</width>
<height>58</height>
</rect>
</property>
@ -413,7 +413,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>105</width>
<width>100</width>
<height>156</height>
</rect>
</property>
@ -567,7 +567,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>105</width>
<width>100</width>
<height>104</height>
</rect>
</property>
@ -741,6 +741,14 @@
</layout>
</widget>
<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">
<string>Layout</string>
</attribute>
@ -754,7 +762,9 @@
<string>Settings</string>
</property>
<property name="icon">
<iconset theme="emblem-system"/>
<iconset theme="emblem-system">
<normaloff/>
</iconset>
</property>
<property name="iconSize">
<size>
@ -1474,6 +1484,9 @@
</property>
</action>
<action name="actionLast_tool">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Last Tool</string>
</property>

View File

@ -42,7 +42,8 @@
MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
: QMainWindow(parent), listDetails(QVector<VLayoutDetail>()), currentScene(nullptr), tempSceneLayout(nullptr),
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();
}

View File

@ -62,6 +62,10 @@ protected:
QList<QGraphicsScene *> scenes;
QList<QList<QGraphicsItem *> > details;
QAction *undoAction;
QAction *redoAction;
QAction *actionDockWidgetToolOptions;
void PrepareDetailsForLayout(const QHash<quint32, VDetail> *details);
void InitTempLayoutScene();