summaryrefslogtreecommitdiff
authorhrw <hrw>2005-10-12 21:05:47 (UTC)
committer hrw <hrw>2005-10-12 21:05:47 (UTC)
commit6d3c752d2e93f5a43a4b5156f9968e07b3144c0a (patch) (unidiff)
tree0bdc7f3c4db68a21c266993a96bc428dc96bcbfa
parentd5beae7038e36633480cc3e17134a85b6d68fbc7 (diff)
downloadopie-6d3c752d2e93f5a43a4b5156f9968e07b3144c0a.zip
opie-6d3c752d2e93f5a43a4b5156f9968e07b3144c0a.tar.gz
opie-6d3c752d2e93f5a43a4b5156f9968e07b3144c0a.tar.bz2
fixed bug #1686: opie-console lack U I setting for switching scrollbar
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog1
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp3
-rw-r--r--noncore/apps/opie-console/emulation_handler.h1
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp41
-rw-r--r--noncore/apps/opie-console/mainwindow.h9
5 files changed, 55 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 07be30b..b817062 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,58 +1,59 @@
1 2005-??-??Opie 1.2.2 1 2005-??-??Opie 1.2.2
2 2
3 3
4 New Features 4 New Features
5 ------------ 5 ------------
6 6
7 7
8 Fixed Bugs 8 Fixed Bugs
9 ---------- 9 ----------
10 * #1695 - Date selector use too small fontsize on VGA screen (hrw) 10 * #1695 - Date selector use too small fontsize on VGA screen (hrw)
11 * #1686 - opie-console lack UI setting for switching scrollbar (hrw)
11 * n.a. - remove hardcoded font size from wellenreiter (hrw) 12 * n.a. - remove hardcoded font size from wellenreiter (hrw)
12 * n.a. - added patch to build QT/E 2.3.10 with gc 4.x.x (hrw) 13 * n.a. - added patch to build QT/E 2.3.10 with gc 4.x.x (hrw)
13 14
14 2005-09-11Opie 1.2.1 15 2005-09-11Opie 1.2.1
15 16
16 17
17 New Features 18 New Features
18 ------------ 19 ------------
19 * OpieStumbler: Scans WiFi networks using the wireless extension scanning (skyhusker) 20 * OpieStumbler: Scans WiFi networks using the wireless extension scanning (skyhusker)
20 * Opie-Reader: Support for document formats ArriereGo and Reb, add flite output (tim,pohly) 21 * Opie-Reader: Support for document formats ArriereGo and Reb, add flite output (tim,pohly)
21 * Opie-Networksettings: Add support for wlan-ng devices and improve WEP handling (Dirk Opfer) 22 * Opie-Networksettings: Add support for wlan-ng devices and improve WEP handling (Dirk Opfer)
22 * Wellenreiter: Remove Joining networks - use OpieStumbler for that (mickeyl) 23 * Wellenreiter: Remove Joining networks - use OpieStumbler for that (mickeyl)
23 * Opie-Mobilemsg has gone unsupported - it never really worked and there will be a replacement (mickeyl) 24 * Opie-Mobilemsg has gone unsupported - it never really worked and there will be a replacement (mickeyl)
24 * Opie-Tabmanager has gone unsupported - it barely works and there is not much of a use of it anyway (mickeyl) 25 * Opie-Tabmanager has gone unsupported - it barely works and there is not much of a use of it anyway (mickeyl)
25 * Checkbook: Added configuration option to use smaller font for checkbook transaction tab (hrw) 26 * Checkbook: Added configuration option to use smaller font for checkbook transaction tab (hrw)
26 * ZSafe: Made UI conform to Opie standards (drw) 27 * ZSafe: Made UI conform to Opie standards (drw)
27 * Today Addressbook plugin: Fixed configuration to show/not show birthdays, use checkboxes for selection (hrw) 28 * Today Addressbook plugin: Fixed configuration to show/not show birthdays, use checkboxes for selection (hrw)
28 * Opie-Console: Read initial fixed font configuration from qpe.conf (mickeyl) 29 * Opie-Console: Read initial fixed font configuration from qpe.conf (mickeyl)
29 * Opie-PcmciaApplet: Configure insert/resume actions and bind unsupported cards (mickeyl) 30 * Opie-PcmciaApplet: Configure insert/resume actions and bind unsupported cards (mickeyl)
30 * SysInfo: Remove CPU tab and add Devices tab instead (mickeyl) 31 * SysInfo: Remove CPU tab and add Devices tab instead (mickeyl)
31 * Opie-smb: Added Opie front end for Samba (ljp) 32 * Opie-smb: Added Opie front end for Samba (ljp)
32 * Opie-Bluetooth: Replace obex send implementation and patch libopieobex and the bluetoothapplet (Michael Haynie) 33 * Opie-Bluetooth: Replace obex send implementation and patch libopieobex and the bluetoothapplet (Michael Haynie)
33 * Opieplayer: rudimentary podcast support (ljp) 34 * Opieplayer: rudimentary podcast support (ljp)
34 35
35 Fixed Bugs 36 Fixed Bugs
36 ---------- 37 ----------
37 * #1377 - Suspend Powermanagement when switched to another VT (mickeyl) 38 * #1377 - Suspend Powermanagement when switched to another VT (mickeyl)
38 - We actually suspend the complete Opie now in that case. 39 - We actually suspend the complete Opie now in that case.
39 * #1384 - Battery status updated improperly when charging (skyhusker) 40 * #1384 - Battery status updated improperly when charging (skyhusker)
40 * #1476 - Wrong order of application entries in the O-menu (skyhusker) 41 * #1476 - Wrong order of application entries in the O-menu (skyhusker)
41 * #1514 - Remove usage of cardmon/pcmcia picture in applications. pcmcia is now an inline picture (mickeyl) 42 * #1514 - Remove usage of cardmon/pcmcia picture in applications. pcmcia is now an inline picture (mickeyl)
42 * #1535- Missing line break and unnecessary location shown with Today-Calendar plugin (deller) 43 * #1535- Missing line break and unnecessary location shown with Today-Calendar plugin (deller)
43 * #1543 - Time Settings: "predict" tab is displayed twice after reopen (hrw) 44 * #1543 - Time Settings: "predict" tab is displayed twice after reopen (hrw)
44 * #1546 - Battery applet popup is not always large enough to show jacket remaining info (skyhusker) 45 * #1546 - Battery applet popup is not always large enough to show jacket remaining info (skyhusker)
45 * #1557 - Light&Power-Settings don't store warning intervall and warning levels (skyhusker) 46 * #1557 - Light&Power-Settings don't store warning intervall and warning levels (skyhusker)
46 * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller) 47 * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller)
47 * #1614 - Make Opie-console start in $HOME instead of / (skyhusker) 48 * #1614 - Make Opie-console start in $HOME instead of / (skyhusker)
48 * #1635 - opie-today, datebook-plugin does not show notes (skyhusker) 49 * #1635 - opie-today, datebook-plugin does not show notes (skyhusker)
49 * #1665 - Opie-IRC displays the host prepended to the message when peer is using and ipv6 address (skyhusker) 50 * #1665 - Opie-IRC displays the host prepended to the message when peer is using and ipv6 address (skyhusker)
50 * #1666 - Opie-IRC does not allow to add !channels in config asautojoin ones (skyhusker) 51 * #1666 - Opie-IRC does not allow to add !channels in config asautojoin ones (skyhusker)
51 * #1667 - Opie-IRC does not show messages from !channel (skyhusker) 52 * #1667 - Opie-IRC does not show messages from !channel (skyhusker)
52 * #1679 - Security PIN plugin is QVGA sized (hrw) 53 * #1679 - Security PIN plugin is QVGA sized (hrw)
53 * #1682 - Properly resize tab control in OTabWidget (drw) 54 * #1682 - Properly resize tab control in OTabWidget (drw)
54 * n.a. - always show volume and wireless applet popups inside visible screen (deller) 55 * n.a. - always show volume and wireless applet popups inside visible screen (deller)
55 * n.a. - scale O-Menu-Applets appropriately (mickeyl) 56 * n.a. - scale O-Menu-Applets appropriately (mickeyl)
56 * n.a. - libopienet: fix bugs in wireless scanning and setting SSID (skyhusker) 57 * n.a. - libopienet: fix bugs in wireless scanning and setting SSID (skyhusker)
57 * n.a. - Wellenreiter: relax WE version matching test a bit (mickeyl) 58 * n.a. - Wellenreiter: relax WE version matching test a bit (mickeyl)
58 * n.a. - scale BluezApplet appropriately and use larger icons (mickeyl) 59 * n.a. - scale BluezApplet appropriately and use larger icons (mickeyl)
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index 2087f57..d5a435e 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -205,48 +205,51 @@ bool EmulationHandler::isRecording() {
205bool EmulationHandler::isLogging() { 205bool EmulationHandler::isLogging() {
206 return (m_log != 0); 206 return (m_log != 0);
207} 207}
208 208
209void EmulationHandler::startRecording() { 209void EmulationHandler::startRecording() {
210 if (!isRecording()) 210 if (!isRecording())
211 m_script = new Script(); 211 m_script = new Script();
212} 212}
213 213
214void EmulationHandler::startLogging(const QString fileName) { 214void EmulationHandler::startLogging(const QString fileName) {
215 m_logFileName = fileName; 215 m_logFileName = fileName;
216 if (!isLogging()) 216 if (!isLogging())
217 m_log = new Logger(m_logFileName); 217 m_log = new Logger(m_logFileName);
218} 218}
219 219
220QString EmulationHandler::logFileName() { 220QString EmulationHandler::logFileName() {
221 return m_logFileName; 221 return m_logFileName;
222} 222}
223 223
224void EmulationHandler::clearScript() { 224void EmulationHandler::clearScript() {
225 if (isRecording()) { 225 if (isRecording()) {
226 delete m_script; 226 delete m_script;
227 m_script = 0; 227 m_script = 0;
228 } 228 }
229} 229}
230 230
231void EmulationHandler::clearLog() { 231void EmulationHandler::clearLog() {
232 if (isLogging()) { 232 if (isLogging()) {
233 delete m_log; 233 delete m_log;
234 m_log = 0; 234 m_log = 0;
235 } 235 }
236} 236}
237 237
238void EmulationHandler::runScript(const Script *script) { 238void EmulationHandler::runScript(const Script *script) {
239 emit send(script->script()); 239 emit send(script->script());
240} 240}
241 241
242void EmulationHandler::copy() { 242void EmulationHandler::copy() {
243 m_teWid->emitSelection(); 243 m_teWid->emitSelection();
244} 244}
245void EmulationHandler::paste() { 245void EmulationHandler::paste() {
246 m_teWid->pasteClipboard(); 246 m_teWid->pasteClipboard();
247} 247}
248 248
249void EmulationHandler::setWrap(int columns) { 249void EmulationHandler::setWrap(int columns) {
250 m_teWid->setWrapAt(columns); 250 m_teWid->setWrapAt(columns);
251} 251}
252 252
253void EmulationHandler::setScrollbarLocation(int index) {
254 m_teWid->setScrollbarLocation(index);
255}
diff --git a/noncore/apps/opie-console/emulation_handler.h b/noncore/apps/opie-console/emulation_handler.h
index 1092c82..dabdb15 100644
--- a/noncore/apps/opie-console/emulation_handler.h
+++ b/noncore/apps/opie-console/emulation_handler.h
@@ -38,74 +38,75 @@ class EmulationHandler : public QObject {
38 Q_OBJECT 38 Q_OBJECT
39public: 39public:
40 /** 40 /**
41 * simple c'tor the parent of the TEWdiget 41 * simple c'tor the parent of the TEWdiget
42 * and a name 42 * and a name
43 * and a Profile 43 * and a Profile
44 */ 44 */
45 EmulationHandler( const Profile&, QWidget* parent, const char* name = 0l ); 45 EmulationHandler( const Profile&, QWidget* parent, const char* name = 0l );
46 46
47 /** 47 /**
48 * delete all components 48 * delete all components
49 */ 49 */
50 ~EmulationHandler(); 50 ~EmulationHandler();
51 51
52 void load( const Profile& ); 52 void load( const Profile& );
53 QWidget* widget(); 53 QWidget* widget();
54 TEmulation *emulation(); 54 TEmulation *emulation();
55 void setColor( const QColor& fore, const QColor& back ); 55 void setColor( const QColor& fore, const QColor& back );
56 QPushButton* cornerButton(); 56 QPushButton* cornerButton();
57 57
58 /* Scripts */ 58 /* Scripts */
59 /* Create a new script and record all typed characters */ 59 /* Create a new script and record all typed characters */
60 void startRecording(); 60 void startRecording();
61 61
62 void startLogging(const QString); 62 void startLogging(const QString);
63 63
64 /* Return whether we are currently recording a script */ 64 /* Return whether we are currently recording a script */
65 bool isRecording(); 65 bool isRecording();
66 66
67 /* Return whether we are currently recording a log */ 67 /* Return whether we are currently recording a log */
68 bool isLogging(); 68 bool isLogging();
69 69
70 QString logFileName(); 70 QString logFileName();
71 71
72 /* Return the current script (or NULL) */ 72 /* Return the current script (or NULL) */
73 Script *script(); 73 Script *script();
74 74
75 /* Stop recording and remove the current script from memory */ 75 /* Stop recording and remove the current script from memory */
76 void clearScript(); 76 void clearScript();
77 77
78 /* Stop logging and remove the current log from memory */ 78 /* Stop logging and remove the current log from memory */
79 void clearLog(); 79 void clearLog();
80 80
81 /* Run a script by forwarding its keys to the EmulationLayer */ 81 /* Run a script by forwarding its keys to the EmulationLayer */
82 void runScript(const Script *); 82 void runScript(const Script *);
83 83
84 /* Propagate change to widget */ 84 /* Propagate change to widget */
85 void setWrap(int columns); 85 void setWrap(int columns);
86 void setScrollbarLocation(int index);
86signals: 87signals:
87 void send( const QByteArray& ); 88 void send( const QByteArray& );
88 void changeSize(int rows, int cols ); 89 void changeSize(int rows, int cols );
89 90
90 91
91public slots: 92public slots:
92 void recv( const QByteArray& ); 93 void recv( const QByteArray& );
93 void paste(); 94 void paste();
94 void copy(); 95 void copy();
95 96
96private slots: 97private slots:
97 void recvEmulation( const char*, int len ); 98 void recvEmulation( const char*, int len );
98private: 99private:
99 QFont font( int ); 100 QFont font( int );
100 QColor foreColor(int ); 101 QColor foreColor(int );
101 QColor backColor(int ); 102 QColor backColor(int );
102 103
103private: 104private:
104 TEWidget* m_teWid; 105 TEWidget* m_teWid;
105 TEmulation* m_teEmu; 106 TEmulation* m_teEmu;
106 Script * m_script; 107 Script * m_script;
107 Logger *m_log; 108 Logger *m_log;
108 QString m_logFileName; 109 QString m_logFileName;
109}; 110};
110 111
111#endif 112#endif
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 45a662c..18c0434 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -24,191 +24,203 @@ using namespace Opie::Ui;
24#include <qmessagebox.h> 24#include <qmessagebox.h>
25#include <qwhatsthis.h> 25#include <qwhatsthis.h>
26#include <qfileinfo.h> 26#include <qfileinfo.h>
27 27
28/* STD */ 28/* STD */
29#include <assert.h> 29#include <assert.h>
30 30
31#include <opie2/oconfig.h> 31#include <opie2/oconfig.h>
32 32
33MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 33MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
34 34
35#ifdef FSCKED_DISTRI 35#ifdef FSCKED_DISTRI
36 FixIt fix; 36 FixIt fix;
37 fix.fixIt(); 37 fix.fixIt();
38#endif 38#endif
39 39
40 setCaption(QObject::tr("Opie Console") ); 40 setCaption(QObject::tr("Opie Console") );
41 KeyTrans::loadAll(); 41 KeyTrans::loadAll();
42 for (int i = 0; i < KeyTrans::count(); i++ ) { 42 for (int i = 0; i < KeyTrans::count(); i++ ) {
43 KeyTrans* s = KeyTrans::find(i ); 43 KeyTrans* s = KeyTrans::find(i );
44 assert( s ); 44 assert( s );
45 } 45 }
46 m_factory = new MetaFactory(); 46 m_factory = new MetaFactory();
47 Default def(m_factory); 47 Default def(m_factory);
48 m_sessions.setAutoDelete( TRUE ); 48 m_sessions.setAutoDelete( TRUE );
49 m_curSession = 0; 49 m_curSession = 0;
50 m_manager = new ProfileManager( m_factory ); 50 m_manager = new ProfileManager( m_factory );
51 m_manager->load(); 51 m_manager->load();
52 m_scriptsData.setAutoDelete(TRUE); 52 m_scriptsData.setAutoDelete(TRUE);
53 53
54 initUI(); 54 initUI();
55 populateProfiles(); 55 populateProfiles();
56 populateScripts(); 56 populateScripts();
57} 57}
58 58
59void MainWindow::initUI() { 59void MainWindow::initUI() {
60 60
61 setToolBarsMovable( FALSE ); 61 setToolBarsMovable( FALSE );
62 62
63 /* tool bar for the menu */ 63 /* tool bar for the menu */
64 m_tool = new QToolBar( this ); 64 m_tool = new QToolBar( this );
65 m_tool->setHorizontalStretchable( TRUE ); 65 m_tool->setHorizontalStretchable( TRUE );
66 66
67 m_bar = new QMenuBar( m_tool ); 67 m_bar = new QMenuBar( m_tool );
68 m_console = new QPopupMenu( this ); 68 m_console = new QPopupMenu( this );
69 m_scripts = new QPopupMenu( this ); 69 m_scripts = new QPopupMenu( this );
70 m_sessionsPop= new QPopupMenu( this ); 70 m_sessionsPop= new QPopupMenu( this );
71 m_scriptsPop = new QPopupMenu( this ); 71 m_scriptsPop = new QPopupMenu( this );
72 m_scrollbar = new QPopupMenu( this );
72 73
73 /* add a toolbar for icons */ 74 /* add a toolbar for icons */
74 m_icons = new QToolBar(this); 75 m_icons = new QToolBar(this);
75 76
76 /* 77 /*
77 * the settings action 78 * the settings action
78 */ 79 */
79 m_setProfiles = new QAction(tr("Configure Profiles"), 80 m_setProfiles = new QAction(tr("Configure Profiles"),
80 Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ), 81 Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ),
81 QString::null, 0, this, 0); 82 QString::null, 0, this, 0);
82 m_setProfiles->addTo( m_console ); 83 m_setProfiles->addTo( m_console );
83 connect( m_setProfiles, SIGNAL(activated() ), 84 connect( m_setProfiles, SIGNAL(activated() ),
84 this, SLOT(slotConfigure() ) ); 85 this, SLOT(slotConfigure() ) );
85 86
86 m_console->insertSeparator(); 87 m_console->insertSeparator();
87 /* 88 /*
88 * new Action for new sessions 89 * new Action for new sessions
89 */ 90 */
90 QAction* newCon = new QAction(tr("New Profile"), 91 QAction* newCon = new QAction(tr("New Profile"),
91 Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), 92 Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ),
92 QString::null, 0, this, 0); 93 QString::null, 0, this, 0);
93 newCon->addTo( m_console ); 94 newCon->addTo( m_console );
94 connect( newCon, SIGNAL(activated() ), 95 connect( newCon, SIGNAL(activated() ),
95 this, SLOT(slotNew() ) ); 96 this, SLOT(slotNew() ) );
96 97
97 m_console->insertSeparator(); 98 m_console->insertSeparator();
98 99
99 QAction *saveCon = new QAction( tr("Save Profile" ), 100 QAction *saveCon = new QAction( tr("Save Profile" ),
100 Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ), QString::null, 101 Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ), QString::null,
101 0, this, 0 ); 102 0, this, 0 );
102 saveCon->addTo( m_console ); 103 saveCon->addTo( m_console );
103 connect( saveCon, SIGNAL(activated() ), 104 connect( saveCon, SIGNAL(activated() ),
104 this, SLOT(slotSaveSession() ) ); 105 this, SLOT(slotSaveSession() ) );
105 m_console->insertSeparator(); 106 m_console->insertSeparator();
106 107
107 /* 108 /*
108 * connect action 109 * connect action
109 */ 110 */
110 m_connect = new QAction( tr("Connect"), Opie::Core::OResource::loadPixmap("console/connected", 111 m_connect = new QAction( tr("Connect"), Opie::Core::OResource::loadPixmap("console/connected",
111 Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); 112 Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
112 m_connect->addTo( m_console ); 113 m_connect->addTo( m_console );
113 connect(m_connect, SIGNAL(activated() ), 114 connect(m_connect, SIGNAL(activated() ),
114 this, SLOT(slotConnect() ) ); 115 this, SLOT(slotConnect() ) );
115 116
116 /* 117 /*
117 * disconnect action 118 * disconnect action
118 */ 119 */
119 m_disconnect = new QAction( tr("Disconnect"), Opie::Core::OResource::loadPixmap("console/notconnected", 120 m_disconnect = new QAction( tr("Disconnect"), Opie::Core::OResource::loadPixmap("console/notconnected",
120 Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); 121 Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
121 m_disconnect->addTo( m_console ); 122 m_disconnect->addTo( m_console );
122 connect(m_disconnect, SIGNAL(activated() ), 123 connect(m_disconnect, SIGNAL(activated() ),
123 this, SLOT(slotDisconnect() ) ); 124 this, SLOT(slotDisconnect() ) );
124 125
125 m_console->insertSeparator(); 126 m_console->insertSeparator();
126 127
127#ifndef EAST 128#ifndef EAST
128 m_quickLaunch = new QAction( tr("QuickLaunch"), 129 m_quickLaunch = new QAction( tr("QuickLaunch"),
129 Opie::Core::OResource::loadPixmap("console/konsole_mini", Opie::Core::OResource::SmallIcon ), 130 Opie::Core::OResource::loadPixmap("console/konsole_mini", Opie::Core::OResource::SmallIcon ),
130 QString::null, 0, this, 0 ); 131 QString::null, 0, this, 0 );
131 m_quickLaunch->addTo( m_icons ); 132 m_quickLaunch->addTo( m_icons );
132 connect( m_quickLaunch, SIGNAL( activated() ), 133 connect( m_quickLaunch, SIGNAL( activated() ),
133 this, SLOT( slotQuickLaunch() ) ); 134 this, SLOT( slotQuickLaunch() ) );
134#endif 135#endif
135 136
136 QWhatsThis::add( m_icons, tr( "The shell button launches the \"default\" profile. If there is none default values are taken" ) ); 137 QWhatsThis::add( m_icons, tr( "The shell button launches the \"default\" profile. If there is none default values are taken" ) );
137 138
138 m_transfer = new QAction( tr("Transfer file..."), Opie::Core::OResource::loadPixmap("pass", Opie::Core::OResource::SmallIcon ), 139 m_transfer = new QAction( tr("Transfer file..."), Opie::Core::OResource::loadPixmap("pass", Opie::Core::OResource::SmallIcon ),
139 QString::null, 0, this, 0 ); 140 QString::null, 0, this, 0 );
140 m_transfer->addTo( m_console ); 141 m_transfer->addTo( m_console );
141 connect(m_transfer, SIGNAL(activated() ), 142 connect(m_transfer, SIGNAL(activated() ),
142 this, SLOT(slotTransfer() ) ); 143 this, SLOT(slotTransfer() ) );
143 144
144 145
145 146
146 /* 147 /*
147 * immediate change of line wrap policy 148 * immediate change of line wrap policy
148 */ 149 */
149 m_isWrapped = true; 150 m_isWrapped = true;
150 m_wrap = new QAction( tr("Line wrap"), Opie::Core::OResource::loadPixmap( "linewrap", Opie::Core::OResource::SmallIcon ), 151 m_wrap = new QAction( tr("Line wrap"), Opie::Core::OResource::loadPixmap( "linewrap", Opie::Core::OResource::SmallIcon ),
151 QString::null, 0, this, 0, true ); 152 QString::null, 0, this, 0, true );
152 m_wrap->addTo( m_console ); 153 m_wrap->addTo( m_console );
153 m_wrap->setOn( true ); 154 m_wrap->setOn( true );
154 connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) ); 155 connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) );
155 156
156 /* 157 /*
157 * fullscreen 158 * fullscreen
158 */ 159 */
159 m_isFullscreen = false; 160 m_isFullscreen = false;
160 161
161 m_fullscreen = new QAction( tr("Full screen"), Opie::Core::OResource::loadPixmap( "fullscreen", 162 m_fullscreen = new QAction( tr("Full screen"), Opie::Core::OResource::loadPixmap( "fullscreen",
162 Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); 163 Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 );
163 m_fullscreen->addTo( m_console ); 164 m_fullscreen->addTo( m_console );
164 connect( m_fullscreen, SIGNAL( activated() ), 165 connect( m_fullscreen, SIGNAL( activated() ),
165 this, SLOT( slotFullscreen() ) ); 166 this, SLOT( slotFullscreen() ) );
166 167
168 /*
169 * scrollbar
170 */
171 sm_none = m_scrollbar->insertItem(tr( "None" ));
172 sm_left = m_scrollbar->insertItem(tr( "Left" ));
173 sm_right = m_scrollbar->insertItem(tr( "Right" ));
174
175 m_console->insertItem(tr("Scrollbar"), m_scrollbar, -1, 0);
176 connect( m_scrollbar, SIGNAL(activated(int)),
177 this, SLOT(slotScrollbarSelected(int)));
178
167 m_console->insertSeparator(); 179 m_console->insertSeparator();
168 180
169 m_recordLog = new QAction(); 181 m_recordLog = new QAction();
170 m_recordLog->setText( tr("Start log") ); 182 m_recordLog->setText( tr("Start log") );
171 m_recordLog->addTo( m_console ); 183 m_recordLog->addTo( m_console );
172 connect(m_recordLog, SIGNAL(activated() ), 184 connect(m_recordLog, SIGNAL(activated() ),
173 this, SLOT( slotSaveLog() ) ); 185 this, SLOT( slotSaveLog() ) );
174 m_recordingLog = false; 186 m_recordingLog = false;
175 187
176 QAction *a = new QAction(); 188 QAction *a = new QAction();
177 a->setText( tr("Save history") ); 189 a->setText( tr("Save history") );
178 a->addTo( m_console ); 190 a->addTo( m_console );
179 connect(a, SIGNAL(activated() ), 191 connect(a, SIGNAL(activated() ),
180 this, SLOT(slotSaveHistory() ) ); 192 this, SLOT(slotSaveHistory() ) );
181 /* 193 /*
182 * terminate action 194 * terminate action
183 */ 195 */
184 m_terminate = new QAction(); 196 m_terminate = new QAction();
185 m_terminate->setText( tr("Terminate") ); 197 m_terminate->setText( tr("Terminate") );
186 m_terminate->addTo( m_console ); 198 m_terminate->addTo( m_console );
187 connect(m_terminate, SIGNAL(activated() ), 199 connect(m_terminate, SIGNAL(activated() ),
188 this, SLOT(slotTerminate() ) ); 200 this, SLOT(slotTerminate() ) );
189 201
190 m_closewindow = new QAction(); 202 m_closewindow = new QAction();
191 m_closewindow->setText( tr("Close Window") ); 203 m_closewindow->setText( tr("Close Window") );
192 m_closewindow->addTo( m_console ); 204 m_closewindow->addTo( m_console );
193 connect( m_closewindow, SIGNAL(activated() ), 205 connect( m_closewindow, SIGNAL(activated() ),
194 this, SLOT(slotClose() ) ); 206 this, SLOT(slotClose() ) );
195 207
196 208
197 /* 209 /*
198 * script actions 210 * script actions
199 */ 211 */
200 m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0); 212 m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0);
201 connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int))); 213 connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int)));
202 214
203 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); 215 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0);
204 m_recordScript->addTo(m_scripts); 216 m_recordScript->addTo(m_scripts);
205 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); 217 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript()));
206 218
207 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); 219 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0);
208 m_saveScript->addTo(m_scripts); 220 m_saveScript->addTo(m_scripts);
209 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); 221 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript()));
210 222
211 223
212 224
213 225
214 /* 226 /*
@@ -648,96 +660,125 @@ void MainWindow::slotSessionChanged( Session* ses ) {
648 } else { 660 } else {
649 m_isWrapped = false; 661 m_isWrapped = false;
650 } 662 }
651 663
652 m_kb->load(currentSession()->profile()); 664 m_kb->load(currentSession()->profile());
653 } 665 }
654} 666}
655 667
656void MainWindow::slotWrap() 668void MainWindow::slotWrap()
657{ 669{
658 if(m_curSession) 670 if(m_curSession)
659 { 671 {
660 EmulationHandler *e = m_curSession->emulationHandler(); 672 EmulationHandler *e = m_curSession->emulationHandler();
661 if(e) 673 if(e)
662 { 674 {
663 e->setWrap( m_isWrapped ? 80:0 ); 675 e->setWrap( m_isWrapped ? 80:0 );
664 m_isWrapped = !m_isWrapped; 676 m_isWrapped = !m_isWrapped;
665 } 677 }
666 } 678 }
667} 679}
668 680
669void MainWindow::slotFullscreen() { 681void MainWindow::slotFullscreen() {
670 682
671 683
672 684
673 if ( m_isFullscreen ) { 685 if ( m_isFullscreen ) {
674 ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); 686 ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true );
675 ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); 687 ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() );
676 ( m_curSession->emulationHandler() )->cornerButton()->hide(); 688 ( m_curSession->emulationHandler() )->cornerButton()->hide();
677 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 689 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
678 690
679 } else { 691 } else {
680 savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget(); 692 savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget();
681 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); 693 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame );
682 ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop 694 ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop
683 , QPoint(0,0), false ); 695 , QPoint(0,0), false );
684 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); 696 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() );
685 ( m_curSession->widgetStack() )->setFocus(); 697 ( m_curSession->widgetStack() )->setFocus();
686 ( m_curSession->widgetStack() )->show(); 698 ( m_curSession->widgetStack() )->show();
687 699
688 ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); 700 ( ( m_curSession->emulationHandler() )->cornerButton() )->show();
689 701
690 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 702 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
691 } 703 }
692 704
693 m_isFullscreen = !m_isFullscreen; 705 m_isFullscreen = !m_isFullscreen;
694} 706}
695 707
708void MainWindow::slotScrollbarSelected(int index)
709{
710 int loc;
711
712 Config cfg( "Konsole" );
713 cfg.setGroup("ScrollBar");
714 if(index == sm_none)
715 {
716 loc = 0;
717 }
718 else if(index == sm_left)
719 {
720 loc = 1;
721 }
722 else if(index == sm_right)
723 {
724 loc = 2;
725 }
726
727 cfg.writeEntry("Position", loc);
728
729 if (currentSession()) {
730 currentSession()->emulationHandler()->setScrollbarLocation(loc);
731 }
732
733 m_scrollbar->setItemChecked(sm_none, index == sm_none);
734 m_scrollbar->setItemChecked(sm_left, index == sm_left);
735 m_scrollbar->setItemChecked(sm_right, index == sm_right);
736}
696 737
697void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { 738void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) {
698 739
699 if ( m_curSession ) { 740 if ( m_curSession ) {
700 741
701 QEvent::Type state; 742 QEvent::Type state;
702 743
703 if (pressed) state = QEvent::KeyPress; 744 if (pressed) state = QEvent::KeyPress;
704 else state = QEvent::KeyRelease; 745 else state = QEvent::KeyRelease;
705 746
706 QKeyEvent ke(state, k.qcode, k.unicode, 0, QString(QChar(k.unicode))); 747 QKeyEvent ke(state, k.qcode, k.unicode, 0, QString(QChar(k.unicode)));
707 748
708 // is this the best way to do this? cant figure out any other way to work 749 // is this the best way to do this? cant figure out any other way to work
709 QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); 750 QApplication::sendEvent((QObject *)m_curSession->widget(), &ke);
710 ke.ignore(); 751 ke.ignore();
711 } 752 }
712} 753}
713void MainWindow::slotCopy() { 754void MainWindow::slotCopy() {
714 if (!currentSession() ) return; 755 if (!currentSession() ) return;
715 currentSession()->emulationHandler()->copy(); 756 currentSession()->emulationHandler()->copy();
716} 757}
717void MainWindow::slotPaste() { 758void MainWindow::slotPaste() {
718 if (!currentSession() ) return; 759 if (!currentSession() ) return;
719 currentSession()->emulationHandler()->paste(); 760 currentSession()->emulationHandler()->paste();
720} 761}
721 762
722/* 763/*
723 * Save the session 764 * Save the session
724 */ 765 */
725 766
726void MainWindow::slotSaveSession() { 767void MainWindow::slotSaveSession() {
727 if (!currentSession() ) { 768 if (!currentSession() ) {
728 QMessageBox::information(this, tr("Save Connection"), 769 QMessageBox::information(this, tr("Save Connection"),
729 tr("<qt>There is no Connection.</qt>"), 1 ); 770 tr("<qt>There is no Connection.</qt>"), 1 );
730 return; 771 return;
731 } 772 }
732 manager()->add( currentSession()->profile() ); 773 manager()->add( currentSession()->profile() );
733 manager()->save(); 774 manager()->save();
734 populateProfiles(); 775 populateProfiles();
735} 776}
736 777
737 778
738 779
739void MainWindow::slotSaveLog() { 780void MainWindow::slotSaveLog() {
740 781
741 if( currentSession()->emulationHandler()->isLogging() ) { 782 if( currentSession()->emulationHandler()->isLogging() ) {
742 DocLnk nf; 783 DocLnk nf;
743 QString m_logName = currentSession()->emulationHandler()->logFileName(); 784 QString m_logName = currentSession()->emulationHandler()->logFileName();
diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h
index f3c8b81..abdf6ee 100644
--- a/noncore/apps/opie-console/mainwindow.h
+++ b/noncore/apps/opie-console/mainwindow.h
@@ -1,143 +1,152 @@
1#ifndef OPIE_MAIN_WINDOW_H 1#ifndef OPIE_MAIN_WINDOW_H
2#define OPIE_MAIN_WINDOW_H 2#define OPIE_MAIN_WINDOW_H
3 3
4#include <qmainwindow.h> 4#include <qmainwindow.h>
5#include <qlist.h> 5#include <qlist.h>
6#include <qfile.h> 6#include <qfile.h>
7 7
8#include "session.h" 8#include "session.h"
9 9
10/** 10/**
11 * this is the MainWindow of the new opie console 11 * this is the MainWindow of the new opie console
12 * it's also the dispatcher between the different 12 * it's also the dispatcher between the different
13 * actions supported by the gui 13 * actions supported by the gui
14 */ 14 */
15class QToolBar; 15class QToolBar;
16class QToolButton; 16class QToolButton;
17class QMenuBar; 17class QMenuBar;
18class QAction; 18class QAction;
19class MetaFactory; 19class MetaFactory;
20class TabWidget; 20class TabWidget;
21class ProfileManager; 21class ProfileManager;
22class Profile; 22class Profile;
23class FunctionKeyboard; 23class FunctionKeyboard;
24class FKey; 24class FKey;
25class DocLnk; 25class DocLnk;
26 26
27
27class MainWindow : public QMainWindow { 28class MainWindow : public QMainWindow {
28 Q_OBJECT 29 Q_OBJECT
29public: 30public:
30 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); 31 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
31 ~MainWindow(); 32 ~MainWindow();
32 static QString appName() {return QString::fromLatin1("opie-console"); } 33 static QString appName() {return QString::fromLatin1("opie-console"); }
33 34
34 /** 35 /**
35 * our factory to generate IOLayer and so on 36 * our factory to generate IOLayer and so on
36 * 37 *
37 */ 38 */
38 MetaFactory* factory(); 39 MetaFactory* factory();
39 40
40 /** 41 /**
41 * A session contains a QWidget*, 42 * A session contains a QWidget*,
42 * an IOLayer* and some infos for us 43 * an IOLayer* and some infos for us
43 */ 44 */
44 Session* currentSession(); 45 Session* currentSession();
45 46
46 /** 47 /**
47 * the session list 48 * the session list
48 */ 49 */
49 QList<Session> sessions(); 50 QList<Session> sessions();
50 51
51 /** 52 /**
52 * 53 *
53 */ 54 */
54 ProfileManager* manager(); 55 ProfileManager* manager();
55 TabWidget* tabWidget(); 56 TabWidget* tabWidget();
56 57
57private slots: 58private slots:
58 void slotNew(); 59 void slotNew();
59 void slotConnect(); 60 void slotConnect();
60 void slotDisconnect(); 61 void slotDisconnect();
61 void slotTerminate(); 62 void slotTerminate();
62 void slotConfigure(); 63 void slotConfigure();
63 void slotClose(); 64 void slotClose();
64 void slotProfile(int); 65 void slotProfile(int);
65 void slotTransfer(); 66 void slotTransfer();
66 void slotOpenKeb(bool); 67 void slotOpenKeb(bool);
67 void slotOpenButtons(bool); 68 void slotOpenButtons(bool);
68 void slotRecordScript(); 69 void slotRecordScript();
69 void slotSaveScript(); 70 void slotSaveScript();
70 void slotRunScript(int); 71 void slotRunScript(int);
71 void slotFullscreen(); 72 void slotFullscreen();
72 void slotQuickLaunch(); 73 void slotQuickLaunch();
73 void slotWrap(); 74 void slotWrap();
74 void slotSessionChanged( Session* ); 75 void slotSessionChanged( Session* );
75 void slotKeyReceived(FKey, ushort, ushort, bool); 76 void slotKeyReceived(FKey, ushort, ushort, bool);
76 void slotSaveHistory(); 77 void slotSaveHistory();
77 void slotSaveLog(); 78 void slotSaveLog();
79 void slotScrollbarSelected(int);
78 80
79 /* what could these both slot do? */ 81 /* what could these both slot do? */
80 void slotCopy(); 82 void slotCopy();
81 void slotPaste(); 83 void slotPaste();
82 84
83 /* save the currentSession() to Profiles */ 85 /* save the currentSession() to Profiles */
84 void slotSaveSession(); 86 void slotSaveSession();
85 87
86private: 88private:
87 void initUI(); 89 void initUI();
88 void populateProfiles(); 90 void populateProfiles();
89 void populateScripts(); 91 void populateScripts();
90 void create( const Profile& ); 92 void create( const Profile& );
91 /** 93 /**
92 * the current session 94 * the current session
93 */ 95 */
94 Session* m_curSession; 96 Session* m_curSession;
95 97
96 /** 98 /**
97 * the session list 99 * the session list
98 */ 100 */
99 QList<Session> m_sessions; 101 QList<Session> m_sessions;
100 QList<DocLnk> m_scriptsData; 102 QList<DocLnk> m_scriptsData;
101 103
102 /** 104 /**
103 * the metafactory 105 * the metafactory
104 */ 106 */
105 MetaFactory* m_factory; 107 MetaFactory* m_factory;
106 ProfileManager* m_manager; 108 ProfileManager* m_manager;
107 109
110 /*
111 * scrollbar
112 */
113
114 int sm_none, sm_left, sm_right;
115
108 TabWidget* m_consoleWindow; 116 TabWidget* m_consoleWindow;
109 QToolBar* m_tool; 117 QToolBar* m_tool;
110 QToolBar* m_icons; 118 QToolBar* m_icons;
111 QToolBar* m_keyBar; 119 QToolBar* m_keyBar;
112 QToolBar* m_buttonBar; 120 QToolBar* m_buttonBar;
113 QMenuBar* m_bar; 121 QMenuBar* m_bar;
114 QPopupMenu* m_console; 122 QPopupMenu* m_console;
115 QPopupMenu* m_sessionsPop; 123 QPopupMenu* m_sessionsPop;
116 QPopupMenu* m_scriptsPop; 124 QPopupMenu* m_scriptsPop;
117 QPopupMenu* m_scripts; 125 QPopupMenu* m_scripts;
126 QPopupMenu* m_scrollbar;
118 QAction* m_connect; 127 QAction* m_connect;
119 QAction* m_disconnect; 128 QAction* m_disconnect;
120 QAction* m_quickLaunch; 129 QAction* m_quickLaunch;
121 QAction* m_terminate; 130 QAction* m_terminate;
122 QAction* m_transfer; 131 QAction* m_transfer;
123 QAction* m_setProfiles; 132 QAction* m_setProfiles;
124 QAction* m_openKeys; 133 QAction* m_openKeys;
125 QAction* m_openButtons; 134 QAction* m_openButtons;
126 QAction* m_recordScript; 135 QAction* m_recordScript;
127 QAction* m_saveScript; 136 QAction* m_saveScript;
128 QAction* m_fullscreen; 137 QAction* m_fullscreen;
129 QAction* m_wrap; 138 QAction* m_wrap;
130 QAction* m_closewindow; 139 QAction* m_closewindow;
131 QAction* m_recordLog; 140 QAction* m_recordLog;
132 141
133 FunctionKeyboard *m_kb; 142 FunctionKeyboard *m_kb;
134 int m_runScript_id; 143 int m_runScript_id;
135 bool m_isFullscreen; 144 bool m_isFullscreen;
136 bool m_isWrapped; 145 bool m_isWrapped;
137 bool m_recordingLog; 146 bool m_recordingLog;
138 147
139 QWidget* savedParentFullscreen; 148 QWidget* savedParentFullscreen;
140}; 149};
141 150
142 151
143#endif 152#endif