summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-14 23:23:55 (UTC)
committer harlekin <harlekin>2002-10-14 23:23:55 (UTC)
commitc7aed90e02d06502dff04043103c5db0883cc011 (patch) (side-by-side diff)
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
@@ -9,4 +9,5 @@
#include <qtoolbar.h>
#include <qmessagebox.h>
+#include <qpushbutton.h>
#include <qpe/resource.h>
@@ -27,4 +28,27 @@
#include "script.h"
+
+
+static char * menu_xpm[] = {
+"12 12 5 1",
+" c None",
+". c #000000",
+"+ c #FFFDAD",
+"@ c #FFFF00",
+"# c #E5E100",
+" ",
+" ",
+" ......... ",
+" .+++++++. ",
+" .+@@@@#. ",
+" .+@@@#. ",
+" .+@@#. ",
+" .+@#. ",
+" .+#. ",
+" .+. ",
+" .. ",
+" "};
+
+
MainWindow::MainWindow() {
KeyTrans::loadAll();
@@ -94,4 +118,17 @@ void MainWindow::initUI() {
this, SLOT(slotTransfer() ) );
+
+ /*
+ * fullscreen
+ */
+ m_isFullscreen = false;
+
+ m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" )
+ , QString::null, 0, this, 0);
+ m_fullscreen->addTo( m_console );
+ m_fullscreen->addTo( m_icons );
+ connect( m_fullscreen, SIGNAL( activated() ),
+ this, SLOT( slotFullscreen() ) );
+
/*
* terminate action
@@ -103,8 +140,8 @@ void MainWindow::initUI() {
this, SLOT(slotTerminate() ) );
- a = new QAction();
- a->setText( tr("Close Window") );
- a->addTo( m_console );
- connect(a, SIGNAL(activated() ),
+ m_closewindow = new QAction();
+ m_closewindow->setText( tr("Close Window") );
+ m_closewindow->addTo( m_console );
+ connect( m_closewindow, SIGNAL(activated() ),
this, SLOT(slotClose() ) );
@@ -179,4 +216,6 @@ void MainWindow::initUI() {
m_saveScript->setEnabled( false );
m_runScript->setEnabled( false );
+ m_fullscreen->setEnabled( false );
+ m_closewindow->setEnabled( false );
/*
@@ -326,4 +365,16 @@ void MainWindow::slotClose() {
m_curSession = m_sessions.first();
tabWidget()->setCurrent( m_curSession );
+
+ if (!currentSession() ) {
+ m_connect->setEnabled( false );
+ m_disconnect->setEnabled( false );
+ m_terminate->setEnabled( false );
+ m_transfer->setEnabled( false );
+ m_recordScript->setEnabled( false );
+ m_saveScript->setEnabled( false );
+ m_runScript->setEnabled( false );
+ m_fullscreen->setEnabled( false );
+ m_closewindow->setEnabled( false );
+ }
}
@@ -353,5 +404,5 @@ void MainWindow::create( const Profile& prof ) {
m_curSession = ses;
- // dicide if its a local term ( then no connction and no tranfer)
+ // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it
m_connect->setEnabled( true );
m_disconnect->setEnabled( true );
@@ -361,6 +412,6 @@ void MainWindow::create( const Profile& prof ) {
m_saveScript->setEnabled( true );
m_runScript->setEnabled( true );
-
-
+ m_fullscreen->setEnabled( true );
+ m_closewindow->setEnabled( true );
}
@@ -388,16 +439,30 @@ void MainWindow::slotSessionChanged( Session* ses ) {
}
-void MainWindow::setOn() {
-
-/*
- m_connect
- m_disconnect
- m_terminate
- m_transfer
- m_recordScript
- m_saveScript
- m_runScript
-*/
+void MainWindow::slotFullscreen() {
+ if ( m_isFullscreen ) {
+ ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false );
+ ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ setCentralWidget( m_consoleWindow );
+ ( m_curSession->widgetStack() )->show();
+ m_fullscreen->setText( tr("Full screen") );
+
+ } else {
+ ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame );
+ ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop,
+ QPoint(0,0), false);
+ ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height());
+ ( m_curSession->widgetStack() )->setFocus();
+ ( m_curSession->widgetStack() )->show();
+
+ // QPushButton *cornerButton = new QPushButton( this );
+ //cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
+ //connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
+ // need teh scrollbar
+ // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton );
+ m_fullscreen->setText( tr("Stop full screen") );
+ }
+
+ m_isFullscreen = !m_isFullscreen;
}
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
@@ -63,5 +63,5 @@ private slots:
void slotSaveScript();
void slotRunScript();
- void setOn();
+ void slotFullscreen();
void slotSessionChanged( Session* );
private:
@@ -103,6 +103,9 @@ private:
QAction* m_saveScript;
QAction* m_runScript;
+ QAction* m_fullscreen;
+ QAction* m_closewindow;
FunctionKeyboard *m_kb;
+ bool m_isFullscreen;
};