Index: ossp-pkg/as/as-gui/as_dataop.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_dataop.cpp,v rcsdiff -q -kk '-r1.27' '-r1.28' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_dataop.cpp,v' 2>/dev/null --- as_dataop.cpp 2002/12/17 14:08:33 1.27 +++ as_dataop.cpp 2002/12/18 12:36:16 1.28 @@ -244,10 +244,14 @@ if (!Remark.isEmpty()) m_pMaintable->setText(nIter, TITRAQ_IDXREMARK, Remark); - if (bValid) // Show a bitmap to signal valid or error state + if (bValid) { // Show a bitmap to signal valid or error state + m_pMaintable->setText(nIter, TITRAQ_IDXSTATUS, QString(QChar('O'))); m_pMaintable->setPixmap(nIter, TITRAQ_IDXSTATUS, Statokay); - else + } + else { + m_pMaintable->setText(nIter, TITRAQ_IDXSTATUS, QString(QChar('E'))); m_pMaintable->setPixmap(nIter, TITRAQ_IDXSTATUS, Staterror); + } nIter++; // The big increment Line = trUtf8(""); // Clear line for next round Index: ossp-pkg/as/as-gui/as_slot.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v rcsdiff -q -kk '-r1.67' '-r1.68' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- as_slot.cpp 2002/12/17 14:08:33 1.67 +++ as_slot.cpp 2002/12/18 12:36:16 1.68 @@ -716,33 +716,36 @@ // void Titraqform::validateData(int nRow, int nCol) { - 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)); + if (!m_pMaintable->numRows() > 0) { // If no rows exist then short circuit + m_pStatbar->message(trUtf8("Timesheet contains no data"), 4000); + return; + } + + QString Statis = m_pMaintable->text(nRow, TITRAQ_IDXSTATUS); // Get text - // 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)); + // Quick review of data validity, and set pixmaps accordingly + if (m_pMaintable->text(nRow, TITRAQ_IDXUSER).isEmpty() || + m_pMaintable->text(nRow, TITRAQ_IDXGUID).isEmpty() || + m_pMaintable->text(nRow, TITRAQ_IDXCRC).isEmpty() || + m_pMaintable->text(nRow, TITRAQ_IDXREV).isEmpty() || + m_pMaintable->text(nRow, TITRAQ_IDXDATE).isEmpty() || + m_pMaintable->text(nRow, TITRAQ_IDXSTART).isEmpty() || + m_pMaintable->text(nRow, TITRAQ_IDXFINISH).isEmpty() || + m_pMaintable->text(nRow, TITRAQ_IDXAMOUNT).isEmpty() || + m_pMaintable->text(nRow, TITRAQ_IDXTASK).isEmpty()) + { // No K&R style to show where actual code begins + if (!Statis.startsWith(QString("E"))) { // Conditionally set pixmap to avoid overhead + m_pMaintable->setText(nRow, TITRAQ_IDXSTATUS, Statis.replace(0, sizeof(char), 'E')); m_pMaintable->setPixmap(nRow, TITRAQ_IDXSTATUS, QPixmap(s_kpcStaterror_xpm)); } - else { - m_pStatusedit->setPixmap(QPixmap(s_kpcStatokay_xpm)); + } + else { + if (!Statis.startsWith(QString("O"))) { // Conditionally set pixmap to avoid overhead + m_pMaintable->setText(nRow, TITRAQ_IDXSTATUS, Statis.replace(0, sizeof(char), 'O')); m_pMaintable->setPixmap(nRow, TITRAQ_IDXSTATUS, QPixmap(s_kpcStatokay_xpm)); } } + m_pStatbar->message(trUtf8("Refreshed display"), 4000); // Announce result } //