From 75f16903a09a80ad9a22ccb7d0b90591b7b780a2 Mon Sep 17 00:00:00 2001 From: kintel Date: Mon, 25 Jan 2010 21:39:34 +0000 Subject: Quit now really quits instead of just closing the current document, also fixes dangling dialog problem git-svn-id: http://svn.clifford.at/openscad/trunk@353 b57f626f-c46c-0410-a088-ec61d464b74c diff --git a/MainWindow.h b/MainWindow.h index 17269ae..bb1bdc4 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -136,6 +136,7 @@ public slots: void dropEvent(QDropEvent *event); void helpAbout(); void helpManual(); + void quit(); }; #endif diff --git a/MainWindow.ui b/MainWindow.ui index 2569c04..656e908 100644 --- a/MainWindow.ui +++ b/MainWindow.ui @@ -656,22 +656,6 @@ - fileActionQuit - triggered() - MainWindow - close() - - - -1 - -1 - - - 340 - 323 - - - - fileActionClose triggered() MainWindow diff --git a/TODO.txt b/TODO.txt index 9aea6cc..b61e57b 100644 --- a/TODO.txt +++ b/TODO.txt @@ -19,16 +19,12 @@ o Preferences - Default language feature settings - Auto-view CSG/thrown together on load o Export etc.: automatically add missing extension as in SaveAs -o Mac OS X: - - universal binary -> fix cgal and opencsg o MDI - Think about how to do MDI the right way - - Quit vs. Close MainWindow. - Today Quit just closes the current window and there is no close function - Ctrl-W should close the current dialog, not the current main window -> implement as for Preferences? - Menu bar handling: - Mac: share menubar among all top-level windows + Mac: share menubar among all top-level windows? o 3D View - Improve mouse rotation - Add modifier key combos to handle pan on 1 mouse button systems @@ -50,7 +46,6 @@ o Editor - Couple the source code to the AST to allow highlighting selected elements in the source code in the 3D view o Misc - - Fix current_win hack - Reload and compile: Ask for confirmation if file is locally edited (make this configurable in preferences?) - Save: Ask for confirmation if file has been externaly changed @@ -100,6 +95,7 @@ CODE ---- o Refactor from MainWindow: + - Fix current_win hack - CSG data structure (compiled model) - CGAL data structure (compiled model) o C++-ify @@ -121,4 +117,6 @@ MISC ---- o Collect "all" available OpenSCAD scripts from the internets and batch convert them to STL to assist with robustness testing. +o Mac OS X: + - universal binary -> fix cgal and opencsg diff --git a/mainwin.cc b/mainwin.cc index 5ad510b..7abb4ed 100644 --- a/mainwin.cc +++ b/mainwin.cc @@ -158,6 +158,7 @@ MainWindow::MainWindow(const char *filename) connect(this->fileActionSave, SIGNAL(triggered()), this, SLOT(actionSave())); connect(this->fileActionSaveAs, SIGNAL(triggered()), this, SLOT(actionSaveAs())); connect(this->fileActionReload, SIGNAL(triggered()), this, SLOT(actionReload())); + connect(this->fileActionQuit, SIGNAL(triggered()), this, SLOT(quit())); #ifndef __APPLE__ this->fileActionSave->setShortcut(QKeySequence(Qt::Key_F2)); this->fileActionReload->setShortcut(QKeySequence(Qt::Key_F3)); @@ -1790,3 +1791,10 @@ void MainWindow::setFont(const QString &family, uint size) font.setStyleHint(QFont::TypeWriter); editor->setFont(font); } + +void MainWindow::quit() +{ + QCloseEvent ev; + QApplication::sendEvent(QApplication::instance(), &ev); + if (ev.isAccepted()) QApplication::instance()->quit(); +} -- cgit v0.10.1