Index: ossp-pkg/as/as-gui/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/ChangeLog,v rcsdiff -q -kk '-r1.34' '-r1.35' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/ChangeLog,v' 2>/dev/null --- ChangeLog 2003/02/06 15:27:39 1.34 +++ ChangeLog 2003/02/06 15:55:01 1.35 @@ -1,6 +1,7 @@ Geschichte des OSSP titraq in Vorwaerts Cronordnung 030206 Implemented embedding of escape characters into event data file + Begin treating quit op on an edited doc as a special case to avoid loss 030205 Add logic to save empty remark fields with surrounding double quotes CORBA client transmission improvements, including multiple entry allowance 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.97' '-r1.98' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v' 2>/dev/null --- as_assist.cpp 2003/02/04 19:30:31 1.97 +++ as_assist.cpp 2003/02/06 15:55:01 1.98 @@ -236,8 +236,7 @@ m_pFilequitact = new QAction(trUtf8("Exit"), trUtf8("E&xit"), CTRL+Key_Q, this, "Exit"); if (m_pFilequitact == NULL) // Sanity check throw Genexcept("Main window file quit action creation failed."); - connect(m_pFilequitact, SIGNAL(activated()), this, SLOT(close())); - connect(m_pFilequitact, SIGNAL(activated()), qApp, SLOT(quit())); + connect(m_pFilequitact, SIGNAL(activated()), this, SLOT(quitApp())); // Cut action m_pCutact = new QAction(trUtf8("Cut"), Cutiset, trUtf8("&Cut"), CTRL+Key_X, this, "Cut"); Index: ossp-pkg/as/as-gui/as_gui.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v rcsdiff -q -kk '-r1.70' '-r1.71' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_gui.h,v' 2>/dev/null --- as_gui.h 2003/02/04 19:30:31 1.70 +++ as_gui.h 2003/02/06 15:55:01 1.71 @@ -237,6 +237,7 @@ void syncSoap(void); // Syncronize data with server using SOAP void newDoc(void); // Make and display a new document window void openDoc(void); // Open and display an existing document + void quitApp(void); // Close the current document and quit void saveFile(void); // Serialize to the current file void saveAs(void); // Serialize to a selected file void saveName(void); // Implicitly serialize to a selected file 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.112' '-r1.113' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- as_slot.cpp 2003/02/05 12:54:22 1.112 +++ as_slot.cpp 2003/02/06 15:55:01 1.113 @@ -564,6 +564,37 @@ } // +// Close current document, and then quit the application +// +void Titraqform::quitApp(void) +{ + int nResult = 0; + + if (m_pMaintable->isDirty()) { + nResult = QMessageBox::information(this, QString(TITRAQ_APPTITLE) + + ' ' + asgui_version.v_short, trUtf8(TITRAQ_SAVEFIRST), + trUtf8("&Save"), trUtf8("&Discard"), trUtf8("Cancel"), 0, 2); + + switch (nResult) { // Maybe save before closing + case 0: // Save first + this->saveFile(); // Save changes first + break; + case 1: // Don't save first + m_pMaintable->setDirty(false); + break; + case 2: // Do nothing + default: + return; // Go away without closing + break; + } + } + + // We should be clean now, but double check just in case + if (!m_pMaintable->isDirty()) + qApp->quit(); +} + +// // Close current document, displaying in main window // void Titraqform::closeEvent(QCloseEvent *pClosit)