summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-14 23:23:55 (UTC)
committer harlekin <harlekin>2002-10-14 23:23:55 (UTC)
commitc7aed90e02d06502dff04043103c5db0883cc011 (patch) (unidiff)
tree1787c9d92e23474d2e69bb1607ecaf565cac2475
parent91adb54066037522a619ce5d072c2e932901fd74 (diff)
downloadopie-c7aed90e02d06502dff04043103c5db0883cc011.zip
opie-c7aed90e02d06502dff04043103c5db0883cc011.tar.gz
opie-c7aed90e02d06502dff04043103c5db0883cc011.tar.bz2
half way fullscreen done
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp101
-rw-r--r--noncore/apps/opie-console/mainwindow.h5
2 files changed, 87 insertions, 19 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
@@ -8,6 +8,7 @@
8#include <qpopupmenu.h> 8#include <qpopupmenu.h>
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>
13#include <opie/ofiledialog.h> 14#include <opie/ofiledialog.h>
@@ -26,6 +27,29 @@
26#include "function_keyboard.h" 27#include "function_keyboard.h"
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();
31 for (int i = 0; i < KeyTrans::count(); i++ ) { 55 for (int i = 0; i < KeyTrans::count(); i++ ) {
@@ -93,6 +117,19 @@ void MainWindow::initUI() {
93 connect(m_transfer, SIGNAL(activated() ), 117 connect(m_transfer, SIGNAL(activated() ),
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
98 */ 135 */
@@ -102,10 +139,10 @@ void MainWindow::initUI() {
102 connect(m_terminate, SIGNAL(activated() ), 139 connect(m_terminate, SIGNAL(activated() ),
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
111 /* 148 /*
@@ -178,6 +215,8 @@ void MainWindow::initUI() {
178 m_recordScript->setEnabled( false ); 215 m_recordScript->setEnabled( false );
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 /*
183 * connect to the menu activation 222 * connect to the menu activation
@@ -325,6 +364,18 @@ void MainWindow::slotClose() {
325 m_sessions.remove( m_curSession ); 364 m_sessions.remove( m_curSession );
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
330/* 381/*
@@ -352,7 +403,7 @@ void MainWindow::create( const Profile& prof ) {
352 tabWidget()->add( ses ); 403 tabWidget()->add( ses );
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 );
358 m_terminate->setEnabled( true ); 409 m_terminate->setEnabled( true );
@@ -360,8 +411,8 @@ void MainWindow::create( const Profile& prof ) {
360 m_recordScript->setEnabled( true ); 411 m_recordScript->setEnabled( true );
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
367void MainWindow::slotTransfer() 418void MainWindow::slotTransfer()
@@ -387,17 +438,31 @@ void MainWindow::slotSessionChanged( Session* ses ) {
387 } 438 }
388} 439}
389 440
390void MainWindow::setOn() { 441void MainWindow::slotFullscreen() {
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 442
443 if ( m_isFullscreen ) {
444 ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false );
445 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken );
446 setCentralWidget( m_consoleWindow );
447 ( m_curSession->widgetStack() )->show();
448 m_fullscreen->setText( tr("Full screen") );
449
450 } else {
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 }
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
@@ -62,7 +62,7 @@ private slots:
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:
68 void initUI(); 68 void initUI();
@@ -102,8 +102,11 @@ private:
102 QAction* m_recordScript; 102 QAction* m_recordScript;
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
109 112