OSSP CVS Repository

ossp - Difference in ossp-pkg/as/as-gui/as_slot.cpp versions 1.112 and 1.113
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/as/as-gui/as_slot.cpp 1.112 -> 1.113

--- as_slot.cpp  2003/02/05 12:54:22     1.112
+++ as_slot.cpp  2003/02/06 15:55:01     1.113
@@ -564,6 +564,37 @@
 }
 
 //
+// Close current document, and then quit the application
+//
+void Titraqform::quitApp(void)
+{
+    int nResult = 0;
+
+    if (m_pMaintable->isDirty()) {
+        nResult = QMessageBox::information(this, QString(TITRAQ_APPTITLE)
+                + ' ' + asgui_version.v_short, trUtf8(TITRAQ_SAVEFIRST),
+                  trUtf8("&Save"), trUtf8("&Discard"), trUtf8("Cancel"), 0, 2);
+
+        switch (nResult) {      // Maybe save before closing
+        case 0: // Save first
+            this->saveFile();   // Save changes first
+            break;
+        case 1: // Don't save first
+            m_pMaintable->setDirty(false);
+            break;
+        case 2: // Do nothing
+        default:
+            return; // Go away without closing
+            break;
+        }
+    }
+
+    // We should be clean now, but double check just in case
+    if (!m_pMaintable->isDirty())
+        qApp->quit();
+}
+
+//
 // Close current document, displaying in main window
 //
 void Titraqform::closeEvent(QCloseEvent *pClosit)

CVSTrac 2.0.1