OSSP CVS Repository

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

Check-in Number: 2904
Date: 2002-Nov-27 00:26:07 (local)
2002-Nov-26 23:26:07 (UTC)
User:ms
Branch:
Comment: Implemented edition controls, corrected amount formatting, and corrected file format saving.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_amount.cpp      1.2 -> 1.3     7 inserted, 5 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.28 -> 1.29     7 inserted, 8 deleted
ossp-pkg/as/as-gui/as_dataop.cpp      1.7 -> 1.8     11 inserted, 11 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.22 -> 1.23     9 inserted, 2 deleted
ossp-pkg/titraq/tidatops.cpp      1.7 -> 1.8     11 inserted, 11 deleted
ossp-pkg/titraq/titamount.cpp      1.2 -> 1.3     7 inserted, 5 deleted
ossp-pkg/titraq/titassist.cpp      1.28 -> 1.29     7 inserted, 8 deleted
ossp-pkg/titraq/titslot.cpp      1.22 -> 1.23     9 inserted, 2 deleted

ossp-pkg/as/as-gui/as_amount.cpp 1.2 -> 1.3

--- as_amount.cpp        2002/11/26 19:33:36     1.2
+++ as_amount.cpp        2002/11/26 23:26:07     1.3
@@ -25,13 +25,15 @@
 // Return a text formatted representation
 QString AmountBox::text(void) const
 {
-    QString Strout;
+    QString Strfirst, Strsecond;
     int nHours = 0;
     int nMins = this->value();
 
-    nHours = nMins / TITRAQ_MINSINHOUR;    // Calculate total hours
-    nMins  = nMins % TITRAQ_MINSINHOUR;    // Calculate total minutes
-    Strout = trUtf8("%1:%2").arg(nHours).arg(nMins); // Format string
+    nHours    = nMins / TITRAQ_MINSINHOUR;      // Calculate total hours
+    nMins     = nMins % TITRAQ_MINSINHOUR;      // Calculate total minutes
+    Strfirst  = trUtf8("%1:").arg(nHours);      // Format the first part
+    Strsecond = trUtf8("%1").arg(nMins);        // Format the second part
 
-    return Strout;
+    // Pad the resulting concatination before sending it out the back
+    return Strfirst.rightJustify(3, '0') + Strsecond.rightJustify(2, '0');
 }


ossp-pkg/as/as-gui/as_assist.cpp 1.28 -> 1.29

--- as_assist.cpp        2002/11/26 22:22:53     1.28
+++ as_assist.cpp        2002/11/26 23:26:07     1.29
@@ -426,7 +426,6 @@
 
     // Table update signals
     connect(m_pMaintable, SIGNAL(currentChanged(int, int)), this, SLOT(updEdit(int, int)));
-//    connect(m_pMaintable, SIGNAL(clicked(int, int, int, const QPoint&)), this, SLOT(updEdit(int, int)));
 //    connect(m_pMaintable, SIGNAL(doubleClicked(int, int, int, const QPoint&)), this, SLOT(updEdit(int, int)));
 //    connect(m_pMaintable, SIGNAL(valueChanged(int, int)), this, SLOT(tableChanged(int, int)));
 }
@@ -457,7 +456,7 @@
     QWhatsThis::add(m_pDateedit, kszDateedit);
 
     // Make the start time selector
-    m_pStarttime = new QTimeEdit(QTime::currentTime(), m_pCenframe, "StartTime");
+    m_pStarttime = new QTimeEdit(m_pCenframe, "StartTime");
     if (m_pStarttime == NULL)                                       // Sanity check
         throw Genexcept("Main window start time creation failed."); // Spew errors
 
@@ -474,7 +473,7 @@
     QWhatsThis::add(m_pStarttime, kszStarttime);
 
     // Make the end time selector
-    m_pEndtime = new QTimeEdit(QTime::currentTime(), m_pCenframe, "EndTime");
+    m_pEndtime = new QTimeEdit(m_pCenframe, "EndTime");
     if (m_pEndtime == NULL)                                        // Sanity check
         throw Genexcept("Main window end time creation failed.");  // Spew errors
 
@@ -575,9 +574,9 @@
     QWhatsThis::add(m_pConfirmbutton, kszConfirmtext);
 
 //    // Signals
