summaryrefslogtreecommitdiff
Unidiff
Diffstat (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
@@ -59,8 +59,9 @@
59#include <qclipboard.h> 59#include <qclipboard.h>
60#include <qstyle.h> 60#include <qstyle.h>
61#include <qfile.h> 61#include <qfile.h>
62#include <qdragobject.h> 62#include <qdragobject.h>
63#include <qvbox.h>
63 64
64#include <stdio.h> 65#include <stdio.h>
65#include <stdlib.h> 66#include <stdlib.h>
66#include <unistd.h> 67#include <unistd.h>
@@ -70,8 +71,10 @@
70#include <signal.h> 71#include <signal.h>
71 72
72#include <assert.h> 73#include <assert.h>
73 74
75
76
74// #include "TEWidget.moc" 77// #include "TEWidget.moc"
75//#include <kapp.h> 78//#include <kapp.h>
76//#include <kcursor.h> 79//#include <kcursor.h>
77//#include <kurl.h> 80//#include <kurl.h>
@@ -273,9 +276,11 @@ void TEWidget::setFont(const QFont &)
273/* ------------------------------------------------------------------------- */ 276/* ------------------------------------------------------------------------- */
274/* */ 277/* */
275/* Constructor / Destructor */ 278/* Constructor / Destructor */
276/* */ 279/* */
277/* ------------------------------------------------------------------------- */ 280/* ----------------------------------------------------------------------- */
281
282
278 283
279TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) 284TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
280{ 285{
281#ifndef QT_NO_CLIPBOARD 286#ifndef QT_NO_CLIPBOARD
@@ -283,12 +288,18 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
283 QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), 288 QObject::connect( (QObject*)cb, SIGNAL(dataChanged()),
284 this, SLOT(onClearSelection()) ); 289 this, SLOT(onClearSelection()) );
285#endif 290#endif
286 291
287 scrollbar = new QScrollBar(this); 292
293 scrollbar = new QScrollBar( this );
288 scrollbar->setCursor( arrowCursor ); 294 scrollbar->setCursor( arrowCursor );
289 connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); 295 connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int)));
290 296
297 m_cornerButton = new QPushButton( this );
298 m_cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) );
299 m_cornerButton->setMaximumSize( 14, 14 );
300 m_cornerButton->hide();
301
291 Config cfg("Konsole"); 302 Config cfg("Konsole");
292 cfg.setGroup("ScrollBar"); 303 cfg.setGroup("ScrollBar");
293 switch( cfg.readNumEntry("Position",2)){ 304 switch( cfg.readNumEntry("Position",2)){
294 case 0: 305 case 0:
@@ -853,9 +864,9 @@ void TEWidget::mouseDoubleClickEvent(QMouseEvent* ev)
853} 864}
854 865
855void TEWidget::focusInEvent( QFocusEvent * ) 866void TEWidget::focusInEvent( QFocusEvent * )
856{ 867{
857 868
858 // do nothing, to prevent repainting 869 // do nothing, to prevent repainting
859} 870}
860 871
861 872
@@ -1261,4 +1272,7 @@ void TEWidget::drop_menu_activated(int item)
1261 } 1272 }
1262#endif 1273#endif
1263} 1274}
1264 1275
1276QPushButton* TEWidget::cornerButton() {
1277 return m_cornerButton;
1278}
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
@@ -25,20 +25,44 @@
25#include <qkeycode.h> 25#include <qkeycode.h>
26#include <qscrollbar.h> 26#include <qscrollbar.h>
27 27
28#include <qpopupmenu.h> 28#include <qpopupmenu.h>
29#include <qpushbutton.h>
29 30
30#include "TECommon.h" 31#include "TECommon.h"
31 32
32extern unsigned short vt100_graphics[32]; 33extern unsigned short vt100_graphics[32];
33 34
35
36
37static char * menu_xpm[] = {
38"12 12 5 1",
39 " c None",
40 ".c #000000",
41 "+c #FFFDAD",
42 "@c #FFFF00",
43 "#c #E5E100",
44" ",
45" ",
46" ......... ",
47" .+++++++. ",
48" .+@@@@#. ",
49" .+@@@#. ",
50" .+@@#. ",
51" .+@#. ",
52" .+#. ",
53" .+. ",
54" .. ",
55" "};
56
34class TESession; 57class TESession;
35 58
36// class Konsole; 59// class Konsole;
37 60
38class TEWidget : public QFrame 61class TEWidget : public QFrame
39// a widget representing attributed text 62// a widget representing attributed text
40{ Q_OBJECT 63{
64 Q_OBJECT
41 65
42// friend class Konsole; 66// friend class Konsole;
43 67
44public: 68public:
@@ -48,8 +72,9 @@ public:
48 72
49public: 73public:
50 74
51 QColor getDefaultBackColor(); 75 QColor getDefaultBackColor();
76 QPushButton *cornerButton();
52 77
53 const ColorEntry* getColorTable() const; 78 const ColorEntry* getColorTable() const;
54 const ColorEntry* getdefaultColorTable() const; 79 const ColorEntry* getdefaultColorTable() const;
55 void setColorTable(const ColorEntry table[]); 80 void setColorTable(const ColorEntry table[]);
@@ -130,9 +155,9 @@ protected:
130 void clearImage(); 155 void clearImage();
131 156
132public: 157public:
133 const QPixmap *backgroundPixmap(); 158 const QPixmap *backgroundPixmap();
134 159
135 void setSelection(const QString &t); 160 void setSelection(const QString &t);
136 161
137 virtual void setFont(const QFont &); 162 virtual void setFont(const QFont &);
138 void setVTFont(const QFont &); 163 void setVTFont(const QFont &);
@@ -178,8 +203,9 @@ private:
178 int actSel; // selection state 203 int actSel; // selection state
179 BOOL word_selection_mode; 204 BOOL word_selection_mode;
180 BOOL preserve_line_breaks; 205 BOOL preserve_line_breaks;
181 206
207 QPushButton *m_cornerButton;
182 QClipboard* cb; 208 QClipboard* cb;
183 QScrollBar* scrollbar; 209 QScrollBar* scrollbar;
184 int scrollLoc; 210 int scrollLoc;
185 211
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,5 +1,6 @@
1#include <qwidget.h> 1#include <qwidget.h>
2#include <qpushbutton.h>
2 3
3#include "TEWidget.h" 4#include "TEWidget.h"
4#include "TEmuVt102.h" 5#include "TEmuVt102.h"
5 6
@@ -139,4 +140,8 @@ QColor EmulationHandler::backColor(int col ) {
139 } 140 }
140 141
141 return co; 142 return co;
142} 143}
144
145QPushButton* EmulationHandler::cornerButton() {
146 return m_teWid->cornerButton();
147}
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
@@ -24,8 +24,9 @@
24 * the pre QByteArray world! 24 * the pre QByteArray world!
25 */ 25 */
26class Profile; 26class Profile;
27class QWidget; 27class QWidget;
28class QPushButton;
28class TEWidget; 29class TEWidget;
29class TEmulation; 30class TEmulation;
30class QFont; 31class QFont;
31class EmulationHandler : public QObject { 32class EmulationHandler : public QObject {
@@ -45,8 +46,10 @@ public:
45 46
46 void load( const Profile& ); 47 void load( const Profile& );
47 QWidget* widget(); 48 QWidget* widget();
48 void setColor( const QColor& fore, const QColor& back ); 49 void setColor( const QColor& fore, const QColor& back );
50 QPushButton* cornerButton();
51
49signals: 52signals:
50 void send( const QByteArray& ); 53 void send( const QByteArray& );
51 void changeSize(int rows, int cols ); 54 void changeSize(int rows, int cols );
52 55
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
@@ -28,9 +28,8 @@ bool IOBt::open() {
28 // only set up bt stuff if mac address was set, otherwise use the device set 28 // only set up bt stuff if mac address was set, otherwise use the device set
29 if ( !m_mac.isEmpty() ) { 29 if ( !m_mac.isEmpty() ) {
30 30
31 // now it should also be checked, if there is a connection to the device with that mac allready 31 // now it should also be checked, if there is a connection to the device with that mac allready
32
33 // hciattach here 32 // hciattach here
34 m_attach = new OProcess(); 33 m_attach = new OProcess();
35 *m_attach << "hciattach /dev/ttyS2 any 57600"; 34 *m_attach << "hciattach /dev/ttyS2 any 57600";
36 35
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
@@ -25,33 +25,13 @@
25#include "mainwindow.h" 25#include "mainwindow.h"
26#include "tabwidget.h" 26#include "tabwidget.h"
27#include "transferdialog.h" 27#include "transferdialog.h"
28#include "function_keyboard.h" 28#include "function_keyboard.h"
29#include "emulation_handler.h"
29#include "script.h" 30#include "script.h"
30 31
31 32
32 33
33static char * menu_xpm[] = {
34"12 12 5 1",
35 " c None",
36 ".c #000000",
37 "+c #FFFDAD",
38 "@c #FFFF00",
39 "#c #E5E100",
40" ",
41" ",
42" ......... ",
43" .+++++++. ",
44" .+@@@@#. ",
45" .+@@@#. ",
46" .+@@#. ",
47" .+@#. ",
48" .+#. ",
49" .+. ",
50" .. ",
51" "};
52
53
54MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 34MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
55 KeyTrans::loadAll(); 35 KeyTrans::loadAll();
56 for (int i = 0; i < KeyTrans::count(); i++ ) { 36 for (int i = 0; i < KeyTrans::count(); i++ ) {
57 KeyTrans* s = KeyTrans::find(i ); 37 KeyTrans* s = KeyTrans::find(i );
@@ -461,27 +441,25 @@ void MainWindow::slotFullscreen() {
461 ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false ); 441 ( m_curSession->widgetStack() )->reparent( m_consoleWindow, 0, QPoint(0,0), false );
462 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 442 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken );
463 setCentralWidget( m_consoleWindow ); 443 setCentralWidget( m_consoleWindow );
464 ( m_curSession->widgetStack() )->show(); 444 ( m_curSession->widgetStack() )->show();
465 m_fullscreen->setText( tr("Full screen") ); 445 ( m_curSession->emulationHandler() )->cornerButton()->hide();
446 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
466 447
467 } else { 448 } else {
468 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); 449 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame );
469 ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop 450 ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop
470 , QPoint(0,0), false); 451 , QPoint(0,0), false );
471 ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height()); 452 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() );
472 ( m_curSession->widgetStack() )->setFocus(); 453 ( m_curSession->widgetStack() )->setFocus();
473 ( m_curSession->widgetStack() )->show(); 454 ( m_curSession->widgetStack() )->show();
474 455
475 QPushButton *cornerButton = new QPushButton( m_curSession->widgetStack() ); 456 ( ( m_curSession->emulationHandler() )->cornerButton() )->show();
476 cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); 457
477 connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 458 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
478 // would need a scrollview
479 // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton );
480 m_fullscreen->setText( tr("Stop full screen") );
481 } 459 }
482 m_isFullscreen = !m_isFullscreen;
483 460
461 m_isFullscreen = !m_isFullscreen;
484} 462}
485 463
486 464
487void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) { 465void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool, bool) {