author | hash <hash> | 2002-10-13 01:49:42 (UTC) |
---|---|---|
committer | hash <hash> | 2002-10-13 01:49:42 (UTC) |
commit | e99b83c709d04a892f2c63d389a5e5932035dcb6 (patch) (side-by-side diff) | |
tree | f1484cd7b8961717d209fe491582b30a364c4bc5 | |
parent | b977a4bc4a8ac2b8685c4fa13534f630dabbf956 (diff) | |
download | opie-e99b83c709d04a892f2c63d389a5e5932035dcb6.zip opie-e99b83c709d04a892f2c63d389a5e5932035dcb6.tar.gz opie-e99b83c709d04a892f2c63d389a5e5932035dcb6.tar.bz2 |
added the keyboard open/close button
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 37 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.h | 7 |
2 files changed, 44 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 88727e4..2a4d069 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -1,51 +1,59 @@ #include <qaction.h> #include <qmenubar.h> #include <qlabel.h> #include <qpopupmenu.h> #include <qtoolbar.h> +#include <qpe/resource.h> + #include "profileeditordialog.h" #include "configdialog.h" #include "default.h" #include "metafactory.h" #include "profile.h" #include "profilemanager.h" #include "mainwindow.h" #include "tabwidget.h" #include "transferdialog.h" +#include "function_keyboard.h" MainWindow::MainWindow() { m_factory = new MetaFactory(); Default def(m_factory); m_sessions.setAutoDelete( TRUE ); m_curSession = 0; m_manager = new ProfileManager( m_factory ); m_manager->load(); initUI(); populateProfiles(); } 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_sessionsPop= new QPopupMenu( this ); m_settings = new QPopupMenu( this ); + /* add a toolbar for icons */ + m_icons = new QToolBar(this); + m_icons->setHorizontalStretchable( TRUE ); + /* * new Action for new sessions */ QAction* a = new QAction(); a->setText( tr("New Connection") ); a->addTo( m_console ); connect(a, SIGNAL(activated() ), this, SLOT(slotNew() ) ); /* * connect action */ @@ -85,34 +93,56 @@ void MainWindow::initUI() { connect(a, SIGNAL(activated() ), this, SLOT(slotClose() ) ); /* * the settings action */ m_setProfiles = new QAction(); m_setProfiles->setText( tr("Configure Profiles") ); m_setProfiles->addTo( m_settings ); connect( m_setProfiles, SIGNAL(activated() ), this, SLOT(slotConfigure() ) ); + /* + * action that open/closes the keyboard + */ + m_openKeys = new QAction ("Keyboard...", + Resource::loadPixmap( "down" ), + QString::null, 0, this, 0); + + m_openKeys->setToggleAction(true); + + connect (m_openKeys, SIGNAL(toggled(bool)), + this, SLOT(slotOpenKeb(bool))); + m_openKeys->addTo(m_icons); + + /* insert the submenu */ m_console->insertItem(tr("New from Profile"), m_sessionsPop, -1, 0); /* insert the connection menu */ m_bar->insertItem( tr("Connection"), m_console ); /* the settings menu */ m_bar->insertItem( tr("Settings"), m_settings ); + /* and the keyboard */ + m_keyBar = new QToolBar(this); + addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); + m_keyBar->setHorizontalStretchable( TRUE ); + m_keyBar->hide(); + + m_kb = new FunctionKeyboard(m_keyBar); + /* * connect to the menu activation */ connect( m_sessionsPop, SIGNAL(activated( int ) ), this, SLOT(slotProfile( int ) ) ); m_consoleWindow = new TabWidget( this, "blah"); setCentralWidget( m_consoleWindow ); } ProfileManager* MainWindow::manager() { @@ -224,12 +254,19 @@ void MainWindow::create( const Profile& prof ) { } void MainWindow::slotTransfer() { if ( currentSession() ) { TransferDialog dlg(this); dlg.showMaximized(); dlg.exec(); } } + +void MainWindow::slotOpenKeb(bool state) { + + if (state) m_keyBar->show(); + else m_keyBar->hide(); + +} diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h index c8b0b65..73bb285 100644 --- a/noncore/apps/opie-console/mainwindow.h +++ b/noncore/apps/opie-console/mainwindow.h @@ -3,30 +3,32 @@ #include <qmainwindow.h> #include <qlist.h> #include "session.h" /** * this is the MainWindow of the new opie console * it's also the dispatcher between the different * actions supported by the gui */ class QToolBar; +class QToolButton; class QMenuBar; class QAction; class MetaFactory; class TabWidget; class ProfileManager; class Profile; +class FunctionKeyboard; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(); ~MainWindow(); /** * our factory to generate IOLayer and so on * */ MetaFactory* factory(); @@ -47,49 +49,54 @@ public: ProfileManager* manager(); TabWidget* tabWidget(); private slots: void slotNew(); void slotConnect(); void slotDisconnect(); void slotTerminate(); void slotConfigure(); void slotClose(); void slotProfile(int); void slotTransfer(); + void slotOpenKeb(bool); private: void initUI(); void populateProfiles(); void create( const Profile& ); /** * the current session */ Session* m_curSession; /** * the session list */ QList<Session> m_sessions; /** * the metafactory */ MetaFactory* m_factory; ProfileManager* m_manager; TabWidget* m_consoleWindow; QToolBar* m_tool; + QToolBar* m_icons; + QToolBar* m_keyBar; QMenuBar* m_bar; QPopupMenu* m_console; QPopupMenu* m_settings; QPopupMenu* m_sessionsPop; QAction* m_connect; QAction* m_disconnect; QAction* m_terminate; QAction* m_transfer; QAction* m_setProfiles; + QAction* m_openKeys; + FunctionKeyboard *m_kb; }; #endif |