OSSP CVS Repository

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

ossp-pkg/as/as-gui/as_slot.cpp 1.59 -> 1.60

--- as_slot.cpp  2002/12/13 20:50:18     1.59
+++ as_slot.cpp  2002/12/13 21:25:32     1.60
@@ -194,10 +194,32 @@
             m_pRemark->setText(NULL);
 
             m_pMaintable->setNumRows(0);    // Remove all data in table
+            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);
             this->setDirty(false);          // Reset data to clean state
             break;
         case 1: // Second button selected, so don't save first but do new
             m_pMaintable->setNumRows(0);    // Remove all data in table
+            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);
             this->setDirty(false);          // Reset data to clean state
             break;
         case 2: // Third button selected, so don't do a new timesheet
@@ -214,6 +236,17 @@
         m_pTasks->setCurrentText(NULL);
         m_pRemark->setText(NULL);
         m_pMaintable->setNumRows(0);        // Remove all data in table
+        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);
         this->setDirty(false);              // Reset data to clean state
     }
 }
@@ -563,42 +596,36 @@
 //
 void Titraqform::validateData(int nRow, int nCol)
 {
-    // Field strings to check for validity and process
-    QString Textstat(m_pMaintable->text(nRow, TITRAQ_IDXSTATUS));
-    QString Textline(m_pMaintable->text(nRow, TITRAQ_IDXLINE));
-    QString Textuser(m_pMaintable->text(nRow, TITRAQ_IDXUSER));
-    QString Textguid(m_pMaintable->text(nRow, TITRAQ_IDXGUID));
-    QString Textcrc(m_pMaintable->text(nRow, TITRAQ_IDXCRC));
-    QString Textrev(m_pMaintable->text(nRow, TITRAQ_IDXREV));
-    QString Textdate(m_pMaintable->text(nRow, TITRAQ_IDXDATE));
-    QString Textstart(m_pMaintable->text(nRow, TITRAQ_IDXSTART));
-    QString Textfinish(m_pMaintable->text(nRow, TITRAQ_IDXFINISH));
-    QString Textamount(m_pMaintable->text(nRow, TITRAQ_IDXAMOUNT));
-    QString Texttask(m_pMaintable->text(nRow, TITRAQ_IDXTASK));
-    QString Textremark(m_pMaintable->text(nRow, TITRAQ_IDXREMARK));
-
-    // Quick review of data validity, and set pixmaps accordingly
-    if (Textuser.isEmpty() || Textguid.isEmpty() || Textcrc.isEmpty() ||
-        Textrev.isEmpty() || Textdate.isEmpty() || Textstart.isEmpty() ||
-        Textfinish.isEmpty() || Textamount.isEmpty() || Texttask.isEmpty()) {
-        m_pStatusedit->setPixmap(QPixmap(s_kpcStaterror_xpm));
-        m_pMaintable->setPixmap(nRow, TITRAQ_IDXSTATUS, QPixmap(s_kpcStaterror_xpm));
-    }
-    else {
-        m_pStatusedit->setPixmap(QPixmap(s_kpcStatokay_xpm));
-        m_pMaintable->setPixmap(nRow, TITRAQ_IDXSTATUS, QPixmap(s_kpcStatokay_xpm));
+    if (m_pMaintable->numRows() > 0) {
+        // Field strings to check for validity and process
+        QString Textstat(m_pMaintable->text(nRow, TITRAQ_IDXSTATUS));
+        QString Textline(m_pMaintable->text(nRow, TITRAQ_IDXLINE));
+        QString Textuser(m_pMaintable->text(nRow, TITRAQ_IDXUSER));
+        QString Textguid(m_pMaintable->text(nRow, TITRAQ_IDXGUID));
+        QString Textcrc(m_pMaintable->text(nRow, TITRAQ_IDXCRC));
+        QString Textrev(m_pMaintable->text(nRow, TITRAQ_IDXREV));
+        QString Textdate(m_pMaintable->text(nRow, TITRAQ_IDXDATE));
+        QString Textstart(m_pMaintable->text(nRow, TITRAQ_IDXSTART));
+        QString Textfinish(m_pMaintable->text(nRow, TITRAQ_IDXFINISH));
+        QString Textamount(m_pMaintable->text(nRow, TITRAQ_IDXAMOUNT));
+        QString Texttask(m_pMaintable->text(nRow, TITRAQ_IDXTASK));
+        QString Textremark(m_pMaintable->text(nRow, TITRAQ_IDXREMARK));
+
+        // Quick review of data validity, and set pixmaps accordingly
+        if (Textuser.isEmpty() || Textguid.isEmpty() || Textcrc.isEmpty() ||
+            Textrev.isEmpty() || Textdate.isEmpty() || Textstart.isEmpty() ||
+            Textfinish.isEmpty() || Textamount.isEmpty() || Texttask.isEmpty()) {
+            m_pStatusedit->setPixmap(QPixmap(s_kpcStaterror_xpm));
+            m_pMaintable->setPixmap(nRow, TITRAQ_IDXSTATUS, QPixmap(s_kpcStaterror_xpm));
+        }
+        else {
+            m_pStatusedit->setPixmap(QPixmap(s_kpcStatokay_xpm));
+            m_pMaintable->setPixmap(nRow, TITRAQ_IDXSTATUS, QPixmap(s_kpcStatokay_xpm));
+        }
     }
 }
 
 //
-// Validation overloaded convenience method
-//
-void Titraqform::validateData(void)
-{
-    validateData(m_pMaintable->currentRow(), 0);
-}
-
-//
 // Update the current status column item
 //
 void Titraqform::updateStatus(const QString &Instring)

CVSTrac 2.0.1