OSSP CVS Repository

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

Check-in Number: 3860
Date: 2002-Dec-12 14:27:22 (local)
2002-Dec-12 13:27:22 (UTC)
User:ms
Branch:
Comment: Fixed bug on safely closing unclean documents.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_slot.cpp      1.51 -> 1.52     21 inserted, 6 deleted

ossp-pkg/as/as-gui/as_slot.cpp 1.51 -> 1.52

--- as_slot.cpp  2002/12/12 13:20:43     1.51
+++ as_slot.cpp  2002/12/12 13:27:22     1.52
@@ -186,7 +186,7 @@
                   trUtf8("&Discard"), trUtf8("Cancel"), 0, 2);
 
         switch (nResult) {
-        case 0: // Save first
+        case 0: // First button selected, so save first
             this->saveFile();               // Save changes first
 
             // Reset widget text values before blanking table
@@ -200,11 +200,11 @@
             m_pMaintable->setNumRows(0);    // Remove all data in table
             this->setDirty(false);          // Reset data to clean state
             break;
-        case 1: // Don't save first but do new
+        case 1: // Second button selected, so don't save first but do new
             m_pMaintable->setNumRows(0);    // Remove all data in table
             this->setDirty(false);          // Reset data to clean state
             break;
-        case 2: // Don't do a new timesheet
+        case 2: // Third button selected, so don't do a new timesheet
         default:
             break;
         }
@@ -503,7 +503,7 @@
 }
 
 //
-//
+// What to do if a data cell is modified
 //
 void Titraqform::dataChanged(int nRow, int nCol)
 {
@@ -568,6 +568,7 @@
 //
 void Titraqform::updateStatus(const QString &Instring)
 {
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXSTATUS, Instring);
 }
 
@@ -576,6 +577,7 @@
 //
 void Titraqform::updateLine(const QString &Instring)
 {
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXLINE, Instring);
 }
 
@@ -584,6 +586,7 @@
 //
 void Titraqform::updateUser(const QString &Instring)
 {
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXUSER, Instring);
 }
 
@@ -592,6 +595,7 @@
 //
 void Titraqform::updateGuid(const QString &Instring)
 {
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXGUID, Instring);
 }
 
@@ -600,6 +604,7 @@
 //
 void Titraqform::updateCrc(const QString &Instring)
 {
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXCRC, Instring);
 }
 
@@ -608,6 +613,7 @@
 //
 void Titraqform::updateRev(const QString &Instring)
 {
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXREV, Instring);
 }
 
@@ -616,10 +622,14 @@
 //
 void Titraqform::updateDate(const QDate &Dateup)
 {
-    if (Dateup == *m_pDatezero) // Complete the already nasty hack
+    if (Dateup == *m_pDatezero) { // Complete the already nasty hack
+        setDirty(); // Mark this timesheet dirty, changes pending save
         m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXDATE, trUtf8(TITRAQ_DATEZERO));
-    else
+    }
+    else {
+        setDirty(); // Mark this timesheet dirty, changes pending save
         m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXDATE, Dateup.toString(Qt::ISODate));
+    }
 }
 
 //
@@ -627,6 +637,7 @@
 //
 void Titraqform::updateStart(const QTime &Startup)
 {
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXSTART, Startup.toString(Qt::ISODate));
 }
 
@@ -635,6 +646,7 @@
 //
 void Titraqform::updateFinish(const QTime &Finishup)
 {
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXFINISH, Finishup.toString(Qt::ISODate));
 }
 
@@ -644,6 +656,7 @@
 void Titraqform::updateAmount(const QString &Amountup)
 {
     // Ignore incoming data and use widget managed data because its easier
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXAMOUNT, m_pAmount->text());
 }
 
@@ -657,6 +670,7 @@
 //    pTask = static_cast<RtTableItem *>(m_pMaintable->item(m_pMaintable->currentRow(), TITRAQ_IDXTASK));
 //    pTask->setText(Taskup);
 
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXTASK, Taskup);
 }
 
@@ -665,6 +679,7 @@
 //
 void Titraqform::updateRemark(const QString &Remarkup)
 {
+    setDirty(); // Mark this timesheet dirty, changes pending save
     m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXREMARK, Remarkup);
 }
 

CVSTrac 2.0.1