author | harlekin <harlekin> | 2002-10-17 17:19:20 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-17 17:19:20 (UTC) |
commit | df5a8d26c398ad65f09bd26c492c08f6c0ee22e0 (patch) (side-by-side diff) | |
tree | e1fcefde6e4942f65fa2b5ad253f40a190caa78a /noncore/apps | |
parent | cedc9eed0c0b8d1685c3ca745eafd77988d394dc (diff) | |
download | opie-df5a8d26c398ad65f09bd26c492c08f6c0ee22e0.zip opie-df5a8d26c398ad65f09bd26c492c08f6c0ee22e0.tar.gz opie-df5a8d26c398ad65f09bd26c492c08f6c0ee22e0.tar.bz2 |
fullscreen mode ready
-rw-r--r-- | noncore/apps/opie-console/TEWidget.cpp | 16 | ||||
-rw-r--r-- | noncore/apps/opie-console/TEWidget.h | 28 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.h | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_bt.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 36 |
6 files changed, 57 insertions, 32 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 @@ -57,23 +57,26 @@ #include <qregexp.h> #include <qpainter.h> #include <qclipboard.h> #include <qstyle.h> #include <qfile.h> #include <qdragobject.h> +#include <qvbox.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <ctype.h> #include <sys/stat.h> #include <sys/types.h> #include <signal.h> #include <assert.h> + + // #include "TEWidget.moc" //#include <kapp.h> //#include <kcursor.h> //#include <kurl.h> //#include <kdebug.h> //#include <klocale.h> @@ -271,26 +274,34 @@ void TEWidget::setFont(const QFont &) } /* ------------------------------------------------------------------------- */ /* */ /* Constructor / Destructor */ /* */ -/* ------------------------------------------------------------------------- */ +/* ----------------------------------------------------------------------- */ + + TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) { #ifndef QT_NO_CLIPBOARD cb = QApplication::clipboard(); QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), this, SLOT(onClearSelection()) ); #endif + 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)){ case 0: scrollLoc = SCRNONE; break; @@ -1259,6 +1270,9 @@ void TEWidget::drop_menu_activated(int item) // KWM::activate((Window)this->winId()); break; } #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 @@ -23,35 +23,60 @@ #include <qtimer.h> #include <qcolor.h> #include <qkeycode.h> #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; public: TEWidget(QWidget *parent=0, const char *name=0); virtual ~TEWidget(); public: QColor getDefaultBackColor(); + QPushButton *cornerButton(); const ColorEntry* getColorTable() const; const ColorEntry* getdefaultColorTable() const; void setColorTable(const ColorEntry table[]); void setScrollbarLocation(int loc); @@ -176,12 +201,13 @@ private: QPoint iPntSel; // initial selection point QPoint pntSel; // current selection point int actSel; // selection state BOOL word_selection_mode; BOOL preserve_line_breaks; + QPushButton *m_cornerButton; QClipboard* cb; QScrollBar* scrollbar; int scrollLoc; //#define SCRNONE 0 //#define SCRLEFT 1 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,7 +1,8 @@ #include <qwidget.h> +#include <qpushbutton.h> #include "TEWidget.h" #include "TEmuVt102.h" #include "profile.h" #include "emulation_handler.h" @@ -137,6 +138,10 @@ QColor EmulationHandler::backColor(int col ) { co = Qt::black; break; } 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 @@ -22,12 +22,13 @@ * it'll set up the widget internally * and manage the communication between * the pre QByteArray world! */ class Profile; class QWidget; +class QPushButton; class TEWidget; class TEmulation; class QFont; class EmulationHandler : public QObject { Q_OBJECT public: @@ -43,12 +44,14 @@ public: */ ~EmulationHandler(); 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 ); public slots: 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 @@ -26,13 +26,12 @@ void IOBt::close() { bool IOBt::open() { // only set up bt stuff if mac address was set, otherwise use the device set 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"; // then start hcid, then rcfomm handling (m_mac) 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 @@ -23,37 +23,17 @@ #include "profile.h" #include "profilemanager.h" #include "mainwindow.h" #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++ ) { KeyTrans* s = KeyTrans::find(i ); assert( s ); } @@ -459,31 +439,29 @@ 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") ); + ( 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()); ( 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; } void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) { qWarning("received key event! relay to TE widget"); |