-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 39 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.h | 3 |
2 files changed, 40 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index b143361..89cdf51 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -2,19 +2,21 @@ | |||
2 | 2 | ||
3 | 3 | ||
4 | 4 | ||
5 | #include <qaction.h> | 5 | #include <qaction.h> |
6 | #include <qmenubar.h> | 6 | #include <qmenubar.h> |
7 | #include <qlabel.h> | 7 | #include <qlabel.h> |
8 | #include <qpopupmenu.h> | 8 | #include <qpopupmenu.h> |
9 | #include <qtoolbar.h> | 9 | #include <qtoolbar.h> |
10 | #include <qmessagebox.h> | ||
11 | |||
10 | #include <qpe/resource.h> | 12 | #include <qpe/resource.h> |
11 | #include <opie/ofiledialog.h> | 13 | #include <opie/ofiledialog.h> |
12 | #include <qmessagebox.h> | 14 | |
13 | 15 | ||
14 | #include "keytrans.h" | 16 | #include "keytrans.h" |
15 | #include "profileeditordialog.h" | 17 | #include "profileeditordialog.h" |
16 | #include "configdialog.h" | 18 | #include "configdialog.h" |
17 | #include "default.h" | 19 | #include "default.h" |
18 | #include "metafactory.h" | 20 | #include "metafactory.h" |
19 | #include "profile.h" | 21 | #include "profile.h" |
20 | #include "profilemanager.h" | 22 | #include "profilemanager.h" |
@@ -162,16 +164,26 @@ void MainWindow::initUI() { | |||
162 | /* and the keyboard */ | 164 | /* and the keyboard */ |
163 | m_keyBar = new QToolBar(this); | 165 | m_keyBar = new QToolBar(this); |
164 | addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); | 166 | addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); |
165 | m_keyBar->setHorizontalStretchable( TRUE ); | 167 | m_keyBar->setHorizontalStretchable( TRUE ); |
166 | m_keyBar->hide(); | 168 | m_keyBar->hide(); |
167 | 169 | ||
168 | m_kb = new FunctionKeyboard(m_keyBar); | 170 | m_kb = new FunctionKeyboard(m_keyBar); |
169 | 171 | ||
172 | |||
173 | |||
174 | m_connect->setEnabled( false ); | ||
175 | m_disconnect->setEnabled( false ); | ||
176 | m_terminate->setEnabled( false ); | ||
177 | m_transfer->setEnabled( false ); | ||
178 | m_recordScript->setEnabled( false ); | ||
179 | m_saveScript->setEnabled( false ); | ||
180 | m_runScript->setEnabled( false ); | ||
181 | |||
170 | /* | 182 | /* |
171 | * connect to the menu activation | 183 | * connect to the menu activation |
172 | */ | 184 | */ |
173 | connect( m_sessionsPop, SIGNAL(activated( int ) ), | 185 | connect( m_sessionsPop, SIGNAL(activated( int ) ), |
174 | this, SLOT(slotProfile( int ) ) ); | 186 | this, SLOT(slotProfile( int ) ) ); |
175 | 187 | ||
176 | m_consoleWindow = new TabWidget( this, "blah"); | 188 | m_consoleWindow = new TabWidget( this, "blah"); |
177 | connect(m_consoleWindow, SIGNAL(activated(Session*) ), | 189 | connect(m_consoleWindow, SIGNAL(activated(Session*) ), |
@@ -335,16 +347,26 @@ void MainWindow::create( const Profile& prof ) { | |||
335 | //if(ses) delete ses; | 347 | //if(ses) delete ses; |
336 | return; | 348 | return; |
337 | } | 349 | } |
338 | 350 | ||
339 | m_sessions.append( ses ); | 351 | m_sessions.append( ses ); |
340 | tabWidget()->add( ses ); | 352 | tabWidget()->add( ses ); |
341 | m_curSession = ses; | 353 | m_curSession = ses; |
342 | 354 | ||
355 | // dicide if its a local term ( then no connction and no tranfer) | ||
356 | m_connect->setEnabled( true ); | ||
357 | m_disconnect->setEnabled( true ); | ||
358 | m_terminate->setEnabled( true ); | ||
359 | m_transfer->setEnabled( true ); | ||
360 | m_recordScript->setEnabled( true ); | ||
361 | m_saveScript->setEnabled( true ); | ||
362 | m_runScript->setEnabled( true ); | ||
363 | |||
364 | |||
343 | } | 365 | } |
344 | 366 | ||
345 | void MainWindow::slotTransfer() | 367 | void MainWindow::slotTransfer() |
346 | { | 368 | { |
347 | // if ( currentSession() ) { | 369 | // if ( currentSession() ) { |
348 | TransferDialog dlg(this); | 370 | TransferDialog dlg(this); |
349 | dlg.showMaximized(); | 371 | dlg.showMaximized(); |
350 | dlg.exec(); | 372 | dlg.exec(); |
@@ -359,8 +381,23 @@ void MainWindow::slotOpenKeb(bool state) { | |||
359 | 381 | ||
360 | } | 382 | } |
361 | void MainWindow::slotSessionChanged( Session* ses ) { | 383 | void MainWindow::slotSessionChanged( Session* ses ) { |
362 | if ( ses ) { | 384 | if ( ses ) { |
363 | qWarning("changing %s", ses->name().latin1() ); | 385 | qWarning("changing %s", ses->name().latin1() ); |
364 | m_curSession = ses; | 386 | m_curSession = ses; |
365 | } | 387 | } |
366 | } | 388 | } |
389 | |||
390 | void MainWindow::setOn() { | ||
391 | |||
392 | /* | ||
393 | m_connect | ||
394 | m_disconnect | ||
395 | m_terminate | ||
396 | m_transfer | ||
397 | m_recordScript | ||
398 | m_saveScript | ||
399 | m_runScript | ||
400 | */ | ||
401 | |||
402 | |||
403 | } | ||
diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h index d16d6af..378870a 100644 --- a/noncore/apps/opie-console/mainwindow.h +++ b/noncore/apps/opie-console/mainwindow.h | |||
@@ -57,16 +57,17 @@ private slots: | |||
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 setOn(); | ||
65 | void slotSessionChanged( Session* ); | 66 | void slotSessionChanged( Session* ); |
66 | private: | 67 | private: |
67 | void initUI(); | 68 | void initUI(); |
68 | void populateProfiles(); | 69 | void populateProfiles(); |
69 | void create( const Profile& ); | 70 | void create( const Profile& ); |
70 | /** | 71 | /** |
71 | * the current session | 72 | * the current session |
72 | */ | 73 | */ |
@@ -90,17 +91,17 @@ private: | |||
90 | QMenuBar* m_bar; | 91 | QMenuBar* m_bar; |
91 | QPopupMenu* m_console; | 92 | QPopupMenu* m_console; |
92 | QPopupMenu* m_settings; | 93 | QPopupMenu* m_settings; |
93 | QPopupMenu* m_sessionsPop; | 94 | QPopupMenu* m_sessionsPop; |
94 | QPopupMenu* m_scripts; | 95 | QPopupMenu* m_scripts; |
95 | QAction* m_connect; | 96 | QAction* m_connect; |
96 | QAction* m_disconnect; | 97 | QAction* m_disconnect; |
97 | QAction* m_terminate; | 98 | QAction* m_terminate; |
98 | QAction* m_transfer; | 99 | QAction* m_transfer; |
99 | QAction* m_setProfiles; | 100 | QAction* m_setProfiles; |
100 | QAction* m_openKeys; | 101 | QAction* m_openKeys; |
101 | QAction* m_recordScript; | 102 | QAction* m_recordScript; |
102 | QAction* m_saveScript; | 103 | QAction* m_saveScript; |
103 | QAction* m_runScript; | 104 | QAction* m_runScript; |
104 | 105 | ||
105 | FunctionKeyboard *m_kb; | 106 | FunctionKeyboard *m_kb; |
106 | }; | 107 | }; |