Index: ossp-pkg/as/as-gui/TODO RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v rcsdiff -q -kk '-r1.16' '-r1.17' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v' 2>/dev/null --- TODO 2002/11/25 15:45:05 1.16 +++ TODO 2002/11/26 14:10:32 1.17 @@ -28,6 +28,7 @@ Memory optimization needed in tidataops QTable::valueChanged(int row, int col) should be responsible for dirty flag Remove magic numbers from cpp files to titconst like TITRAQ_INDEXREMARK +Reduce dependence to STL by removing cout to QTextStream Dreams ------ Index: ossp-pkg/as/as-gui/as_assist.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v rcsdiff -q -kk '-r1.17' '-r1.18' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v' 2>/dev/null --- as_assist.cpp 2002/11/25 16:23:35 1.17 +++ as_assist.cpp 2002/11/26 14:10:32 1.18 @@ -244,15 +244,21 @@ // void Titraqform::setupFiletools(void) { - // Construct and populate the main tool bar - m_pToolbar = new QToolBar("Toolfile", this, DockTop); - if (m_pToolbar == NULL) // Sanity check - throw Genexcept("Main window tool bar creation failed."); - m_pToolbar->setLabel(trUtf8("File Ops")); - m_pFilenewact->addTo(m_pToolbar); - m_pFileopenact->addTo(m_pToolbar); - m_pFilesaveact->addTo(m_pToolbar); - QWhatsThis::whatsThisButton(m_pToolbar); // Preconfigured whats this button + // Construct and populate the file tool bar + m_pFiletools = new QToolBar("Toolfile", this, DockTop); + if (m_pFiletools == NULL) // Sanity check + throw Genexcept("File tool bar creation failed."); + m_pFiletools->setLabel(trUtf8("File Ops")); + m_pFilenewact->addTo(m_pFiletools); + m_pFileopenact->addTo(m_pFiletools); + m_pFilesaveact->addTo(m_pFiletools); + QWhatsThis::whatsThisButton(m_pFiletools); // Preconfigured whats this button + + // Construct and populate the edit tool bar + m_pEdittools = new QToolBar("Tooledit", this, DockTop); + if (m_pEdittools == NULL) // Sanity check + throw Genexcept("Edit tool bar creation failed."); + m_pEdittools->setLabel(trUtf8("Edit Ops")); } // Index: ossp-pkg/as/as-gui/as_const.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_const.h,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_const.h,v' 2>/dev/null --- as_const.h 2002/11/25 15:45:06 1.3 +++ as_const.h 2002/11/26 14:10:32 1.4 @@ -22,5 +22,5 @@ // Values #define TITRAQ_MAXAMOUNT 960 // Maximum valid amount -#define TITRAQ_MINAMOUNT -1 // Minimum valid amount +#define TITRAQ_MINAMOUNT 0 // Minimum valid amount #define TITRAQ_STEPAMOUNT 15 // Line step interval 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.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_dataop.cpp,v' 2>/dev/null --- as_dataop.cpp 2002/11/24 23:11:56 1.6 +++ as_dataop.cpp 2002/11/26 14:10:32 1.7 @@ -75,10 +75,9 @@ nIter++; // The big increment } - m_pMaintable->setUpdatesEnabled(true); // Repaint all - m_pMaintable->setNumRows(nIter - 1); // Trim unneeded rows - m_pRemark->setText(trUtf8("Loaded text goes here")); - m_pRemark->setEdited(false); // Reset widget + m_pMaintable->setUpdatesEnabled(true); // Update and repaint + m_pMaintable->setNumRows(nIter - 1); // Trim excess rows + m_pMaintable->setCurrentCell(nIter - 1, 0); // Move focus to last row if (!bValid) throw Genexcept("Warning, invalid accounting data."); Index: ossp-pkg/as/as-gui/as_gui.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v rcsdiff -q -kk '-r1.20' '-r1.21' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.cpp,v' 2>/dev/null --- as_gui.cpp 2002/11/24 23:11:56 1.20 +++ as_gui.cpp 2002/11/26 14:10:32 1.21 @@ -11,7 +11,6 @@ m_pDeletebutton->setPaletteBackgroundColor(QColor(196, 196, 176)); m_pWritebutton->setPaletteBackgroundColor(QColor(206, 192, 176)); m_pQuitbutton->setPaletteBackgroundColor(QColor(196, 196, 176)); - m_pMaintable->setCurrentCell(0, 0); // Set the initial focus m_pMaintable->setFocus(); // Focus on the table } Index: ossp-pkg/as/as-gui/as_gui.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v rcsdiff -q -kk '-r1.24' '-r1.25' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v' 2>/dev/null --- as_gui.h 2002/11/25 15:45:06 1.24 +++ as_gui.h 2002/11/26 14:10:32 1.25 @@ -118,7 +118,8 @@ QStatusBar *m_pStatbar; // Belong to us - QToolBar *m_pToolbar; + QToolBar *m_pFiletools; + QToolBar *m_pEdittools; QString *m_szFilename; // Standard members 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.13' '-r1.14' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- as_slot.cpp 2002/11/25 15:45:06 1.13 +++ as_slot.cpp 2002/11/26 14:10:32 1.14 @@ -53,8 +53,7 @@ // void Titraqform::newDoc(void) { - // The only way in Qt 3.X to clear rows efficiently - m_pMaintable->setNumRows(0); // Get rid of any data in table + m_pMaintable->setNumRows(0); // Get rid of any data in table } // @@ -193,20 +192,34 @@ // void Titraqform::updEdit(int nRow, int nCol) { - QString Tasktext; // For searching through prefixed task text QRegExp Shorten("/(\\w+)$"); // For stripping prefix off the current task - m_pDateedit->setDate(QDate::fromString(m_pMaintable->text(nRow, TITRAQ_INDEXDATE), Qt::ISODate)); - m_pStarttime->setTime(QTime::fromString(m_pMaintable->text(nRow, TITRAQ_INDEXAMOUNT), Qt::ISODate)); - m_pEndtime->setTime(QTime::fromString(m_pMaintable->text(nRow, TITRAQ_INDEXAMOUNT), Qt::ISODate)); - m_pAmount->setText(m_pMaintable->text(nRow, TITRAQ_INDEXAMOUNT)); + // Field strings to check for validity and process + QString Textdate(m_pMaintable->text(nRow, TITRAQ_INDEXDATE)); + QString Textstart(m_pMaintable->text(nRow, TITRAQ_INDEXAMOUNT)); + QString Textfinish(m_pMaintable->text(nRow, TITRAQ_INDEXAMOUNT)); + QString Textamount(m_pMaintable->text(nRow, TITRAQ_INDEXAMOUNT)); + QString Texttask(m_pMaintable->text(nRow, TITRAQ_INDEXTASK)); + QString Textremark(m_pMaintable->text(nRow, TITRAQ_INDEXREMARK)); + + if (!Textdate.isEmpty()) + m_pDateedit->setDate(QDate::fromString(Textdate, Qt::ISODate)); + + if (!Textstart.isEmpty()) + m_pStarttime->setTime(QTime::fromString(Textstart, Qt::ISODate)); + + if (!Textfinish.isEmpty()) + m_pEndtime->setTime(QTime::fromString(Textfinish, Qt::ISODate)); + + if (!Textamount.isEmpty()) + m_pAmount->setText(Textamount); // Process the task combo box to compress text length - Tasktext = m_pMaintable->text(nRow, TITRAQ_INDEXTASK); - Tasktext.remove(0, Shorten.search(Tasktext) + 1); // Add one to strip leading slash + Texttask.remove(0, Shorten.search(Texttask) + 1); // Strip leading slash + m_pTasks->setCurrentText(Texttask); - m_pTasks->setCurrentText(Tasktext); - m_pRemark->setText(m_pMaintable->text(nRow, TITRAQ_INDEXREMARK)); + if (!Textremark.isEmpty()) + m_pRemark->setText(Textremark); } //