OSSP CVS Repository

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

Check-in Number: 3978
Date: 2003-Jan-31 00:48:00 (local)
2003-Jan-30 23:48:00 (UTC)
User:ms
Branch:
Comment: Fixed open document but empty timesheet debug text spew bug, and improved user interface by adding more clue messages and denying flawed ops.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/ChangeLog      1.23 -> 1.24     1 inserted, 0 deleted
ossp-pkg/as/as-gui/TODO      1.69 -> 1.70     0 inserted, 1 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.91 -> 1.92     7 inserted, 7 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.98 -> 1.99     47 inserted, 41 deleted

ossp-pkg/as/as-gui/ChangeLog 1.23 -> 1.24

--- ChangeLog    2003/01/30 23:17:06     1.23
+++ ChangeLog    2003/01/30 23:48:00     1.24
@@ -9,6 +9,7 @@
        Fixed close document operation with bad caption and status message
        Added exception handlers where none existed to close possible bugs
        Improved condition of empty but open timesheets by disabling edit cntrls
+       Fixed open document but empty timesheet debug text spew bug
        Fixed void clipboard pointer bug
 
 030129 Fixed the autoscroll before show bug, causing wrong data position


ossp-pkg/as/as-gui/TODO 1.69 -> 1.70

--- TODO 2003/01/30 23:17:06     1.69
+++ TODO 2003/01/30 23:48:00     1.70
@@ -49,7 +49,6 @@
 Pressing escape on task data cells does not exit edit mode
 On win32, all or some file reads and writes probably need IO_Translate?
 Method saveData(stream) must write to a new file, otherwise writes data pattern
-Clicking on an open document with no rows spews debug text
 
 Nice to have
 ------------


ossp-pkg/as/as-gui/as_assist.cpp 1.91 -> 1.92

--- as_assist.cpp        2003/01/30 22:02:41     1.91
+++ as_assist.cpp        2003/01/30 23:48:00     1.92
@@ -273,23 +273,23 @@
     m_pPasteact->setWhatsThis(kszPastetext);
 
     // Add data row action
-    m_pAddrowact = new QAction(trUtf8("Add Row"), Rowaddiset, trUtf8("&Add row"), Key_Insert, this, "Addrow");
+    m_pAddrowact = new QAction(trUtf8("Add Entry"), Rowaddiset, trUtf8("&Add entry"), Key_Insert, this, "Addentry");
     if (m_pAddrowact == NULL)   // Sanity check
-        throw Genexcept("Main window add row action creation failed.");
+        throw Genexcept("Main window add entry action creation failed.");
     connect(m_pAddrowact, SIGNAL(activated()), this, SLOT(addEntry()));
     const char *kszAddrowtext = "<p><img source=\"rowadd\"> "
-                                "Click this button to add a <em>new row</em>. "
+                                "Click this button to add a <em>new entry</em>. "
                                 "You can also select the <b>Add</b> command "
                                 "from the <b>Edit</b> menu.</p>";
     m_pAddrowact->setWhatsThis(kszAddrowtext);
 
     // Delete data row action
-    m_pDelrowact = new QAction(trUtf8("Delete Row"), Rowdeliset, trUtf8("&Delete row"), Key_Delete, this, "Delrow");
+    m_pDelrowact = new QAction(trUtf8("Delete Entry"), Rowdeliset, trUtf8("&Delete entry"), Key_Delete, this, "Delentry");
     if (m_pDelrowact == NULL)   // Sanity check
-        throw Genexcept("Main window delete row action creation failed.");
+        throw Genexcept("Main window delete entry action creation failed.");
     connect(m_pDelrowact, SIGNAL(activated()), this, SLOT(delEntry()));
     const char *kszDelrowtext = "<p><img source=\"rowdel\"> "
-                                   "Click this button to delete a <em>row</em>. "
+                                   "Click this button to delete a <em>entry</em>. "
                                    "You can also select the <b>Delete</b> command "
                                    "from the <b>Edit</b> menu.</p>";
     m_pDelrowact->setWhatsThis(kszDelrowtext);
@@ -649,7 +649,7 @@
     // Whatsthis info for the item status edit
     const char *kszStatustext = "The <em>item status</em> shows a green "
                                 "symbol for valid entries, a yellow symbol "
-                                "to warn, and a red symbol for flawed entries.";
+                                "for warning, and a red symbol for flawed entries.";
     QWhatsThis::add(m_pStatusedit, kszStatustext);
     QToolTip::add(m_pStatusedit, trUtf8("Status Indicator"));
     m_pEditlayout->addWidget(m_pStatusedit);  // Finally add the item status edit


