Index: ossp-pkg/as/as-gui/TODO RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v rcsdiff -q -kk '-r1.35' '-r1.36' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v' 2>/dev/null --- TODO 2002/12/06 15:40:50 1.35 +++ TODO 2002/12/10 00:00:57 1.36 @@ -36,6 +36,7 @@ Krass date block data shading keyed to sort function Does resetting data clean make sense after closeEvent? Change default config location to homedir, with --confgen option +Quitting is the same as closing the (only) window Beim Editmodus --------------- 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.52' '-r1.53' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_assist.cpp,v' 2>/dev/null --- as_assist.cpp 2002/12/09 16:44:37 1.52 +++ as_assist.cpp 2002/12/10 00:00:57 1.53 @@ -213,7 +213,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()), qApp, SLOT(quit())); + connect(m_pFilequitact, SIGNAL(activated()), this, SLOT(close())); // Cut action m_pCutact = new QAction(trUtf8("Cut"), QPixmap(s_kpcCut_xpm), trUtf8("&Cut"), CTRL+Key_X, this, "Cut"); @@ -249,7 +249,7 @@ m_pPasteact->setWhatsThis(kszPastetext); // Add data row action - m_pAddrowact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcRowadd_xpm), trUtf8("&Add row"), CTRL+Key_A, this, "Addrow"); + m_pAddrowact = new QAction(trUtf8("Add Row"), QPixmap(s_kpcRowadd_xpm), trUtf8("&Add row"), Key_Insert, this, "Addrow"); if (m_pAddrowact == NULL) // Sanity check throw Genexcept("Main window add row action creation failed."); connect(m_pAddrowact, SIGNAL(activated()), this, SLOT(addEntry())); @@ -260,7 +260,7 @@ m_pAddrowact->setWhatsThis(kszAddrowtext); // Delete data row action - m_pDelrowact = new QAction(trUtf8("Delete Row"), QPixmap(s_kpcRowdel_xpm), trUtf8("&Delete row"), CTRL+Key_D, this, "Delrow"); + m_pDelrowact = new QAction(trUtf8("Delete Row"), QPixmap(s_kpcRowdel_xpm), trUtf8("&Delete row"), Key_Delete, this, "Delrow"); if (m_pDelrowact == NULL) // Sanity check throw Genexcept("Main window delete row action creation failed."); connect(m_pDelrowact, SIGNAL(activated()), this, SLOT(delEntry())); Index: ossp-pkg/as/as-gui/as_main.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_main.cpp,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_main.cpp,v' 2>/dev/null --- as_main.cpp 2002/12/02 13:25:36 1.8 +++ as_main.cpp 2002/12/10 00:00:57 1.9 @@ -39,5 +39,6 @@ Titraqform Mainform; // Main app window App.setMainWidget(&Mainform); Mainform.show(); // Finally start the show + App.connect(&App, SIGNAL(lastWindowClosed()), &App, SLOT(quit())); return App.exec(); } 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.43' '-r1.44' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_slot.cpp,v' 2>/dev/null --- 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); } //