Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 5295600..408d3dd 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -23,37 +23,17 @@ | |||
23 | #include "profile.h" | 23 | #include "profile.h" |
24 | #include "profilemanager.h" | 24 | #include "profilemanager.h" |
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 "script.h" | 30 | #include "script.h" |
30 | 31 | ||
31 | 32 | ||
32 | 33 | ||
33 | static char * menu_xpm[] = { | ||
34 | "12 12 5 1", | ||
35 | " c None", | ||
36 | ".c #000000", | ||
37 | "+c #FFFDAD", | ||
38 | "@c #FFFF00", | ||
39 | "#c #E5E100", | ||
40 | " ", | ||
41 | " ", | ||
42 | " ......... ", | ||
43 | " .+++++++. ", | ||
44 | " .+@@@@#. ", | ||
45 | " .+@@@#. ", | ||
46 | " .+@@#. ", | ||
47 | " .+@#. ", | ||
48 | " .+#. ", | ||
49 | " .+. ", | ||
50 | " .. ", | ||
51 | " "}; | ||
52 | |||
53 | |||
54 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 34 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
55 | KeyTrans::loadAll(); | 35 | KeyTrans::loadAll(); |
56 | for (int i = 0; i < KeyTrans::count(); i++ ) { | 36 | for (int i = 0; i < KeyTrans::count(); i++ ) { |
57 | KeyTrans* s = KeyTrans::find(i ); | 37 | KeyTrans* s = KeyTrans::find(i ); |
58 | assert( s ); | 38 | assert( s ); |
59 | } | 39 | } |
@@ -459,31 +439,29 @@ void MainWindow::slotFullscreen() { | |||
459 | 439 | ||
460 | if ( m_isFullscreen ) { | 440 | if ( m_isFullscreen ) { |
461 | ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false ); | 441 | ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false ); |
462 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 442 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
463 | setCentralWidget( m_consoleWindow ); | 443 | setCentralWidget( m_consoleWindow ); |
464 | ( m_curSession->widgetStack() )->show(); | 444 | ( m_curSession->widgetStack() )->show(); |
465 | m_fullscreen->setText( tr("Full screen") ); | 445 | ( m_curSession->emulationHandler() )->cornerButton()->hide(); |
446 | disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); | ||
466 | 447 | ||
467 | } else { | 448 | } else { |
468 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); | 449 | ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); |
469 | ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop | 450 | ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop |
470 | , QPoint(0,0), false); | 451 | , QPoint(0,0), false ); |
471 | ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height()); | 452 | ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); |
472 | ( m_curSession->widgetStack() )->setFocus(); | 453 | ( m_curSession->widgetStack() )->setFocus(); |
473 | ( m_curSession->widgetStack() )->show(); | 454 | ( m_curSession->widgetStack() )->show(); |
474 | 455 | ||
475 | QPushButton *cornerButton = new QPushButton( m_curSession->widgetStack() ); | 456 | ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); |
476 | cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); | 457 | |
477 | connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); | 458 | connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); |
478 | // would need a scrollview | ||
479 | // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton ); | ||
480 | m_fullscreen->setText( tr("Stop full screen") ); | ||
481 | } | 459 | } |
482 | m_isFullscreen = !m_isFullscreen; | ||
483 | 460 | ||
461 | m_isFullscreen = !m_isFullscreen; | ||
484 | } | 462 | } |
485 | 463 | ||
486 | 464 | ||
487 | void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) { | 465 | void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) { |
488 | 466 | ||
489 | qWarning("received key event! relay to TE widget"); | 467 | qWarning("received key event! relay to TE widget"); |