Mercurial > octave
comparison libgui/src/terminal-dock-widget.h @ 31696:8fed04d0607c
eliminate shortcut_manager class and revamp shortcut handling
* settings-dialog.ui: Use a custom type for the
* shortcuts-tree-widget.h, shortcuts-tree-widget.cc: New files.
(shortcuts_tree_widget): New class to use for editing and displaying
shortcuts in the settings dialog. Adapt constructor from
shortcut_manager::fill_treewidget function.
(enter_shortcut): Move here from shortcut-manager.h and
shortcut-manager.cc.
(tree_widget_shortcut_item): New class to use for items in the
shortcuts_tree_widget class in place of QTreeWidgetItem.
(shortcut_edit_dialog): New class to use for shortcut editing dialog
in place of a simple QDialog. Allows for capturing edited values in
the dialog object.
* gui-preferences-sc.h, gui-preferences-sc.cc (sc_group):
Drop trailing "/" from definition and move here from
gui-preferences.h. Update code that prepends sc_group to a settings key.
(get_shortcut_section): New function.
* gui-preferences.h, gui-preferences.cc
(sc_pref::def_value, sc_pref::def_text): New functions.
(all_shortcut_preferences::value, all_shortcut_preferences::keys): New
static funtions.
(all_shortcut_preferences::do_value,
all_shortcut_preferences::do_keys): New helper functions.
* gui-settings.cc (gui_settings::sc_def_value):
Simply call sc_pref::def_value.
* settings-dialog.h, settings-dialog.cc (class settings_dialog):
Eliminate use of base_qobject and shortcut_manager.
(settings_dialog::import_shortcut_set): Get file name here. Call
shortcuts_tree_widget::import_shortcuts instead of
shortcut_manager::import_export.
(settings_dialog::export_shortcut_set): Get file name here. Call
shortcuts_tree_widget::export_shortcuts instead of
shortcut_manager::import_export.
(settings_dialog::default_shortcut_set): Check whether to overwrite
shortcuts here. Call shortcuts_tree_widget::set_default_shortcuts
instead of shortcut_manager::import_export.
(settings_dialog::write_changed_settings): Eliminate CLOSING
argument. Call shortcuts_tree_widget::write_settings instead of
shortcut_manager::write_shortcuts.
(settings_dialog::get_shortcuts_file_name): New function to prompt
user for file name.
(settings_dialog::overwrite_all_shortcuts): New function to ask user
whether replacing shortcuts is OK.
(import_export_action): Move enum decl here from shortcut-manager.h.
* main-window.cc (main_window::process_settings_dialog_request):
Eliminate m_octave_qobj in call to settings_dialog ctor.
(main_window::main_window): Don't call shortcut_manager::init_data.
* terminal-dock-widget.h, terminal-dock-widget.cc
(terminal_dock_widget::init_control_d_shortcut_behavior): New function.
(terminal_dock_widget::terminal_dock_widget): Use it instead of
performing same action in shortcut_manager::init.
* octave-qobject.h, octave-qobject.cc
(base_qobject::m_shortcut_manager): Delete data member.
(base_qobject::get_shortcut_manager): Delete.
(base_qobject::base_qobject): Don't call shortcut_manager::init_data.
* shortcut-manager.h, shortcut-manager.cc: Delete. Eliminates the now
unnecessary shortcut_manager class.
* libgui/src/module.mk: Update.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 26 Dec 2022 17:29:59 -0500 |
parents | deb553ac2c54 |
children | dd904ce6f53f |
comparison
equal
deleted
inserted
replaced
31695:5749674b826e | 31696:8fed04d0607c |
---|---|
49 | 49 |
50 bool has_focus (void) const; | 50 bool has_focus (void) const; |
51 | 51 |
52 void init_command_prompt (); | 52 void init_command_prompt (); |
53 | 53 |
54 void init_control_d_shortcut_behavior (); | |
55 | |
54 // FIXME: The next two functions could be eliminated (or combined) | 56 // FIXME: The next two functions could be eliminated (or combined) |
55 // if we had a common interface for the old and new terminal | 57 // if we had a common interface for the old and new terminal |
56 // widgets. | 58 // widgets. |
57 | 59 |
58 // Only valid if using the old terminal widget. | 60 // Only valid if using the old terminal widget. |