Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index f0130e1..b813442 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -25,12 +25,13 @@ | |||
25 | #include "mainwindow.h" | 25 | #include "mainwindow.h" |
26 | #include "tabwidget.h" | 26 | #include "tabwidget.h" |
27 | #include "transferdialog.h" | 27 | #include "transferdialog.h" |
28 | #include "function_keyboard.h" | 28 | #include "function_keyboard.h" |
29 | #include "emulation_handler.h" | 29 | #include "emulation_handler.h" |
30 | #include "script.h" | 30 | #include "script.h" |
31 | #include "quick_button.h" | ||
31 | 32 | ||
32 | 33 | ||
33 | 34 | ||
34 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 35 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
35 | KeyTrans::loadAll(); | 36 | KeyTrans::loadAll(); |
36 | for (int i = 0; i < KeyTrans::count(); i++ ) { | 37 | for (int i = 0; i < KeyTrans::count(); i++ ) { |
@@ -169,12 +170,26 @@ void MainWindow::initUI() { | |||
169 | 170 | ||
170 | connect (m_openKeys, SIGNAL(toggled(bool)), | 171 | connect (m_openKeys, SIGNAL(toggled(bool)), |
171 | this, SLOT(slotOpenKeb(bool))); | 172 | this, SLOT(slotOpenKeb(bool))); |
172 | m_openKeys->addTo(m_icons); | 173 | m_openKeys->addTo(m_icons); |
173 | 174 | ||
174 | 175 | ||
176 | /* | ||
177 | * action that open/closes the keyboard | ||
178 | */ | ||
179 | m_openButtons = new QAction ( tr( "Open Buttons..." ), | ||
180 | Resource::loadPixmap( "down" ), | ||
181 | QString::null, 0, this, 0 ); | ||
182 | |||
183 | m_openButtons->setToggleAction( true ); | ||
184 | |||
185 | connect ( m_openButtons, SIGNAL( toggled( bool ) ), | ||
186 | this, SLOT( slotOpenButtons( bool ) ) ); | ||
187 | m_openButtons->addTo( m_icons ); | ||
188 | |||
189 | |||
175 | /* insert the submenu */ | 190 | /* insert the submenu */ |
176 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, | 191 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, |
177 | -1, 0); | 192 | -1, 0); |
178 | 193 | ||
179 | /* insert the connection menu */ | 194 | /* insert the connection menu */ |
180 | m_bar->insertItem( tr("Connection"), m_console ); | 195 | m_bar->insertItem( tr("Connection"), m_console ); |
@@ -192,12 +207,20 @@ void MainWindow::initUI() { | |||
192 | m_keyBar->hide(); | 207 | m_keyBar->hide(); |
193 | 208 | ||
194 | m_kb = new FunctionKeyboard(m_keyBar); | 209 | m_kb = new FunctionKeyboard(m_keyBar); |
195 | connect(m_kb, SIGNAL(keyPressed(ushort, ushort, bool, bool, bool)), | 210 | connect(m_kb, SIGNAL(keyPressed(ushort, ushort, bool, bool, bool)), |
196 | this, SLOT(slotKeyReceived(ushort, ushort, bool, bool, bool))); | 211 | this, SLOT(slotKeyReceived(ushort, ushort, bool, bool, bool))); |
197 | 212 | ||
213 | m_buttonBar = new QToolBar( this ); | ||
214 | addToolBar( m_buttonBar, "Buttons", QMainWindow::Top, TRUE ); | ||
215 | m_buttonBar->setHorizontalStretchable( TRUE ); | ||
216 | m_buttonBar->hide(); | ||
217 | |||
218 | m_qb = new QuickButton( m_buttonBar ); | ||
219 | connect( m_qb, SIGNAL( keyPressed( ushort, ushort, bool, bool, bool) ), | ||
220 | this, SLOT( slotKeyReceived( ushort, ushort, bool, bool, bool) ) ); | ||
198 | 221 | ||
199 | 222 | ||
200 | m_connect->setEnabled( false ); | 223 | m_connect->setEnabled( false ); |
201 | m_disconnect->setEnabled( false ); | 224 | m_disconnect->setEnabled( false ); |
202 | m_terminate->setEnabled( false ); | 225 | m_terminate->setEnabled( false ); |
203 | m_transfer->setEnabled( false ); | 226 | m_transfer->setEnabled( false ); |
@@ -428,12 +451,25 @@ void MainWindow::slotTransfer() | |||
428 | void MainWindow::slotOpenKeb(bool state) { | 451 | void MainWindow::slotOpenKeb(bool state) { |
429 | 452 | ||
430 | if (state) m_keyBar->show(); | 453 | if (state) m_keyBar->show(); |
431 | else m_keyBar->hide(); | 454 | else m_keyBar->hide(); |
432 | 455 | ||
433 | } | 456 | } |
457 | |||
458 | |||
459 | void MainWindow::slotOpenButtons( bool state ) { | ||
460 | |||
461 | if ( state ) { | ||
462 | m_buttonBar->show(); | ||
463 | } else { | ||
464 | m_buttonBar->hide(); | ||
465 | } | ||
466 | } | ||
467 | |||
468 | |||
469 | |||
434 | void MainWindow::slotSessionChanged( Session* ses ) { | 470 | void MainWindow::slotSessionChanged( Session* ses ) { |
435 | qWarning("changed!"); | 471 | qWarning("changed!"); |
436 | if ( ses ) { | 472 | if ( ses ) { |
437 | m_curSession = ses; | 473 | m_curSession = ses; |
438 | qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); | 474 | qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); |
439 | if ( m_curSession->layer()->isConnected() ) { | 475 | if ( m_curSession->layer()->isConnected() ) { |