Mercurial > hg > octave-shane
changeset 16623:9c0487bb205b
save and restore last used tabs of the settings dialog
* settings-dialog.cc(constructor): restore last used tab from settings
(read_lexer_settings): restore last used lexer tab from settings
(write_changed_settings): save last used tab
(write_lexer_settings): save last used lexer tab
author | Torsten <ttl@justmail.de> |
---|---|
date | Mon, 06 May 2013 22:23:53 +0200 |
parents | 38fef1e833ea |
children | 96d02808a881 |
files | libgui/src/settings-dialog.cc |
diffstat | 1 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/settings-dialog.cc +++ b/libgui/src/settings-dialog.cc @@ -154,7 +154,9 @@ lexer = new QsciLexerBash (); read_lexer_settings (lexer,settings); delete lexer; -#endif +#endif + + ui->tabWidget->setCurrentIndex (settings->value("settings/last_tab",0).toInt ()); } settings_dialog::~settings_dialog () @@ -248,6 +250,9 @@ scroll_area_contents->setLayout (style_grid); scroll_area->setWidget (scroll_area_contents); ui->tabs_editor_styles->addTab (scroll_area,lexer->language ()); + + ui->tabs_editor_styles->setCurrentIndex ( + settings->value("settings/last_editor_styles_tab",0).toInt ()); } #endif @@ -410,6 +415,8 @@ write_workspace_colors (settings); write_terminal_colors (settings); + + settings->setValue("settings/last_tab",ui->tabWidget->currentIndex ()); } #ifdef HAVE_QSCINTILLA @@ -468,6 +475,9 @@ lexer->setColor (color->color (),styles[i]); } lexer->writeSettings (*settings); + + settings->setValue ( + "settings/last_editor_styles_tab",ui->tabs_editor_styles->currentIndex ()); } #endif