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()
{
ui->actionDetails->setChecked(false);
ui->actionDetails->setEnabled(false);
ui->actionDraw->setChecked(true);
ui->actionDraw->setEnabled(false);
setCurrentFile("");
pattern->Clear();
doc->clear();
@ -1396,9 +1400,15 @@ void MainWindow::Clear()
comboBoxDraws->clear();
ui->actionOptionDraw->setEnabled(false);
ui->actionSave->setEnabled(false);
ui->actionSaveAs->setEnabled(false);
ui->actionPattern_properties->setEnabled(false);
ui->actionZoomIn->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);
qApp->setPatternUnit(Unit::Cm);
qApp->setPatternType(MeasurementsType::Individual);
@ -2123,6 +2133,7 @@ void MainWindow::CreateActions()
connect(ui->actionPattern_properties, &QAction::triggered, this, &MainWindow::PatternProperties);
ui->actionPattern_properties->setEnabled(false);
connect(ui->actionEdit_pattern_code, &QAction::triggered, this, &MainWindow::EditPatternCode);
connect(ui->actionCloseWindow, &QAction::triggered, this, &MainWindow::Clear);
ui->actionEdit_pattern_code->setEnabled(false);
//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
ZoomFirstShow();
ui->actionDraw->setChecked(true);
}
}

View file

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