author | zecke <zecke> | 2002-11-07 18:31:52 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-11-07 18:31:52 (UTC) |
commit | b89e9179db00b777e41bdd0c95885fb76b3f1a88 (patch) (side-by-side diff) | |
tree | 6b0b6e33d5d084849ab8d7b17ba1c03b74d8a0c9 /noncore/apps/opie-console/mainwindow.cpp | |
parent | 8baa44cf756fc3767829983941fc64c9547b8cc0 (diff) | |
download | opie-b89e9179db00b777e41bdd0c95885fb76b3f1a88.zip opie-b89e9179db00b777e41bdd0c95885fb76b3f1a88.tar.gz opie-b89e9179db00b777e41bdd0c95885fb76b3f1a88.tar.bz2 |
Renove Emulationhandler from MetaFactory
common.h clashed with TECommon.h
Implement saving of history!
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index d221715..01468ca 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -9,6 +9,7 @@ #include <qpushbutton.h> #include <qwhatsthis.h> #include <qfileinfo.h> +#include <qtextstream.h> #include <qpe/resource.h> #include <qpe/qpeapplication.h> @@ -17,6 +18,7 @@ #include <opie/ofiledialog.h> +#include "TEmulation.h" #include "keytrans.h" #include "profileeditordialog.h" #include "configdialog.h" @@ -241,6 +243,12 @@ void MainWindow::initUI() { this, SLOT( slotFullscreen() ) ); m_console->insertSeparator(); + + QAction *a = new QAction(); + a->setText( tr("Save history") ); + a->addTo( m_console ); + connect(a, SIGNAL(activated() ), + this, SLOT(slotSaveHistory() ) ); /* * terminate action */ @@ -302,7 +310,7 @@ void MainWindow::initUI() { this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool))); - QAction *a = new QAction(tr("Copy"), + a = new QAction(tr("Copy"), Resource::loadPixmap("copy"), QString::null, 0, this, 0 ); //a->addTo( m_icons ); @@ -768,3 +776,28 @@ void MainWindow::slotSaveSession() { manager()->save(); populateProfiles(); } +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; + + QFileInfo info(filename); + + DocLnk nf; + nf.setType("text/plain"); + nf.setFile(filename); + nf.setName(info.fileName()); + + + QFile file(filename); + file.open(IO_WriteOnly ); + QTextStream str(&file ); + if ( currentSession() ) + currentSession()->emulationHandler()->emulation()->streamHistory(&str); + + file.close(); + nf.writeLink(); +} |