summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp101
-rw-r--r--noncore/apps/opie-console/mainwindow.h7
2 files changed, 88 insertions, 20 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 89cdf51..6dc9e6e 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -9,4 +9,5 @@
9#include <qtoolbar.h> 9#include <qtoolbar.h>
10#include <qmessagebox.h> 10#include <qmessagebox.h>
11#include <qpushbutton.h>
11 12
12#include <qpe/resource.h> 13#include <qpe/resource.h>
@@ -27,4 +28,27 @@
27#include "script.h" 28#include "script.h"
28 29
30
31
32static char * menu_xpm[] = {
33"12 12 5 1",
34 " c None",
35 ".c #000000",
36 "+c #FFFDAD",
37 "@c #FFFF00",
38 "#c #E5E100",
39" ",
40" ",
41" ......... ",
42" .+++++++. ",
43" .+@@@@#. ",
44" .+@@@#. ",
45" .+@@#. ",
46" .+@#. ",
47" .+#. ",
48" .+. ",
49" .. ",
50" "};
51
52
29MainWindow::MainWindow() { 53MainWindow::MainWindow() {
30 KeyTrans::loadAll(); 54 KeyTrans::loadAll();
@@ -94,4 +118,17 @@ void MainWindow::initUI() {
94 this, SLOT(slotTransfer() ) ); 118 this, SLOT(slotTransfer() ) );
95 119
120
121 /*
122 * fullscreen
123 */
124 m_isFullscreen = false;
125
126 m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" )
127 , QString::null, 0, this, 0);
128 m_fullscreen->addTo( m_console );
129 m_fullscreen->addTo( m_icons );
130 connect( m_fullscreen, SIGNAL( activated() ),
131 this, SLOT( slotFullscreen() ) );
132
96 /* 133 /*
97 * terminate action 134 * terminate action
@@ -103,8 +140,8 @@ void MainWindow::initUI() {
103 this, SLOT(slotTerminate() ) ); 140 this, SLOT(slotTerminate() ) );
104 141
105 a = new QAction(); 142 m_closewindow = new QAction();
106 a->setText( tr("Close Window") ); 143 m_closewindow->setText( tr("Close Window") );
107 a->addTo( m_console ); 144 m_closewindow->addTo( m_console );
108 connect(a, SIGNAL(activated() ), 145 connect( m_closewindow, SIGNAL(activated() ),
109 this, SLOT(slotClose() ) ); 146 this, SLOT(slotClose() ) );
110 147
@@ -179,4 +216,6 @@ void MainWindow::initUI() {
179 m_saveScript->setEnabled( false ); 216 m_saveScript->setEnabled( false );
180 m_runScript->setEnabled( false ); 217 m_runScript->setEnabled( false );
218 m_fullscreen->setEnabled( false );
219 m_closewindow->setEnabled( false );
181 220
182 /* 221 /*
@@ -326,4 +365,16 @@ void MainWindow::slotClose() {
326 m_curSession = m_sessions.first(); 365 m_curSession = m_sessions.first();
327 tabWidget()->setCurrent( m_curSession ); 366 tabWidget()->setCurrent( m_curSession );
367
368 if (!currentSession() ) {
369 m_connect->setEnabled( false );
370 m_disconnect->setEnabled( false );
371 m_terminate->setEnabled( false );
372 m_transfer->setEnabled( false );
373 m_recordScript->setEnabled( false );
374 m_saveScript->setEnabled( false );
375 m_runScript->setEnabled( false );
376 m_fullscreen->setEnabled( false );
377 m_closewindow->setEnabled( false );
378 }
328} 379}
329 380
@@ -353,5 +404,5 @@ void MainWindow::create( const Profile& prof ) {
353 m_curSession = ses; 404 m_curSession = ses;
354 405
355 // dicide if its a local term ( then no connction and no tranfer) 406 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it
356 m_connect->setEnabled( true ); 407 m_connect->setEnabled( true );
357 m_disconnect->setEnabled( true ); 408 m_disconnect->setEnabled( true );
@@ -361,6 +412,6 @@ void MainWindow::create( const Profile& prof ) {
361 m_saveScript->setEnabled( true ); 412 m_saveScript->setEnabled( true );
362 m_runScript->setEnabled( true ); 413 m_runScript->setEnabled( true );
363 414 m_fullscreen->setEnabled( true );
364 415 m_closewindow->setEnabled( true );
365} 416}
366 417
@@ -388,16 +439,30 @@ void MainWindow::slotSessionChanged( Session* ses ) {
388} 439}
389 440
390void MainWindow::setOn() { 441void MainWindow::slotFullscreen() {
391 442
392/* 443 if ( m_isFullscreen ) {
393 m_connect 444 ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false );
394 m_disconnect 445 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken );
395 m_terminate 446 setCentralWidget( m_consoleWindow );
396 m_transfer 447 ( m_curSession->widgetStack() )->show();
397 m_recordScript 448 m_fullscreen->setText( tr("Full screen") );
398 m_saveScript 449
399 m_runScript 450 } else {
400*/ 451 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame );
452 ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop,
453 QPoint(0,0), false);
454 ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height());
455 ( m_curSession->widgetStack() )->setFocus();
456 ( m_curSession->widgetStack() )->show();
457
458 // QPushButton *cornerButton = new QPushButton( this );
459 //cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
460 //connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
461 // need teh scrollbar
462 // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton );
463 m_fullscreen->setText( tr("Stop full screen") );
464 }
401 465
466 m_isFullscreen = !m_isFullscreen;
402 467
403} 468}
diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h
index 378870a..e63078a 100644
--- a/noncore/apps/opie-console/mainwindow.h
+++ b/noncore/apps/opie-console/mainwindow.h
@@ -58,10 +58,10 @@ private slots:
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 slotFullscreen();
66 void slotSessionChanged( Session* ); 66 void slotSessionChanged( Session* );
67private: 67private:
@@ -103,6 +103,9 @@ private:
103 QAction* m_saveScript; 103 QAction* m_saveScript;
104 QAction* m_runScript; 104 QAction* m_runScript;
105 QAction* m_fullscreen;
106 QAction* m_closewindow;
105 107
106 FunctionKeyboard *m_kb; 108 FunctionKeyboard *m_kb;
109 bool m_isFullscreen;
107}; 110};
108 111