Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 54 |
1 files changed, 49 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 1a5a59f..a0622d4 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -32,2 +32,3 @@ using namespace Opie::Ui; MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { + #ifdef FSCKED_DISTRI @@ -124,3 +125,3 @@ void MainWindow::initUI() { - +#ifndef EAST m_quickLaunch = new QAction( tr("QuickLaunch"), Resource::loadPixmap("console/konsole_mini"), QString::null, 0, this, 0 ); @@ -129,2 +130,3 @@ void MainWindow::initUI() { this, SLOT( slotQuickLaunch() ) ); +#endif @@ -162,2 +164,9 @@ void MainWindow::initUI() { + m_recordLog = new QAction(); + m_recordLog->setText( tr("Start log") ); + m_recordLog->addTo( m_console ); + connect(m_recordLog, SIGNAL(activated() ), + this, SLOT( slotSaveLog() ) ); + m_recordingLog = false; + QAction *a = new QAction(); @@ -424,6 +433,4 @@ void MainWindow::slotTerminate() { - - - void MainWindow::slotQuickLaunch() { + Profile prof = manager()->profile( "default" ); @@ -432,2 +439,3 @@ void MainWindow::slotQuickLaunch() { } else { + #ifndef EAST Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 ); @@ -436,4 +444,4 @@ void MainWindow::slotQuickLaunch() { slotSaveSession(); + #endif } - } @@ -610,2 +618,8 @@ void MainWindow::slotSessionChanged( Session* ses ) { + if ( ( currentSession()->emulationHandler()->isLogging() ) ) { + m_recordLog->setText( tr("Stop log") ); + } else { + m_recordLog->setText( tr("Start log") ); + } + if ( ( m_curSession->layer() )->supports()[1] == 0 ) { @@ -709,2 +723,32 @@ void MainWindow::slotSaveSession() { } + + + +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); + if (m_logName.isEmpty() ) return; + + m_recordLog->setText( tr("Stop log") ); + m_recordingLog = true; + currentSession()->emulationHandler()->startLogging(m_logName); + } +} + void MainWindow::slotSaveHistory() { |