OSSP CVS Repository

ossp - Check-in [3851]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3851
Date: 2002-Dec-10 01:00:57 (local)
2002-Dec-10 00:00:57 (UTC)
User:ms
Branch:
Comment: Changed key bindings and exit without save logic, removed error messages on new document generation.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/TODO      1.35 -> 1.36     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.52 -> 1.53     3 inserted, 3 deleted
ossp-pkg/as/as-gui/as_main.cpp      1.8 -> 1.9     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.43 -> 1.44     25 inserted, 12 deleted

ossp-pkg/as/as-gui/TODO 1.35 -> 1.36

--- 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
 ---------------


ossp-pkg/as/as-gui/as_assist.cpp 1.52 -> 1.53

--- 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()));


ossp-pkg/as/as-gui/as_main.cpp 1.8 -> 1.9

--- 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();
 }


ossp-pkg/as/as-gui/as_slot.cpp 1.43 -> 1.44

--- 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);
 }
 
 //

CVSTrac 2.0.1