OSSP CVS Repository

ossp - Check-in [2890]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2890
Date: 2002-Nov-26 15:10:32 (local)
2002-Nov-26 14:10:32 (UTC)
User:ms
Branch:
Comment: Add edit toolbar to eventually replace bottom button matrix, and correct edit control update logic to avoid needlessly updating controls from empty fields.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/TODO      1.16 -> 1.17     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.17 -> 1.18     15 inserted, 9 deleted
ossp-pkg/as/as-gui/as_const.h      1.3 -> 1.4     1 inserted, 1 deleted
ossp-pkg/as/as-gui/as_dataop.cpp      1.6 -> 1.7     3 inserted, 4 deleted
ossp-pkg/as/as-gui/as_gui.cpp      1.20 -> 1.21     0 inserted, 1 deleted
ossp-pkg/as/as-gui/as_gui.h      1.24 -> 1.25     2 inserted, 1 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.13 -> 1.14     24 inserted, 11 deleted
ossp-pkg/titraq/TODO      1.16 -> 1.17     1 inserted, 0 deleted
ossp-pkg/titraq/tidatops.cpp      1.6 -> 1.7     3 inserted, 4 deleted
ossp-pkg/titraq/titassist.cpp      1.17 -> 1.18     15 inserted, 9 deleted
ossp-pkg/titraq/titconst.h      1.3 -> 1.4     1 inserted, 1 deleted
ossp-pkg/titraq/titraq.cpp      1.20 -> 1.21     0 inserted, 1 deleted
ossp-pkg/titraq/titraq.h      1.24 -> 1.25     2 inserted, 1 deleted
ossp-pkg/titraq/titslot.cpp      1.13 -> 1.14     24 inserted, 11 deleted

ossp-pkg/as/as-gui/TODO 1.16 -> 1.17

--- 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
 ------


ossp-pkg/as/as-gui/as_assist.cpp 1.17 -> 1.18

--- 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"));
 }
 
 //


ossp-pkg/as/as-gui/as_const.h 1.3 -> 1.4

--- 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


ossp-pkg/as/as-gui/as_dataop.cpp 1.6 -> 1.7

--- 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.");


ossp-pkg/as/as-gui/as_gui.cpp 1.20 -> 1.21

--- 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
 }
 


ossp-pkg/as/as-gui/as_gui.h 1.24 -> 1.25

--- 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


ossp-pkg/as/as-gui/as_slot.cpp 1.13 -> 1.14

--- 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);
 }
 
 //








CVSTrac 2.0.1