diff libgui/src/settings-dialog.cc @ 18302:e8176099889c gui-release

settings dialog with varaible size (bug #41197) * settings-dialog.ui: add a scroll area to each tab and make the widget resizable by the user * settings-dialog.cc (constructor): restore geoemtry read from the settings; (write_changed_settings): save geoemtry into settings file; (write_lexer_settings): add a sync after writing to the settings file
author Torsten <ttl@justmail.de>
date Sat, 18 Jan 2014 09:25:33 +0100
parents 01646e48a650
children 024940bd5b77
line wrap: on
line diff
--- a/libgui/src/settings-dialog.cc	Fri Jan 17 19:51:22 2014 -0500
+++ b/libgui/src/settings-dialog.cc	Sat Jan 18 09:25:33 2014 +0100
@@ -57,7 +57,9 @@
   ui->setupUi (this);
 
   QSettings *settings = resource_manager::get_settings ();
-  // FIXME: what should happen if settings is 0?
+
+  // restore last geometry
+  restoreGeometry (settings->value("settings/geometry").toByteArray ());
 
   // look for available language files and the actual settings
   QString qm_dir_name = resource_manager::get_gui_translation_dir ();
@@ -622,6 +624,8 @@
   write_terminal_colors (settings);
 
   settings->setValue ("settings/last_tab",ui->tabWidget->currentIndex ());
+  settings->setValue ("settings/geometry",saveGeometry ());
+  settings->sync ();
 }
 
 #ifdef HAVE_QSCINTILLA
@@ -705,6 +709,7 @@
 
   settings->setValue (
     "settings/last_editor_styles_tab",ui->tabs_editor_lexers->currentIndex ());
+  settings->sync ();
 }
 #endif