--- as_slot.cpp 2002/12/19 11:25:19 1.71
+++ as_slot.cpp 2002/12/19 13:23:35 1.72
@@ -275,6 +275,9 @@
m_pTasks->setEnabled(true);
m_pRemark->setEnabled(true);
this->updEdit(0, 0); // Reset edit controls
+ this->setCaption(trUtf8("No file name"));
+ m_pStatbar->message(trUtf8("New document"), 4000);
+ *m_szFilename = ""; // Blank the file name
m_pMaintable->setDirty(false); // Reset data to clean state
break;
case 1: // Second button selected, so don't save first but do new
@@ -292,6 +295,9 @@
m_pTasks->setEnabled(true);
m_pRemark->setEnabled(true);
this->updEdit(0, 0); // Reset edit controls
+ this->setCaption(trUtf8("No file name"));
+ m_pStatbar->message(trUtf8("New document"), 4000);
+ *m_szFilename = ""; // Blank the file name
m_pMaintable->setDirty(false); // Reset data to clean state
break;
case 2: // Third button selected, so don't do a new timesheet
@@ -321,6 +327,9 @@
m_pTasks->setEnabled(true);
m_pRemark->setEnabled(true);
this->updEdit(0, 0); // Reset edit controls
+ this->setCaption(trUtf8("No file name"));
+ m_pStatbar->message(trUtf8("New document"), 4000);
+ *m_szFilename = ""; // Blank the file name
m_pMaintable->setDirty(false); // Reset data to clean state
}
}
@@ -464,15 +473,14 @@
int nResult = 0; // For checking user's answer
// First get the selected file name to save to
- 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);
+ 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)) {
+ if (QFile::exists(Filestring)) {
nResult = QMessageBox::warning(this, trUtf8(TITRAQ_APPTITLE),
trUtf8(TITRAQ_OVERWRITE), trUtf8("&Yes"), trUtf8("&No"), NULL, 1, 1);
switch (nResult) {
case 0: // Overwrite contents
+ *m_szFilename = Filestring;
this->saveFile();
break;
case 1: // Don't overwrite
|