OSSP CVS Repository

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

Check-in Number: 3980
Date: 2003-Jan-31 15:03:03 (local)
2003-Jan-31 14:03:03 (UTC)
User:ms
Branch:
Comment: Fix logic when calling saveFile, but returning in a dirty state.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/ChangeLog      1.24 -> 1.25     2 inserted, 0 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.99 -> 1.100     32 inserted, 14 deleted

ossp-pkg/as/as-gui/ChangeLog 1.24 -> 1.25

--- ChangeLog    2003/01/30 23:48:00     1.24
+++ ChangeLog    2003/01/31 14:03:03     1.25
@@ -1,5 +1,7 @@
 Geschichte des OSSP titraq in Vorwaerts Cronordnung
 
+030131 Fix logic when calling saveFile, but returning in a dirty state
+
 030130 Made day date section focus the default value
        Remove hackful zero date value, replace with current date
        Added aggregate class User, and prefer user data from environment


ossp-pkg/as/as-gui/as_slot.cpp 1.99 -> 1.100

--- as_slot.cpp  2003/01/30 23:48:00     1.99
+++ as_slot.cpp  2003/01/31 14:03:03     1.100
@@ -204,6 +204,21 @@
         m_pRefreshact->setEnabled(true);
         m_pCutact->setEnabled(true);
         m_pCopyact->setEnabled(true);
+
+        // Brighten all the edit controls also
+        m_pLineedit->setEnabled(true);
+        m_pUseredit->setEnabled(true);
+        m_pGuidedit->setEnabled(true);
+        m_pCrcedit->setEnabled(true);
+        m_pRevedit->setEnabled(true);
+        m_pDateedit->setEnabled(true);
+        m_pStarttime->setEnabled(true);
+        m_pEndtime->setEnabled(true);
+        m_pAmount->setEnabled(true);
+        m_pTasks->setEnabled(true);
+        m_pRemark->setEnabled(true);
+
+        // And optionally the RPC actions, too
 #ifdef HAVE_MICO
         m_pSynciiopact->setEnabled(true);
 #endif // HAVE_MICO
@@ -419,7 +434,7 @@
                 return;                 // and short circuit
             }
             catch (Genexcept& Genex) {
-                Genex.reportErr();      // Report the error
+//                Genex.reportErr();      // Report the error
                 return;                 // and short circuit
             }
         }
@@ -558,6 +573,7 @@
             this->saveFile();   // Save changes first
             break;
         case 1: // Don't save first
+            m_pMaintable->setDirty(false);
             break;
         case 2: // Do nothing
         default:
@@ -567,20 +583,22 @@
         }
     }
 
-    // Fall through to implicit close code
-    this->setCaption(TITRAQ_APPTITLE);
-    try { // There might be problems, so wrap these last ops with error handling
-        QString Lightsout;          // It's late, go to bed
-        if (this->isOpen())
-            Lightsout = trUtf8("Closed document ") + *this->getFilename();
-        this->setOpen(false);       // Set doc state to closed
-        this->enableIface(false);   // Turn off the lights
-        m_pStatbar->message(Lightsout, 4000);
-    }
-    catch (Genexcept& Genex) {
-        Genex.reportErr();
+    if (!m_pMaintable->isDirty()) { // Check again
+        // Fall through to implicit close code
+        this->setCaption(TITRAQ_APPTITLE);
+        try { // There might be problems, so wrap these last ops with error handling
+            QString Lightsout;          // It's late, go to bed
+            if (this->isOpen())
+                Lightsout = trUtf8("Closed document ") + *this->getFilename();
+            this->setOpen(false);       // Set doc state to closed
+            this->enableIface(false);   // Turn off the lights
+            m_pStatbar->message(Lightsout, 4000);
+        }
+        catch (Genexcept& Genex) {
+            Genex.reportErr();
+        }
     }
-    pClosit->ignore();              // Finish off by not closing
+    pClosit->ignore();  // Finish off by not closing
 }
 
 //

CVSTrac 2.0.1