OSSP CVS Repository

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

ossp-pkg/as/as-gui/as_slot.cpp 1.101 -> 1.102

--- as_slot.cpp  2003/01/31 18:03:36     1.101
+++ as_slot.cpp  2003/01/31 18:37:01     1.102
@@ -313,7 +313,7 @@
 //
 void Titraqform::newDoc(void)
 {
-    int nResult = 0;
+    int nResult = 0; // Holds return value from save first messagebox
 
     // Check modification state of current data
     if (m_pMaintable->isDirty()) {
@@ -323,24 +323,28 @@
 
         switch (nResult) {
         case 0: // First button selected, so save first
-            this->saveFile();               // Save changes first
+            this->saveFile();   // Save changes first
             break;
         case 1: // Second button selected, so don't save
             break;
         case 2: // Third button selected, so return sofort
         default:
+            m_pStatbar->message(trUtf8("New aborted"), 4000);
             return;
             break;
         }
     }
-    // Fall through to implicit new doc code
-    this->enableIface(true);            // Enable the interface
-    m_pMaintable->setNumRows(0);        // Remove all data in table
-    this->setCaption(trUtf8("No file name"));
-    m_pStatbar->message(trUtf8("New document"), 4000);
-    this->setOpen();                    // Signal an open doc state
-    this->addEntry(1);                  // Default new op adds a row
-    m_pMaintable->setDirty(false);      // Start out clean
+
+    if (!m_pMaintable->isDirty() || nResult == 1) { // Check modification state
+        // Fall through to implicit new doc code
+        this->setCaption(trUtf8("No file name"));
+        m_pStatbar->message(trUtf8("New document"), 4000);
+        this->enableIface(true);            // Enable the interface
+        m_pMaintable->setNumRows(0);        // Remove all data in table
+        this->setFilename("");               // Signal a closed doc state
+        this->addEntry(1);                  // Default new op adds a row
+        m_pMaintable->setDirty(false);      // Start out clean
+    }
 }
 
 //
@@ -348,7 +352,7 @@
 //
 void Titraqform::openDoc(void)
 {
-    int nResult = 0;    // Holds return value from save first messagebox
+    int nResult = 0; // Holds return value from save first messagebox
 
 //
 // This block will guide the user to saving the contents of the timesheet

CVSTrac 2.0.1