OSSP CVS Repository

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

ossp-pkg/as/as-gui/as_slot.cpp 1.87 -> 1.88

--- as_slot.cpp  2003/01/24 19:44:40     1.87
+++ as_slot.cpp  2003/01/27 13:24:26     1.88
@@ -192,6 +192,21 @@
 
     m_pMaintable->setUpdatesEnabled(true);  // Turn updates back on
     m_pMaintable->repaintContents(true);    // Do a general repaint of table
+
+    // In case we added the first and only row entry,
+    // do post state adjustments like icon undimming
+    if (m_pMaintable->numRows() == 1) {
+        m_pDelrowact->setEnabled(true);
+        m_pRefreshact->setEnabled(true);
+        m_pCutact->setEnabled(true);
+        m_pCopyact->setEnabled(true);
+#ifdef HAVE_MICO
+        m_pSynciiopact->setEnabled(true);
+#endif // HAVE_MICO
+#ifdef HAVE_ESOAP
+        m_pSyncsoapact->setEnabled(true);
+#endif // HAVE_ESOAP
+    }
 }
 
 //
@@ -221,6 +236,21 @@
     // Update line numbers for this new row and all subsequent rows
     for (int nIter = m_pMaintable->currentRow(); nIter < m_pMaintable->numRows(); nIter++)
         m_pMaintable->setText(nIter, TITRAQ_IDXLINE, QString::number(nIter));
+
+    // In case we removed the last remaining row,
+    // do post state adjustments like icon dimming
+    if (m_pMaintable->numRows() <= 0) {
+        m_pDelrowact->setEnabled(false);
+        m_pRefreshact->setEnabled(false);
+        m_pCutact->setEnabled(false);
+        m_pCopyact->setEnabled(false);
+#ifdef HAVE_MICO
+        m_pSynciiopact->setEnabled(false);
+#endif // HAVE_MICO
+#ifdef HAVE_ESOAP
+        m_pSyncsoapact->setEnabled(false);
+#endif // HAVE_ESOAP
+    }
 }
 
 //
@@ -274,7 +304,9 @@
     this->setCaption(trUtf8("No file name"));
     m_pStatbar->message(trUtf8("New document"), 4000);
     this->setFilename("");
-    this->updEdit(0);                   // Update edit controls
+    this->addEntry(1);                  // Default new op adds a row
+    this->updEdit(1);                   // Update edit controls
+    m_pMaintable->setDirty(false);      // Start out clean
 }
 
 //

CVSTrac 2.0.1