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,26 +1,27 @@
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)
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
@@ -237,16 +237,19 @@ void EmulationHandler::clearLog() {
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
@@ -70,32 +70,33 @@ public:
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 );
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
@@ -56,32 +56,33 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(
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 /*
@@ -151,32 +152,43 @@ void MainWindow::initUI() {
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
@@ -680,32 +692,61 @@ void MainWindow::slotFullscreen() {
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 }
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
@@ -11,32 +11,33 @@
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
@@ -62,72 +63,80 @@ private slots:
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;