Index: ossp-pkg/as/as-gui/as_amount.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_amount.h,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_amount.h,v' 2>/dev/null --- as_amount.h 2002/11/28 20:44:36 1.2 +++ as_amount.h 2002/12/04 14:50:08 1.3 @@ -38,7 +38,7 @@ class AmountBox : public QSpinBox { public: - AmountBox(int nMinval, int nMaxval, int nStep = 1, QWidget *pParent = 0, const char *szName = 0) : QSpinBox(nMinval, nMaxval, nStep, pParent, szName) {}; + AmountBox(int nMinval, int nMaxval, int nStep = 1, QWidget *pParent = 0, const char *szName = 0) : QSpinBox(nMinval, nMaxval, nStep, pParent, szName) {setValue(0);}; void setText(const QString &); // Sets a text formatted representation QString text(void) const; // Return a text formatted representation }; Index: ossp-pkg/as/as-gui/as_assist.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v rcsdiff -q -kk '-r1.43' '-r1.44' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v' 2>/dev/null --- as_assist.cpp 2002/12/04 11:41:55 1.43 +++ as_assist.cpp 2002/12/04 14:50:08 1.44 @@ -593,6 +593,8 @@ m_pTasks->insertStringList(*m_pTaskentries); m_pTasks->setCurrentText(NULL); m_pTasks->setAutoCompletion(true); + m_pTasks->setDuplicatesEnabled(false); +// m_pTasks->setEditable(false); // Only idiots define noneditable and autocompletion // Add an auto scroll bar if possible under current GUI style if (m_pTasks->listBox()) // Motif style has no list box Index: ossp-pkg/as/as-gui/as_const.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_const.h,v rcsdiff -q -kk '-r1.12' '-r1.13' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_const.h,v' 2>/dev/null --- as_const.h 2002/12/04 11:41:55 1.12 +++ as_const.h 2002/12/04 14:50:08 1.13 @@ -49,6 +49,9 @@ #define TITRAQ_PREFLOCALLOG "loglocal" #define TITRAQ_DEFLOCALLOG "no" +// Other string constants +#define TITRAQ_DATEZERO "00.00.00" + // Indexes of table columns #define TITRAQ_IDXALLCTRLS -1 #define TITRAQ_IDXDATE 0 Index: ossp-pkg/as/as-gui/as_slot.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v rcsdiff -q -kk '-r1.33' '-r1.34' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- 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)); } //