-//    m_pDateedit->valueChanged(const QDate &date);
-//    m_pStarttime->valueChanged(const QTime &time);
-//    m_pEndtime->valueChanged(const QTime &time);
-//    m_pAmount->valueChanged(int value);
-//    m_pTasks->textChanged(const QString &string);
+//    connect(m_pDateedit, SIGNAL(valueChanged(const QDate &date)), this, SLOT(updateDate()));
+//    connect(m_pStarttime, SIGNAL(valueChanged(const QTime &time)), this, SLOT(updateStart()));
+//    connect(m_pEndtime, SIGNAL(valueChanged(const QTime &time)), this, SLOT(updateFinish()));
+//    connect(m_pAmount, SIGNAL(valueChanged(int value), this, SLOT(updateAmount()));
+//    connect(m_pTasks, SIGNAL(textChanged(const QString &string), this, SLOT(updateTask()));
 }


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

--- as_dataop.cpp        2002/11/26 14:10:32     1.7
+++ as_dataop.cpp        2002/11/26 23:26:07     1.8
@@ -115,39 +115,39 @@
     for (int nIter = 0; nIter <= nRows; nIter++) {
         Tempfield = m_pMaintable->text(nIter, 0);   // Load date field text
         if (Tempfield != NULL)
-            Tstream << Tempfield << trUtf8(" ");    // Save date field text
+            Tstream << Tempfield;                   // Save date field text
         else
             bValid = false;
 
-        Tstream << trUtf8("user ");                 // Save user field text
+        Tstream << trUtf8(" ") << trUtf8("user");   // Save user field text
 
-/*        Tempfield = m_pMaintable->text(nIter, 1);   // Load start field text
+        Tempfield = m_pMaintable->text(nIter, 1);   // Load start field text
         if (Tempfield != NULL)
-            Tstream << Tempfield << trUtf8(" ");    // Save start field text
-        else
-            bValid = false;
+            Tstream << trUtf8(" ") << Tempfield;    // Save start field text
+/*        else
+            bValid = false;*/
 
         Tempfield = m_pMaintable->text(nIter, 2);   // Load end field text
         if (Tempfield != NULL)
-            Tstream << Tempfield << trUtf8(" ");    // Save end field text
-        else
+            Tstream << trUtf8(" ") << Tempfield;    // Save end field text
+/*        else
             bValid = false;*/
 
         Tempfield = m_pMaintable->text(nIter, 4);   // Load amount field text
         if (Tempfield != NULL)
-            Tstream << Tempfield << trUtf8(" ");    // Save amount field text
+            Tstream << trUtf8(" ") << Tempfield;    // Save amount field text
         else
             bValid = false;
 
         Tempfield = m_pMaintable->text(nIter, 3);   // Load acct field text
         if (Tempfield != NULL)
-            Tstream << Tempfield << trUtf8(" ");    // Save acct field text
+            Tstream << trUtf8(" ") << Tempfield;    // Save acct field text
         else
             bValid = false;
 
         Tempfield = m_pMaintable->text(nIter, 5);   // Load remark field text
         if (Tempfield != NULL)
-            Tstream << Tempfield << trUtf8(" ");    // Save remark field text
+            Tstream << trUtf8(" ") << Tempfield;    // Save remark field text
         else
             bValid = false;
 


ossp-pkg/as/as-gui/as_slot.cpp 1.22 -> 1.23

--- as_slot.cpp  2002/11/26 22:22:53     1.22
+++ as_slot.cpp  2002/11/26 23:26:07     1.23
@@ -192,8 +192,8 @@
 
     // Field strings to check for validity and process
     QString Textdate(m_pMaintable->text(nRow, TITRAQ_IDXDATE));
-    QString Textstart(m_pMaintable->text(nRow, TITRAQ_IDXAMOUNT));
-    QString Textfinish(m_pMaintable->text(nRow, TITRAQ_IDXAMOUNT));
+    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));
@@ -227,6 +227,13 @@
 //
 void Titraqform::confirmEdit(void)
 {
+    // Conversions from edit control data formats to native tabular format
+    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXDATE, m_pDateedit->date().toString(Qt::ISODate));
+    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXSTART, m_pStarttime->time().toString(Qt::ISODate));
+    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXFINISH, m_pEndtime->time().toString(Qt::ISODate));
+    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXAMOUNT, m_pAmount->text());
+    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXTASK, m_pTasks->currentText());
+    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXREMARK, m_pRemark->text());
 }
 
 //





CVSTrac 2.0.1