OSSP CVS Repository

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

Check-in Number: 3870
Date: 2002-Dec-13 18:44:42 (local)
2002-Dec-13 17:44:42 (UTC)
User:ms
Branch:
Comment: Fix display of initialized cells, initialize new cells, and add a shift tab event handler.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/TODO      1.41 -> 1.42     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.64 -> 1.65     9 inserted, 4 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.56 -> 1.57     26 inserted, 27 deleted
ossp-pkg/as/as-gui/as_table.cpp      1.9 -> 1.10     15 inserted, 1 deleted

ossp-pkg/as/as-gui/TODO 1.41 -> 1.42

--- TODO 2002/12/13 11:46:38     1.41
+++ TODO 2002/12/13 17:44:42     1.42
@@ -41,6 +41,7 @@
 Preserve main window geo and dock pos with << operators
 Make edit control window dockable anywhere
 Give configure a location to place and look for conf file
+Add customizable column ordering by click and drag
 
 Beim Editmodus
 ---------------


ossp-pkg/as/as-gui/as_assist.cpp 1.64 -> 1.65

--- as_assist.cpp        2002/12/12 21:24:07     1.64
+++ as_assist.cpp        2002/12/13 17:44:42     1.65
@@ -675,9 +675,10 @@
         throw Genexcept("Main window start time creation failed."); // Spew errors
 
     // Configure attributes
+    m_pStarttime->setDisplay(QTimeEdit::Hours | QTimeEdit::Minutes);
     m_pStarttime->setAutoAdvance(true);
 
-    m_pEditlayout->addWidget(m_pStarttime);                      // Finally add the start editor
+    m_pEditlayout->addWidget(m_pStarttime);                         // Finally add the start editor
     QToolTip::add(m_pStarttime, trUtf8("Task Starting Time"));
 
     // Whatsthis info for the time editor
@@ -688,10 +689,14 @@
 
     // Make the end time selector
     m_pEndtime = new QTimeEdit(m_pCenframe, "EndTime");
-    if (m_pEndtime == NULL)                                        // Sanity check
-        throw Genexcept("Main window end time creation failed.");  // Spew errors
+    if (m_pEndtime == NULL)                                         // Sanity check
+        throw Genexcept("Main window end time creation failed.");   // Spew errors
 
-    m_pEditlayout->addWidget(m_pEndtime);                       // Finally add the end editor
+    // Configure attributes
+    m_pEndtime->setDisplay(QTimeEdit::Hours | QTimeEdit::Minutes);
+    m_pEndtime->setAutoAdvance(true);
+
+    m_pEditlayout->addWidget(m_pEndtime);                           // Finally add the end editor
     QToolTip::add(m_pEndtime, trUtf8("Task Ending Time"));
 
     // Whatsthis info for the time editor


ossp-pkg/as/as-gui/as_slot.cpp 1.56 -> 1.57

--- as_slot.cpp  2002/12/13 11:46:38     1.56
+++ as_slot.cpp  2002/12/13 17:44:42     1.57
@@ -114,10 +114,10 @@
         m_pMaintable->ensureCellVisible(m_pMaintable->numRows() - 1, 0); // Scroll please
     }
 
-//    updateDate(*m_pDatezero);
-//    updateStart(QTime::QTime(0, 0));
-//    updateFinish(QTime::QTime(0, 0));
-//    updateAmount(trUtf8("00:00"));
+    updateDate(*m_pDatezero);
+    updateStart(QTime::QTime(0, 0));
+    updateFinish(QTime::QTime(0, 0));
+    updateAmount(trUtf8("00:00"));
 
 //    char szGuitext[37];
 //    uuid_t Guid;
@@ -514,33 +514,32 @@
     // Reset the edition state member
     m_pMaintable->setEdition();
 
-    if (!Textstat.isEmpty())
-        m_pStatusedit->setText(Textstat);
-    if (!Textline.isEmpty())
-        m_pLineedit->setText(Textline);
-    if (!Textuser.isEmpty())
-        m_pUseredit->setText(Textuser);
-    if (!Textguid.isEmpty())
-        m_pGuidedit->setText(Textguid);
-    if (!Textcrc.isEmpty())
-        m_pCrcedit->setText(Textcrc);
-    if (!Textrev.isEmpty())
-        m_pRevedit->setText(Textrev);
+    // Set text of member edit controls
+    m_pStatusedit->setText(Textstat);
+    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(*m_pDatezero);
     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));
-    if (!Textamount.isNull())
-        m_pAmount->setText(Textamount);
-    if (!Texttask.isNull()) { // Process task combo box to compress text length
-//        Texttask.remove(0, Shorten.search(Texttask) + 1); // Strip leading slash
-        m_pTasks->setCurrentText(Texttask);
-    }
-
-    if (!Textremark.isNull())
-        m_pRemark->setText(Textremark);
+    else
+        m_pEndtime->setTime(QTime::QTime(0, 0));
 }
 
 //
@@ -607,7 +606,7 @@
 //
 void Titraqform::updateStart(const QTime &Startup)
 {
-    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXSTART, Startup.toString(Qt::ISODate));
+    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXSTART, Startup.toString("hh:mm"));
 }
 
 //
@@ -615,7 +614,7 @@
 //
 void Titraqform::updateFinish(const QTime &Finishup)
 {
-    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXFINISH, Finishup.toString(Qt::ISODate));
+    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXFINISH, Finishup.toString("hh:mm"));
 }
 
 //


ossp-pkg/as/as-gui/as_table.cpp 1.9 -> 1.10

--- as_table.cpp 2002/12/12 16:20:15     1.9
+++ as_table.cpp 2002/12/13 17:44:42     1.10
@@ -44,7 +44,7 @@
         ((QMouseEvent *)pEvent)->button() == QMouseEvent::MidButton)
         return true;
     else if (pEvent->type() == QEvent::KeyPress) {
-        if (((QKeyEvent *)pEvent)->key() == Qt::Key_Tab) {          // Handle tab key
+        if (((QKeyEvent *)pEvent)->key() == Qt::Key_Tab) { // Handle tab key
             if (this->getEdition() >= 0) {
                 int nColadvance = ((currentColumn() + 1) % TITRAQ_IDXTAIL);
                 if (nColadvance == 0)   // Advance the column and possibly the row too
@@ -52,6 +52,20 @@
                 else
                     this->setCurrentCell(currentRow(), nColadvance);
                 this->setReadOnly(false);
+                this->editCell(currentRow(), currentColumn());
+                this->setEdition(currentColumn());
+                this->setReadOnly(true);
+            }
+            return true;    // Handled the tab key event and cancel its progress
+        }
+        else if (((QKeyEvent *)pEvent)->key() == Qt::Key_Backtab) { // Handle shift tab key
+            if (this->getEdition() >= 0) {
+                int nColadvance = ((currentColumn() - 1) % TITRAQ_IDXTAIL);
+                if (nColadvance == 0)   // Advance the column and possibly the row too
+                    this->setCurrentCell(currentRow() - 1, nColadvance);
+                else
+                    this->setCurrentCell(currentRow(), nColadvance);
+                this->setReadOnly(false);
                 this->editCell(currentRow(), currentColumn());
                 this->setEdition(currentColumn());
                 this->setReadOnly(true);

CVSTrac 2.0.1