OSSP CVS Repository

ossp - Difference in ossp-pkg/as/as-gui/as_slot.cpp versions 1.33 and 1.34
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/as/as-gui/as_slot.cpp 1.33 -> 1.34

--- as_slot.cpp  2002/12/04 11:34:08     1.33
+++ as_slot.cpp  2002/12/04 14:50:08     1.34
@@ -77,14 +77,24 @@
 //
 void Titraqform::addEntry(void)
 {
+    int nCurrentrow = 0;
+
     // Add a row after selection and focus to the new row
-    if (m_pMaintable->currentRow() + 1 != m_pMaintable->numRows()) {
+    if (m_pMaintable->currentRow() + 1 != m_pMaintable->numRows()) { // Add upwards
         m_pMaintable->insertRows(m_pMaintable->currentRow());
-        m_pMaintable->setCurrentCell(m_pMaintable->currentRow() - 3, m_pMaintable->currentColumn());
+        m_pMaintable->setCurrentCell(m_pMaintable->currentRow() - 2, m_pMaintable->currentColumn());
+        updateDate(*m_pDatezero);
+        updateStart(QTime::QTime(0, 0));
+        updateFinish(QTime::QTime(0, 0));
+        updateAmount(trUtf8("00:00"));
     }
-    else // Special case to handle adding an only row or last row
-        m_pMaintable->insertRows(m_pMaintable->currentRow() + 1); {
+    else { // Special case on last row add downwards
+        m_pMaintable->insertRows(m_pMaintable->currentRow() + 1);
         m_pMaintable->setCurrentCell(m_pMaintable->currentRow() + 1, m_pMaintable->currentColumn());
+        updateDate(*m_pDatezero);
+        updateStart(QTime::QTime(0, 0));
+        updateFinish(QTime::QTime(0, 0));
+        updateAmount(trUtf8("00:00"));
     }
 
 //    char szGuitext[37];
@@ -318,7 +328,10 @@
 //
 void Titraqform::updateDate(const QDate &Dateup)
 {
-    m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXDATE, Dateup.toString(Qt::ISODate));
+    if (Dateup == *m_pDatezero) // Complete the already nasty hack
+        m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXDATE, trUtf8(TITRAQ_DATEZERO));
+    else
+        m_pMaintable->setText(m_pMaintable->currentRow(), TITRAQ_IDXDATE, Dateup.toString(Qt::ISODate));
 }
 
 //

CVSTrac 2.0.1