OSSP CVS Repository

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

Check-in Number: 2865
Date: 2002-Nov-21 16:37:08 (local)
2002-Nov-21 15:37:08 (UTC)
User:ms
Branch:
Comment: Consistency fix, and repair slots for opening and saving to local files.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/TODO      1.7 -> 1.8     1 inserted, 0 deleted
ossp-pkg/as/as-gui/as_assist.cpp      1.7 -> 1.8     2 inserted, 2 deleted
ossp-pkg/as/as-gui/as_gui.h      1.15 -> 1.16     3 inserted, 3 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.5 -> 1.6     10 inserted, 12 deleted
ossp-pkg/titraq/TODO      1.7 -> 1.8     1 inserted, 0 deleted
ossp-pkg/titraq/titassist.cpp      1.7 -> 1.8     2 inserted, 2 deleted
ossp-pkg/titraq/titraq.h      1.15 -> 1.16     3 inserted, 3 deleted
ossp-pkg/titraq/titslot.cpp      1.5 -> 1.6     10 inserted, 12 deleted

ossp-pkg/as/as-gui/TODO 1.7 -> 1.8

--- TODO 2002/11/19 19:42:14     1.7
+++ TODO 2002/11/21 15:37:08     1.8
@@ -16,6 +16,7 @@
 QWhatsThis::add(m_pAddbutton, trUtf8("Para soltar la pepa"));
 configure soll ueberpruefen ob libqt[-mt] threads braucht,
   dann wenn so, soll den LIBS -pthread hardgecodet haben
+Report errors in all slot code by throwing exceptions
 
 Dreams
 ------


ossp-pkg/as/as-gui/as_assist.cpp 1.7 -> 1.8

--- as_assist.cpp        2002/11/20 19:37:27     1.7
+++ as_assist.cpp        2002/11/21 15:37:08     1.8
@@ -112,7 +112,7 @@
     m_pFileopenact = new QAction(trUtf8("Open File"), QPixmap(s_kpcFileopen_xpm), trUtf8("&Open..."), CTRL+Key_O, this, "Open");
     if (m_pFileopenact == NULL) // Sanity check
         throw Genexcept("Main window file open action creation failed.");
-    connect(m_pFileopenact, SIGNAL(activated()), this, SLOT(choose()));
+    connect(m_pFileopenact, SIGNAL(activated()), this, SLOT(chooseFile()));
     const char *kszFileopentext = trUtf8("<p><img source=\"fileopen\"> "
                                   "Click this button to open a <em>new file</em>."
                                   "You can also select the <b>Open</b> command "
@@ -123,7 +123,7 @@
     m_pFilesaveact = new QAction(trUtf8("Save File"), QPixmap(s_kpcFilesave_xpm), trUtf8("&Save"), CTRL+Key_S, this, "Save");
     if (m_pFilesaveact == NULL) // Sanity check
         throw Genexcept("Main window file save action creation failed.");
-    connect(m_pFilesaveact, SIGNAL(activated()), this, SLOT(save()));
+    connect(m_pFilesaveact, SIGNAL(activated()), this, SLOT(saveFile()));
     const char *kszFilesavetext = trUtf8("<p><img source=\"filesave\"> "
                                   "Click this button to <em>save</em> the file you "
                                   "are editing. You will be prompted for a file name.\n"


ossp-pkg/as/as-gui/as_gui.h 1.15 -> 1.16

--- as_gui.h     2002/11/20 11:06:32     1.15
+++ as_gui.h     2002/11/21 15:37:08     1.16
@@ -64,9 +64,9 @@
     void delEntry(void);                // Delete a task entry from the list
     void writeEntry(void);              // Write the task list to a filedescriptor
     void newDoc(void);                  // Make and display a new document window
-    void choose(void);                  // Choose a file using a handy file dialog
-    void load(const QString &);         // Load accounting data into main window
-    void save(void);                    // Serialize to the current file
+    void chooseFile(void);              // Choose a file using a handy file dialog
+    void loadData(const QString &);     // Load accounting data into main window
+    void saveFile(void);                // Serialize to the current file
     void saveAs(void);                  // Serialize to a selected file
     void helpContents(void);            // Use the help contents
     void aboutTitraq(void);             // Learn more about this program itself


ossp-pkg/as/as-gui/as_slot.cpp 1.5 -> 1.6

--- as_slot.cpp  2002/11/20 11:06:32     1.5
+++ as_slot.cpp  2002/11/21 15:37:08     1.6
@@ -28,7 +28,7 @@
 }
 
 //
-// Choose a file using a handy file dialog
+// Delete a row entry from the current data window
 //
 void Titraqform::delEntry(void)
 {
@@ -59,11 +59,11 @@
 //
 // Choose a file using a handy file dialog
 //
-void Titraqform::choose(void)
+void Titraqform::chooseFile(void)
 {
-    QString Filestring = QFileDialog::getOpenFileName(QString::null, QString::null, this);
+    QString Filestring = QFileDialog::getOpenFileName("/e/dev/as", QString::null, this, trUtf8("Chooser Dialog"), trUtf8("Choose a file to open"));
     if (!Filestring.isEmpty())
-        load(Filestring);
+        loadData(Filestring);
     else
         m_pStatbar->message(trUtf8("Loading aborted"), 4000);
 }
@@ -71,7 +71,7 @@
 //
 // Load accounting data into main window
 //
-void Titraqform::load(const QString &Filestring)
+void Titraqform::loadData(const QString &Filestring)
 {
     QFile Filetemp(Filestring);         // File to load
 
@@ -88,7 +88,7 @@
 //
 // Serialize current state to the current file
 //
-void Titraqform::save(void)
+void Titraqform::saveFile(void)
 {
     // First time saves are really just saveAs in disguise
     if (m_szFilename->isEmpty()) {
@@ -96,8 +96,7 @@
         return;
     }
 
-    // Try to read the status text, and write it to a file
-    QString Statustext = m_pRemark->text();
+    // Try to open a file for writing to
     QFile Filetemp(*m_szFilename);
     if (!Filetemp.open(IO_WriteOnly)) {
         m_pStatbar->message(QString(trUtf8("Could not write to %1")).arg(*m_szFilename), 4000);
@@ -106,7 +105,7 @@
 
     // Serialize file contents and write to text line
     QTextStream Filestream(&Filetemp);
-    Filestream << Statustext;
+    Filestream << m_pRemark->text();
     Filetemp.close();
 
     // Reset the text line, and give output to main window
@@ -125,8 +124,7 @@
     QString Filestring = QFileDialog::getSaveFileName(QString::null, QString::null, this);
     if (!Filestring.isEmpty()) {
         *m_szFilename = Filestring;
-        m_pRemark->setText(*m_szFilename);
-        save(); // Finish off by calling the save action
+        saveFile(); // Finish off by calling the save action
     }
     else {
         // User did not select a valid file and push okay button
@@ -150,7 +148,7 @@
         trUtf8("The document has been\nchanged since the last save.")),
         trUtf8("Save Now"), trUtf8("Cancel"), trUtf8("Leave Anyway"), 0, 1) {
     case 0:
-        save();
+        saveFile();
         pClosit->accept();
         break;
     case 1:





CVSTrac 2.0.1