diff libgui/src/settings-dialog.cc @ 27818:fa0582694fda

replace literal strings by symbolic constants for shortcut preferences * QTerminal.cc (doc_on_expression): sc_value already returns a string now * documentation.cc (notice_settings): replace literal key names by symb. constants of complete pref structure * dw-main-window.cc (notice_settings): replace literal key names by symb. constants of complete pref structure * gui-preferences-sc.h: add constant sc_pref stuctures for all shortcuts * gui-preferences.h: define a string constant for the shortcut setting group * gui-settings.cc (sc_value): use new method sc_def_value for getting the default value, already returning the shortcut as string (sc_def_value): new method for reading the default value from the shortcuts preferences structure * gui-settings.h: new method sc_def_value, sc_value returns a string * file-editor.cc (handle_enter_debug_mode, handle_exit_debug_mode, set_shortcuts): replace literal key names by symb. constants of complete pref structure * main-window.cc (notice_settings): replace literals by symbolic constant (configure_shortcuts): replace literal key names by symb. constants of complete pref structure * settings-dialog.cc (settings_dialog, write_changed_settings): replace literals by symbolic constants * shortcut-manager.cc (init_data): move all constants into gui-preferences-sc.h, update calls to init (), which now takes complete sc_pref structure as second argument; (write_shortcuts, fill_treewidget, import_shortcuts): replace literals by symbolic constants; (init): only two arguments, second argument gets complete pref structure; (set_shortcut, shortcut): takes complete shortcut structure as second argument instead of key name * shortcut-manager.h: init, set_shortcut, shortcut with new argument types
author Torsten Lilge <ttl-octave@mailbox.org>
date Fri, 13 Dec 2019 21:33:28 +0100
parents dccc551aa83b
children 28d7ec92bae6
line wrap: on
line diff
--- a/libgui/src/settings-dialog.cc	Wed Dec 11 13:00:31 2019 +0000
+++ b/libgui/src/settings-dialog.cc	Fri Dec 13 21:33:28 2019 +0100
@@ -444,7 +444,9 @@
 
     shortcut_manager& scmgr = m_octave_qobj.get_shortcut_manager ();
 
-    cb_prevent_readline_conflicts->setChecked (settings->value ("shortcuts/prevent_readline_conflicts", true).toBool ());
+    cb_prevent_readline_conflicts->setChecked (
+          settings->value (sc_prevent_rl_conflicts.key,
+                           sc_prevent_rl_conflicts.def).toBool ());
 
     // initialize the tree view with all shortcut data
     scmgr.fill_treewidget (shortcuts_treewidget);
@@ -1030,7 +1032,7 @@
 
     // shortcuts
 
-    settings->setValue ("shortcuts/prevent_readline_conflicts", cb_prevent_readline_conflicts->isChecked ());
+    settings->setValue (sc_prevent_rl_conflicts.key, cb_prevent_readline_conflicts->isChecked ());
     shortcut_manager& scmgr = m_octave_qobj.get_shortcut_manager ();
     scmgr.write_shortcuts (settings, closing);