author | harlekin <harlekin> | 2005-01-11 16:03:50 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2005-01-11 16:03:50 (UTC) |
commit | 1833a9079cd7801f333ac3885b447520e44f937f (patch) (side-by-side diff) | |
tree | 4ba1b030a3747b1f22d08a9f0ea55bfb59940761 | |
parent | 4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9 (diff) | |
download | opie-1833a9079cd7801f333ac3885b447520e44f937f.zip opie-1833a9079cd7801f333ac3885b447520e44f937f.tar.gz opie-1833a9079cd7801f333ac3885b447520e44f937f.tar.bz2 |
possibility to set a default path for the save log dialog and also set the initial path into the titelbar
-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 @@ /* OPIE */ #include <opie2/ofiledialog.h> #include <qpe/filemanager.h> using namespace Opie::Ui; /* QT */ #include <qaction.h> #include <qmenubar.h> #include <qtoolbar.h> #include <qmessagebox.h> #include <qwhatsthis.h> #include <qfileinfo.h> /* STD */ #include <assert.h> -#ifdef EAST #include <opie2/oconfig.h> -#endif MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { #ifdef FSCKED_DISTRI FixIt fix; fix.fixIt(); #endif setCaption(QObject::tr("Opie Console") ); KeyTrans::loadAll(); for (int i = 0; i < KeyTrans::count(); i++ ) { KeyTrans* s = KeyTrans::find(i ); assert( s ); } m_factory = new MetaFactory(); Default def(m_factory); @@ -734,33 +732,36 @@ void MainWindow::slotSaveLog() { if( currentSession()->emulationHandler()->isLogging() ) { DocLnk nf; QString m_logName = currentSession()->emulationHandler()->logFileName(); QFileInfo info(m_logName); nf.setType("text/plain"); nf.setFile(m_logName); nf.setName(info.fileName()); nf.writeLink(); m_recordLog->setText( tr("Start log") ); m_recordingLog = false; currentSession()->emulationHandler()->clearLog(); } else { QMap<QString, QStringList> map; QStringList text; text << "text/plain"; map.insert(tr("Log"), text ); - QString m_logName = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); + Opie::Core::OConfig cfg("opie-console"); + cfg.setGroup("defaults"); + QString startDir = cfg.readEntry("defaultlogdir", QPEApplication::documentDir() ); + QString m_logName = OFileDialog::getSaveFileName(2, startDir, QString::null, map, 0, startDir); if (m_logName.isEmpty() ) return; m_recordLog->setText( tr("Stop log") ); m_recordingLog = true; currentSession()->emulationHandler()->startLogging(m_logName); } } void MainWindow::slotSaveHistory() { QMap<QString, QStringList> map; QStringList text; text << "text/plain"; map.insert(tr("History"), text ); QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); if (filename.isEmpty() ) return; |