summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp36
-rw-r--r--noncore/apps/opie-console/mainwindow.h6
-rw-r--r--noncore/apps/opie-console/opie-console.pro4
-rw-r--r--noncore/apps/opie-console/quick_button.cpp67
-rw-r--r--noncore/apps/opie-console/quick_button.h27
5 files changed, 138 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index f0130e1..b813442 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -23,16 +23,17 @@
23#include "profile.h" 23#include "profile.h"
24#include "profilemanager.h" 24#include "profilemanager.h"
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 "emulation_handler.h"
30#include "script.h" 30#include "script.h"
31#include "quick_button.h"
31 32
32 33
33 34
34MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 35MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
35 KeyTrans::loadAll(); 36 KeyTrans::loadAll();
36 for (int i = 0; i < KeyTrans::count(); i++ ) { 37 for (int i = 0; i < KeyTrans::count(); i++ ) {
37 KeyTrans* s = KeyTrans::find(i ); 38 KeyTrans* s = KeyTrans::find(i );
38 assert( s ); 39 assert( s );
@@ -167,16 +168,30 @@ void MainWindow::initUI() {
167 168
168 m_openKeys->setToggleAction(true); 169 m_openKeys->setToggleAction(true);
169 170
170 connect (m_openKeys, SIGNAL(toggled(bool)), 171 connect (m_openKeys, SIGNAL(toggled(bool)),
171 this, SLOT(slotOpenKeb(bool))); 172 this, SLOT(slotOpenKeb(bool)));
172 m_openKeys->addTo(m_icons); 173 m_openKeys->addTo(m_icons);
173 174
174 175
176 /*
177 * action that open/closes the keyboard
178 */
179 m_openButtons = new QAction ( tr( "Open Buttons..." ),
180 Resource::loadPixmap( "down" ),
181 QString::null, 0, this, 0 );
182
183 m_openButtons->setToggleAction( true );
184
185 connect ( m_openButtons, SIGNAL( toggled( bool ) ),
186 this, SLOT( slotOpenButtons( bool ) ) );
187 m_openButtons->addTo( m_icons );
188
189
175 /* insert the submenu */ 190 /* insert the submenu */
176 m_console->insertItem(tr("New from Profile"), m_sessionsPop, 191 m_console->insertItem(tr("New from Profile"), m_sessionsPop,
177 -1, 0); 192 -1, 0);
178 193
179 /* insert the connection menu */ 194 /* insert the connection menu */
180 m_bar->insertItem( tr("Connection"), m_console ); 195 m_bar->insertItem( tr("Connection"), m_console );
181 196
182 /* the scripts menu */ 197 /* the scripts menu */
@@ -190,16 +205,24 @@ void MainWindow::initUI() {
190 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); 205 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
191 m_keyBar->setHorizontalStretchable( TRUE ); 206 m_keyBar->setHorizontalStretchable( TRUE );
192 m_keyBar->hide(); 207 m_keyBar->hide();
193 208
194 m_kb = new FunctionKeyboard(m_keyBar); 209 m_kb = new FunctionKeyboard(m_keyBar);
195 connect(m_kb, SIGNAL(keyPressed(ushort, ushort, bool, bool, bool)), 210 connect(m_kb, SIGNAL(keyPressed(ushort, ushort, bool, bool, bool)),
196 this, SLOT(slotKeyReceived(ushort, ushort, bool, bool, bool))); 211 this, SLOT(slotKeyReceived(ushort, ushort, bool, bool, bool)));
197 212
213 m_buttonBar = new QToolBar( this );
214 addToolBar( m_buttonBar, "Buttons", QMainWindow::Top, TRUE );
215 m_buttonBar->setHorizontalStretchable( TRUE );
216 m_buttonBar->hide();
217
218 m_qb = new QuickButton( m_buttonBar );
219 connect( m_qb, SIGNAL( keyPressed( ushort, ushort, bool, bool, bool) ),
220 this, SLOT( slotKeyReceived( ushort, ushort, bool, bool, bool) ) );
198 221
199 222
200 m_connect->setEnabled( false ); 223 m_connect->setEnabled( false );
201 m_disconnect->setEnabled( false ); 224 m_disconnect->setEnabled( false );
202 m_terminate->setEnabled( false ); 225 m_terminate->setEnabled( false );
203 m_transfer->setEnabled( false ); 226 m_transfer->setEnabled( false );
204 m_recordScript->setEnabled( false ); 227 m_recordScript->setEnabled( false );
205 m_saveScript->setEnabled( false ); 228 m_saveScript->setEnabled( false );
@@ -426,16 +449,29 @@ void MainWindow::slotTransfer()
426 449
427 450
428void MainWindow::slotOpenKeb(bool state) { 451void MainWindow::slotOpenKeb(bool state) {
429 452
430 if (state) m_keyBar->show(); 453 if (state) m_keyBar->show();
431 else m_keyBar->hide(); 454 else m_keyBar->hide();
432 455
433} 456}
457
458
459void MainWindow::slotOpenButtons( bool state ) {
460
461 if ( state ) {
462 m_buttonBar->show();
463 } else {
464 m_buttonBar->hide();
465 }
466}
467
468
469
434void MainWindow::slotSessionChanged( Session* ses ) { 470void MainWindow::slotSessionChanged( Session* ses ) {
435 qWarning("changed!"); 471 qWarning("changed!");
436 if ( ses ) { 472 if ( ses ) {
437 m_curSession = ses; 473 m_curSession = ses;
438 qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); 474 qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) );
439 if ( m_curSession->layer()->isConnected() ) { 475 if ( m_curSession->layer()->isConnected() ) {
440 m_connect->setEnabled( false ); 476 m_connect->setEnabled( false );
441 m_disconnect->setEnabled( true ); 477 m_disconnect->setEnabled( true );
diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h
index 35338b7..7d074b6 100644
--- a/noncore/apps/opie-console/mainwindow.h
+++ b/noncore/apps/opie-console/mainwindow.h
@@ -15,16 +15,18 @@ class QToolBar;
15class QToolButton; 15class QToolButton;
16class QMenuBar; 16class QMenuBar;
17class QAction; 17class QAction;
18class MetaFactory; 18class MetaFactory;
19class TabWidget; 19class TabWidget;
20class ProfileManager; 20class ProfileManager;
21class Profile; 21class Profile;
22class FunctionKeyboard; 22class FunctionKeyboard;
23class QuickButton;
24
23class MainWindow : public QMainWindow { 25class MainWindow : public QMainWindow {
24 Q_OBJECT 26 Q_OBJECT
25public: 27public:
26 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); 28 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
27 ~MainWindow(); 29 ~MainWindow();
28 30
29 /** 31 /**
30 * our factory to generate IOLayer and so on 32 * our factory to generate IOLayer and so on
@@ -54,16 +56,17 @@ private slots:
54 void slotConnect(); 56 void slotConnect();
55 void slotDisconnect(); 57 void slotDisconnect();
56 void slotTerminate(); 58 void slotTerminate();
57 void slotConfigure(); 59 void slotConfigure();
58 void slotClose(); 60 void slotClose();
59 void slotProfile(int); 61 void slotProfile(int);
60 void slotTransfer(); 62 void slotTransfer();
61 void slotOpenKeb(bool); 63 void slotOpenKeb(bool);
64 void slotOpenButtons(bool);
62 void slotRecordScript(); 65 void slotRecordScript();
63 void slotSaveScript(); 66 void slotSaveScript();
64 void slotRunScript(); 67 void slotRunScript();
65 void slotFullscreen(); 68 void slotFullscreen();
66 void slotSessionChanged( Session* ); 69 void slotSessionChanged( Session* );
67 void slotKeyReceived(ushort, ushort, bool, bool, bool); 70 void slotKeyReceived(ushort, ushort, bool, bool, bool);
68 71
69private: 72private:
@@ -85,31 +88,34 @@ private:
85 */ 88 */
86 MetaFactory* m_factory; 89 MetaFactory* m_factory;
87 ProfileManager* m_manager; 90 ProfileManager* m_manager;
88 91
89 TabWidget* m_consoleWindow; 92 TabWidget* m_consoleWindow;
90 QToolBar* m_tool; 93 QToolBar* m_tool;
91 QToolBar* m_icons; 94 QToolBar* m_icons;
92 QToolBar* m_keyBar; 95 QToolBar* m_keyBar;
96 QToolBar* m_buttonBar;
93 QMenuBar* m_bar; 97 QMenuBar* m_bar;
94 QPopupMenu* m_console; 98 QPopupMenu* m_console;
95 QPopupMenu* m_settings; 99 QPopupMenu* m_settings;
96 QPopupMenu* m_sessionsPop; 100 QPopupMenu* m_sessionsPop;
97 QPopupMenu* m_scripts; 101 QPopupMenu* m_scripts;
98 QAction* m_connect; 102 QAction* m_connect;
99 QAction* m_disconnect; 103 QAction* m_disconnect;
100 QAction* m_terminate; 104 QAction* m_terminate;
101 QAction* m_transfer; 105 QAction* m_transfer;
102 QAction* m_setProfiles; 106 QAction* m_setProfiles;
103 QAction* m_openKeys; 107 QAction* m_openKeys;
108 QAction* m_openButtons;
104 QAction* m_recordScript; 109 QAction* m_recordScript;
105 QAction* m_saveScript; 110 QAction* m_saveScript;
106 QAction* m_runScript; 111 QAction* m_runScript;
107 QAction* m_fullscreen; 112 QAction* m_fullscreen;
108 QAction* m_closewindow; 113 QAction* m_closewindow;
109 114
110 FunctionKeyboard *m_kb; 115 FunctionKeyboard *m_kb;
116 QuickButton *m_qb;
111 bool m_isFullscreen; 117 bool m_isFullscreen;
112}; 118};
113 119
114 120
115#endif 121#endif
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro
index c2fb558..51b42bf 100644
--- a/noncore/apps/opie-console/opie-console.pro
+++ b/noncore/apps/opie-console/opie-console.pro
@@ -18,17 +18,17 @@ HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \
18 profiledialogwidget.h \ 18 profiledialogwidget.h \
19 profileeditordialog.h \ 19 profileeditordialog.h \
20 default.h \ 20 default.h \
21 iolayerbase.h \ 21 iolayerbase.h \
22 serialconfigwidget.h irdaconfigwidget.h \ 22 serialconfigwidget.h irdaconfigwidget.h \
23 btconfigwidget.h modemconfigwidget.h \ 23 btconfigwidget.h modemconfigwidget.h \
24 atconfigdialog.h dialdialog.h \ 24 atconfigdialog.h dialdialog.h \
25 procctl.h \ 25 procctl.h \
26 function_keyboard.h \ 26 function_keyboard.h quick_button.h \
27 receive_layer.h filereceive.h \ 27 receive_layer.h filereceive.h \
28 script.h \ 28 script.h \
29 dialer.h \ 29 dialer.h \
30 terminalwidget.h \ 30 terminalwidget.h \
31 emulation_handler.h TECommon.h \ 31 emulation_handler.h TECommon.h \
32 TEHistroy.h TEScreen.h TEWidget.h \ 32 TEHistroy.h TEScreen.h TEWidget.h \
33 TEmuVt102.h TEmulation.h MyPty.h 33 TEmuVt102.h TEmulation.h MyPty.h
34 34
@@ -47,17 +47,17 @@ SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \
47 transferdialog.cpp \ 47 transferdialog.cpp \
48 profiledialogwidget.cpp \ 48 profiledialogwidget.cpp \
49 profileeditordialog.cpp \ 49 profileeditordialog.cpp \
50 iolayerbase.cpp \ 50 iolayerbase.cpp \
51 serialconfigwidget.cpp irdaconfigwidget.cpp \ 51 serialconfigwidget.cpp irdaconfigwidget.cpp \
52 btconfigwidget.cpp modemconfigwidget.cpp \ 52 btconfigwidget.cpp modemconfigwidget.cpp \
53 atconfigdialog.cpp dialdialog.cpp \ 53 atconfigdialog.cpp dialdialog.cpp \
54 default.cpp procctl.cpp \ 54 default.cpp procctl.cpp \
55 function_keyboard.cpp \ 55 function_keyboard.cpp quick_button.cpp \
56 receive_layer.cpp filereceive.cpp \ 56 receive_layer.cpp filereceive.cpp \
57 script.cpp \ 57 script.cpp \
58 dialer.cpp \ 58 dialer.cpp \
59 terminalwidget.cpp \ 59 terminalwidget.cpp \
60 emulation_handler.cpp TEHistory.cpp \ 60 emulation_handler.cpp TEHistory.cpp \
61 TEScreen.cpp TEWidget.cpp \ 61 TEScreen.cpp TEWidget.cpp \
62 TEmuVt102.cpp TEmulation.cpp MyPty.cpp 62 TEmuVt102.cpp TEmulation.cpp MyPty.cpp
63 63
diff --git a/noncore/apps/opie-console/quick_button.cpp b/noncore/apps/opie-console/quick_button.cpp
new file mode 100644
index 0000000..09df901
--- a/dev/null
+++ b/noncore/apps/opie-console/quick_button.cpp
@@ -0,0 +1,67 @@
1#include <qevent.h>
2#include <qapplication.h>
3#include <qaction.h>
4
5#include <qpe/resource.h>
6#include "quick_button.h"
7
8QuickButton::QuickButton(QWidget *parent) : QFrame(parent) {
9
10 QAction *a;
11
12 // Button Commands
13 a = new QAction( tr("Enter"), Resource::loadPixmap( "console/enter" ), QString::null, 0, this, 0 );
14 connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) );
15 a->addTo( parent );
16 a = new QAction( tr("Space"), Resource::loadPixmap( "console/space" ), QString::null, 0, this, 0 );
17 connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) );
18 a->addTo( parent );
19 a = new QAction( tr("Tab"), Resource::loadPixmap( "console/tab" ), QString::null, 0, this, 0 );
20 connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) );
21 a->addTo( parent );
22 a = new QAction( tr("Up"), Resource::loadPixmap( "console/up" ), QString::null, 0, this, 0 );
23 connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) );
24 a->addTo( parent );
25 a = new QAction( tr("Down"), Resource::loadPixmap( "console/down" ), QString::null, 0, this, 0 );
26 connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) );
27 a->addTo( parent );
28 a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 );
29 connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) );
30 a->addTo( parent );
31
32
33}
34
35QuickButton::~QuickButton() {
36}
37
38
39void QuickButton::hitEnter() {
40 emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Enter, 0, 1, 0);
41}
42
43void QuickButton::hitSpace() {
44 emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Space, 0, 1, 0);
45}
46
47void QuickButton::hitTab() {
48 emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Tab, 0, 1, 0);
49}
50
51void QuickButton::hitPaste() {
52 /*
53 TEWidget* te = getTe();
54 if (te != 0) {
55 te->pasteClipboard();
56 }
57 */
58}
59
60void QuickButton::hitUp() {
61 emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Up, 0, 1, 0);
62}
63
64void QuickButton::hitDown() {
65 emit keyPressed( QKeyEvent::KeyPress, Qt::Key_Down, 0, 1, 0);
66}
67
diff --git a/noncore/apps/opie-console/quick_button.h b/noncore/apps/opie-console/quick_button.h
new file mode 100644
index 0000000..d3eb1bb
--- a/dev/null
+++ b/noncore/apps/opie-console/quick_button.h
@@ -0,0 +1,27 @@
1#ifndef QUICK_BUTTON_H
2#define QUICK_BUTTON_H
3
4#include <qframe.h>
5
6class QuickButton : public QFrame {
7
8 Q_OBJECT
9
10public:
11 QuickButton( QWidget *parent = 0 );
12 ~QuickButton();
13
14 signals:
15
16 void keyPressed( ushort, ushort, bool, bool, bool );
17
18private slots:
19 void hitEnter();
20 void hitSpace();
21 void hitTab();
22 void hitPaste();
23 void hitUp();
24 void hitDown();
25};
26
27#endif