--- as_slot.cpp 2002/12/13 18:55:09 1.58
+++ as_slot.cpp 2002/12/13 20:50:18 1.59
@@ -45,6 +45,9 @@
// Icon pixel maps
#include "as_gfx/cwlogo.xpm" // static const char *s_kpcCwlogo_xpm[]
#include "as_gfx/ossplogo.xpm" // static const char *s_kpcOssplogo_xpm[]
+#include "as_gfx/statok.xpm" // static const char *s_kpcStatokay_xpm[]
+#include "as_gfx/staterr.xpm" // static const char *s_kpcStaterror_xpm[]
+#include "as_gfx/statwrn.xpm" // static const char *s_kpcStatwarn_xpm[]
//
@@ -114,6 +117,10 @@
m_pMaintable->ensureCellVisible(m_pMaintable->numRows() - 1, 0); // Scroll please
}
+ // 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));
+
updateUser(m_pPrefs->getString(TITRAQ_PREFUSER, TITRAQ_DEFUSER));
updateGuid(".");
updateCrc(".");
@@ -155,6 +162,10 @@
m_pMaintable->removeRows(Rowselect);
this->setDirty(); // Set data to dirty state
}
+
+ // 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));
}
//
@@ -520,7 +531,7 @@
m_pMaintable->setEdition();
// Set text of member edit controls
- m_pStatusedit->setText(Textstat);
+ m_pStatusedit->setPixmap(m_pMaintable->pixmap(nRow, nCol));
m_pLineedit->setText(Textline);
m_pUseredit->setText(Textuser);
m_pGuidedit->setText(Textguid);
@@ -548,6 +559,46 @@
}
//
+// Validate one row of matrix data
+//
+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));
+ }
+}
+
+//
+// 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)
|