-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.h | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 41 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.h | 9 |
5 files changed, 55 insertions, 0 deletions
@@ -7,8 +7,9 @@ Fixed Bugs ---------- * #1695 - Date selector use too small fontsize on VGA screen (hrw) + * #1686 - opie-console lack UI setting for switching scrollbar (hrw) * n.a. - remove hardcoded font size from wellenreiter (hrw) * n.a. - added patch to build QT/E 2.3.10 with gc 4.x.x (hrw) 2005-09-11 Opie 1.2.1 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 @@ -249,4 +249,7 @@ void EmulationHandler::paste() { void EmulationHandler::setWrap(int columns) { m_teWid->setWrapAt(columns); } +void EmulationHandler::setScrollbarLocation(int index) { + m_teWid->setScrollbarLocation(index); +} 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 @@ -82,8 +82,9 @@ public: void runScript(const Script *); /* Propagate change to widget */ void setWrap(int columns); + void setScrollbarLocation(int index); signals: void send( const QByteArray& ); void changeSize(int rows, int cols ); 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 @@ -68,8 +68,9 @@ void MainWindow::initUI() { m_console = new QPopupMenu( this ); m_scripts = new QPopupMenu( this ); m_sessionsPop= new QPopupMenu( this ); m_scriptsPop = new QPopupMenu( this ); + m_scrollbar = new QPopupMenu( this ); /* add a toolbar for icons */ m_icons = new QToolBar(this); @@ -163,8 +164,19 @@ void MainWindow::initUI() { m_fullscreen->addTo( m_console ); connect( m_fullscreen, SIGNAL( activated() ), this, SLOT( slotFullscreen() ) ); + /* + * scrollbar + */ + sm_none = m_scrollbar->insertItem(tr( "None" )); + sm_left = m_scrollbar->insertItem(tr( "Left" )); + sm_right = m_scrollbar->insertItem(tr( "Right" )); + + m_console->insertItem(tr("Scrollbar"), m_scrollbar, -1, 0); + connect( m_scrollbar, SIGNAL(activated(int)), + this, SLOT(slotScrollbarSelected(int))); + m_console->insertSeparator(); m_recordLog = new QAction(); m_recordLog->setText( tr("Start log") ); @@ -692,8 +704,37 @@ void MainWindow::slotFullscreen() { m_isFullscreen = !m_isFullscreen; } +void MainWindow::slotScrollbarSelected(int index) +{ + int loc; + + Config cfg( "Konsole" ); + cfg.setGroup("ScrollBar"); + if(index == sm_none) + { + loc = 0; + } + else if(index == sm_left) + { + loc = 1; + } + else if(index == sm_right) + { + loc = 2; + } + + cfg.writeEntry("Position", loc); + + if (currentSession()) { + currentSession()->emulationHandler()->setScrollbarLocation(loc); + } + + m_scrollbar->setItemChecked(sm_none, index == sm_none); + m_scrollbar->setItemChecked(sm_left, index == sm_left); + m_scrollbar->setItemChecked(sm_right, index == sm_right); +} void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { if ( m_curSession ) { 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 @@ -23,8 +23,9 @@ class Profile; class FunctionKeyboard; class FKey; class DocLnk; + class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); @@ -74,8 +75,9 @@ private slots: void slotSessionChanged( Session* ); void slotKeyReceived(FKey, ushort, ushort, bool); void slotSaveHistory(); void slotSaveLog(); + void slotScrollbarSelected(int); /* what could these both slot do? */ void slotCopy(); void slotPaste(); @@ -104,8 +106,14 @@ private: */ MetaFactory* m_factory; ProfileManager* m_manager; + /* + * scrollbar + */ + + int sm_none, sm_left, sm_right; + TabWidget* m_consoleWindow; QToolBar* m_tool; QToolBar* m_icons; QToolBar* m_keyBar; @@ -114,8 +122,9 @@ private: QPopupMenu* m_console; QPopupMenu* m_sessionsPop; QPopupMenu* m_scriptsPop; QPopupMenu* m_scripts; + QPopupMenu* m_scrollbar; QAction* m_connect; QAction* m_disconnect; QAction* m_quickLaunch; QAction* m_terminate; |