-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 |
4 files changed, 54 insertions, 0 deletions
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 | |||
@@ -251,2 +251,5 @@ void EmulationHandler::setWrap(int columns) { | |||
251 | } | 251 | } |
252 | 252 | ||
253 | void 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 | |||
@@ -84,4 +84,5 @@ public: | |||
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); | ||
86 | signals: | 87 | signals: |
87 | void send( const QByteArray& ); | 88 | void send( const QByteArray& ); |
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 | |||
@@ -70,4 +70,5 @@ void MainWindow::initUI() { | |||
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 */ |
@@ -165,4 +166,15 @@ void MainWindow::initUI() { | |||
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 | ||
@@ -694,4 +706,33 @@ void MainWindow::slotFullscreen() { | |||
694 | } | 706 | } |
695 | 707 | ||
708 | void 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 | ||
697 | void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { | 738 | void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { |
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 | |||
@@ -25,4 +25,5 @@ class FKey; | |||
25 | class DocLnk; | 25 | class DocLnk; |
26 | 26 | ||
27 | |||
27 | class MainWindow : public QMainWindow { | 28 | class MainWindow : public QMainWindow { |
28 | Q_OBJECT | 29 | Q_OBJECT |
@@ -76,4 +77,5 @@ private slots: | |||
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? */ |
@@ -106,4 +108,10 @@ private: | |||
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; |
@@ -116,4 +124,5 @@ private: | |||
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; |