GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
shortcut-manager.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2014-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include <QAction>
31 #include <QApplication>
32 #include <QCheckBox>
33 #include <QDebug>
34 #include <QDialogButtonBox>
35 #include <QFileDialog>
36 #include <QGridLayout>
37 #include <QHeaderView>
38 #include <QKeySequence>
39 #include <QLineEdit>
40 #include <QMessageBox>
41 #include <QPushButton>
42 #include <QVBoxLayout>
43 #include <QtCore>
44 
45 #include "octave-qobject.h"
46 #include "shortcut-manager.h"
47 #include "gui-preferences-global.h"
48 #include "gui-preferences-sc.h"
49 #include "error.h"
50 
52 
53 // enter_shortcut:
54 // class derived from QLineEdit for directly entering key sequences which
55 
57 {
58  m_direct_shortcut = true; // the shortcut is directly entered
59  m_shift_modifier = false; // the shift modifier is not added
60 }
61 
62 // new keyPressEvent
63 void enter_shortcut::keyPressEvent (QKeyEvent *e)
64 {
65  if (! m_direct_shortcut)
66  {
67  QLineEdit::keyPressEvent (e);
68  return;
69  }
70 
71  if (e->type () == QEvent::KeyPress)
72  {
73  int key = e->key ();
74 
75  if (key == Qt::Key_unknown || key == 0)
76  return;
77 
78  Qt::KeyboardModifiers modifiers = QGuiApplication::keyboardModifiers (); //e->modifiers ();
79 
80  if (m_shift_modifier || (modifiers & Qt::ShiftModifier))
81  key += Qt::SHIFT;
82  if (modifiers & Qt::ControlModifier)
83  key += Qt::CTRL;
84  if (modifiers & Qt::AltModifier)
85  key += Qt::ALT;
86  if (modifiers & Qt::MetaModifier)
87  key += Qt::META;
88 
89  setText (QKeySequence (key).toString ());
90  }
91 }
92 
93 // slot for checkbox whether the shortcut is directly entered or not
95 {
96  if (state)
97  m_direct_shortcut = true; // the shortcut is directly entered
98  else
99  m_direct_shortcut = false; // the shortcut has to be written as text
100 }
101 
102 // slot for checkbox whether the shift modifier should be added
104 {
105  if (state)
106  m_shift_modifier = true; // the shortcut is directly entered
107  else
108  m_shift_modifier = false; // the shortcut has to be written as text
109 }
110 
112  : m_octave_qobj (oct_qobj)
113 {
114  setObjectName ("Shortcut_Manager");
115 
116  // Mac: don't let Qt interpret CMD key ("Meta" in Qt terminology) as Ctrl
117 #if defined (Q_OS_MAC)
118  QCoreApplication::setAttribute (Qt::AA_MacDontSwapCtrlAndMeta, true);
119 #endif
120 }
121 
123 {
126 
127  settings->setValue (sc_main_ctrld.key, false); // reset use fo ctrl-d
128 
129  // actions not related to specific menus or widgets
130 
131  // dock widgets
132  init (tr ("Undock/Dock Widget"), sc_dock_widget_dock);
133  init (tr ("Close Widget"), sc_dock_widget_close);
134 
135  // actions of the main window
136 
137  // file
138  init (tr ("New File"), sc_main_file_new_file);
139  init (tr ("New Function"), sc_main_file_new_function);
140  init (tr ("New Figure"), sc_main_file_new_figure);
141  init (tr ("Open File"), sc_main_file_open_file);
142  init (tr ("Load Workspace"), sc_main_file_load_workspace);
143  init (tr ("Save Workspace As"), sc_main_file_save_workspace);
144  init (tr ("Exit Octave"), sc_main_file_exit);
145 
146  // edit
147  init (tr ("Copy"), sc_main_edit_copy);
148  init (tr ("Paste"), sc_main_edit_paste);
149  init (tr ("Undo"), sc_main_edit_undo);
150  init (tr ("Select All"), sc_main_edit_select_all);
151  init (tr ("Clear Clipboard"), sc_main_edit_clear_clipboard);
152  init (tr ("Find in Files"), sc_main_edit_find_in_files);
153  init (tr ("Clear Command Window"), sc_main_edit_clear_command_window);
154  init (tr ("Clear Command History"), sc_main_edit_clear_history);
155  init (tr ("Clear Workspace"), sc_main_edit_clear_workspace);
156  init (tr ("Set Path"), sc_main_edit_set_path);
157  init (tr ("Preferences"), sc_main_edit_preferences);
158 
159  // debug
160  init (tr ("Step"), sc_main_debug_step_over);
161  init (tr ("Step Into"), sc_main_debug_step_into);
162  init (tr ("Step Out"), sc_main_debug_step_out);
163  init (tr ("Continue"), sc_main_debug_continue);
164  init (tr ("Quit Debug Mode"), sc_main_debug_quit);
165 
166  // tools
167  init (tr ("Start/Stop Profiler Session"), sc_main_tools_start_profiler);
168  init (tr ("Resume Profiler Session"), sc_main_tools_resume_profiler);
169  init (tr ("Show Profile Data"), sc_main_tools_show_profiler);
170 
171  // window
172  init (tr ("Show Command Window"), sc_main_window_show_command);
173  init (tr ("Show Command History"), sc_main_window_show_history);
174  init (tr ("Show File Browser"), sc_main_window_show_file_browser);
175  init (tr ("Show Workspace"), sc_main_window_show_workspace);
176  init (tr ("Show Editor"), sc_main_window_show_editor);
177  init (tr ("Show Documentation"), sc_main_window_show_doc);
178  init (tr ("Show Variable Editor"), sc_main_window_show_variable_editor);
179  init (tr ("Command Window"), sc_main_window_command);
180  init (tr ("Command History"), sc_main_window_history);
181  init (tr ("File Browser"), sc_main_window_file_browser);
182  init (tr ("Workspace"), sc_main_window_workspace);
183  init (tr ("Editor"), sc_main_window_editor);
184  init (tr ("Documentation"), sc_main_window_doc);
185  init (tr ("Variable Editor"), sc_main_window_variable_editor);
186  init (tr ("Previous Widget"), sc_main_window_previous_dock);
187  init (tr ("Reset Default Window Layout"), sc_main_window_reset);
188 
189  // help
190  init (tr ("Show On-disk Documentation"), sc_main_help_ondisk_doc);
191  init (tr ("Show Online Documentation"), sc_main_help_online_doc);
192  init (tr ("Report Bug"), sc_main_help_report_bug);
193  init (tr ("Octave Packages"), sc_main_help_packages);
194  init (tr ("Contribute to Octave"), sc_main_help_contribute);
195  init (tr ("Octave Developer Resources"), sc_main_help_developer);
196  init (tr ("About Octave"), sc_main_help_about);
197 
198  // news
199  init (tr ("Release Notes"), sc_main_news_release_notes);
200  init (tr ("Community News"), sc_main_news_community_news);
201 
202  // Tab handling
203  // The following shortcuts are moved into a separate tab. The key names
204  // are not changed, to preserve compatibility with older versions.
205  init (tr ("Close Tab"), sc_edit_file_close);
206  init (tr ("Close All Tabs"), sc_edit_file_close_all);
207  init (tr ("Close Other Tabs"), sc_edit_file_close_other);
208  init (tr ("Switch to Left Tab"), sc_edit_tabs_switch_left_tab);
209  init (tr ("Switch to Right Tab"), sc_edit_tabs_switch_right_tab);
210  init (tr ("Move Tab Left"), sc_edit_tabs_move_tab_left);
211  init (tr ("Move Tab Right"), sc_edit_tabs_move_tab_right);
212 
213  // Zooming
214  init (tr ("Zoom In"), sc_edit_view_zoom_in);
215  init (tr ("Zoom Out"), sc_edit_view_zoom_out);
216 #if defined (Q_OS_MAC)
217  init (tr ("Zoom Normal"), sc_edit_view_zoom_normal);
218 #else
219  init (tr ("Zoom Normal"), sc_edit_view_zoom_normal);
220 #endif
221 
222  // actions of the editor
223 
224  // file
225  init (tr ("Edit Function"), sc_edit_file_edit_function);
226  init (tr ("Save File"), sc_edit_file_save);
227  init (tr ("Save File As"), sc_edit_file_save_as);
228  init (tr ("Print"), sc_edit_file_print);
229 
230  // edit
231  init (tr ("Redo"), sc_edit_edit_redo);
232  init (tr ("Cut"), sc_edit_edit_cut);
233  init (tr ("Find and Replace"), sc_edit_edit_find_replace);
234  init (tr ("Find Next"), sc_edit_edit_find_next);
235  init (tr ("Find Previous"), sc_edit_edit_find_previous);
236  init (tr ("Delete to Start of Word"), sc_edit_edit_delete_start_word);
237  init (tr ("Delete to End of Word"), sc_edit_edit_delete_end_word);
238  init (tr ("Delete to Start of Line"), sc_edit_edit_delete_start_line);
239  init (tr ("Delete to End of Line"), sc_edit_edit_delete_end_line);
240  init (tr ("Delete Line"), sc_edit_edit_delete_line);
241  init (tr ("Copy Line"), sc_edit_edit_copy_line);
242  init (tr ("Cut Line"), sc_edit_edit_cut_line);
243  init (tr ("Duplicate Selection/Line"), sc_edit_edit_duplicate_selection);
244  init (tr ("Transpose Line"), sc_edit_edit_transpose_line);
245  init (tr ("Show Completion List"), sc_edit_edit_completion_list);
246 
247  init (tr ("Comment Selection"), sc_edit_edit_comment_selection);
248  init (tr ("Uncomment Selection"), sc_edit_edit_uncomment_selection);
249  init (tr ("Comment Selection (Choosing String)"), sc_edit_edit_comment_var_selection);
250  init (tr ("Uppercase Selection"), sc_edit_edit_upper_case);
251  init (tr ("Lowercase Selection"), sc_edit_edit_lower_case);
252 
253 #if defined (Q_OS_MAC)
254  init (tr ("Indent Selection Rigidly"), sc_edit_edit_indent_selection);
255  init (tr ("Unindent Selection Rigidly"), sc_edit_edit_unindent_selection);
256 #else
257  init (tr ("Indent Selection Rigidly"), sc_edit_edit_indent_selection);
258  init (tr ("Unindent Selection Rigidly"), sc_edit_edit_unindent_selection);
259 #endif
261 
262  init (tr ("Convert Line Endings to Windows"), sc_edit_edit_conv_eol_winows);
263  init (tr ("Convert Line Endings to Unix"), sc_edit_edit_conv_eol_unix);
264  init (tr ("Convert Line Endings to Mac"), sc_edit_edit_conv_eol_mac);
265 
266  init (tr ("Goto Line"), sc_edit_edit_goto_line);
267  init (tr ("Move to Matching Brace"), sc_edit_edit_move_to_brace);
268  init (tr ("Select to Matching Brace"), sc_edit_edit_select_to_brace);
269  init (tr ("Toggle Bookmark"), sc_edit_edit_toggle_bookmark);
270  init (tr ("Next Bookmark"), sc_edit_edit_next_bookmark);
271  init (tr ("Previous Bookmark"), sc_edit_edit_previous_bookmark);
272  init (tr ("Remove All Bookmark"), sc_edit_edit_remove_bookmark);
273 
274  init (tr ("Preferences"), sc_edit_edit_preferences);
275  init (tr ("Styles Preferences"), sc_edit_edit_styles_preferences);
276 
277  // view
278  init (tr ("Show Line Numbers"), sc_edit_view_show_line_numbers);
279  init (tr ("Show Whitespace Characters"), sc_edit_view_show_white_spaces);
280  init (tr ("Show Line Endings"), sc_edit_view_show_eol_chars);
281  init (tr ("Show Indentation Guides"), sc_edit_view_show_ind_guides);
282  init (tr ("Show Long Line Marker"), sc_edit_view_show_long_line);
283  init (tr ("Show Toolbar"), sc_edit_view_show_toolbar);
284  init (tr ("Show Statusbar"), sc_edit_view_show_statusbar);
285  init (tr ("Show Horizontal Scrollbar"), sc_edit_view_show_hscrollbar);
286  init (tr ("Sort Tabs Alphabetically"), sc_edit_view_sort_tabs);
287 
288  // debug
289  init (tr ("Toggle Breakpoint"), sc_edit_debug_toggle_breakpoint);
290  init (tr ("Next Breakpoint"), sc_edit_debug_next_breakpoint);
291  init (tr ("Previous Breakpoint"), sc_edit_debug_previous_breakpoint);
292  init (tr ("Remove All Breakpoints"), sc_edit_debug_remove_breakpoints);
293 
294  // run
295  init (tr ("Run File"), sc_edit_run_run_file);
296  init (tr ("Run Selection"), sc_edit_run_run_selection);
297 
298  // help
299  init (tr ("Help on Keyword"), sc_edit_help_help_keyword);
300  init (tr ("Document on Keyword"), sc_edit_help_doc_keyword);
301 
302  // Documentation browser
303  init (tr ("Go to Homepage"), sc_doc_go_home);
304  init (tr ("Go Back one Page"), sc_doc_go_back);
305  init (tr ("Go Forward one Page"), sc_doc_go_next);
306  init (tr ("Bookmark this Page"), sc_doc_bookmark);
307 }
308 
309 // write one or all actual shortcut set(s) into a settings file
311  bool closing)
312 {
313  bool sc_ctrld = false;
314 
315  QString sc_main = sc_main_file.mid (0, sc_main_file.indexOf ('_') + 1);
316 
317  for (int i = 0; i < m_sc.count (); i++) // loop over all shortcuts
318  {
319  settings->setValue (sc_group + "/" + m_sc.at (i).m_settings_key,
320  m_sc.at (i).m_actual_sc.toString ());
321  // special: check main-window for Ctrl-D (Terminal)
322  if (m_sc.at (i).m_settings_key.startsWith (sc_main)
323  && m_sc.at (i).m_actual_sc == QKeySequence (Qt::ControlModifier+Qt::Key_D))
324  sc_ctrld = true;
325  }
326 
327  settings->setValue (sc_main_ctrld.key, sc_ctrld);
328 
329  if (closing)
330  {
331  delete m_dialog; // the dialog for key sequences can be removed now
332  m_dialog = nullptr; // make sure it is zero again
333  }
334 
335  settings->sync (); // sync the settings file
336 }
337 
338 void shortcut_manager::set_shortcut (QAction *action, const sc_pref& scpref,
339  bool enable)
340 {
341  if (! enable)
342  {
343  // Disable => remove existing shortcut from the action
344  action->setShortcut (QKeySequence ());
345  return;
346  }
347 
348  // Enable: Is the given key known? If yes, get the value from the
349  // settings file and set it to the action
350  int index;
351 
352  index = m_action_hash[scpref.key] - 1;
353 
354  if (index > -1 && index < m_sc.count ())
355  {
358  action->setShortcut (QKeySequence (settings->sc_value (scpref)));
359  }
360  else
361  qDebug () << "Key: " << scpref.key << " not found in m_action_hash";
362 }
363 
364 void shortcut_manager::shortcut (QShortcut *sc, const sc_pref& scpref)
365 {
366  int index;
367 
368  index = m_action_hash[scpref.key] - 1;
369 
370  if (index > -1 && index < m_sc.count ())
371  {
374  sc->setKey (QKeySequence (settings->sc_value (scpref)));
375  }
376  else
377  qDebug () << "Key: " << scpref.key << " not found in m_action_hash";
378 }
379 
380 void shortcut_manager::fill_treewidget (QTreeWidget *tree_view)
381 {
382  m_dialog = nullptr;
383  m_level_hash.clear ();
384 
385  tree_view->header ()->setSectionResizeMode (QHeaderView::ResizeToContents);
386 
387  QTreeWidgetItem *main = new QTreeWidgetItem (tree_view);
388  main->setText (0, tr ("Global"));
389  main->setExpanded (true);
390  QTreeWidgetItem *main_file = new QTreeWidgetItem (main);
391  main_file->setText (0, tr ("File Menu"));
392  QTreeWidgetItem *main_edit = new QTreeWidgetItem (main);
393  main_edit->setText (0, tr ("Edit Menu"));
394  QTreeWidgetItem *main_debug = new QTreeWidgetItem (main);
395  main_debug->setText (0, tr ("Debug Menu"));
396  QTreeWidgetItem *main_tools = new QTreeWidgetItem (main);
397  main_tools->setText (0, tr ("Tools Menu"));
398  QTreeWidgetItem *main_window = new QTreeWidgetItem (main);
399  main_window->setText (0, tr ("Window Menu"));
400  QTreeWidgetItem *main_help = new QTreeWidgetItem (main);
401  main_help->setText (0, tr ("Help Menu"));
402  QTreeWidgetItem *main_news = new QTreeWidgetItem (main);
403  main_news->setText (0, tr ("News Menu"));
404  QTreeWidgetItem *main_dock_widgets = new QTreeWidgetItem (main);
405  main_dock_widgets->setText (0, tr ("Handling of Dock Widgets"));
406  QTreeWidgetItem *main_tabs = new QTreeWidgetItem (main);
407  main_tabs->setText (0, tr ("Tab Handling in Dock Widgets"));
408  QTreeWidgetItem *main_find = new QTreeWidgetItem (main);
409  main_find->setText (0, tr ("Find & Replace in Dock Widgets"));
410  QTreeWidgetItem *main_zoom = new QTreeWidgetItem (main);
411  main_zoom->setText (0, tr ("Zooming in Editor and Documentation"));
412 
413  m_level_hash[sc_main_file] = main_file;
414  m_level_hash[sc_main_edit] = main_edit;
415  m_level_hash[sc_main_debug] = main_debug;
416  m_level_hash[sc_main_tools] = main_tools;
418  m_level_hash[sc_main_help] = main_help;
419  m_level_hash[sc_main_news] = main_news;
420  m_level_hash[sc_dock_widget] = main_dock_widgets;
421  m_level_hash[sc_edit_tabs] = main_tabs;
422  m_level_hash[sc_edit_find] = main_find;
423  m_level_hash[sc_edit_zoom] = main_zoom;
424 
425  QTreeWidgetItem *editor = new QTreeWidgetItem (tree_view);
426  editor->setText (0, tr ("Editor"));
427  editor->setExpanded (true);
428  QTreeWidgetItem *editor_file = new QTreeWidgetItem (editor);
429  editor_file->setText (0, tr ("File Menu"));
430  QTreeWidgetItem *editor_edit = new QTreeWidgetItem (editor);
431  editor_edit->setText (0, tr ("Edit Menu"));
432  QTreeWidgetItem *editor_view = new QTreeWidgetItem (editor);
433  editor_view->setText (0, tr ("View Menu"));
434  QTreeWidgetItem *editor_debug = new QTreeWidgetItem (editor);
435  editor_debug->setText (0, tr ("Debug Menu"));
436  QTreeWidgetItem *editor_run = new QTreeWidgetItem (editor);
437  editor_run->setText (0, tr ("Run Menu"));
438  QTreeWidgetItem *editor_help = new QTreeWidgetItem (editor);
439  editor_help->setText (0, tr ("Help Menu"));
440 
441  m_level_hash[sc_edit_file] = editor_file;
442  m_level_hash[sc_edit_edit] = editor_edit;
443  m_level_hash[sc_edit_view] = editor_view;
444  m_level_hash[sc_edit_debug] = editor_debug;
445  m_level_hash[sc_edit_run] = editor_run;
446  m_level_hash[sc_edit_help] = editor_help;
447 
448  QTreeWidgetItem *doc = new QTreeWidgetItem (tree_view);
449  doc->setText (0, tr ("Documentation Viewer"));
450  doc->setExpanded (true);
451 
452  QTreeWidgetItem *doc_browser = new QTreeWidgetItem (doc);
453  doc_browser->setText (0, tr ("Browser"));
454 
455  m_level_hash[sc_doc] = doc_browser;
456 
457  connect (tree_view, &QTreeWidget::itemDoubleClicked,
459 
460  for (int i = 0; i < m_sc.count (); i++)
461  {
462  shortcut_t sc = m_sc.at (i);
463 
464  QTreeWidgetItem *section = m_level_hash[sc.m_settings_key.section (':', 0, 0)];
465 
466  // handle sections which have changed and do not correspond to the
467  // previously defined keyname
468  if (section == editor_file)
469  {
470  // Closing tabs now in global tab handling section
471  if (sc.m_settings_key.contains (sc_edit_file_cl))
472  section = main_tabs;
473  }
474  if (section == editor_edit)
475  {
476  // Find & replace now in global file & replace handling section
477  if (sc.m_settings_key.contains (sc_edit_edit_find))
478  section = main_find;
479  }
480  if (section == editor_view)
481  {
482  // Zooming now in global zoom handling section
483  if (sc.m_settings_key.contains (sc_edit_view_zoom))
484  section = main_zoom;
485  }
486 
487  QTreeWidgetItem *tree_item = new QTreeWidgetItem (section);
488 
489  // set a slightly transparent foreground for default columns
490  QColor fg = QColor (tree_item->foreground (1).color ());
491  fg.setAlpha (128);
492  tree_item->setForeground (1, QBrush (fg));
493 
494  // write the shortcuts
495  tree_item->setText (0, sc.m_description);
496  tree_item->setText (1, sc.m_default_sc.toString ());
497  tree_item->setText (2, sc.m_actual_sc.toString ());
498 
499  m_item_index_hash[tree_item] = i + 1; // index+1 to avoid 0
500  m_index_item_hash[i] = tree_item;
501  }
502 }
503 
504 // import or export of shortcut sets,
505 // called from settings dialog when related buttons are clicked;
506 // returns true on success, false otherwise
507 bool
509 {
510  // ask to save the current shortcuts, maybe abort import
511  if (action == OSC_DEFAULT || action == OSC_IMPORT)
512  {
513  if (! overwrite_all_shortcuts ())
514  return false;
515  }
516 
517  // get the filename to read or write the shortcuts,
518  // the default extension is .osc (octave shortcuts)
519  if (action != OSC_DEFAULT)
520  {
521  QString file;
522 
523  // FIXME: Remove, if for all common KDE versions (bug #54607) is resolved.
524  int opts = 0; // No options by default.
527  if (! settings->value (global_use_native_dialogs).toBool ())
528  opts = QFileDialog::DontUseNativeDialog;
529 
530  if (action == OSC_IMPORT)
531  file = QFileDialog::getOpenFileName (this,
532  tr ("Import shortcuts from file..."), QString (),
533  tr ("Octave Shortcut Files (*.osc);;All Files (*)"),
534  nullptr, QFileDialog::Option (opts));
535  else if (action == OSC_EXPORT)
536  file = QFileDialog::getSaveFileName (this,
537  tr ("Export shortcuts to file..."), QString (),
538  tr ("Octave Shortcut Files (*.osc);;All Files (*)"),
539  nullptr, QFileDialog::Option (opts));
540 
541  if (file.isEmpty ())
542  return false;
543 
544  gui_settings osc_settings (file, QSettings::IniFormat);
545 
546  if (osc_settings.status () != QSettings::NoError)
547  {
548  qWarning () << tr ("Failed to open %1 as Octave shortcut file")
549  .arg (file);
550  return false;
551  }
552  else
553  {
554  if (action == OSC_IMPORT)
555  import_shortcuts (&osc_settings); // import (special action)
556  else if (action == OSC_EXPORT)
557  write_shortcuts (&osc_settings, false); // export, (save settings)
558  }
559  }
560  else
561  {
562  import_shortcuts (nullptr);
563  }
564 
565  return true;
566 }
567 
568 void shortcut_manager::handle_double_clicked (QTreeWidgetItem *item, int col)
569 {
570  if (col != 2)
571  return;
572 
573  int i = m_item_index_hash[item];
574  if (i == 0)
575  return; // top-level-item clicked
576 
577  shortcut_dialog (i-1); // correct to index starting at 0
578 }
579 
581 {
582  if (result == QDialog::Rejected)
583  return;
584 
585  // check for duplicate
586  int double_index = m_shortcut_hash[m_edit_actual->text ()] - 1;
587 
588  if (double_index >= 0 && double_index != m_handled_index)
589  {
590  int ret = QMessageBox::warning (this, tr ("Double Shortcut"),
591  tr ("The chosen shortcut\n \"%1\"\n"
592  "is already used for the action\n \"%2\".\n"
593  "Do you want to use the shortcut anyhow removing it "
594  "from the previous action?")
595  .arg (m_edit_actual->text ())
596  .arg (m_sc.at (double_index).m_description),
597  QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
598 
599  if (ret == QMessageBox::Yes)
600  {
601  shortcut_t double_shortcut = m_sc.at (double_index);
602  double_shortcut.m_actual_sc = QKeySequence ();
603  m_sc.replace (double_index, double_shortcut);
604  m_index_item_hash[double_index]->setText (2, QString ());
605  }
606  else
607  return;
608  }
609 
611  if (! shortcut.m_actual_sc.isEmpty ())
612  m_shortcut_hash.remove (shortcut.m_actual_sc.toString ());
613  shortcut.m_actual_sc = m_edit_actual->text ();
614  m_sc.replace (m_handled_index, shortcut);
615 
616  m_index_item_hash[m_handled_index]->setText (2, shortcut.m_actual_sc.toString ());
617 
618  if (! shortcut.m_actual_sc.isEmpty ())
619  m_shortcut_hash[shortcut.m_actual_sc.toString ()] = m_handled_index + 1;
620 }
621 
623 {
624  m_edit_actual->setText (m_label_default->text ());
625 }
626 
627 void shortcut_manager::init (const QString& description, const sc_pref& sc)
628 {
631 
632  QKeySequence actual = QKeySequence (settings->sc_value (sc));
633 
634  // append the new shortcut to the list
635  shortcut_t shortcut_info;
636  shortcut_info.m_description = description;
637  shortcut_info.m_settings_key = sc.key;
638  shortcut_info.m_actual_sc = actual;
639  shortcut_info.m_default_sc = settings->sc_def_value (sc);
640  m_sc << shortcut_info;
641 
642  // insert shortcut in order to check for duplicates later
643  if (! actual.isEmpty ())
644  m_shortcut_hash[actual.toString ()] = m_sc.count ();
645  m_action_hash[sc.key] = m_sc.count ();
646 
647  // check whether ctrl+d is used from main window, i.e. is a global shortcut
648  QString main_group_prefix
649  = sc_main_file.mid (0, sc_main_file.indexOf ('_') + 1);
650  if (sc.key.startsWith (main_group_prefix)
651  && actual == QKeySequence (Qt::ControlModifier+Qt::Key_D))
652  settings->setValue (sc_main_ctrld.key, true);
653 }
654 
656 {
657  if (! m_dialog)
658  {
659  m_dialog = new QDialog (this);
660 
661  m_dialog->setWindowTitle (tr ("Enter new Shortcut"));
662 
663  QVBoxLayout *box = new QVBoxLayout (m_dialog);
664  box->setSpacing (2);
665  box->setContentsMargins (12, 12, 12, 12);
666 
667  QLabel *help = new QLabel (tr ("Apply the desired shortcut or click "
668  "on the right button to reset the "
669  "shortcut to its default."));
670  help->setWordWrap (true);
671  box->addWidget (help);
672 
673  QCheckBox *direct
674  = new QCheckBox (tr ("Enter shortcut directly by performing it"));
675 
676  QCheckBox *shift
677  = new QCheckBox (tr ("Add Shift modifier\n"
678  "(allows one to enter number keys)"));
679 
680  shift->setStyleSheet
681  ("QCheckBox::indicator { subcontrol-position: left top; }");
682 
683  connect (direct, &QCheckBox::clicked, shift, &QCheckBox::setEnabled);
684 
685  direct->setCheckState (Qt::Checked);
686 
687  box->addWidget (direct);
688  box->addWidget (shift);
689 
690  box->addSpacing (15);
691 
692  QGridLayout *grid = new QGridLayout ();
693 
694  QLabel *actual = new QLabel (tr ("Actual shortcut"));
696  m_edit_actual->setAlignment (Qt::AlignHCenter);
697  grid->addWidget (actual, 0, 0);
698  grid->addWidget (m_edit_actual, 0, 1);
699 
700  QLabel *def = new QLabel (tr ("Default shortcut"));
702  m_label_default->setAlignment (Qt::AlignHCenter);
703  grid->addWidget (def, 1, 0);
704  grid->addWidget (m_label_default, 1, 1);
705 
706  QPushButton *set_default = new QPushButton (tr ("Set to default"));
707  grid->addWidget (set_default, 0, 2);
708  connect (set_default, &QPushButton::clicked,
710 
711  box->addLayout (grid);
712 
713  box->addSpacing (18);
714 
715  QDialogButtonBox *button_box = new QDialogButtonBox (QDialogButtonBox::Ok
716  | QDialogButtonBox::Cancel);
717  QList<QAbstractButton *> buttons = button_box->buttons ();
718  for (int i = 0; i < buttons.count (); i++)
719  buttons.at (i)->setShortcut (QKeySequence ());
720  connect (button_box, &QDialogButtonBox::accepted,
721  m_dialog, &QDialog::accept);
722  connect (button_box, &QDialogButtonBox::rejected,
723  m_dialog, &QDialog::reject);
724  box->addWidget (button_box);
725 
726  m_dialog->setLayout (box);
727 
728  connect (direct, &QCheckBox::stateChanged,
730  connect (shift, &QCheckBox::stateChanged,
732  connect (m_dialog, &QDialog::finished,
734 
735  }
736 
737  m_edit_actual->setText (m_sc.at (index).m_actual_sc.toString ());
738  m_label_default->setText (m_sc.at (index).m_default_sc.toString ());
739  m_handled_index = index;
740 
741  m_edit_actual->setFocus ();
742  m_dialog->setFocusProxy (m_edit_actual);
743  m_dialog->exec ();
744 }
745 
746 // import a shortcut set from a given settings file or reset to
747 // the defaults (settings = 0) and refresh the tree view
749 {
750  for (int i = 0; i < m_sc.count (); i++)
751  {
752  // update the list of all shortcuts
753  shortcut_t sc = m_sc.at (i); // make a copy
754 
755  if (settings)
756  sc.m_actual_sc = QKeySequence ( // get new shortcut from settings
757  settings->value (sc_group + sc.m_settings_key,sc.m_actual_sc).
758  toString ()); // and use the old one as default
759  else
760  sc.m_actual_sc = QKeySequence (sc.m_default_sc); // get default shortcut
761 
762  m_sc.replace (i, sc); // replace the old with the new one
763 
764  // update the tree view
765  QTreeWidgetItem *tree_item = m_index_item_hash[i]; // get related tree item
766  tree_item->setText (2, sc.m_actual_sc.toString ()); // display new shortcut
767  }
768 }
769 
770 // ask the user whether to save the current shortcut set;
771 // returns true to proceed with import action, false to abort it
773 {
774  QMessageBox msg_box;
775  msg_box.setWindowTitle (tr ("Overwriting Shortcuts"));
776  msg_box.setIcon (QMessageBox::Warning);
777  msg_box.setText (tr ("You are about to overwrite all shortcuts.\n"
778  "Would you like to save the current shortcut set or cancel the action?"));
779  msg_box.setStandardButtons (QMessageBox::Save | QMessageBox::Cancel);
780  QPushButton *discard = msg_box.addButton (tr ("Don't save"),
781  QMessageBox::DestructiveRole);
782  msg_box.setDefaultButton (QMessageBox::Save);
783 
784  int ret = msg_box.exec ();
785 
786  if (msg_box.clickedButton () == discard)
787  return true; // do not save and go ahead
788 
789  if (ret == QMessageBox::Save)
790  {
792  return true; // go ahead
793  }
794 
795  return false; // abort the import
796 }
797 
OCTAVE_END_NAMESPACE(octave)
Base class for Octave interfaces that use Qt.
resource_manager & get_resource_manager(void)
virtual void keyPressEvent(QKeyEvent *e)
void handle_direct_shortcut(int)
void handle_shift_modifier(int)
Represents the main window.
Definition: main-window.h:73
gui_settings * get_settings(void) const
void shortcut_dialog_set_default()
enter_shortcut * m_edit_actual
QHash< QString, QTreeWidgetItem * > m_level_hash
void set_shortcut(QAction *action, const sc_pref &scpref, bool enable=true)
void handle_double_clicked(QTreeWidgetItem *, int)
QList< shortcut_t > m_sc
QHash< int, QTreeWidgetItem * > m_index_item_hash
bool overwrite_all_shortcuts(void)
void shortcut_dialog_finished(int)
shortcut_manager(base_qobject &oct_qobj)
QHash< QString, int > m_shortcut_hash
QHash< QString, int > m_action_hash
QHash< QTreeWidgetItem *, int > m_item_index_hash
void write_shortcuts(gui_settings *settings, bool closing)
base_qobject & m_octave_qobj
bool import_export(int action)
void init(const QString &, const sc_pref &scpref)
void import_shortcuts(gui_settings *settings)
void fill_treewidget(QTreeWidget *tree_view)
void shortcut(QShortcut *sc, const sc_pref &scpref)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void warning(const char *fmt,...)
Definition: error.cc:1054
const gui_pref global_use_native_dialogs("use_native_file_dialogs", QVariant(true))
const sc_pref sc_main_help_online_doc(sc_main_help+":online_doc", QKeySequence::UnknownKey)
const sc_pref sc_edit_view_show_long_line(sc_edit_view+":show_long_line", QKeySequence::UnknownKey)
const QString sc_edit_view_zoom(sc_edit_view+":zoom")
const sc_pref sc_edit_file_close(sc_edit_file_cl, QKeySequence::Close)
const sc_pref sc_edit_edit_completion_list(sc_edit_edit+":completion_list", CTRL+Qt::Key_Space)
const sc_pref sc_edit_debug_next_breakpoint(sc_edit_debug+":next_breakpoint", QKeySequence::UnknownKey)
const sc_pref sc_doc_go_home(sc_doc+":go_home", Qt::AltModifier+Qt::Key_Home)
const sc_pref sc_main_file_exit(sc_main_file+":exit", QKeySequence::Quit)
const sc_pref sc_edit_debug_previous_breakpoint(sc_edit_debug+":previous_breakpoint", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_delete_line(sc_edit_edit+":delete_line", CTRL_SHIFT+Qt::Key_L)
const sc_pref sc_main_file_new_file(sc_main_file+":new_file", QKeySequence::New)
const sc_pref sc_edit_edit_move_to_brace(sc_edit_edit+":move_to_brace", CTRL+Qt::Key_M)
const sc_pref sc_edit_edit_toggle_bookmark(sc_edit_edit+":toggle_bookmark", PRE+Qt::Key_F7)
const sc_pref sc_doc_go_back(sc_doc+":go_back", QKeySequence::Back)
const sc_pref sc_edit_edit_delete_start_line(sc_edit_edit+":delete_start_line", CTRL_SHIFT+Qt::Key_Backspace)
const sc_pref sc_main_news_release_notes(sc_main_news+":release_notes", QKeySequence::UnknownKey)
const QString sc_dock_widget("dock_widget")
const sc_pref sc_main_window_workspace(sc_main_window+":workspace", PRE+CTRL+Qt::Key_3)
const sc_pref sc_edit_edit_uncomment_selection(sc_edit_edit+":uncomment_selection", CTRL_SHIFT+Qt::Key_R)
const QString sc_edit_run("editor_run")
const sc_pref sc_edit_edit_cut_line(sc_edit_edit+":cut_line", CTRL_SHIFT+Qt::Key_X)
const sc_pref sc_edit_view_show_hscrollbar(sc_edit_view+":show_hscrollbar", QKeySequence::UnknownKey)
const sc_pref sc_main_file_new_figure(sc_main_file+":new_figure", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_remove_bookmark(sc_edit_edit+":remove_bookmark", QKeySequence::UnknownKey)
const sc_pref sc_main_window_doc(sc_main_window+":doc", PRE+CTRL+Qt::Key_5)
const sc_pref sc_main_debug_step_over(sc_main_debug+":step_over", PRE+Qt::Key_F10)
const sc_pref sc_main_window_show_editor(sc_main_window+":show_editor", PRE+CTRL_SHIFT+Qt::Key_4)
const sc_pref sc_main_edit_set_path(sc_main_edit+":set_path", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_upper_case(sc_edit_edit+":upper_case", CTRL+Qt::Key_U)
const sc_pref sc_edit_file_save(sc_edit_file+":save", QKeySequence::Save)
const sc_pref sc_edit_edit_styles_preferences(sc_edit_edit+":styles_preferences", QKeySequence::UnknownKey)
const sc_pref sc_main_window_file_browser(sc_main_window+":file_browser", PRE+CTRL+Qt::Key_2)
const sc_pref sc_edit_file_print(sc_edit_file+":print", QKeySequence::Print)
const sc_pref sc_edit_edit_goto_line(sc_edit_edit+":goto_line", CTRL+Qt::Key_L)
const sc_pref sc_edit_edit_smart_indent_line_or_selection(sc_edit_edit+":smart_indent_line_or_selection", QKeySequence::UnknownKey)
const sc_pref sc_main_debug_continue(sc_main_debug+":continue", PRE+Qt::Key_F5)
const sc_pref sc_edit_view_show_statusbar(sc_edit_view+":show_statusbar", QKeySequence::UnknownKey)
const sc_pref sc_main_edit_clear_clipboard(sc_main_edit+":clear_clipboard", QKeySequence::UnknownKey)
const sc_pref sc_edit_view_show_eol_chars(sc_edit_view+":show_eol_chars", QKeySequence::UnknownKey)
const sc_pref sc_main_window_show_history(sc_main_window+":show_history", PRE+CTRL_SHIFT+Qt::Key_1)
const sc_pref sc_edit_file_edit_function(sc_edit_file+":edit_function", CTRL+Qt::Key_E)
const sc_pref sc_edit_edit_comment_selection(sc_edit_edit+":comment_selection", CTRL+Qt::Key_R)
const sc_pref sc_main_window_show_workspace(sc_main_window+":show_workspace", PRE+CTRL_SHIFT+Qt::Key_3)
const sc_pref sc_main_edit_clear_workspace(sc_main_edit+":clear_workspace", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_comment_var_selection(sc_edit_edit+":comment_var_selection", CTRL_ALT+Qt::Key_R)
const QString sc_edit_find("editor_find")
const QString sc_main_window("main_window")
const sc_pref sc_dock_widget_dock(sc_dock_widget+":dock", CTRL_ALT+Qt::Key_D)
const gui_pref sc_main_ctrld("shortcuts/main_ctrld", QVariant(false))
const sc_pref sc_edit_run_run_file(sc_edit_run+":run_file", PRE+Qt::Key_F5)
const sc_pref sc_edit_file_save_as(sc_edit_file+":save_as", QKeySequence::SaveAs)
const sc_pref sc_main_file_open_file(sc_main_file+":open_file", QKeySequence::Open)
const sc_pref sc_main_window_show_doc(sc_main_window+":show_doc", PRE+CTRL_SHIFT+Qt::Key_5)
const sc_pref sc_main_file_new_function(sc_main_file+":new_function", CTRL_SHIFT+Qt::Key_N)
const sc_pref sc_main_debug_step_into(sc_main_debug+":step_into", PRE+Qt::Key_F11)
const QString sc_edit_debug("editor_debug")
const sc_pref sc_main_help_about(sc_main_help+":about", QKeySequence::UnknownKey)
const sc_pref sc_edit_view_zoom_normal(sc_edit_view_zoom+"_normal", CTRL+Qt::Key_Period)
const sc_pref sc_edit_edit_find_replace(sc_edit_edit_find+"_replace", QKeySequence::Find)
const sc_pref sc_edit_view_show_ind_guides(sc_edit_view+":show_ind_guides", QKeySequence::UnknownKey)
const sc_pref sc_main_window_show_variable_editor(sc_main_window+":show_variable_editor", PRE+CTRL_SHIFT+Qt::Key_6)
const sc_pref sc_main_window_show_command(sc_main_window+":show_command", PRE+CTRL_SHIFT+Qt::Key_0)
const sc_pref sc_main_window_editor(sc_main_window+":editor", PRE+CTRL+Qt::Key_4)
const sc_pref sc_main_window_variable_editor(sc_main_window+":variable_editor", PRE+CTRL+Qt::Key_6)
const sc_pref sc_edit_file_close_other(sc_edit_file_cl+"_other", QKeySequence::UnknownKey)
const QString sc_main_news("main_news")
const sc_pref sc_main_window_command(sc_main_window+":command", PRE+CTRL+Qt::Key_0)
const sc_pref sc_doc_bookmark(sc_doc+":bookmark", CTRL+Qt::Key_D)
const QString sc_edit_help("editor_help")
const sc_pref sc_main_debug_quit(sc_main_debug+":quit", PRE+Qt::ShiftModifier+Qt::Key_F5)
const QString sc_main_file("main_file")
const sc_pref sc_main_edit_copy(sc_main_edit+":copy", QKeySequence::Copy)
const sc_pref sc_main_help_ondisk_doc(sc_main_help+":ondisk_doc", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_copy_line(sc_edit_edit+":copy_line", CTRL_SHIFT+Qt::Key_C)
const sc_pref sc_edit_edit_transpose_line(sc_edit_edit+":transpose_line", CTRL+Qt::Key_T)
const sc_pref sc_edit_edit_find_next(sc_edit_edit_find+"_next", QKeySequence::FindNext)
const sc_pref sc_edit_help_help_keyword(sc_edit_help+":help_keyword", QKeySequence::HelpContents)
const Qt::KeyboardModifier CTRL
const sc_pref sc_edit_edit_duplicate_selection(sc_edit_edit+":duplicate_selection", CTRL+Qt::Key_D)
const sc_pref sc_edit_view_show_toolbar(sc_edit_view+":show_toolbar", QKeySequence::UnknownKey)
const sc_pref sc_edit_help_doc_keyword(sc_edit_help+":doc_keyword", Qt::SHIFT+Qt::Key_F1)
const sc_pref sc_edit_edit_delete_end_line(sc_edit_edit+":delete_end_line", CTRL_SHIFT+Qt::Key_Delete)
const sc_pref sc_edit_tabs_move_tab_right(sc_edit_tabs+":move_tab_right", Qt::AltModifier+Qt::Key_PageDown)
const QString sc_main_tools("main_tools")
const sc_pref sc_main_help_developer(sc_main_help+":developer", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_cut(sc_edit_edit+":cut", QKeySequence::Cut)
const sc_pref sc_main_edit_undo(sc_main_edit+":undo", QKeySequence::Undo)
const QString sc_doc("doc_browser")
const sc_pref sc_main_edit_clear_command_window(sc_main_edit+":clear_command_window", QKeySequence::UnknownKey)
const sc_pref sc_edit_debug_remove_breakpoints(sc_edit_debug+":remove_breakpoints", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_unindent_selection(sc_edit_edit+":unindent_selection", CTRL_SHIFT+Qt::Key_Tab)
const sc_pref sc_edit_edit_next_bookmark(sc_edit_edit+":next_bookmark", PRE+Qt::Key_F2)
const sc_pref sc_main_window_reset(sc_main_window+":reset", QKeySequence::UnknownKey)
const QString sc_edit_edit("editor_edit")
const QString sc_edit_edit_find(sc_edit_edit+":find")
const sc_pref sc_main_window_previous_dock(sc_main_window+":previous_widget", PRE+CTRL_ALT+Qt::Key_P)
const QString sc_edit_file("editor_file")
const sc_pref sc_main_help_contribute(sc_main_help+":contribute", QKeySequence::UnknownKey)
const sc_pref sc_main_window_history(sc_main_window+":history", PRE+CTRL+Qt::Key_1)
const sc_pref sc_edit_run_run_selection(sc_edit_run+":run_selection", PRE+Qt::Key_F9)
const sc_pref sc_edit_edit_find_previous(sc_edit_edit_find+"_previous", QKeySequence::FindPrevious)
const sc_pref sc_edit_view_show_white_spaces(sc_edit_view+":show_white_spaces", QKeySequence::UnknownKey)
const sc_pref sc_edit_file_close_all(sc_edit_file_cl+"_all", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_select_to_brace(sc_edit_edit+":select_to_brace", CTRL_SHIFT+Qt::Key_M)
const sc_pref sc_edit_debug_toggle_breakpoint(sc_edit_debug+":toggle_breakpoint", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_lower_case(sc_edit_edit+":lower_case", CTRL_ALT+Qt::Key_U)
const sc_pref sc_edit_edit_indent_selection(sc_edit_edit+":indent_selection", CTRL+Qt::Key_Tab)
const QString sc_edit_view("editor_view")
const sc_pref sc_edit_view_zoom_in(sc_edit_view_zoom+"_in", QKeySequence::ZoomIn)
const QString sc_edit_zoom("editor_zoom")
const sc_pref sc_main_edit_preferences(sc_main_edit+":preferences", QKeySequence::UnknownKey)
const sc_pref sc_main_tools_show_profiler(sc_main_tools+":show_profiler", Qt::AltModifier+Qt::ShiftModifier+Qt::Key_P)
const sc_pref sc_main_help_packages(sc_main_help+":packages", QKeySequence::UnknownKey)
const sc_pref sc_doc_go_next(sc_doc+":go_next", QKeySequence::Forward)
const QString sc_main_help("main_help")
const sc_pref sc_edit_tabs_move_tab_left(sc_edit_tabs+":move_tab_left", Qt::AltModifier+Qt::Key_PageUp)
const sc_pref sc_edit_edit_delete_end_word(sc_edit_edit+":delete_end_word", QKeySequence::DeleteEndOfWord)
const sc_pref sc_edit_edit_preferences(sc_edit_edit+":preferences", QKeySequence::UnknownKey)
const QString sc_edit_tabs("editor_tabs")
const sc_pref sc_edit_tabs_switch_right_tab(sc_edit_tabs+":switch_right_tab", CTRL+Qt::Key_PageDown)
const sc_pref sc_edit_edit_redo(sc_edit_edit+":redo", QKeySequence::Redo)
const sc_pref sc_main_file_save_workspace(sc_main_file+":save_workspace", QKeySequence::UnknownKey)
const sc_pref sc_main_edit_paste(sc_main_edit+":paste", QKeySequence::Paste)
const sc_pref sc_main_tools_resume_profiler(sc_main_tools+":resume_profiler", QKeySequence::UnknownKey)
const sc_pref sc_main_edit_find_in_files(sc_main_edit+":find_in_files", CTRL_SHIFT+Qt::Key_F)
const sc_pref sc_main_edit_select_all(sc_main_edit+":select_all", QKeySequence::SelectAll)
const sc_pref sc_main_window_show_file_browser(sc_main_window+":show_file_browser", PRE+CTRL_SHIFT+Qt::Key_2)
const sc_pref sc_main_edit_clear_history(sc_main_edit+":clear_history", QKeySequence::UnknownKey)
const sc_pref sc_main_debug_step_out(sc_main_debug+":step_out", PRE+Qt::ShiftModifier+Qt::Key_F11)
const sc_pref sc_dock_widget_close(sc_dock_widget+":close", CTRL_ALT+Qt::Key_C)
const QString sc_main_edit("main_edit")
const sc_pref sc_edit_edit_conv_eol_unix(sc_edit_edit+":conv_eol_unix", QKeySequence::UnknownKey)
const sc_pref sc_edit_view_sort_tabs(sc_edit_view+":sort_tabs", QKeySequence::UnknownKey)
const sc_pref sc_edit_tabs_switch_left_tab(sc_edit_tabs+":switch_left_tab", CTRL+Qt::Key_PageUp)
const sc_pref sc_edit_view_show_line_numbers(sc_edit_view+":show_line_numbers", QKeySequence::UnknownKey)
const QString sc_main_debug("main_debug")
const sc_pref sc_edit_view_zoom_out(sc_edit_view_zoom+"_out", QKeySequence::ZoomOut)
const sc_pref sc_edit_edit_conv_eol_mac(sc_edit_edit+":conv_eol_mac", QKeySequence::UnknownKey)
const sc_pref sc_main_news_community_news(sc_main_news+":community_news", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_conv_eol_winows(sc_edit_edit+":conv_eol_winows", QKeySequence::UnknownKey)
const QString sc_edit_file_cl(sc_edit_file+":close")
const sc_pref sc_main_tools_start_profiler(sc_main_tools+":start_profiler", CTRL_SHIFT+Qt::Key_P)
const sc_pref sc_edit_edit_previous_bookmark(sc_edit_edit+":previous_bookmark", PRE+Qt::SHIFT+Qt::Key_F2)
const sc_pref sc_main_help_report_bug(sc_main_help+":report_bug", QKeySequence::UnknownKey)
const sc_pref sc_main_file_load_workspace(sc_main_file+":load_workspace", QKeySequence::UnknownKey)
const sc_pref sc_edit_edit_delete_start_word(sc_edit_edit+":delete_start_word", QKeySequence::DeleteStartOfWord)
const QString sc_group("shortcuts/")
int main(int argc, char **argv)
Definition: main-cli.cc:126
static octave_value box(JNIEnv *jni_env, void *jobj, void *jcls_arg=nullptr)
static uint32_t state[624]
Definition: randmtzig.cc:193
const QString key
const QString key