summaryrefslogtreecommitdiff
authorhash <hash>2002-10-15 16:25:43 (UTC)
committer hash <hash>2002-10-15 16:25:43 (UTC)
commitd0cd09e4a68ca8dc3acf50c13a0acce39cd36b55 (patch) (unidiff)
tree7562d562c6463a9f28587af3c1138e1f780dfb3d
parent09ba4d2c79a41b185902519639032a49c85deadb (diff)
downloadopie-d0cd09e4a68ca8dc3acf50c13a0acce39cd36b55.zip
opie-d0cd09e4a68ca8dc3acf50c13a0acce39cd36b55.tar.gz
opie-d0cd09e4a68ca8dc3acf50c13a0acce39cd36b55.tar.bz2
added a keyReceive slot so sending key events to the TE widget _might_ be possible (havent figure that out yet...)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp16
-rw-r--r--noncore/apps/opie-console/mainwindow.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 29dbcf3..d3b6c8a 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -192,32 +192,34 @@ void MainWindow::initUI() {
192 /* insert the connection menu */ 192 /* insert the connection menu */
193 m_bar->insertItem( tr("Connection"), m_console ); 193 m_bar->insertItem( tr("Connection"), m_console );
194 194
195 /* the scripts menu */ 195 /* the scripts menu */
196 m_bar->insertItem( tr("Scripts"), m_scripts ); 196 m_bar->insertItem( tr("Scripts"), m_scripts );
197 197
198 /* the settings menu */ 198 /* the settings menu */
199 m_bar->insertItem( tr("Settings"), m_settings ); 199 m_bar->insertItem( tr("Settings"), m_settings );
200 200
201 /* and the keyboard */ 201 /* and the keyboard */
202 m_keyBar = new QToolBar(this); 202 m_keyBar = new QToolBar(this);
203 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); 203 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
204 m_keyBar->setHorizontalStretchable( TRUE ); 204 m_keyBar->setHorizontalStretchable( TRUE );
205 m_keyBar->hide(); 205 m_keyBar->hide();
206 206
207 m_kb = new FunctionKeyboard(m_keyBar); 207 m_kb = new FunctionKeyboard(m_keyBar);
208 connect(m_kb, SIGNAL(keyPressed(ushort, ushort, bool, bool, bool)),
209 this, SLOT(slotKeyReceived(ushort, ushort, bool, bool, bool)));
208 210
209 211
210 212
211 m_connect->setEnabled( false ); 213 m_connect->setEnabled( false );
212 m_disconnect->setEnabled( false ); 214 m_disconnect->setEnabled( false );
213 m_terminate->setEnabled( false ); 215 m_terminate->setEnabled( false );
214 m_transfer->setEnabled( false ); 216 m_transfer->setEnabled( false );
215 m_recordScript->setEnabled( false ); 217 m_recordScript->setEnabled( false );
216 m_saveScript->setEnabled( false ); 218 m_saveScript->setEnabled( false );
217 m_runScript->setEnabled( false ); 219 m_runScript->setEnabled( false );
218 m_fullscreen->setEnabled( false ); 220 m_fullscreen->setEnabled( false );
219 m_closewindow->setEnabled( false ); 221 m_closewindow->setEnabled( false );
220 222
221 /* 223 /*
222 * connect to the menu activation 224 * connect to the menu activation
223 */ 225 */
@@ -463,16 +465,30 @@ void MainWindow::slotFullscreen() {
463 QPoint(0,0), false); 465 QPoint(0,0), false);
464 ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height()); 466 ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height());
465 ( m_curSession->widgetStack() )->setFocus(); 467 ( m_curSession->widgetStack() )->setFocus();
466 ( m_curSession->widgetStack() )->show(); 468 ( m_curSession->widgetStack() )->show();
467 469
468 //QPushButton *cornerButton = new QPushButton( ); 470 //QPushButton *cornerButton = new QPushButton( );
469 //cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); 471 //cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
470 //connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 472 //connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
471 // need teh scrollbar 473 // need teh scrollbar
472 // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton ); 474 // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton );
473 m_fullscreen->setText( tr("Stop full screen") ); 475 m_fullscreen->setText( tr("Stop full screen") );
474 } 476 }
475 477
476 m_isFullscreen = !m_isFullscreen; 478 m_isFullscreen = !m_isFullscreen;
477 479
478} 480}
481
482
483void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) {
484
485 qWarning("received key event! relay to TE widget");
486
487 if ( m_curSession ) {
488 QKeyEvent ke(QEvent::KeyPress, q, u, 0);
489
490 ke.ignore();
491 // where should i send this event? doesnt work sending it here
492 QApplication::sendEvent((QObject *)m_curSession->widgetStack(), &ke);
493 }
494}
diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h
index e63078a..91ca147 100644
--- a/noncore/apps/opie-console/mainwindow.h
+++ b/noncore/apps/opie-console/mainwindow.h
@@ -51,32 +51,34 @@ public:
51 51
52private slots: 52private slots:
53 void slotNew(); 53 void slotNew();
54 void slotConnect(); 54 void slotConnect();
55 void slotDisconnect(); 55 void slotDisconnect();
56 void slotTerminate(); 56 void slotTerminate();
57 void slotConfigure(); 57 void slotConfigure();
58 void slotClose(); 58 void slotClose();
59 void slotProfile(int); 59 void slotProfile(int);
60 void slotTransfer(); 60 void slotTransfer();
61 void slotOpenKeb(bool); 61 void slotOpenKeb(bool);
62 void slotRecordScript(); 62 void slotRecordScript();
63 void slotSaveScript(); 63 void slotSaveScript();
64 void slotRunScript(); 64 void slotRunScript();
65 void slotFullscreen(); 65 void slotFullscreen();
66 void slotSessionChanged( Session* ); 66 void slotSessionChanged( Session* );
67 void slotKeyReceived(ushort, ushort, bool, bool, bool);
68
67private: 69private:
68 void initUI(); 70 void initUI();
69 void populateProfiles(); 71 void populateProfiles();
70 void create( const Profile& ); 72 void create( const Profile& );
71 /** 73 /**
72 * the current session 74 * the current session
73 */ 75 */
74 Session* m_curSession; 76 Session* m_curSession;
75 77
76 /** 78 /**
77 * the session list 79 * the session list
78 */ 80 */
79 QList<Session> m_sessions; 81 QList<Session> m_sessions;
80 82
81 /** 83 /**
82 * the metafactory 84 * the metafactory