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 /noncore/apps/opie-console/mainwindow.cpp | |
parent | b977a4bc4a8ac2b8685c4fa13534f630dabbf956 (diff) | |
download | opie-e99b83c709d04a892f2c63d389a5e5932035dcb6.zip opie-e99b83c709d04a892f2c63d389a5e5932035dcb6.tar.gz opie-e99b83c709d04a892f2c63d389a5e5932035dcb6.tar.bz2 |
added the keyboard open/close button
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 37 |
1 files changed, 37 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 @@ -3,8 +3,10 @@ #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" @@ -13,8 +15,9 @@ #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); @@ -28,16 +31,21 @@ MainWindow::MainWindow() { } 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(); @@ -93,8 +101,22 @@ void MainWindow::initUI() { 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); @@ -103,8 +125,16 @@ void MainWindow::initUI() { /* 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 ) ), @@ -232,4 +262,11 @@ void MainWindow::slotTransfer() dlg.exec(); } } + +void MainWindow::slotOpenKeb(bool state) { + + if (state) m_keyBar->show(); + else m_keyBar->hide(); + +} |