--- as_slot.cpp 2002/12/16 17:37:39 1.66
+++ as_slot.cpp 2002/12/17 14:08:33 1.67
@@ -98,7 +98,7 @@
m_pMaintable->setText(nIter, TITRAQ_IDXLINE, QString::number(nIter).rightJustify(4, QChar('0')));
// Do basic data validation to warn against missing fields
- for (int nIter = 0; nIter <= nRows; nIter++)
+ for (int nIter = 0; nIter < nRows; nIter++)
this->validateData(m_pMaintable->currentRow() + nIter, 0);
}
@@ -137,7 +137,7 @@
m_pMaintable->setText(Select.topRow() + nIter, TITRAQ_IDXGUID, ".");
m_pMaintable->setText(Select.topRow() + nIter, TITRAQ_IDXCRC, ".");
m_pMaintable->setText(Select.topRow() + nIter, TITRAQ_IDXREV, ".");
- m_pMaintable->setText(Select.topRow() + nIter, TITRAQ_IDXDATE, trUtf8(TITRAQ_DATEZERO));
+ m_pMaintable->setText(Select.topRow() + nIter, TITRAQ_IDXDATE, QDate::currentDate().toString("yyyy.MM.dd"));
m_pMaintable->setText(Select.topRow() + nIter, TITRAQ_IDXSTART, "00:00");
m_pMaintable->setText(Select.topRow() + nIter, TITRAQ_IDXFINISH, "00:00");
m_pMaintable->setText(Select.topRow() + nIter, TITRAQ_IDXAMOUNT, "00:00");
@@ -158,7 +158,7 @@
m_pMaintable->setText(Select.bottomRow() + nIter, TITRAQ_IDXGUID, ".");
m_pMaintable->setText(Select.bottomRow() + nIter, TITRAQ_IDXCRC, ".");
m_pMaintable->setText(Select.bottomRow() + nIter, TITRAQ_IDXREV, ".");
- m_pMaintable->setText(Select.bottomRow() + nIter, TITRAQ_IDXDATE, trUtf8(TITRAQ_DATEZERO));
+ m_pMaintable->setText(Select.bottomRow() + nIter, TITRAQ_IDXDATE, QDate::currentDate().toString("yyyy.MM.dd"));
m_pMaintable->setText(Select.bottomRow() + nIter, TITRAQ_IDXSTART, "00:00");
m_pMaintable->setText(Select.bottomRow() + nIter, TITRAQ_IDXFINISH, "00:00");
m_pMaintable->setText(Select.bottomRow() + nIter, TITRAQ_IDXAMOUNT, "00:00");
@@ -325,7 +325,7 @@
void Titraqform::openDoc(void)
{
int nResult = 0; // Holds return value from save first messagebox
- QString Filestring = QFileDialog::getOpenFileName("/e/dev/as", QString::null, this, trUtf8("Chooser Dialog"), trUtf8("Choose a file to open"));
+ QString Filestring = QFileDialog::getOpenFileName(m_pPrefs->getString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE), trUtf8("Accounting Data (*.as);;Text files (*.txt);;All Files (*)"), this, trUtf8("ChooserDialog"), trUtf8("Choose a file to open"), NULL, false);
if (!Filestring.isEmpty()) {
QFile Filetemp(Filestring); // File to load
@@ -458,7 +458,8 @@
int nResult = 0; // For checking user's answer
// First get the selected file name to save to
- QString Filestring = QFileDialog::getSaveFileName(QString::null, QString::null, this);
+ QString Filestring =
+ QFileDialog::getSaveFileName(m_pPrefs->getString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE), trUtf8("Accounting Data (*.as);;Text files (*.txt);;All Files (*)"), this, trUtf8("ChooserDialog"), trUtf8("Choose a file to save"), NULL, false);
if (!Filestring.isEmpty()) {
*m_szFilename = Filestring;
if (QFile::exists(*m_szFilename)) {
|