--- as_slot.cpp 2002/12/05 18:03:53 1.43
+++ as_slot.cpp 2002/12/10 00:00:57 1.44
@@ -187,6 +187,15 @@
switch (nResult) {
case 0: // Save first
this->saveFile(); // Save changes first
+
+ // Reset widget text values before blanking table
+ m_pDateedit->setDate(*m_pDatezero);
+ m_pStarttime->setTime(QTime::QTime(0, 0));
+ m_pEndtime->setTime(QTime::QTime(0, 0));
+ m_pAmount->setText(NULL);
+ m_pTasks->setCurrentText(NULL);
+ m_pRemark->setText(NULL);
+
m_pMaintable->setNumRows(0); // Remove all data in table
this->setDirty(false); // Reset data to clean state
break;
@@ -199,7 +208,14 @@
break;
}
}
- else { // Data is already up to date
+ else { // Data is already up to date
+ // Reset widget text values before blanking table
+ m_pDateedit->setDate(*m_pDatezero);
+ m_pStarttime->setTime(QTime::QTime(0, 0));
+ m_pEndtime->setTime(QTime::QTime(0, 0));
+ m_pAmount->setText(NULL);
+ m_pTasks->setCurrentText(NULL);
+ m_pRemark->setText(NULL);
m_pMaintable->setNumRows(0); // Remove all data in table
this->setDirty(false); // Reset data to clean state
}
@@ -438,26 +454,23 @@
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));
- else
- m_pEndtime->setTime(QTime::QTime(0, 0));
- m_pAmount->setText(Textamount);
+ if (!Textamount.isNull())
+ m_pAmount->setText(Textamount);
- // Process the task combo box to compress text length
- Texttask.remove(0, Shorten.search(Texttask) + 1); // Strip leading slash
- m_pTasks->setCurrentText(Texttask);
+ 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);
+ }
- m_pRemark->setText(Textremark);
+ if (!Textremark.isNull())
+ m_pRemark->setText(Textremark);
}
//
|