New menu Window->Close window.

--HG--
branch : develop
This commit is contained in:
dismine 2014-11-12 12:56:20 +02:00
parent 79483ab80b
commit d8ead200a8
2 changed files with 28 additions and 0 deletions

View File

@ -1387,6 +1387,10 @@ void MainWindow::RepotBug()
*/ */
void MainWindow::Clear() void MainWindow::Clear()
{ {
ui->actionDetails->setChecked(false);
ui->actionDetails->setEnabled(false);
ui->actionDraw->setChecked(true);
ui->actionDraw->setEnabled(false);
setCurrentFile(""); setCurrentFile("");
pattern->Clear(); pattern->Clear();
doc->clear(); doc->clear();
@ -1396,9 +1400,15 @@ void MainWindow::Clear()
comboBoxDraws->clear(); comboBoxDraws->clear();
ui->actionOptionDraw->setEnabled(false); ui->actionOptionDraw->setEnabled(false);
ui->actionSave->setEnabled(false); ui->actionSave->setEnabled(false);
ui->actionSaveAs->setEnabled(false);
ui->actionPattern_properties->setEnabled(false); ui->actionPattern_properties->setEnabled(false);
ui->actionZoomIn->setEnabled(false); ui->actionZoomIn->setEnabled(false);
ui->actionZoomOut->setEnabled(false); ui->actionZoomOut->setEnabled(false);
ui->actionZoomFitBest->setEnabled(false);
ui->actionZoomOriginal->setEnabled(false);
ui->actionHistory->setEnabled(false);
ui->actionTable->setEnabled(false);
ui->actionEdit_pattern_code->setEnabled(false);
SetEnableTool(false); SetEnableTool(false);
qApp->setPatternUnit(Unit::Cm); qApp->setPatternUnit(Unit::Cm);
qApp->setPatternType(MeasurementsType::Individual); qApp->setPatternType(MeasurementsType::Individual);
@ -2123,6 +2133,7 @@ void MainWindow::CreateActions()
connect(ui->actionPattern_properties, &QAction::triggered, this, &MainWindow::PatternProperties); connect(ui->actionPattern_properties, &QAction::triggered, this, &MainWindow::PatternProperties);
ui->actionPattern_properties->setEnabled(false); ui->actionPattern_properties->setEnabled(false);
connect(ui->actionEdit_pattern_code, &QAction::triggered, this, &MainWindow::EditPatternCode); connect(ui->actionEdit_pattern_code, &QAction::triggered, this, &MainWindow::EditPatternCode);
connect(ui->actionCloseWindow, &QAction::triggered, this, &MainWindow::Clear);
ui->actionEdit_pattern_code->setEnabled(false); ui->actionEdit_pattern_code->setEnabled(false);
//Actions for recent files loaded by a main window application. //Actions for recent files loaded by a main window application.
@ -2286,6 +2297,8 @@ void MainWindow::LoadPattern(const QString &fileName)
//Fit scene size to best size for first show //Fit scene size to best size for first show
ZoomFirstShow(); ZoomFirstShow();
ui->actionDraw->setChecked(true);
} }
} }

View File

@ -804,9 +804,16 @@
</property> </property>
<addaction name="actionTable"/> <addaction name="actionTable"/>
</widget> </widget>
<widget class="QMenu" name="menuWindow">
<property name="title">
<string>Window</string>
</property>
<addaction name="actionCloseWindow"/>
</widget>
<addaction name="menuFile"/> <addaction name="menuFile"/>
<addaction name="menuPatternPiece"/> <addaction name="menuPatternPiece"/>
<addaction name="menuMeasurements"/> <addaction name="menuMeasurements"/>
<addaction name="menuWindow"/>
<addaction name="menuHelp"/> <addaction name="menuHelp"/>
</widget> </widget>
<widget class="QToolBar" name="mainToolBar"> <widget class="QToolBar" name="mainToolBar">
@ -1249,6 +1256,14 @@
<string>Report bug</string> <string>Report bug</string>
</property> </property>
</action> </action>
<action name="actionCloseWindow">
<property name="text">
<string>Close window</string>
</property>
<property name="shortcut">
<string>Ctrl+W</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<customwidgets> <customwidgets>