author | hash <hash> | 2002-10-13 01:49:42 (UTC) |
---|---|---|
committer | hash <hash> | 2002-10-13 01:49:42 (UTC) |
commit | e99b83c709d04a892f2c63d389a5e5932035dcb6 (patch) (unidiff) | |
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 | |||
@@ -3,8 +3,10 @@ | |||
3 | #include <qmenubar.h> | 3 | #include <qmenubar.h> |
4 | #include <qlabel.h> | 4 | #include <qlabel.h> |
5 | #include <qpopupmenu.h> | 5 | #include <qpopupmenu.h> |
6 | #include <qtoolbar.h> | 6 | #include <qtoolbar.h> |
7 | #include <qpe/resource.h> | ||
8 | |||
7 | 9 | ||
8 | #include "profileeditordialog.h" | 10 | #include "profileeditordialog.h" |
9 | #include "configdialog.h" | 11 | #include "configdialog.h" |
10 | #include "default.h" | 12 | #include "default.h" |
@@ -13,8 +15,9 @@ | |||
13 | #include "profilemanager.h" | 15 | #include "profilemanager.h" |
14 | #include "mainwindow.h" | 16 | #include "mainwindow.h" |
15 | #include "tabwidget.h" | 17 | #include "tabwidget.h" |
16 | #include "transferdialog.h" | 18 | #include "transferdialog.h" |
19 | #include "function_keyboard.h" | ||
17 | 20 | ||
18 | MainWindow::MainWindow() { | 21 | MainWindow::MainWindow() { |
19 | m_factory = new MetaFactory(); | 22 | m_factory = new MetaFactory(); |
20 | Default def(m_factory); | 23 | Default def(m_factory); |
@@ -28,16 +31,21 @@ MainWindow::MainWindow() { | |||
28 | } | 31 | } |
29 | void MainWindow::initUI() { | 32 | void MainWindow::initUI() { |
30 | setToolBarsMovable( FALSE ); | 33 | setToolBarsMovable( FALSE ); |
31 | 34 | ||
35 | /* tool bar for the menu */ | ||
32 | m_tool = new QToolBar( this ); | 36 | m_tool = new QToolBar( this ); |
33 | m_tool->setHorizontalStretchable( TRUE ); | 37 | m_tool->setHorizontalStretchable( TRUE ); |
34 | 38 | ||
35 | m_bar = new QMenuBar( m_tool ); | 39 | m_bar = new QMenuBar( m_tool ); |
36 | m_console = new QPopupMenu( this ); | 40 | m_console = new QPopupMenu( this ); |
37 | m_sessionsPop= new QPopupMenu( this ); | 41 | m_sessionsPop= new QPopupMenu( this ); |
38 | m_settings = new QPopupMenu( this ); | 42 | m_settings = new QPopupMenu( this ); |
39 | 43 | ||
44 | /* add a toolbar for icons */ | ||
45 | m_icons = new QToolBar(this); | ||
46 | m_icons->setHorizontalStretchable( TRUE ); | ||
47 | |||
40 | /* | 48 | /* |
41 | * new Action for new sessions | 49 | * new Action for new sessions |
42 | */ | 50 | */ |
43 | QAction* a = new QAction(); | 51 | QAction* a = new QAction(); |
@@ -93,8 +101,22 @@ void MainWindow::initUI() { | |||
93 | m_setProfiles->addTo( m_settings ); | 101 | m_setProfiles->addTo( m_settings ); |
94 | connect( m_setProfiles, SIGNAL(activated() ), | 102 | connect( m_setProfiles, SIGNAL(activated() ), |
95 | this, SLOT(slotConfigure() ) ); | 103 | this, SLOT(slotConfigure() ) ); |
96 | 104 | ||
105 | /* | ||
106 | * action that open/closes the keyboard | ||
107 | */ | ||
108 | m_openKeys = new QAction ("Keyboard...", | ||
109 | Resource::loadPixmap( "down" ), | ||
110 | QString::null, 0, this, 0); | ||
111 | |||
112 | m_openKeys->setToggleAction(true); | ||
113 | |||
114 | connect (m_openKeys, SIGNAL(toggled(bool)), | ||
115 | this, SLOT(slotOpenKeb(bool))); | ||
116 | m_openKeys->addTo(m_icons); | ||
117 | |||
118 | |||
97 | /* insert the submenu */ | 119 | /* insert the submenu */ |
98 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, | 120 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, |
99 | -1, 0); | 121 | -1, 0); |
100 | 122 | ||
@@ -103,8 +125,16 @@ void MainWindow::initUI() { | |||
103 | 125 | ||
104 | /* the settings menu */ | 126 | /* the settings menu */ |
105 | m_bar->insertItem( tr("Settings"), m_settings ); | 127 | m_bar->insertItem( tr("Settings"), m_settings ); |
106 | 128 | ||
129 | /* and the keyboard */ | ||
130 | m_keyBar = new QToolBar(this); | ||
131 | addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); | ||
132 | m_keyBar->setHorizontalStretchable( TRUE ); | ||
133 | m_keyBar->hide(); | ||
134 | |||
135 | m_kb = new FunctionKeyboard(m_keyBar); | ||
136 | |||
107 | /* | 137 | /* |
108 | * connect to the menu activation | 138 | * connect to the menu activation |
109 | */ | 139 | */ |
110 | connect( m_sessionsPop, SIGNAL(activated( int ) ), | 140 | connect( m_sessionsPop, SIGNAL(activated( int ) ), |
@@ -232,4 +262,11 @@ void MainWindow::slotTransfer() | |||
232 | dlg.exec(); | 262 | dlg.exec(); |
233 | } | 263 | } |
234 | } | 264 | } |
235 | 265 | ||
266 | |||
267 | void MainWindow::slotOpenKeb(bool state) { | ||
268 | |||
269 | if (state) m_keyBar->show(); | ||
270 | else m_keyBar->hide(); | ||
271 | |||
272 | } | ||
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 | |||
@@ -11,14 +11,16 @@ | |||
11 | * it's also the dispatcher between the different | 11 | * it's also the dispatcher between the different |
12 | * actions supported by the gui | 12 | * actions supported by the gui |
13 | */ | 13 | */ |
14 | class QToolBar; | 14 | class QToolBar; |
15 | class QToolButton; | ||
15 | class QMenuBar; | 16 | class QMenuBar; |
16 | class QAction; | 17 | class QAction; |
17 | class MetaFactory; | 18 | class MetaFactory; |
18 | class TabWidget; | 19 | class TabWidget; |
19 | class ProfileManager; | 20 | class ProfileManager; |
20 | class Profile; | 21 | class Profile; |
22 | class FunctionKeyboard; | ||
21 | class MainWindow : public QMainWindow { | 23 | class MainWindow : public QMainWindow { |
22 | Q_OBJECT | 24 | Q_OBJECT |
23 | public: | 25 | public: |
24 | MainWindow(); | 26 | MainWindow(); |
@@ -55,8 +57,9 @@ private slots: | |||
55 | void slotConfigure(); | 57 | void slotConfigure(); |
56 | void slotClose(); | 58 | void slotClose(); |
57 | void slotProfile(int); | 59 | void slotProfile(int); |
58 | void slotTransfer(); | 60 | void slotTransfer(); |
61 | void slotOpenKeb(bool); | ||
59 | 62 | ||
60 | private: | 63 | private: |
61 | void initUI(); | 64 | void initUI(); |
62 | void populateProfiles(); | 65 | void populateProfiles(); |
@@ -78,8 +81,10 @@ private: | |||
78 | ProfileManager* m_manager; | 81 | ProfileManager* m_manager; |
79 | 82 | ||
80 | TabWidget* m_consoleWindow; | 83 | TabWidget* m_consoleWindow; |
81 | QToolBar* m_tool; | 84 | QToolBar* m_tool; |
85 | QToolBar* m_icons; | ||
86 | QToolBar* m_keyBar; | ||
82 | QMenuBar* m_bar; | 87 | QMenuBar* m_bar; |
83 | QPopupMenu* m_console; | 88 | QPopupMenu* m_console; |
84 | QPopupMenu* m_settings; | 89 | QPopupMenu* m_settings; |
85 | QPopupMenu* m_sessionsPop; | 90 | QPopupMenu* m_sessionsPop; |
@@ -87,9 +92,11 @@ private: | |||
87 | QAction* m_disconnect; | 92 | QAction* m_disconnect; |
88 | QAction* m_terminate; | 93 | QAction* m_terminate; |
89 | QAction* m_transfer; | 94 | QAction* m_transfer; |
90 | QAction* m_setProfiles; | 95 | QAction* m_setProfiles; |
96 | QAction* m_openKeys; | ||
91 | 97 | ||
98 | FunctionKeyboard *m_kb; | ||
92 | }; | 99 | }; |
93 | 100 | ||
94 | 101 | ||
95 | #endif | 102 | #endif |