diff libgui/src/dw-main-window.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 262cdd0f7619
children 465ac679e976
line wrap: on
line diff
--- a/libgui/src/dw-main-window.cc	Wed Dec 11 13:00:31 2019 +0000
+++ b/libgui/src/dw-main-window.cc	Fri Dec 13 21:33:28 2019 +0100
@@ -35,6 +35,7 @@
 #include "dw-main-window.h"
 #include "octave-qobject.h"
 #include "shortcut-manager.h"
+#include "gui-preferences-sc.h"
 
 namespace octave
 {
@@ -130,12 +131,12 @@
   {
     shortcut_manager& scmgr = m_octave_qobj.get_shortcut_manager ();
 
-    scmgr.set_shortcut (m_close_action, "editor_file:close");
-    scmgr.set_shortcut (m_close_all_action, "editor_file:close_all");
-    scmgr.set_shortcut (m_close_others_action, "editor_file:close_other");
+    scmgr.set_shortcut (m_close_action, sc_edit_file_close);
+    scmgr.set_shortcut (m_close_all_action, sc_edit_file_close_all);
+    scmgr.set_shortcut (m_close_others_action, sc_edit_file_close_other);
 
-    scmgr.set_shortcut (m_switch_left_action, "editor_tabs:switch_left_tab");
-    scmgr.set_shortcut (m_switch_right_action, "editor_tabs:switch_right_tab");
+    scmgr.set_shortcut (m_switch_left_action, sc_edit_tabs_switch_left_tab);
+    scmgr.set_shortcut (m_switch_right_action, sc_edit_tabs_switch_right_tab);
   }