Mercurial > octave-libgccjit
comparison libgui/src/main-window.h @ 18611:086093fbdc1a gui-release
first implementation of a shortcut manager (bug #41217)
* file-editor.cc (set_shortcuts): use shortcut-manager to set some shortcuts
* main_window.cc (set_global_shortcuts): use shortcut-manager to set some
shortcuts;
(construct_file_menu): all actions as class variables;
(construct_edit_menu): all actions as class variables;
* main_window.h: actions as class variables
* module.mk: new files shortcut_manager.cc, shortcut_manager.h
* octave-gui.cc (octave_start_gui): initialize the shortcut_manager
* settings-dialog.cc (constructor): call shortcut-manager for shortcut table
(write_changed_settings): call shortcut-manager for writing shortcuts
* settings-dialog.ui: new tab with a tree widget for the shortcuts
* shortcut_manager.cc (constructor, destructor): new class;
(instance_ok): checks if instance is valid, creates a new one otherwise;
(do_init_data): initialize the list with all shortcut's data;
(init): internal function for initializing the data list;
(do_fill_treewidget): fills the tree widget in the settings dialog;
(do_write_shortcuts): writes shortcuts from settings dialog into file;
(do_set_shortcut): setting the shortcut for an action;
(handle_double_clicked): slot for double clicking into the tree widget;
(shortcut_dialog): dialog for entering a new shortcut;
(shortcut_dialog_finished): processing the dialog's result;
(shortcut_dialog_set_default): setting the shortcut to it's default;
(enter_shortcut::enter_shortcut): new class derived from QLineEdit;
(enter_shortcut::handle_direct_shortcut): switch between normal editing and
directly entering a shortcut;
(enter_shortcut::keyPressEvent): event handler filtering the shortcuts;
* shortcut_manager.h (init_data): static function calling do_init_data;
(write_shortcuts): static function calling do_write_shortcuts;
(fill_treewidget): static function calling do_fill_treewidget;
(set_shortcut): static function calling do_set_shortcut;
author | Torsten <ttl@justmail.de> |
---|---|
date | Tue, 01 Apr 2014 21:29:48 +0200 |
parents | 2d5d0d86432e |
children | 7cb98e81ecd1 |
comparison
equal
deleted
inserted
replaced
18610:6e81b59d657c | 18611:086093fbdc1a |
---|---|
313 QAction *_debug_quit; | 313 QAction *_debug_quit; |
314 | 314 |
315 QAction *_new_script_action; | 315 QAction *_new_script_action; |
316 QAction *_new_function_action; | 316 QAction *_new_function_action; |
317 QAction *_open_action; | 317 QAction *_open_action; |
318 QAction *_new_figure_action; | |
319 QAction *_load_workspace_action; | |
320 QAction *_save_workspace_action; | |
321 QAction *_preferences_action; | |
322 QAction *_exit_action; | |
318 | 323 |
319 QAction *_copy_action; | 324 QAction *_copy_action; |
320 QAction *_paste_action; | 325 QAction *_paste_action; |
321 QAction *_clear_clipboard_action; | 326 QAction *_clear_clipboard_action; |
322 QAction *_undo_action; | 327 QAction *_undo_action; |
323 | 328 QAction *_clear_command_window_action; |
329 QAction *_clear_command_history_action; | |
330 QAction *_clear_workspace_action; | |
324 QAction *_find_files_action; | 331 QAction *_find_files_action; |
325 QAction *_exit_action; | 332 QAction *_select_all_action; |
326 | 333 |
327 // Toolbars. | 334 // Toolbars. |
328 QComboBox *_current_directory_combo_box; | 335 QComboBox *_current_directory_combo_box; |
329 static const int current_directory_width = 300; | 336 static const int current_directory_width = 300; |
330 static const int current_directory_max_visible = 16; | 337 static const int current_directory_max_visible = 16; |