comparison libgui/src/octave-dock-widget.cc @ 31692:2422fb7f1e6c

move shortcut setting functions to gui_settings from shortcut_manager * gui-settings.h, gui-settings.cc (gui_settings::set_shortcut, gui_settings::shortcut): Move here from shortcut-manager.h and shortcut-manager.cc. * documentation-bookmarks.cc, documentation.cc, dw-main-window.cc, file-editor.cc, octave-qscintilla.cc, main-window.cc, octave-dock-widget.cc, variable-editor.cc: Change all uses of set_shortcut and shortcut. Only include shortcut-manager.h where necessary.
author John W. Eaton <jwe@octave.org>
date Sun, 25 Dec 2022 12:46:53 -0500
parents deb553ac2c54
children 88119be1f926
comparison
equal deleted inserted replaced
31691:fc3bc1402b0d 31692:2422fb7f1e6c
217 connect (this, &octave_dock_widget::queue_make_window, 217 connect (this, &octave_dock_widget::queue_make_window,
218 this, &octave_dock_widget::make_window, Qt::QueuedConnection); 218 this, &octave_dock_widget::make_window, Qt::QueuedConnection);
219 connect (this, &octave_dock_widget::queue_make_widget, 219 connect (this, &octave_dock_widget::queue_make_widget,
220 this, [=] () { make_widget (); }, Qt::QueuedConnection); 220 this, [=] () { make_widget (); }, Qt::QueuedConnection);
221 221
222 shortcut_manager& scmgr = m_octave_qobj.get_shortcut_manager (); 222 gui_settings settings;
223 scmgr.set_shortcut (m_dock_action, sc_dock_widget_dock); 223
224 settings.set_shortcut (m_dock_action, sc_dock_widget_dock);
224 m_dock_action->setShortcutContext (Qt::WidgetWithChildrenShortcut); 225 m_dock_action->setShortcutContext (Qt::WidgetWithChildrenShortcut);
225 addAction (m_dock_action); 226 addAction (m_dock_action);
226 connect (m_dock_action, &QAction::triggered, 227 connect (m_dock_action, &QAction::triggered,
227 this, &octave_dock_widget::make_window); 228 this, &octave_dock_widget::make_window);
228 229
229 scmgr.set_shortcut (m_close_action, sc_dock_widget_close); 230 settings.set_shortcut (m_close_action, sc_dock_widget_close);
230 m_close_action->setShortcutContext (Qt::WidgetWithChildrenShortcut); 231 m_close_action->setShortcutContext (Qt::WidgetWithChildrenShortcut);
231 addAction (m_close_action); 232 addAction (m_close_action);
232 connect (m_close_action, &QAction::triggered, 233 connect (m_close_action, &QAction::triggered,
233 this, &octave_dock_widget::change_visibility); 234 this, &octave_dock_widget::change_visibility);
234 235