-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 9b615f1..21de5c0 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -14,35 +14,33 @@ | |||
14 | /* OPIE */ | 14 | /* OPIE */ |
15 | #include <opie2/ofiledialog.h> | 15 | #include <opie2/ofiledialog.h> |
16 | #include <qpe/filemanager.h> | 16 | #include <qpe/filemanager.h> |
17 | using namespace Opie::Ui; | 17 | using namespace Opie::Ui; |
18 | 18 | ||
19 | /* QT */ | 19 | /* QT */ |
20 | #include <qaction.h> | 20 | #include <qaction.h> |
21 | #include <qmenubar.h> | 21 | #include <qmenubar.h> |
22 | #include <qtoolbar.h> | 22 | #include <qtoolbar.h> |
23 | #include <qmessagebox.h> | 23 | #include <qmessagebox.h> |
24 | #include <qwhatsthis.h> | 24 | #include <qwhatsthis.h> |
25 | #include <qfileinfo.h> | 25 | #include <qfileinfo.h> |
26 | 26 | ||
27 | /* STD */ | 27 | /* STD */ |
28 | #include <assert.h> | 28 | #include <assert.h> |
29 | 29 | ||
30 | #ifdef EAST | ||
31 | #include <opie2/oconfig.h> | 30 | #include <opie2/oconfig.h> |
32 | #endif | ||
33 | 31 | ||
34 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 32 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
35 | 33 | ||
36 | #ifdef FSCKED_DISTRI | 34 | #ifdef FSCKED_DISTRI |
37 | FixIt fix; | 35 | FixIt fix; |
38 | fix.fixIt(); | 36 | fix.fixIt(); |
39 | #endif | 37 | #endif |
40 | 38 | ||
41 | setCaption(QObject::tr("Opie Console") ); | 39 | setCaption(QObject::tr("Opie Console") ); |
42 | KeyTrans::loadAll(); | 40 | KeyTrans::loadAll(); |
43 | for (int i = 0; i < KeyTrans::count(); i++ ) { | 41 | for (int i = 0; i < KeyTrans::count(); i++ ) { |
44 | KeyTrans* s = KeyTrans::find(i ); | 42 | KeyTrans* s = KeyTrans::find(i ); |
45 | assert( s ); | 43 | assert( s ); |
46 | } | 44 | } |
47 | m_factory = new MetaFactory(); | 45 | m_factory = new MetaFactory(); |
48 | Default def(m_factory); | 46 | Default def(m_factory); |
@@ -734,33 +732,36 @@ void MainWindow::slotSaveLog() { | |||
734 | if( currentSession()->emulationHandler()->isLogging() ) { | 732 | if( currentSession()->emulationHandler()->isLogging() ) { |
735 | DocLnk nf; | 733 | DocLnk nf; |
736 | QString m_logName = currentSession()->emulationHandler()->logFileName(); | 734 | QString m_logName = currentSession()->emulationHandler()->logFileName(); |
737 | QFileInfo info(m_logName); | 735 | QFileInfo info(m_logName); |
738 | nf.setType("text/plain"); | 736 | nf.setType("text/plain"); |
739 | nf.setFile(m_logName); | 737 | nf.setFile(m_logName); |
740 | nf.setName(info.fileName()); | 738 | nf.setName(info.fileName()); |
741 | nf.writeLink(); | 739 | nf.writeLink(); |
742 | m_recordLog->setText( tr("Start log") ); | 740 | m_recordLog->setText( tr("Start log") ); |
743 | m_recordingLog = false; | 741 | m_recordingLog = false; |
744 | currentSession()->emulationHandler()->clearLog(); | 742 | currentSession()->emulationHandler()->clearLog(); |
745 | } else { | 743 | } else { |
746 | QMap<QString, QStringList> map; | 744 | QMap<QString, QStringList> map; |
747 | QStringList text; | 745 | QStringList text; |
748 | text << "text/plain"; | 746 | text << "text/plain"; |
749 | map.insert(tr("Log"), text ); | 747 | map.insert(tr("Log"), text ); |
750 | QString m_logName = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); | 748 | Opie::Core::OConfig cfg("opie-console"); |
749 | cfg.setGroup("defaults"); | ||
750 | QString startDir = cfg.readEntry("defaultlogdir", QPEApplication::documentDir() ); | ||
751 | QString m_logName = OFileDialog::getSaveFileName(2, startDir, QString::null, map, 0, startDir); | ||
751 | if (m_logName.isEmpty() ) return; | 752 | if (m_logName.isEmpty() ) return; |
752 | 753 | ||
753 | m_recordLog->setText( tr("Stop log") ); | 754 | m_recordLog->setText( tr("Stop log") ); |
754 | m_recordingLog = true; | 755 | m_recordingLog = true; |
755 | currentSession()->emulationHandler()->startLogging(m_logName); | 756 | currentSession()->emulationHandler()->startLogging(m_logName); |
756 | } | 757 | } |
757 | } | 758 | } |
758 | 759 | ||
759 | void MainWindow::slotSaveHistory() { | 760 | void MainWindow::slotSaveHistory() { |
760 | QMap<QString, QStringList> map; | 761 | QMap<QString, QStringList> map; |
761 | QStringList text; | 762 | QStringList text; |
762 | text << "text/plain"; | 763 | text << "text/plain"; |
763 | map.insert(tr("History"), text ); | 764 | map.insert(tr("History"), text ); |
764 | QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); | 765 | QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); |
765 | if (filename.isEmpty() ) return; | 766 | if (filename.isEmpty() ) return; |
766 | 767 | ||