-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
@@ -1,34 +1,35 @@ 2005-??-?? Opie 1.2.2 New Features ------------ 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 New Features ------------ * OpieStumbler: Scans WiFi networks using the wireless extension scanning (skyhusker) * Opie-Reader: Support for document formats ArriereGo and Reb, add flite output (tim,pohly) * Opie-Networksettings: Add support for wlan-ng devices and improve WEP handling (Dirk Opfer) * Wellenreiter: Remove Joining networks - use OpieStumbler for that (mickeyl) * Opie-Mobilemsg has gone unsupported - it never really worked and there will be a replacement (mickeyl) * Opie-Tabmanager has gone unsupported - it barely works and there is not much of a use of it anyway (mickeyl) * Checkbook: Added configuration option to use smaller font for checkbook transaction tab (hrw) * ZSafe: Made UI conform to Opie standards (drw) * Today Addressbook plugin: Fixed configuration to show/not show birthdays, use checkboxes for selection (hrw) * Opie-Console: Read initial fixed font configuration from qpe.conf (mickeyl) * Opie-PcmciaApplet: Configure insert/resume actions and bind unsupported cards (mickeyl) * SysInfo: Remove CPU tab and add Devices tab instead (mickeyl) * Opie-smb: Added Opie front end for Samba (ljp) * Opie-Bluetooth: Replace obex send implementation and patch libopieobex and the bluetoothapplet (Michael Haynie) * Opieplayer: rudimentary podcast support (ljp) 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 @@ -229,24 +229,27 @@ void EmulationHandler::clearScript() { } void EmulationHandler::clearLog() { if (isLogging()) { delete m_log; m_log = 0; } } void EmulationHandler::runScript(const Script *script) { emit send(script->script()); } void EmulationHandler::copy() { m_teWid->emitSelection(); } void EmulationHandler::paste() { m_teWid->pasteClipboard(); } 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 @@ -62,48 +62,49 @@ public: void startLogging(const QString); /* Return whether we are currently recording a script */ bool isRecording(); /* Return whether we are currently recording a log */ bool isLogging(); QString logFileName(); /* Return the current script (or NULL) */ Script *script(); /* Stop recording and remove the current script from memory */ void clearScript(); /* Stop logging and remove the current log from memory */ void clearLog(); /* Run a script by forwarding its keys to the EmulationLayer */ 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 ); public slots: void recv( const QByteArray& ); void paste(); void copy(); private slots: void recvEmulation( const char*, int len ); private: QFont font( int ); QColor foreColor(int ); QColor backColor(int ); private: TEWidget* m_teWid; TEmulation* m_teEmu; Script * m_script; Logger *m_log; QString m_logFileName; }; 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 @@ -48,48 +48,49 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow( m_sessions.setAutoDelete( TRUE ); m_curSession = 0; m_manager = new ProfileManager( m_factory ); m_manager->load(); m_scriptsData.setAutoDelete(TRUE); initUI(); populateProfiles(); populateScripts(); } void MainWindow::initUI() { setToolBarsMovable( FALSE ); /* tool bar for the menu */ m_tool = new QToolBar( this ); m_tool->setHorizontalStretchable( TRUE ); m_bar = new QMenuBar( m_tool ); 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); /* * the settings action */ m_setProfiles = new QAction(tr("Configure Profiles"), Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0); m_setProfiles->addTo( m_console ); connect( m_setProfiles, SIGNAL(activated() ), this, SLOT(slotConfigure() ) ); m_console->insertSeparator(); /* * new Action for new sessions */ QAction* newCon = new QAction(tr("New Profile"), Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0); newCon->addTo( m_console ); connect( newCon, SIGNAL(activated() ), this, SLOT(slotNew() ) ); @@ -143,48 +144,59 @@ void MainWindow::initUI() { /* * immediate change of line wrap policy */ m_isWrapped = true; m_wrap = new QAction( tr("Line wrap"), Opie::Core::OResource::loadPixmap( "linewrap", Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0, true ); m_wrap->addTo( m_console ); m_wrap->setOn( true ); connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) ); /* * fullscreen */ m_isFullscreen = false; m_fullscreen = new QAction( tr("Full screen"), Opie::Core::OResource::loadPixmap( "fullscreen", Opie::Core::OResource::SmallIcon ), QString::null, 0, this, 0 ); 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") ); m_recordLog->addTo( m_console ); connect(m_recordLog, SIGNAL(activated() ), this, SLOT( slotSaveLog() ) ); m_recordingLog = false; QAction *a = new QAction(); a->setText( tr("Save history") ); a->addTo( m_console ); connect(a, SIGNAL(activated() ), this, SLOT(slotSaveHistory() ) ); /* * terminate action */ m_terminate = new QAction(); m_terminate->setText( tr("Terminate") ); m_terminate->addTo( m_console ); connect(m_terminate, SIGNAL(activated() ), this, SLOT(slotTerminate() ) ); m_closewindow = new QAction(); @@ -672,48 +684,77 @@ void MainWindow::slotFullscreen() { if ( m_isFullscreen ) { ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); ( m_curSession->emulationHandler() )->cornerButton()->hide(); disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); } else { savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget(); ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop , QPoint(0,0), false ); ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); ( m_curSession->widgetStack() )->setFocus(); ( m_curSession->widgetStack() )->show(); ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( 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 ) { QEvent::Type state; if (pressed) state = QEvent::KeyPress; else state = QEvent::KeyRelease; QKeyEvent ke(state, k.qcode, k.unicode, 0, QString(QChar(k.unicode))); // is this the best way to do this? cant figure out any other way to work QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); ke.ignore(); } } void MainWindow::slotCopy() { if (!currentSession() ) return; currentSession()->emulationHandler()->copy(); } void MainWindow::slotPaste() { if (!currentSession() ) return; currentSession()->emulationHandler()->paste(); 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 @@ -3,48 +3,49 @@ #include <qmainwindow.h> #include <qlist.h> #include <qfile.h> #include "session.h" /** * this is the MainWindow of the new opie console * it's also the dispatcher between the different * actions supported by the gui */ class QToolBar; class QToolButton; class QMenuBar; class QAction; class MetaFactory; class TabWidget; class ProfileManager; 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 ); ~MainWindow(); static QString appName() {return QString::fromLatin1("opie-console"); } /** * our factory to generate IOLayer and so on * */ MetaFactory* factory(); /** * A session contains a QWidget*, * an IOLayer* and some infos for us */ Session* currentSession(); /** * the session list */ QList<Session> sessions(); @@ -54,88 +55,96 @@ public: ProfileManager* manager(); TabWidget* tabWidget(); private slots: void slotNew(); void slotConnect(); void slotDisconnect(); void slotTerminate(); void slotConfigure(); void slotClose(); void slotProfile(int); void slotTransfer(); void slotOpenKeb(bool); void slotOpenButtons(bool); void slotRecordScript(); void slotSaveScript(); void slotRunScript(int); void slotFullscreen(); void slotQuickLaunch(); void slotWrap(); 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(); /* save the currentSession() to Profiles */ void slotSaveSession(); private: void initUI(); void populateProfiles(); void populateScripts(); void create( const Profile& ); /** * the current session */ Session* m_curSession; /** * the session list */ QList<Session> m_sessions; QList<DocLnk> m_scriptsData; /** * the metafactory */ 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; QToolBar* m_buttonBar; QMenuBar* m_bar; 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; QAction* m_transfer; QAction* m_setProfiles; QAction* m_openKeys; QAction* m_openButtons; QAction* m_recordScript; QAction* m_saveScript; QAction* m_fullscreen; QAction* m_wrap; QAction* m_closewindow; QAction* m_recordLog; FunctionKeyboard *m_kb; int m_runScript_id; bool m_isFullscreen; bool m_isWrapped; bool m_recordingLog; QWidget* savedParentFullscreen; }; |