comparison libgui/src/shortcut-manager.cc @ 19629:be7ac98fab43 gui-release

strip trailing whitespace from most source files * NEWS, etc/NEWS.3, libgui/graphics/Backend.h, libgui/graphics/ButtonControl.h, libgui/graphics/EditControl.cc, libgui/graphics/Object.h, libgui/graphics/QtHandlesUtils.cc, libgui/graphics/ToolBarButton.h, libgui/graphics/__init_qt__.cc, libgui/graphics/gl-select.cc, libgui/qterminal/libqterminal/unix/TerminalView.cpp, libgui/qterminal/libqterminal/unix/TerminalView.h, libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp, libgui/src/m-editor/file-editor-tab.cc, libgui/src/m-editor/file-editor.cc, libgui/src/m-editor/file-editor.h, libgui/src/m-editor/octave-qscintilla.cc, libgui/src/settings-dialog.cc, libgui/src/shortcut-manager.cc, libgui/src/workspace-view.cc, libinterp/corefcn/graphics.cc, libinterp/corefcn/input.cc, libinterp/parse-tree/pt-unop.cc, liboctave/array/dSparse.h, scripts/pkg/pkg.m, scripts/polynomial/polyeig.m, test/io.tst: Strip trailing whitespace.
author John W. Eaton <jwe@octave.org>
date Tue, 20 Jan 2015 09:43:29 -0500
parents 417355ed0812
children 0e1f5a750d00 8ef79bc61d8a
comparison
equal deleted inserted replaced
19628:fe689210525c 19629:be7ac98fab43
45 shortcut_manager *shortcut_manager::instance = 0; 45 shortcut_manager *shortcut_manager::instance = 0;
46 46
47 shortcut_manager::shortcut_manager () 47 shortcut_manager::shortcut_manager ()
48 { 48 {
49 setObjectName ("Shortcut_Manager"); 49 setObjectName ("Shortcut_Manager");
50 50
51 // Mac: don't let Qt interpret CMD key ("Meta" in Qt terminology) as Ctrl 51 // Mac: don't let Qt interpret CMD key ("Meta" in Qt terminology) as Ctrl
52 #if defined (Q_OS_MAC) 52 #if defined (Q_OS_MAC)
53 QCoreApplication::setAttribute (Qt::AA_MacDontSwapCtrlAndMeta, true); 53 QCoreApplication::setAttribute (Qt::AA_MacDontSwapCtrlAndMeta, true);
54 #endif 54 #endif
55 55
85 85
86 void 86 void
87 shortcut_manager::do_init_data () 87 shortcut_manager::do_init_data ()
88 { 88 {
89 QKeySequence ctrl; 89 QKeySequence ctrl;
90 int prefix; 90 int prefix;
91 #if defined (Q_OS_MAC) 91 #if defined (Q_OS_MAC)
92 // Use CMD key as an equivalent of Ctrl key on other platforms 92 // Use CMD key as an equivalent of Ctrl key on other platforms
93 ctrl = Qt::MetaModifier; 93 ctrl = Qt::MetaModifier;
94 // Some of octave default shortcuts on windows/linux are already defined 94 // Some of octave default shortcuts on windows/linux are already defined
95 // as system wide shortcuts on Mac Os X (almost all Function keys). 95 // as system wide shortcuts on Mac Os X (almost all Function keys).
96 // Prefix those with Option (Alt) modifier to avoid conflicts. 96 // Prefix those with Option (Alt) modifier to avoid conflicts.
97 prefix = Qt::AltModifier; 97 prefix = Qt::AltModifier;
98 #else 98 #else
99 ctrl = Qt::ControlModifier; 99 ctrl = Qt::ControlModifier;
100 prefix = Qt::NoModifier; 100 prefix = Qt::NoModifier;
101 #endif 101 #endif
102 102
103 QKeySequence ctrl_shift = ctrl + Qt::ShiftModifier; 103 QKeySequence ctrl_shift = ctrl + Qt::ShiftModifier;
104 QKeySequence ctrl_alt = ctrl + Qt::AltModifier; 104 QKeySequence ctrl_alt = ctrl + Qt::AltModifier;
105 105
106 // actions of the main window 106 // actions of the main window
107 107
108 // file 108 // file
109 init (tr ("New File"), "main_file:new_file", QKeySequence::New); 109 init (tr ("New File"), "main_file:new_file", QKeySequence::New);
110 init (tr ("New Function"), "main_file:new_function", 110 init (tr ("New Function"), "main_file:new_function",
128 QKeySequence ()); 128 QKeySequence ());
129 init (tr ("Clear Command History"), "main_edit:clear_history", 129 init (tr ("Clear Command History"), "main_edit:clear_history",
130 QKeySequence ()); 130 QKeySequence ());
131 init (tr ("Clear Workspace"), "main_edit:clear_workspace", QKeySequence ()); 131 init (tr ("Clear Workspace"), "main_edit:clear_workspace", QKeySequence ());
132 132
133 // debug 133 // debug
134 init (tr ("Step Over"), "main_debug:step_over", 134 init (tr ("Step Over"), "main_debug:step_over",
135 QKeySequence (prefix + Qt::Key_F10)); 135 QKeySequence (prefix + Qt::Key_F10));
136 init (tr ("Step Into"), "main_debug:step_into", 136 init (tr ("Step Into"), "main_debug:step_into",
137 QKeySequence (prefix + Qt::Key_F11)); 137 QKeySequence (prefix + Qt::Key_F11));
138 init (tr ("Step Out"), "main_debug:step_out", 138 init (tr ("Step Out"), "main_debug:step_out",
139 QKeySequence (prefix + Qt::ShiftModifier + Qt::Key_F11)); 139 QKeySequence (prefix + Qt::ShiftModifier + Qt::Key_F11));
140 init (tr ("Continue"), "main_debug:continue", 140 init (tr ("Continue"), "main_debug:continue",
141 QKeySequence (prefix + Qt::Key_F5)); 141 QKeySequence (prefix + Qt::Key_F5));
142 init (tr ("Quit Debug Mode"), "main_debug:quit", 142 init (tr ("Quit Debug Mode"), "main_debug:quit",
143 QKeySequence (prefix + Qt::ShiftModifier + Qt::Key_F5)); 143 QKeySequence (prefix + Qt::ShiftModifier + Qt::Key_F5));
144 144
145 // window 145 // window
146 init (tr ("Show Command Window"), "main_window:show_command", 146 init (tr ("Show Command Window"), "main_window:show_command",
147 prefix + ctrl_shift + Qt::Key_0); 147 prefix + ctrl_shift + Qt::Key_0);
148 init (tr ("Show Command History"), "main_window:show_history", 148 init (tr ("Show Command History"), "main_window:show_history",
149 prefix + ctrl_shift + Qt::Key_1); 149 prefix + ctrl_shift + Qt::Key_1);
150 init (tr ("Show File Browser"), "main_window:show_file_browser", 150 init (tr ("Show File Browser"), "main_window:show_file_browser",
151 prefix + ctrl_shift + Qt::Key_2); 151 prefix + ctrl_shift + Qt::Key_2);
152 init (tr ("Show Workspace"), "main_window:show_workspace", 152 init (tr ("Show Workspace"), "main_window:show_workspace",
153 prefix + ctrl_shift + Qt::Key_3); 153 prefix + ctrl_shift + Qt::Key_3);
154 init (tr ("Show Editor"), "main_window:show_editor", 154 init (tr ("Show Editor"), "main_window:show_editor",
155 prefix + ctrl_shift + Qt::Key_4); 155 prefix + ctrl_shift + Qt::Key_4);
156 init (tr ("Show Documentation"), "main_window:show_doc", 156 init (tr ("Show Documentation"), "main_window:show_doc",
157 prefix + ctrl_shift + Qt::Key_5); 157 prefix + ctrl_shift + Qt::Key_5);
158 init (tr ("Command Window"), "main_window:command", 158 init (tr ("Command Window"), "main_window:command",
159 prefix + ctrl + Qt::Key_0); 159 prefix + ctrl + Qt::Key_0);
160 init (tr ("Command History"), "main_window:history", 160 init (tr ("Command History"), "main_window:history",
161 prefix + ctrl + Qt::Key_1); 161 prefix + ctrl + Qt::Key_1);
162 init (tr ("File Browser"), "main_window:file_browser", 162 init (tr ("File Browser"), "main_window:file_browser",
163 prefix + ctrl + Qt::Key_2); 163 prefix + ctrl + Qt::Key_2);
164 init (tr ("Workspace"), "main_window:workspace", 164 init (tr ("Workspace"), "main_window:workspace",
165 prefix + ctrl + Qt::Key_3); 165 prefix + ctrl + Qt::Key_3);
166 init (tr ("Editor"), "main_window:editor", 166 init (tr ("Editor"), "main_window:editor",
167 prefix + ctrl + Qt::Key_4); 167 prefix + ctrl + Qt::Key_4);
168 init (tr ("Documentation"), "main_window:doc", 168 init (tr ("Documentation"), "main_window:doc",
169 prefix + ctrl + Qt::Key_5); 169 prefix + ctrl + Qt::Key_5);
170 init (tr ("Reset Window Layout"), "main_window:reset", QKeySequence ()); 170 init (tr ("Reset Window Layout"), "main_window:reset", QKeySequence ());
171 171
172 // help 172 // help
173 init (tr ("Show Ondisk Documentation"), "main_help:ondisk_doc", QKeySequence ()); 173 init (tr ("Show Ondisk Documentation"), "main_help:ondisk_doc", QKeySequence ());
202 init (tr ("Cut"), "editor_edit:cut", QKeySequence::Cut); 202 init (tr ("Cut"), "editor_edit:cut", QKeySequence::Cut);
203 init (tr ("Paste"), "editor_edit:paste", QKeySequence::Paste); 203 init (tr ("Paste"), "editor_edit:paste", QKeySequence::Paste);
204 init (tr ("Select All"), "editor_edit:select_all", QKeySequence::SelectAll); 204 init (tr ("Select All"), "editor_edit:select_all", QKeySequence::SelectAll);
205 init (tr ("Find and Replace"), "editor_edit:find_replace", 205 init (tr ("Find and Replace"), "editor_edit:find_replace",
206 QKeySequence::Find); 206 QKeySequence::Find);
207 init (tr ("Delete to Start of Word"), "editor_edit:delete_start_word", 207 init (tr ("Delete to Start of Word"), "editor_edit:delete_start_word",
208 QKeySequence::DeleteStartOfWord); 208 QKeySequence::DeleteStartOfWord);
209 init (tr ("Delete to End of Word"), "editor_edit:delete_end_word", 209 init (tr ("Delete to End of Word"), "editor_edit:delete_end_word",
210 QKeySequence::DeleteEndOfWord); 210 QKeySequence::DeleteEndOfWord);
211 init (tr ("Delete to Start of Line"), "editor_edit:delete_start_line", 211 init (tr ("Delete to Start of Line"), "editor_edit:delete_start_line",
212 QKeySequence (ctrl_shift + Qt::Key_Backspace)); 212 QKeySequence (ctrl_shift + Qt::Key_Backspace));
213 init (tr ("Delete to End of Line"), "editor_edit:delete_end_line", 213 init (tr ("Delete to End of Line"), "editor_edit:delete_end_line",
214 QKeySequence (ctrl_shift + Qt::Key_Delete)); 214 QKeySequence (ctrl_shift + Qt::Key_Delete));
215 init (tr ("Delete Line"), "editor_edit:delete_line", 215 init (tr ("Delete Line"), "editor_edit:delete_line",
216 QKeySequence (ctrl_shift + Qt::Key_L)); 216 QKeySequence (ctrl_shift + Qt::Key_L));
217 init (tr ("Copy Line"), "editor_edit:copy_line", 217 init (tr ("Copy Line"), "editor_edit:copy_line",
218 QKeySequence (ctrl_shift + Qt::Key_C)); 218 QKeySequence (ctrl_shift + Qt::Key_C));
219 init (tr ("Cut Line"), "editor_edit:cut_line", 219 init (tr ("Cut Line"), "editor_edit:cut_line",
220 QKeySequence (ctrl_shift + Qt::Key_X)); 220 QKeySequence (ctrl_shift + Qt::Key_X));
221 init (tr ("Duplicate Selection/Line"), "editor_edit:duplicate_selection", 221 init (tr ("Duplicate Selection/Line"), "editor_edit:duplicate_selection",
222 QKeySequence (ctrl + Qt::Key_D)); 222 QKeySequence (ctrl + Qt::Key_D));
223 init (tr ("Transpose Line"), "editor_edit:transpose_line", 223 init (tr ("Transpose Line"), "editor_edit:transpose_line",
224 QKeySequence (ctrl + Qt::Key_T)); 224 QKeySequence (ctrl + Qt::Key_T));
225 init (tr ("Completion List"), "editor_edit:completion_list", 225 init (tr ("Completion List"), "editor_edit:completion_list",
226 QKeySequence (ctrl + Qt::Key_Space)); 226 QKeySequence (ctrl + Qt::Key_Space));
227 227
228 init (tr ("Comment Selection"), "editor_edit:comment_selection", 228 init (tr ("Comment Selection"), "editor_edit:comment_selection",
229 QKeySequence (ctrl + Qt::Key_R)); 229 QKeySequence (ctrl + Qt::Key_R));
230 init (tr ("Uncomment Selection"), "editor_edit:uncomment_selection", 230 init (tr ("Uncomment Selection"), "editor_edit:uncomment_selection",
231 QKeySequence (ctrl_shift + Qt::Key_R)); 231 QKeySequence (ctrl_shift + Qt::Key_R));
232 init (tr ("Uppercase Selection"), "editor_edit:upper_case", 232 init (tr ("Uppercase Selection"), "editor_edit:upper_case",
233 QKeySequence (ctrl + Qt::Key_U)); 233 QKeySequence (ctrl + Qt::Key_U));
234 init (tr ("Lowercase Selection"), "editor_edit:lower_case", 234 init (tr ("Lowercase Selection"), "editor_edit:lower_case",
235 QKeySequence (ctrl_alt + Qt::Key_U)); 235 QKeySequence (ctrl_alt + Qt::Key_U));
236 236
237 #if defined (Q_OS_MAC) 237 #if defined (Q_OS_MAC)
238 init (tr ("Indent Selection"), "editor_edit:indent_selection", 238 init (tr ("Indent Selection"), "editor_edit:indent_selection",
239 QKeySequence (prefix + Qt::Key_Tab)); 239 QKeySequence (prefix + Qt::Key_Tab));
240 init (tr ("Unindent Selection"), "editor_edit:unindent_selection", 240 init (tr ("Unindent Selection"), "editor_edit:unindent_selection",
241 QKeySequence (prefix + Qt::ShiftModifier + Qt::Key_Tab)); 241 QKeySequence (prefix + Qt::ShiftModifier + Qt::Key_Tab));
242 #else 242 #else
243 init (tr ("Indent Selection"), "editor_edit:indent_selection", 243 init (tr ("Indent Selection"), "editor_edit:indent_selection",
244 QKeySequence (ctrl + Qt::Key_Tab)); 244 QKeySequence (ctrl + Qt::Key_Tab));
245 init (tr ("Unindent Selection"), "editor_edit:unindent_selection", 245 init (tr ("Unindent Selection"), "editor_edit:unindent_selection",
246 QKeySequence (ctrl_shift + Qt::Key_Tab)); 246 QKeySequence (ctrl_shift + Qt::Key_Tab));
247 #endif 247 #endif
248 248
249 init (tr ("Convert Line Ednings to Windows"), "editor_edit:conv_eol_winows", 249 init (tr ("Convert Line Ednings to Windows"), "editor_edit:conv_eol_winows",
250 QKeySequence ()); 250 QKeySequence ());
251 init (tr ("Convert Line Ednings to Unix"), "editor_edit:conv_eol_unix", 251 init (tr ("Convert Line Ednings to Unix"), "editor_edit:conv_eol_unix",
252 QKeySequence ()); 252 QKeySequence ());
253 init (tr ("Convert Line Ednings to Mac"), "editor_edit:conv_eol_mac", 253 init (tr ("Convert Line Ednings to Mac"), "editor_edit:conv_eol_mac",
254 QKeySequence ()); 254 QKeySequence ());
255 255
256 init (tr ("Goto Line"), "editor_edit:goto_line", 256 init (tr ("Goto Line"), "editor_edit:goto_line",
257 QKeySequence (ctrl + Qt::Key_G)); 257 QKeySequence (ctrl + Qt::Key_G));
258 init (tr ("Toggle Bookmark"), "editor_edit:toggle_bookmark", 258 init (tr ("Toggle Bookmark"), "editor_edit:toggle_bookmark",
259 QKeySequence (prefix + Qt::Key_F7)); 259 QKeySequence (prefix + Qt::Key_F7));
260 init (tr ("Next Bookmark"), "editor_edit:next_bookmark", 260 init (tr ("Next Bookmark"), "editor_edit:next_bookmark",
261 QKeySequence (prefix + Qt::Key_F2)); 261 QKeySequence (prefix + Qt::Key_F2));
293 QKeySequence ()); 293 QKeySequence ());
294 init (tr ("Remove All Breakpoints"), "editor_debug:remove_breakpoints", 294 init (tr ("Remove All Breakpoints"), "editor_debug:remove_breakpoints",
295 QKeySequence ()); 295 QKeySequence ());
296 296
297 // run 297 // run
298 init (tr ("Run File"), "editor_run:run_file", 298 init (tr ("Run File"), "editor_run:run_file",
299 QKeySequence (prefix + Qt::Key_F5) ); 299 QKeySequence (prefix + Qt::Key_F5) );
300 init (tr ("Run Selection"), "editor_run:run_selection", 300 init (tr ("Run Selection"), "editor_run:run_selection",
301 QKeySequence (prefix + Qt::Key_F9) ); 301 QKeySequence (prefix + Qt::Key_F9) );
302 302
303 // help 303 // help
304 init (tr ("Help on Keyword"), "editor_help:help_keyword", QKeySequence::HelpContents); 304 init (tr ("Help on Keyword"), "editor_help:help_keyword", QKeySequence::HelpContents);
305 init (tr ("Document on Keyword"), "editor_help:doc_keyword", QKeySequence (Qt::SHIFT + Qt::Key_F1)); 305 init (tr ("Document on Keyword"), "editor_help:doc_keyword", QKeySequence (Qt::SHIFT + Qt::Key_F1));