author | harlekin <harlekin> | 2004-10-08 20:03:40 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-10-08 20:03:40 (UTC) |
commit | 4e884ee63f16d1367ff7b854dbe5b50a6871c008 (patch) (unidiff) | |
tree | fb9d9d13e9329e6ee9048bfc0e857d3918f4ecca /noncore/apps/opie-console/mainwindow.cpp | |
parent | 51e49f0bd035545b983c799f7089de6b0ff2547e (diff) | |
download | opie-4e884ee63f16d1367ff7b854dbe5b50a6871c008.zip opie-4e884ee63f16d1367ff7b854dbe5b50a6871c008.tar.gz opie-4e884ee63f16d1367ff7b854dbe5b50a6871c008.tar.bz2 |
added a 10east define for some changed builds for them, also added a logging mode, also some changes to the "fix broken distros" part, snapshot
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 60 |
1 files changed, 52 insertions, 8 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 | |||
@@ -29,11 +29,12 @@ using namespace Opie::Ui; | |||
29 | /* STD */ | 29 | /* STD */ |
30 | #include <assert.h> | 30 | #include <assert.h> |
31 | 31 | ||
32 | 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) { |
33 | |||
33 | #ifdef FSCKED_DISTRI | 34 | #ifdef FSCKED_DISTRI |
34 | FixIt fix; | 35 | FixIt fix; |
35 | fix.fixIt(); | 36 | fix.fixIt(); |
36 | #endif | 37 | #endif |
37 | 38 | ||
38 | setCaption(QObject::tr("Opie Console") ); | 39 | setCaption(QObject::tr("Opie Console") ); |
39 | KeyTrans::loadAll(); | 40 | KeyTrans::loadAll(); |
@@ -121,13 +122,14 @@ void MainWindow::initUI() { | |||
121 | this, SLOT(slotDisconnect() ) ); | 122 | this, SLOT(slotDisconnect() ) ); |
122 | 123 | ||
123 | m_console->insertSeparator(); | 124 | m_console->insertSeparator(); |
124 | 125 | ||
125 | 126 | #ifndef EAST | |
126 | m_quickLaunch = new QAction( tr("QuickLaunch"), Resource::loadPixmap("console/konsole_mini"), QString::null, 0, this, 0 ); | 127 | m_quickLaunch = new QAction( tr("QuickLaunch"), Resource::loadPixmap("console/konsole_mini"), QString::null, 0, this, 0 ); |
127 | m_quickLaunch->addTo( m_icons ); | 128 | m_quickLaunch->addTo( m_icons ); |
128 | connect( m_quickLaunch, SIGNAL( activated() ), | 129 | connect( m_quickLaunch, SIGNAL( activated() ), |
129 | this, SLOT( slotQuickLaunch() ) ); | 130 | this, SLOT( slotQuickLaunch() ) ); |
131 | #endif | ||
130 | 132 | ||
131 | QWhatsThis::add( m_icons, tr( "The shell button launches the \"default\" profile. If there is none default values are taken" ) ); | 133 | QWhatsThis::add( m_icons, tr( "The shell button launches the \"default\" profile. If there is none default values are taken" ) ); |
132 | 134 | ||
133 | m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null, | 135 | m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null, |
@@ -159,8 +161,15 @@ void MainWindow::initUI() { | |||
159 | this, SLOT( slotFullscreen() ) ); | 161 | this, SLOT( slotFullscreen() ) ); |
160 | 162 | ||
161 | m_console->insertSeparator(); | 163 | m_console->insertSeparator(); |
162 | 164 | ||
165 | m_recordLog = new QAction(); | ||
166 | m_recordLog->setText( tr("Start log") ); | ||
167 | m_recordLog->addTo( m_console ); | ||
168 | connect(m_recordLog, SIGNAL(activated() ), | ||
169 | this, SLOT( slotSaveLog() ) ); | ||
170 | m_recordingLog = false; | ||
171 | |||
163 | QAction *a = new QAction(); | 172 | QAction *a = new QAction(); |
164 | a->setText( tr("Save history") ); | 173 | a->setText( tr("Save history") ); |
165 | a->addTo( m_console ); | 174 | a->addTo( m_console ); |
166 | connect(a, SIGNAL(activated() ), | 175 | connect(a, SIGNAL(activated() ), |
@@ -421,22 +430,21 @@ void MainWindow::slotTerminate() { | |||
421 | } | 430 | } |
422 | 431 | ||
423 | 432 | ||
424 | 433 | ||
425 | |||
426 | |||
427 | |||
428 | void MainWindow::slotQuickLaunch() { | 434 | void MainWindow::slotQuickLaunch() { |
429 | Profile prof = manager()->profile( "default" ); | 435 | |
436 | Profile prof = manager()->profile( "default" ); | ||
430 | if ( prof.name() == "default" ) { | 437 | if ( prof.name() == "default" ) { |
431 | create( prof ); | 438 | create( prof ); |
432 | } else { | 439 | } else { |
440 | #ifndef EAST | ||
433 | Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 ); | 441 | Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 ); |
434 | newProf.setAutoConnect( true ); | 442 | newProf.setAutoConnect( true ); |
435 | create( newProf ); | 443 | create( newProf ); |
436 | slotSaveSession(); | 444 | slotSaveSession(); |
445 | #endif | ||
437 | } | 446 | } |
438 | |||
439 | } | 447 | } |
440 | 448 | ||
441 | void MainWindow::slotConfigure() { | 449 | void MainWindow::slotConfigure() { |
442 | ConfigDialog conf( manager()->all(), factory() ); | 450 | ConfigDialog conf( manager()->all(), factory() ); |
@@ -607,8 +615,14 @@ void MainWindow::slotSessionChanged( Session* ses ) { | |||
607 | m_saveScript->setEnabled( false ); | 615 | m_saveScript->setEnabled( false ); |
608 | m_scripts->setItemEnabled(m_runScript_id, false); | 616 | m_scripts->setItemEnabled(m_runScript_id, false); |
609 | } | 617 | } |
610 | 618 | ||
619 | if ( ( currentSession()->emulationHandler()->isLogging() ) ) { | ||
620 | m_recordLog->setText( tr("Stop log") ); | ||
621 | } else { | ||
622 | m_recordLog->setText( tr("Start log") ); | ||
623 | } | ||
624 | |||
611 | if ( ( m_curSession->layer() )->supports()[1] == 0 ) { | 625 | if ( ( m_curSession->layer() )->supports()[1] == 0 ) { |
612 | m_transfer->setEnabled( false ); | 626 | m_transfer->setEnabled( false ); |
613 | } else { | 627 | } else { |
614 | m_transfer->setEnabled( true ); | 628 | m_transfer->setEnabled( true ); |
@@ -706,8 +720,38 @@ void MainWindow::slotSaveSession() { | |||
706 | manager()->add( currentSession()->profile() ); | 720 | manager()->add( currentSession()->profile() ); |
707 | manager()->save(); | 721 | manager()->save(); |
708 | populateProfiles(); | 722 | populateProfiles(); |
709 | } | 723 | } |
724 | |||
725 | |||
726 | |||
727 | void MainWindow::slotSaveLog() { | ||
728 | |||
729 | if( currentSession()->emulationHandler()->isLogging() ) { | ||
730 | DocLnk nf; | ||
731 | QString m_logName = currentSession()->emulationHandler()->logFileName(); | ||
732 | QFileInfo info(m_logName); | ||
733 | nf.setType("text/plain"); | ||
734 | nf.setFile(m_logName); | ||
735 | nf.setName(info.fileName()); | ||
736 | nf.writeLink(); | ||
737 | m_recordLog->setText( tr("Start log") ); | ||
738 | m_recordingLog = false; | ||
739 | currentSession()->emulationHandler()->clearLog(); | ||
740 | } else { | ||
741 | QMap<QString, QStringList> map; | ||
742 | QStringList text; | ||
743 | text << "text/plain"; | ||
744 | map.insert(tr("Log"), text ); | ||
745 | QString m_logName = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); | ||
746 | if (m_logName.isEmpty() ) return; | ||
747 | |||
748 | m_recordLog->setText( tr("Stop log") ); | ||
749 | m_recordingLog = true; | ||
750 | currentSession()->emulationHandler()->startLogging(m_logName); | ||
751 | } | ||
752 | } | ||
753 | |||
710 | void MainWindow::slotSaveHistory() { | 754 | void MainWindow::slotSaveHistory() { |
711 | QMap<QString, QStringList> map; | 755 | QMap<QString, QStringList> map; |
712 | QStringList text; | 756 | QStringList text; |
713 | text << "text/plain"; | 757 | text << "text/plain"; |