Move the measurement diagram action to the ui file.

--HG--
branch : develop
This commit is contained in:
Wren Turkal 2019-01-14 22:21:31 -08:00
parent 77cb644f90
commit a190fcaea2
2 changed files with 37 additions and 11 deletions

View File

@ -96,7 +96,6 @@ TMainWindow::TMainWindow(QWidget *parent)
labelGradationHeights(nullptr), labelGradationHeights(nullptr),
labelGradationSizes(nullptr), labelGradationSizes(nullptr),
labelPatternUnit(nullptr), labelPatternUnit(nullptr),
actionDockDiagram(nullptr),
dockDiagramVisible(true), dockDiagramVisible(true),
isInitialized(false), isInitialized(false),
mIsReadOnly(false), mIsReadOnly(false),
@ -1997,12 +1996,6 @@ void TMainWindow::SetupMenu()
connect(ui->actionAddKnown, &QAction::triggered, this, &TMainWindow::AddKnown); connect(ui->actionAddKnown, &QAction::triggered, this, &TMainWindow::AddKnown);
connect(ui->actionDatabase, &QAction::triggered, qApp, &MApplication::ShowDataBase); connect(ui->actionDatabase, &QAction::triggered, qApp, &MApplication::ShowDataBase);
connect(ui->actionImportFromPattern, &QAction::triggered, this, &TMainWindow::ImportFromPattern); connect(ui->actionImportFromPattern, &QAction::triggered, this, &TMainWindow::ImportFromPattern);
actionDockDiagram = ui->dockWidgetDiagram->toggleViewAction();
actionDockDiagram->setMenuRole(QAction::NoRole);
ui->menuMeasurements->addAction(actionDockDiagram);
ui->mainToolBar->addAction(actionDockDiagram);
actionDockDiagram->setEnabled(false);
actionDockDiagram->setIcon(QIcon("://tapeicon/24x24/mannequin.png"));
// Window // Window
connect(ui->menuWindow, &QMenu::aboutToShow, this, &TMainWindow::AboutToShowWindowMenu); connect(ui->menuWindow, &QMenu::aboutToShow, this, &TMainWindow::AboutToShowWindowMenu);
@ -2031,8 +2024,7 @@ void TMainWindow::InitWindow()
SCASSERT(m != nullptr) SCASSERT(m != nullptr)
ui->labelToolTip->setVisible(false); ui->labelToolTip->setVisible(false);
ui->tabWidget->setVisible(true); ui->tabWidget->setVisible(true);
ui->dockWidgetDiagram->setVisible(dockDiagramVisible); ui->actionMeasurementDiagram->setEnabled(true);
actionDockDiagram->setEnabled(true);
ui->tabWidget->setCurrentIndex(0); ui->tabWidget->setCurrentIndex(0);
ui->plainTextEditNotes->setEnabled(true); ui->plainTextEditNotes->setEnabled(true);

View File

@ -839,7 +839,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>835</width> <width>835</width>
<height>22</height> <height>18</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">
@ -884,6 +884,7 @@
<addaction name="actionAddCustom"/> <addaction name="actionAddCustom"/>
<addaction name="actionDatabase"/> <addaction name="actionDatabase"/>
<addaction name="actionImportFromPattern"/> <addaction name="actionImportFromPattern"/>
<addaction name="actionMeasurementDiagram"/>
</widget> </widget>
<addaction name="menuFile"/> <addaction name="menuFile"/>
<addaction name="menuMeasurements"/> <addaction name="menuMeasurements"/>
@ -914,6 +915,7 @@
<addaction name="actionSave"/> <addaction name="actionSave"/>
<addaction name="actionAddKnown"/> <addaction name="actionAddKnown"/>
<addaction name="actionAddCustom"/> <addaction name="actionAddCustom"/>
<addaction name="actionMeasurementDiagram"/>
</widget> </widget>
<widget class="QStatusBar" name="statusBar"/> <widget class="QStatusBar" name="statusBar"/>
<widget class="QToolBar" name="toolBarGradation"> <widget class="QToolBar" name="toolBarGradation">
@ -1206,6 +1208,21 @@
<string>Import from CSV</string> <string>Import from CSV</string>
</property> </property>
</action> </action>
<action name="actionMeasurementDiagram">
<property name="checkable">
<bool>true</bool>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="share/resources/tapeicon.qrc">
<normaloff>:/tapeicon/24x24/mannequin.png</normaloff>:/tapeicon/24x24/mannequin.png</iconset>
</property>
<property name="text">
<string>Measurement diagram</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<customwidgets> <customwidgets>
@ -1218,5 +1235,22 @@
<resources> <resources>
<include location="share/resources/tapeicon.qrc"/> <include location="share/resources/tapeicon.qrc"/>
</resources> </resources>
<connections/> <connections>
<connection>
<sender>actionMeasurementDiagram</sender>
<signal>toggled(bool)</signal>
<receiver>dockWidgetDiagram</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>764</x>
<y>377</y>
</hint>
<hint type="destinationlabel">
<x>764</x>
<y>377</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>