OSSP CVS Repository

ossp - Check-in [4015]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4015
Date: 2003-Feb-06 16:55:01 (local)
2003-Feb-06 15:55:01 (UTC)
User:ms
Branch:
Comment: Begin treating quit op on an edited doc as a special case to avoid loss.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/ChangeLog      1.34 -> 1.35     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.97 -> 1.98     1 inserted, 2 deleted
ossp-pkg/as/as-gui/as_gui.h      1.70 -> 1.71     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.112 -> 1.113     31 inserted, 0 deleted

ossp-pkg/as/as-gui/ChangeLog 1.34 -> 1.35

--- ChangeLog    2003/02/06 15:27:39     1.34
+++ ChangeLog    2003/02/06 15:55:01     1.35
@@ -1,6 +1,7 @@
 Geschichte des OSSP titraq in Vorwaerts Cronordnung
 
 030206 Implemented embedding of escape characters into event data file
+       Begin treating quit op on an edited doc as a special case to avoid loss
 
 030205 Add logic to save empty remark fields with surrounding double quotes
        CORBA client transmission improvements, including multiple entry allowance


ossp-pkg/as/as-gui/as_assist.cpp 1.97 -> 1.98

--- as_assist.cpp        2003/02/04 19:30:31     1.97
+++ as_assist.cpp        2003/02/06 15:55:01     1.98
@@ -236,8 +236,7 @@
     m_pFilequitact = new QAction(trUtf8("Exit"), trUtf8("E&xit"), CTRL+Key_Q, this, "Exit");
     if (m_pFilequitact == NULL)     // Sanity check
         throw Genexcept("Main window file quit action creation failed.");
-    connect(m_pFilequitact, SIGNAL(activated()), this, SLOT(close()));
-    connect(m_pFilequitact, SIGNAL(activated()), qApp, SLOT(quit()));
+    connect(m_pFilequitact, SIGNAL(activated()), this, SLOT(quitApp()));
 
     // Cut action
     m_pCutact = new QAction(trUtf8("Cut"), Cutiset, trUtf8("&Cut"), CTRL+Key_X, this, "Cut");


ossp-pkg/as/as-gui/as_gui.h 1.70 -> 1.71

--- as_gui.h     2003/02/04 19:30:31     1.70
+++ as_gui.h     2003/02/06 15:55:01     1.71
@@ -237,6 +237,7 @@
     void syncSoap(void);                // Syncronize data with server using SOAP
     void newDoc(void);                  // Make and display a new document window
     void openDoc(void);                 // Open and display an existing document
+    void quitApp(void);                 // Close the current document and quit
     void saveFile(void);                // Serialize to the current file
     void saveAs(void);                  // Serialize to a selected file
     void saveName(void);                // Implicitly serialize to a selected file


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