Mercurial > octave-nkf
diff gui/src/main-window.cc @ 14998:de3a318128f2 gui
Added support for changing the terminal cursor and the cursor blinking.
* main-window.cc: Added code to react on cursor settings changes.
* settings-dialog.cc: Added code to handle new GUI settings elements.
* settings-dialog.ui: Added combo box and checkbox for cursor settings.
author | Jacob Dawid <jacob.dawid@gmail.com> |
---|---|
date | Sat, 21 Jul 2012 01:39:03 -0400 |
parents | c2afeeb35f4d |
children | 7c14e3e6fc6b |
line wrap: on
line diff
--- a/gui/src/main-window.cc Fri Jul 20 16:45:10 2012 -0400 +++ b/gui/src/main-window.cc Sat Jul 21 01:39:03 2012 -0400 @@ -160,8 +160,6 @@ settingsDialog->exec (); delete settingsDialog; emit settings_changed (); - resource_manager::instance ()->update_network_settings (); - notice_settings(); } void @@ -169,10 +167,22 @@ { // Set terminal font: QSettings *settings = resource_manager::instance ()->get_settings (); + QFont font = QFont(); font.setFamily(settings->value("terminal/fontName").toString()); font.setPointSize(settings->value("terminal/fontSize").toInt ()); _terminal->setTerminalFont(font); + + QString cursorType = settings->value ("terminal/cursorType").toString (); + bool cursorBlinking = settings->value ("terminal/cursorBlinking").toBool (); + if (cursorType == "ibeam") + _terminal->setCursorType(QTerminalInterface::IBeamCursor, cursorBlinking); + else if (cursorType == "block") + _terminal->setCursorType(QTerminalInterface::BlockCursor, cursorBlinking); + else if (cursorType == "underline") + _terminal->setCursorType(QTerminalInterface::UnderlineCursor, cursorBlinking); + + resource_manager::instance ()->update_network_settings (); } void