summaryrefslogtreecommitdiff
path: root/noncore
authorharlekin <harlekin>2002-10-17 17:19:20 (UTC)
committer harlekin <harlekin>2002-10-17 17:19:20 (UTC)
commitdf5a8d26c398ad65f09bd26c492c08f6c0ee22e0 (patch) (side-by-side diff)
treee1fcefde6e4942f65fa2b5ad253f40a190caa78a /noncore
parentcedc9eed0c0b8d1685c3ca745eafd77988d394dc (diff)
downloadopie-df5a8d26c398ad65f09bd26c492c08f6c0ee22e0.zip
opie-df5a8d26c398ad65f09bd26c492c08f6c0ee22e0.tar.gz
opie-df5a8d26c398ad65f09bd26c492c08f6c0ee22e0.tar.bz2
fullscreen mode ready
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/TEWidget.cpp20
-rw-r--r--noncore/apps/opie-console/TEWidget.h30
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp5
-rw-r--r--noncore/apps/opie-console/emulation_handler.h3
-rw-r--r--noncore/apps/opie-console/io_bt.cpp1
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp40
6 files changed, 62 insertions, 37 deletions
diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp
index 75c438c..f3f462f 100644
--- a/noncore/apps/opie-console/TEWidget.cpp
+++ b/noncore/apps/opie-console/TEWidget.cpp
@@ -60,6 +60,7 @@
#include <qstyle.h>
#include <qfile.h>
#include <qdragobject.h>
+#include <qvbox.h>
#include <stdio.h>
#include <stdlib.h>
@@ -71,6 +72,8 @@
#include <assert.h>
+
+
// #include "TEWidget.moc"
//#include <kapp.h>
//#include <kcursor.h>
@@ -274,7 +277,9 @@ void TEWidget::setFont(const QFont &)
/* */
/* Constructor / Destructor */
/* */
-/* ------------------------------------------------------------------------- */
+/* ----------------------------------------------------------------------- */
+
+
TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
{
@@ -284,10 +289,16 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
this, SLOT(onClearSelection()) );
#endif
- scrollbar = new QScrollBar(this);
+
+ scrollbar = new QScrollBar( this );
scrollbar->setCursor( arrowCursor );
connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int)));
+ m_cornerButton = new QPushButton( this );
+ m_cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
+ m_cornerButton->setMaximumSize( 14, 14 );
+ m_cornerButton->hide();
+
Config cfg("Konsole");
cfg.setGroup("ScrollBar");
switch( cfg.readNumEntry("Position",2)){
@@ -854,7 +865,7 @@ void TEWidget::mouseDoubleClickEvent(QMouseEvent* ev)
void TEWidget::focusInEvent( QFocusEvent * )
{
-
+
// do nothing, to prevent repainting
}
@@ -1262,3 +1273,6 @@ void TEWidget::drop_menu_activated(int item)
#endif
}
+QPushButton* TEWidget::cornerButton() {
+ return m_cornerButton;
+}
diff --git a/noncore/apps/opie-console/TEWidget.h b/noncore/apps/opie-console/TEWidget.h
index 40e1aea..1b5300f 100644
--- a/noncore/apps/opie-console/TEWidget.h
+++ b/noncore/apps/opie-console/TEWidget.h
@@ -26,18 +26,42 @@
#include <qscrollbar.h>
#include <qpopupmenu.h>
+#include <qpushbutton.h>
#include "TECommon.h"
extern unsigned short vt100_graphics[32];
+
+
+static char * menu_xpm[] = {
+"12 12 5 1",
+" c None",
+". c #000000",
+"+ c #FFFDAD",
+"@ c #FFFF00",
+"# c #E5E100",
+" ",
+" ",
+" ......... ",
+" .+++++++. ",
+" .+@@@@#. ",
+" .+@@@#. ",
+" .+@@#. ",
+" .+@#. ",
+" .+#. ",
+" .+. ",
+" .. ",
+" "};
+
class TESession;
// class Konsole;
class TEWidget : public QFrame
// a widget representing attributed text
-{ Q_OBJECT
+{
+ Q_OBJECT
// friend class Konsole;
@@ -49,6 +73,7 @@ public:
public:
QColor getDefaultBackColor();
+ QPushButton *cornerButton();
const ColorEntry* getColorTable() const;
const ColorEntry* getdefaultColorTable() const;
@@ -131,7 +156,7 @@ protected:
public:
const QPixmap *backgroundPixmap();
-
+
void setSelection(const QString &t);
virtual void setFont(const QFont &);
@@ -179,6 +204,7 @@ private:
BOOL word_selection_mode;
BOOL preserve_line_breaks;
+ QPushButton *m_cornerButton;
QClipboard* cb;
QScrollBar* scrollbar;
int scrollLoc;
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index b2cd348..8846959 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -1,4 +1,5 @@
#include <qwidget.h>
+#include <qpushbutton.h>
#include "TEWidget.h"
#include "TEmuVt102.h"
@@ -140,3 +141,7 @@ QColor EmulationHandler::backColor(int col ) {
return co;
}
+
+QPushButton* EmulationHandler::cornerButton() {
+ return m_teWid->cornerButton();
+}
diff --git a/noncore/apps/opie-console/emulation_handler.h b/noncore/apps/opie-console/emulation_handler.h
index 9af7680..9ceafc6 100644
--- a/noncore/apps/opie-console/emulation_handler.h
+++ b/noncore/apps/opie-console/emulation_handler.h
@@ -25,6 +25,7 @@
*/
class Profile;
class QWidget;
+class QPushButton;
class TEWidget;
class TEmulation;
class QFont;
@@ -46,6 +47,8 @@ public:
void load( const Profile& );
QWidget* widget();
void setColor( const QColor& fore, const QColor& back );
+ QPushButton* cornerButton();
+
signals:
void send( const QByteArray& );
void changeSize(int rows, int cols );
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
index d71aacc..4486eea 100644
--- a/noncore/apps/opie-console/io_bt.cpp
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -29,7 +29,6 @@ bool IOBt::open() {
if ( !m_mac.isEmpty() ) {
// now it should also be checked, if there is a connection to the device with that mac allready
-
// hciattach here
m_attach = new OProcess();
*m_attach << "hciattach /dev/ttyS2 any 57600";
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
@@ -26,31 +26,11 @@
#include "tabwidget.h"
#include "transferdialog.h"
#include "function_keyboard.h"
+#include "emulation_handler.h"
#include "script.h"
-static char * menu_xpm[] = {
-"12 12 5 1",
-" c None",
-". c #000000",
-"+ c #FFFDAD",
-"@ c #FFFF00",
-"# c #E5E100",
-" ",
-" ",
-" ......... ",
-" .+++++++. ",
-" .+@@@@#. ",
-" .+@@@#. ",
-" .+@@#. ",
-" .+@#. ",
-" .+#. ",
-" .+. ",
-" .. ",
-" "};
-
-
MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
KeyTrans::loadAll();
for (int i = 0; i < KeyTrans::count(); i++ ) {
@@ -462,25 +442,23 @@ void MainWindow::slotFullscreen() {
( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken );
setCentralWidget( m_consoleWindow );
( m_curSession->widgetStack() )->show();
- m_fullscreen->setText( tr("Full screen") );
+ ( m_curSession->emulationHandler() )->cornerButton()->hide();
+ disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
} 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());
+ , 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( m_curSession->widgetStack() );
- cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
- connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
- // would need a scrollview
- // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton );
- m_fullscreen->setText( tr("Stop full screen") );
+ ( ( m_curSession->emulationHandler() )->cornerButton() )->show();
+
+ connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
}
- m_isFullscreen = !m_isFullscreen;
+ m_isFullscreen = !m_isFullscreen;
}