Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 02a3fa9..ddaaf1b 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -17,25 +17,24 @@ | |||
17 | #include "profileeditordialog.h" | 17 | #include "profileeditordialog.h" |
18 | #include "configdialog.h" | 18 | #include "configdialog.h" |
19 | #include "default.h" | 19 | #include "default.h" |
20 | #include "metafactory.h" | 20 | #include "metafactory.h" |
21 | #include "profile.h" | 21 | #include "profile.h" |
22 | #include "profilemanager.h" | 22 | #include "profilemanager.h" |
23 | #include "mainwindow.h" | 23 | #include "mainwindow.h" |
24 | #include "tabwidget.h" | 24 | #include "tabwidget.h" |
25 | #include "transferdialog.h" | 25 | #include "transferdialog.h" |
26 | #include "function_keyboard.h" | 26 | #include "function_keyboard.h" |
27 | #include "emulation_handler.h" | 27 | #include "emulation_handler.h" |
28 | #include "script.h" | 28 | #include "script.h" |
29 | #include "quick_button.h" | ||
30 | 29 | ||
31 | 30 | ||
32 | 31 | ||
33 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 32 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
34 | KeyTrans::loadAll(); | 33 | KeyTrans::loadAll(); |
35 | for (int i = 0; i < KeyTrans::count(); i++ ) { | 34 | for (int i = 0; i < KeyTrans::count(); i++ ) { |
36 | KeyTrans* s = KeyTrans::find(i ); | 35 | KeyTrans* s = KeyTrans::find(i ); |
37 | assert( s ); | 36 | assert( s ); |
38 | } | 37 | } |
39 | m_factory = new MetaFactory(); | 38 | m_factory = new MetaFactory(); |
40 | Default def(m_factory); | 39 | Default def(m_factory); |
41 | m_sessions.setAutoDelete( TRUE ); | 40 | m_sessions.setAutoDelete( TRUE ); |
@@ -165,25 +164,25 @@ void MainWindow::initUI() { | |||
165 | m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); | 164 | m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); |
166 | m_saveScript->addTo(m_scripts); | 165 | m_saveScript->addTo(m_scripts); |
167 | connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); | 166 | connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); |
168 | 167 | ||
169 | m_runScript = new QAction(tr("Run Script"), QString::null, 0, this, 0); | 168 | m_runScript = new QAction(tr("Run Script"), QString::null, 0, this, 0); |
170 | m_runScript->addTo(m_scripts); | 169 | m_runScript->addTo(m_scripts); |
171 | connect(m_runScript, SIGNAL(activated()), this, SLOT(slotRunScript())); | 170 | connect(m_runScript, SIGNAL(activated()), this, SLOT(slotRunScript())); |
172 | 171 | ||
173 | /* | 172 | /* |
174 | * action that open/closes the keyboard | 173 | * action that open/closes the keyboard |
175 | */ | 174 | */ |
176 | m_openKeys = new QAction (tr("Open Keyboard..."), | 175 | m_openKeys = new QAction (tr("Open Keyboard..."), |
177 | Resource::loadPixmap( "down" ), | 176 | Resource::loadPixmap( "console/keys/keyboard_icon" ), |
178 | QString::null, 0, this, 0); | 177 | QString::null, 0, this, 0); |
179 | 178 | ||
180 | m_openKeys->setToggleAction(true); | 179 | m_openKeys->setToggleAction(true); |
181 | 180 | ||
182 | connect (m_openKeys, SIGNAL(toggled(bool)), | 181 | connect (m_openKeys, SIGNAL(toggled(bool)), |
183 | this, SLOT(slotOpenKeb(bool))); | 182 | this, SLOT(slotOpenKeb(bool))); |
184 | m_openKeys->addTo(m_icons); | 183 | m_openKeys->addTo(m_icons); |
185 | 184 | ||
186 | 185 | ||
187 | /* | 186 | /* |
188 | * action that open/closes the keyboard | 187 | * action that open/closes the keyboard |
189 | 188 | ||
@@ -218,30 +217,24 @@ void MainWindow::initUI() { | |||
218 | m_keyBar->setHorizontalStretchable( TRUE ); | 217 | m_keyBar->setHorizontalStretchable( TRUE ); |
219 | m_keyBar->hide(); | 218 | m_keyBar->hide(); |
220 | 219 | ||
221 | m_kb = new FunctionKeyboard(m_keyBar); | 220 | m_kb = new FunctionKeyboard(m_keyBar); |
222 | connect(m_kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), | 221 | connect(m_kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), |
223 | this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool))); | 222 | this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool))); |
224 | 223 | ||
225 | m_buttonBar = new QToolBar( this ); | 224 | m_buttonBar = new QToolBar( this ); |
226 | addToolBar( m_buttonBar, "Buttons", QMainWindow::Top, TRUE ); | 225 | addToolBar( m_buttonBar, "Buttons", QMainWindow::Top, TRUE ); |
227 | m_buttonBar->setHorizontalStretchable( TRUE ); | 226 | m_buttonBar->setHorizontalStretchable( TRUE ); |
228 | m_buttonBar->hide(); | 227 | m_buttonBar->hide(); |
229 | 228 | ||
230 | /* | ||
231 | m_qb = new QuickButton( m_buttonBar ); | ||
232 | connect( m_qb, SIGNAL( keyPressed( ushort, ushort, bool, bool, bool) ), | ||
233 | this, SLOT( slotKeyReceived( ushort, ushort, bool, bool, bool) ) ); | ||
234 | */ | ||
235 | /* now add the copy and paste actions */ | ||
236 | a = new QAction(tr("Copy"), | 229 | a = new QAction(tr("Copy"), |
237 | Resource::loadPixmap("copy"), QString::null, | 230 | Resource::loadPixmap("copy"), QString::null, |
238 | 0, this, 0 ); | 231 | 0, this, 0 ); |
239 | //a->addTo( m_icons ); | 232 | //a->addTo( m_icons ); |
240 | connect( a, SIGNAL(activated() ), | 233 | connect( a, SIGNAL(activated() ), |
241 | this, SLOT(slotCopy() ) ); | 234 | this, SLOT(slotCopy() ) ); |
242 | 235 | ||
243 | a = new QAction(tr("Paste"), | 236 | a = new QAction(tr("Paste"), |
244 | Resource::loadPixmap("paste"), QString::null, | 237 | Resource::loadPixmap("paste"), QString::null, |
245 | 0, this, 0 ); | 238 | 0, this, 0 ); |
246 | a->addTo( m_icons ); | 239 | a->addTo( m_icons ); |
247 | connect( a, SIGNAL(activated() ), | 240 | connect( a, SIGNAL(activated() ), |
@@ -438,24 +431,25 @@ void MainWindow::create( const Profile& prof ) { | |||
438 | 431 | ||
439 | if((!ses) || (!ses->layer()) || (!ses->widgetStack())) | 432 | if((!ses) || (!ses->layer()) || (!ses->widgetStack())) |
440 | { | 433 | { |
441 | QMessageBox::warning(this, | 434 | QMessageBox::warning(this, |
442 | QObject::tr("Session failed"), | 435 | QObject::tr("Session failed"), |
443 | QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); | 436 | QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); |
444 | //if(ses) delete ses; | 437 | //if(ses) delete ses; |
445 | return; | 438 | return; |
446 | } | 439 | } |
447 | 440 | ||
448 | m_sessions.append( ses ); | 441 | m_sessions.append( ses ); |
449 | tabWidget()->add( ses ); | 442 | tabWidget()->add( ses ); |
443 | tabWidget()->repaint(); | ||
450 | m_curSession = ses; | 444 | m_curSession = ses; |
451 | 445 | ||
452 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it | 446 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it |
453 | m_connect->setEnabled( true ); | 447 | m_connect->setEnabled( true ); |
454 | m_disconnect->setEnabled( false ); | 448 | m_disconnect->setEnabled( false ); |
455 | m_terminate->setEnabled( true ); | 449 | m_terminate->setEnabled( true ); |
456 | m_transfer->setEnabled( true ); | 450 | m_transfer->setEnabled( true ); |
457 | m_recordScript->setEnabled( true ); | 451 | m_recordScript->setEnabled( true ); |
458 | m_saveScript->setEnabled( true ); | 452 | m_saveScript->setEnabled( true ); |
459 | m_runScript->setEnabled( true ); | 453 | m_runScript->setEnabled( true ); |
460 | m_fullscreen->setEnabled( true ); | 454 | m_fullscreen->setEnabled( true ); |
461 | m_closewindow->setEnabled( true ); | 455 | m_closewindow->setEnabled( true ); |