-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 21 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/terminalwidget.cpp | 26 | ||||
-rw-r--r-- | pics/console/konsole_mini.png | bin | 0 -> 783 bytes |
4 files changed, 36 insertions, 13 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index abcdb84..a6fc30b 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -39,32 +39,33 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow( for (int i = 0; i < KeyTrans::count(); i++ ) { KeyTrans* s = KeyTrans::find(i ); assert( s ); } m_factory = new MetaFactory(); Default def(m_factory); m_sessions.setAutoDelete( TRUE ); m_curSession = 0; m_manager = new ProfileManager( m_factory ); m_manager->load(); m_scriptsData.setAutoDelete(TRUE); initUI(); populateProfiles(); populateScripts(); } + void MainWindow::initUI() { setToolBarsMovable( FALSE ); /* tool bar for the menu */ m_tool = new QToolBar( this ); m_tool->setHorizontalStretchable( TRUE ); m_bar = new QMenuBar( m_tool ); m_console = new QPopupMenu( this ); m_scripts = new QPopupMenu( this ); m_sessionsPop= new QPopupMenu( this ); m_scriptsPop = new QPopupMenu( this ); /* add a toolbar for icons */ m_icons = new QToolBar(this); @@ -106,38 +107,45 @@ void MainWindow::initUI() { QString::null, 0, this, 0 ); m_connect->addTo( m_console ); connect(m_connect, SIGNAL(activated() ), this, SLOT(slotConnect() ) ); /* * disconnect action */ m_disconnect = new QAction( tr("Disconnect"), Resource::loadPixmap("console/notconnected"), QString::null, 0, this, 0 ); m_disconnect->addTo( m_console ); connect(m_disconnect, SIGNAL(activated() ), this, SLOT(slotDisconnect() ) ); m_console->insertSeparator(); + m_quickLaunch = new QAction( tr("QuickLaunch"), Resource::loadPixmap("console/konsole_mini"), QString::null, 0, this, 0 ); + m_quickLaunch->addTo( m_icons ); + connect( m_quickLaunch, SIGNAL( activated() ), + this, SLOT( slotQuickLaunch() ) ); + m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null, 0, this, 0 ); m_transfer->addTo( m_console ); connect(m_transfer, SIGNAL(activated() ), this, SLOT(slotTransfer() ) ); + + /* * immediate change of line wrap policy */ m_isWrapped = false; m_wrap = new QAction( tr("Line wrap"), Resource::loadPixmap( "linewrap" ), QString::null, 0, this, 0 ); m_wrap->addTo( m_console ); connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) ); /* * fullscreen */ m_isFullscreen = false; m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" ) , QString::null, 0, this, 0); m_fullscreen->addTo( m_console ); @@ -389,32 +397,42 @@ void MainWindow::slotDisconnect() { m_disconnect->setEnabled( false ); m_transfer->setEnabled( false ); m_recordScript->setEnabled( false); m_saveScript->setEnabled( false ); m_scripts->setItemEnabled(m_runScript_id, false); } } void MainWindow::slotTerminate() { if ( currentSession() ) currentSession()->layer()->close(); slotClose(); /* FIXME move to the next session */ } +void MainWindow::slotQuickLaunch() { + Profile prof = manager()->profile( "default" ); + if ( prof.name() == "default" ) { + create( prof ); + } else { + QMessageBox::warning(this, tr("Failure"),tr("please configure one profile named \"default\"")); + } + +} + void MainWindow::slotConfigure() { ConfigDialog conf( manager()->all(), factory() ); conf.showMaximized(); int ret = conf.exec(); if ( QDialog::Accepted == ret ) { manager()->setProfiles( conf.list() ); manager()->save(); populateProfiles(); } } /* * we will remove * this window from the tabwidget * remove it from the list @@ -446,32 +464,35 @@ void MainWindow::slotClose() { m_wrap->setEnabled( false ); m_closewindow->setEnabled( false ); } m_kb->loadDefaults(); } /* * We will get the name * Then the profile * and then we will make a profile */ void MainWindow::slotProfile( int id) { Profile prof = manager()->profile( m_sessionsPop->text( id) ); create( prof ); } + + + void MainWindow::create( const Profile& prof ) { if(m_curSession) if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); Session *ses = manager()->fromProfile( prof, tabWidget() ); if((!ses) || (!ses->layer()) || (!ses->widgetStack())) { QMessageBox::warning(this, QObject::tr("Session failed"), QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); //if(ses) delete ses; return; } m_sessions.append( ses ); diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h index 0fac38b..86939c1 100644 --- a/noncore/apps/opie-console/mainwindow.h +++ b/noncore/apps/opie-console/mainwindow.h @@ -54,32 +54,33 @@ public: private slots: void slotNew(); void slotConnect(); void slotDisconnect(); void slotTerminate(); void slotConfigure(); void slotClose(); void slotProfile(int); void slotTransfer(); void slotOpenKeb(bool); void slotOpenButtons(bool); void slotRecordScript(); void slotSaveScript(); void slotRunScript(int); void slotFullscreen(); + void slotQuickLaunch(); void slotWrap(); void slotSessionChanged( Session* ); void slotKeyReceived(FKey, ushort, ushort, bool); void slotSaveHistory(); /* what could these both slot do? */ void slotCopy(); void slotPaste(); /* save the currentSession() to Profiles */ void slotSaveSession(); private: void initUI(); void populateProfiles(); void populateScripts(); @@ -100,32 +101,33 @@ private: */ MetaFactory* m_factory; ProfileManager* m_manager; TabWidget* m_consoleWindow; QToolBar* m_tool; QToolBar* m_icons; QToolBar* m_keyBar; QToolBar* m_buttonBar; QMenuBar* m_bar; QPopupMenu* m_console; QPopupMenu* m_sessionsPop; QPopupMenu* m_scriptsPop; QPopupMenu* m_scripts; QAction* m_connect; QAction* m_disconnect; + QAction* m_quickLaunch; QAction* m_terminate; QAction* m_transfer; QAction* m_setProfiles; QAction* m_openKeys; QAction* m_openButtons; QAction* m_recordScript; QAction* m_saveScript; QAction* m_fullscreen; QAction* m_wrap; QAction* m_closewindow; FunctionKeyboard *m_kb; int m_runScript_id; bool m_isFullscreen; bool m_isWrapped; diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp index a8cee93..70f7c9b 100644 --- a/noncore/apps/opie-console/terminalwidget.cpp +++ b/noncore/apps/opie-console/terminalwidget.cpp @@ -35,54 +35,54 @@ namespace { }; TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, const char* na ) : ProfileDialogTerminalWidget( name, parent, na ) { m_terminal = new QLabel(tr("Terminal Type"), this ); m_terminalBox = new QComboBox(this); m_colorLabel = new QLabel(tr("Color scheme"), this); m_colorCmb = new QComboBox(this ); m_groupSize = new QHButtonGroup(tr("Font size"), this ); m_sizeSmall = new QRadioButton(tr("small"), m_groupSize ); m_sizeMedium = new QRadioButton(tr("medium"), m_groupSize ); m_sizeLarge = new QRadioButton(tr("large"), m_groupSize ); - m_groupConv = new QHGroupBox(tr("Line-break conversions"), this ); - m_convInbound = new QCheckBox(tr("Inbound"), m_groupConv ); - m_convOutbound = new QCheckBox(tr("Outbound"), m_groupConv ); + m_groupConv = new QHGroupBox( tr("Line-break conversions"), this ); + m_convInbound = new QCheckBox( tr("Inbound"), m_groupConv ); + m_convOutbound = new QCheckBox( tr("Outbound"), m_groupConv ); m_groupOptions = new QHGroupBox( tr("Options"), this ); - m_optionEcho = new QCheckBox(tr("Local echo"), m_groupOptions ); - m_optionWrap = new QCheckBox(tr("Line wrap"), m_groupOptions ); + m_optionEcho = new QCheckBox( tr("Local echo"), m_groupOptions ); + m_optionWrap = new QCheckBox( tr("Line wrap"), m_groupOptions ); - m_lroot = new QVBoxLayout( this ); + m_lroot = new QVBoxLayout( this ); m_typeBox = new QVBoxLayout( m_lroot ); m_colorBox = new QVBoxLayout( m_lroot ); // Layout - m_typeBox->add(m_terminal ); - m_typeBox->add(m_terminalBox ); - m_lroot->add(m_groupSize ); + m_typeBox->add( m_terminal ); + m_typeBox->add( m_terminalBox ); + m_lroot->add( m_groupSize ); - m_colorBox->add( m_colorLabel ); - m_colorBox->add( m_colorCmb ); + m_colorBox->add( m_colorLabel ); + m_colorBox->add( m_colorCmb ); - m_lroot->add(m_groupConv ); - m_lroot->add(m_groupOptions ); + m_lroot->add( m_groupConv ); + m_lroot->add( m_groupOptions ); m_lroot->addStretch( 0 ); // Fill in some options qWarning("Options for terminal box"); m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */); m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); m_colorCmb->insertItem( tr("black on white"), id_term_black ); m_colorCmb->insertItem( tr("white on black"), id_term_white ); m_colorCmb->insertItem( tr("green on black"), id_term_green ); m_colorCmb->insertItem( tr("orange on black"), id_term_orange ); // signals + slots diff --git a/pics/console/konsole_mini.png b/pics/console/konsole_mini.png Binary files differnew file mode 100644 index 0000000..590a417 --- a/dev/null +++ b/pics/console/konsole_mini.png |