ossp-pkg/as/as-gui/as_slot.cpp 1.98 -> 1.99

--- as_slot.cpp  2003/01/30 23:17:06     1.98
+++ as_slot.cpp  2003/01/30 23:48:00     1.99
@@ -778,53 +778,59 @@
 //
 void Titraqform::updEdit(int nRow, int nCol)
 {
-//    QRegExp Shorten("/(\\w+)$");    // For stripping prefix off the current task
-
-    // Field strings to check for validity and process
-    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));
-
-    // Reset the edition state member
-    m_pMaintable->setEdition();
-
-    // Set text of member edit controls
-    if (m_pMaintable->text(nRow, TITRAQ_IDXSTATUS).isEmpty())   // If row is empty
-        m_pStatusedit->setPixmap(s_kpcStatvoid_xpm);            // add a placeholder
-    else
-        m_pStatusedit->setPixmap(m_pMaintable->pixmap(nRow, TITRAQ_IDXSTATUS));
-    m_pLineedit->setText(Textline);
-    m_pUseredit->setText(Textuser);
-    m_pGuidedit->setText(Textguid);
-    m_pCrcedit->setText(Textcrc);
-    m_pRevedit->setText(Textrev);
-
-    m_pAmount->setText(Textamount);
-//    Texttask.remove(0, Shorten.search(Texttask) + 1); // Strip leading slash
-    m_pTasks->setCurrentText(Texttask);
-    m_pRemark->setText(Textremark);
-
-    // Members not suitable for empty string text
-    if (!Textdate.isEmpty())
-        m_pDateedit->setDate(QDate::fromString(Textdate, Qt::ISODate));
-    else
-        m_pDateedit->setDate(QDate::currentDate());
-    if (!Textstart.isEmpty())
-        m_pStarttime->setTime(QTime::fromString(Textstart, Qt::ISODate));
-    else
-        m_pStarttime->setTime(QTime::QTime(0, 0));
-    if (!Textfinish.isEmpty())
-        m_pEndtime->setTime(QTime::fromString(Textfinish, Qt::ISODate));
+    // Why is the app sending negative row signal? I don't know yet,
+    // so add in this nasty hack to fend off the debug spew on stderr
+    if (m_pMaintable->numRows() > 0 && nRow >= 0) {
+        // Field strings to check for validity and process
+        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));
+
+        // Reset the edition state member
+        m_pMaintable->setEdition();
+
+        // Set text of member edit controls
+        if (m_pMaintable->text(nRow, TITRAQ_IDXSTATUS).isEmpty())   // If row is empty
+            m_pStatusedit->setPixmap(s_kpcStatvoid_xpm);            // add a placeholder
+        else
+            m_pStatusedit->setPixmap(m_pMaintable->pixmap(nRow, TITRAQ_IDXSTATUS));
+        m_pLineedit->setText(Textline);
+        m_pUseredit->setText(Textuser);
+        m_pGuidedit->setText(Textguid);
+        m_pCrcedit->setText(Textcrc);
+        m_pRevedit->setText(Textrev);
+
+//        QRegExp Shorten("/(\\w+)$");    // For stripping prefix off the current task
+//        Texttask.remove(0, Shorten.search(Texttask) + 1); // Strip leading slash
+
+        m_pAmount->setText(Textamount);
+        m_pRemark->setText(Textremark);
+        m_pTasks->setCurrentText(Texttask);
+
+        // Members not suitable for empty string text
+        if (!Textdate.isEmpty())
+            m_pDateedit->setDate(QDate::fromString(Textdate, Qt::ISODate));
+        else
+            m_pDateedit->setDate(QDate::currentDate());
+        if (!Textstart.isEmpty())
+            m_pStarttime->setTime(QTime::fromString(Textstart, Qt::ISODate));
+        else
+            m_pStarttime->setTime(QTime::QTime(0, 0));
+        if (!Textfinish.isEmpty())
+            m_pEndtime->setTime(QTime::fromString(Textfinish, Qt::ISODate));
+        else
+            m_pEndtime->setTime(QTime::QTime(0, 0));
+    }
     else
-        m_pEndtime->setTime(QTime::QTime(0, 0));
+        m_pStatbar->message(trUtf8("Empty timesheet, add entries first please"), 4000);
 }
 
 //

CVSTrac 2.0.1