Check-in Number:
|
2866 | |
Date: |
2002-Nov-22 12:46:32 (local)
2002-Nov-22 11:46:32 (UTC) |
User: | ms |
Branch: | |
Comment: |
Start using real AS data, correct load logic, and move data operations
to tidatops. |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/as/as-gui/Makefile.in 1.13 -> 1.14
--- Makefile.in 2002/11/20 22:04:24 1.13
+++ Makefile.in 2002/11/22 11:46:32 1.14
@@ -65,9 +65,9 @@
TARGET_PROGS = titraq
TARGET_MANS = titraq.1 titraq.conf.5
-SRCS = main.cpp titraq.cpp titassist.cpp titslot.cpp titrex.cpp generic.cpp titraq_version.c
+SRCS = main.cpp titraq.cpp titassist.cpp titslot.cpp tidatops.cpp titrex.cpp generic.cpp titraq_version.c
-OBJS = main.o titraq.o titassist.o titslot.o titrex.o generic.o titraq_version.o
+OBJS = main.o titraq.o titassist.o titslot.o tidatops.o titrex.o generic.o titraq_version.o
GRAFX = gfx/ossplogo.xpm
|
|
ossp-pkg/as/as-gui/TODO 1.8 -> 1.9
--- TODO 2002/11/21 15:37:08 1.8
+++ TODO 2002/11/22 11:46:32 1.9
@@ -16,7 +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
+Report errors in all slot code and tidatops by throwing exceptions
Dreams
------
|
|
ossp-pkg/as/as-gui/as_dataop.cpp -> 1.1
*** /dev/null Sat Nov 23 01:25:52 2024
--- - Sat Nov 23 01:25:59 2024
***************
*** 0 ****
--- 1,31 ----
+ #include "titraq.h"
+
+
+ //
+ // Convenience method to load accounting data from a file
+ //
+ void Titraqform::loadData(QFile &Fileobj)
+ {
+ if (Fileobj.isOpen()) { // Check state of file
+ Fileobj.flush(); // Begin processing file cleanly
+ QTextStream Asentry(&Fileobj); // Convert data to stream
+ loadData(Asentry); // Pass off to do the real work
+ }
+ else {
+ if (!Fileobj.open(IO_ReadOnly)) // Need a wrapped exception here,
+ return; // instead of a short circuit
+ QTextStream Asentry(&Fileobj); // Convert data to stream
+ loadData(Asentry); // Pass off to do the real work
+ Fileobj.close(); // Finish fileop by closing
+ }
+ }
+
+ //
+ // Load accounting data from a stream
+ //
+ void Titraqform::loadData(QTextStream &Tstream)
+ {
+ m_pRemark->setText(Tstream.readLine()); // Read from stream
+ m_pRemark->setEdited(false); // Reset widget
+ }
+
|
|
ossp-pkg/as/as-gui/as_gui.h 1.16 -> 1.17
--- as_gui.h 2002/11/21 15:37:08 1.16
+++ as_gui.h 2002/11/22 11:46:32 1.17
@@ -14,6 +14,7 @@
#include <qspinbox.h>
#include <qlineedit.h>
#include <qlayout.h>
+#include <qfile.h>
// Intentional no operation
#define TITRAQ_NOP ((void)0)
@@ -65,7 +66,6 @@
void writeEntry(void); // Write the task list to a filedescriptor
void newDoc(void); // Make and display a new document window
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
@@ -118,6 +118,10 @@
void setupEditlay(void); // Editing lay
void setupButtons(void); // Push button widgets
void setupPieces(void); // Assemble widget pieces
+
+ // Data processing
+ void loadData(QFile &); // Load accounting data from file
+ void loadData(QTextStream &); // Load accounting data from stream
};
#endif // TITRAQMWIN_H
|
|
ossp-pkg/as/as-gui/as_slot.cpp 1.6 -> 1.7
--- as_slot.cpp 2002/11/21 15:37:08 1.6
+++ as_slot.cpp 2002/11/22 11:46:32 1.7
@@ -1,5 +1,4 @@
// Qt headers
-#include <qfile.h>
#include <qfiledialog.h>
// User interface
@@ -61,31 +60,18 @@
//
void Titraqform::chooseFile(void)
{
- QString Filestring = QFileDialog::getOpenFileName("/e/dev/as", QString::null, this, trUtf8("Chooser Dialog"), trUtf8("Choose a file to open"));
- if (!Filestring.isEmpty())
- loadData(Filestring);
+ QString Filestring = QFileDialog::getOpenFileName("/export/home/mschloh/tmp/bifftest/ms.txt", QString::null, this, trUtf8("Chooser Dialog"), trUtf8("Choose a file to open"));
+ if (!Filestring.isEmpty()) {
+ QFile Filetemp(Filestring); // File to load
+ loadData(Filetemp); // Pass to helper method
+ setCaption(Filestring);
+ m_pStatbar->message(trUtf8("Loaded document ") + Filestring, 4000);
+ }
else
m_pStatbar->message(trUtf8("Loading aborted"), 4000);
}
//
-// Load accounting data into main window
-//
-void Titraqform::loadData(const QString &Filestring)
-{
- QFile Filetemp(Filestring); // File to load
-
- if (!Filetemp.open(IO_ReadOnly)) // Need a wrapped exception here
- return;
-
- QTextStream Textstream(&Filetemp); // Convert the file contents to a stream
- m_pRemark->setText(Textstream.read());
- m_pRemark->setEdited(false);
- setCaption(Filestring);
- m_pStatbar->message(trUtf8("Loaded document ") + Filestring, 4000);
-}
-
-//
// Serialize current state to the current file
//
void Titraqform::saveFile(void)
|
|