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