summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 55e9836..27407d9 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -1,40 +1,38 @@
1#include <assert.h> 1#include <assert.h>
2 2
3
4
5#include <qaction.h> 3#include <qaction.h>
6#include <qmenubar.h> 4#include <qmenubar.h>
7#include <qlabel.h> 5#include <qlabel.h>
8#include <qpopupmenu.h> 6#include <qpopupmenu.h>
9#include <qtoolbar.h> 7#include <qtoolbar.h>
10#include <qmessagebox.h> 8#include <qmessagebox.h>
11#include <qpushbutton.h> 9#include <qpushbutton.h>
12#include <qwhatsthis.h> 10#include <qwhatsthis.h>
13 11
14#include <qpe/resource.h> 12#include <qpe/resource.h>
15#include <opie/ofiledialog.h>
16 13
14#include <opie/ofiledialog.h>
17 15
18#include "keytrans.h" 16#include "keytrans.h"
19#include "profileeditordialog.h" 17#include "profileeditordialog.h"
20#include "configdialog.h" 18#include "configdialog.h"
21#include "default.h" 19#include "default.h"
22#include "metafactory.h" 20#include "metafactory.h"
23#include "profile.h" 21#include "profile.h"
24#include "profilemanager.h" 22#include "profilemanager.h"
25#include "mainwindow.h" 23#include "mainwindow.h"
26#include "tabwidget.h" 24#include "tabwidget.h"
27#include "transferdialog.h" 25#include "transferdialog.h"
28#include "function_keyboard.h" 26#include "function_keyboard.h"
29#include "emulation_handler.h" 27#include "emulation_handler.h"
30#include "script.h" 28#include "script.h"
31#include "quick_button.h" 29#include "quick_button.h"
32 30
33 31
34 32
35MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 33MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
36 KeyTrans::loadAll(); 34 KeyTrans::loadAll();
37 for (int i = 0; i < KeyTrans::count(); i++ ) { 35 for (int i = 0; i < KeyTrans::count(); i++ ) {
38 KeyTrans* s = KeyTrans::find(i ); 36 KeyTrans* s = KeyTrans::find(i );
39 assert( s ); 37 assert( s );
40 } 38 }
@@ -465,59 +463,63 @@ void MainWindow::slotOpenButtons( bool state ) {
465 } else { 463 } else {
466 m_buttonBar->hide(); 464 m_buttonBar->hide();
467 } 465 }
468} 466}
469 467
470 468
471 469
472void MainWindow::slotSessionChanged( Session* ses ) { 470void MainWindow::slotSessionChanged( Session* ses ) {
473 qWarning("changed!"); 471 qWarning("changed!");
474 if ( ses ) { 472 if ( ses ) {
475 m_curSession = ses; 473 m_curSession = ses;
476 qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); 474 qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) );
477 if ( m_curSession->layer()->isConnected() ) { 475 if ( m_curSession->layer()->isConnected() ) {
478 m_connect->setEnabled( false ); 476 m_connect->setEnabled( false );
479 m_disconnect->setEnabled( true ); 477 m_disconnect->setEnabled( true );
480 } else { 478 } else {
481 m_connect->setEnabled( true ); 479 m_connect->setEnabled( true );
482 m_disconnect->setEnabled( false ); 480 m_disconnect->setEnabled( false );
483 } 481 }
484 } 482 }
485} 483}
486 484
487void MainWindow::slotFullscreen() { 485void MainWindow::slotFullscreen() {
488 486
487
488
489 if ( m_isFullscreen ) { 489 if ( m_isFullscreen ) {
490 ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false ); 490 ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), false );
491 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 491 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken );
492
492 setCentralWidget( m_consoleWindow ); 493 setCentralWidget( m_consoleWindow );
493 ( m_curSession->widgetStack() )->show(); 494 ( m_curSession->widgetStack() )->show();
494 ( m_curSession->emulationHandler() )->cornerButton()->hide(); 495 ( m_curSession->emulationHandler() )->cornerButton()->hide();
495 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 496 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
496 497
497 } else { 498 } else {
499 savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget();
498 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); 500 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame );
499 ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop 501 ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop
500 , QPoint(0,0), false ); 502 , QPoint(0,0), false );
501 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); 503 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() );
502 ( m_curSession->widgetStack() )->setFocus(); 504 ( m_curSession->widgetStack() )->setFocus();
503 ( m_curSession->widgetStack() )->show(); 505 ( m_curSession->widgetStack() )->show();
504 506
505 ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); 507 ( ( m_curSession->emulationHandler() )->cornerButton() )->show();
506 508
507 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 509 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
508 } 510 }
509 511
510 m_isFullscreen = !m_isFullscreen; 512 m_isFullscreen = !m_isFullscreen;
511} 513}
512 514
513 515
514void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool pressed, bool) { 516void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool pressed, bool) {
515 517
516 qWarning("unicode: %x, qkey: %x, %s", u, q, pressed ? "pressed" : "released"); 518 qWarning("unicode: %x, qkey: %x, %s", u, q, pressed ? "pressed" : "released");
517 519
518 if ( m_curSession ) { 520 if ( m_curSession ) {
519 521
520 QEvent::Type state; 522 QEvent::Type state;
521 523
522 if (pressed) state = QEvent::KeyPress; 524 if (pressed) state = QEvent::KeyPress;
523 else state = QEvent::KeyRelease; 525 else state = QEvent::KeyRelease;