Commit 65cfc2373726c12d03f37af61d753c33fa2c82ec

  • avatar
  • con <qtc-committer @no…a.com>
  • Fri Oct 09 13:34:56 CEST 2009
Enable multi key shortcuts on the Mac.

Since that was fixed in Qt.
(cherry picked from commit fe9d0bf3c5056a5336ed0fe235db2ae9aec79155)
  
325325 mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE);
326326 connect(m_d->m_goForwardAction, SIGNAL(triggered()), this, SLOT(goForwardInNavigationHistory()));
327327
328#ifdef Q_WS_MAC
329 QString prefix = tr("Meta+E");
330#else
331 QString prefix = tr("Ctrl+E");
332#endif
333
328334 m_d->m_splitAction = new QAction(tr("Split"), this);
329335 cmd = am->registerAction(m_d->m_splitAction, Constants::SPLIT, editManagerContext);
330#ifndef Q_WS_MAC
331 cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,2")));
332#endif
336 cmd->setDefaultKeySequence(QKeySequence(tr("%1,2").arg(prefix)));
333337 mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
334338 connect(m_d->m_splitAction, SIGNAL(triggered()), this, SLOT(split()));
335339
336340 m_d->m_splitSideBySideAction = new QAction(tr("Split Side by Side"), this);
337341 cmd = am->registerAction(m_d->m_splitSideBySideAction, Constants::SPLIT_SIDE_BY_SIDE, editManagerContext);
338#ifndef Q_WS_MAC
339 cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,3")));
340#endif
342 cmd->setDefaultKeySequence(QKeySequence(tr("%1,3").arg(prefix)));
341343 mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
342344 connect(m_d->m_splitSideBySideAction, SIGNAL(triggered()), this, SLOT(splitSideBySide()));
343345
344346 m_d->m_removeCurrentSplitAction = new QAction(tr("Remove Current Split"), this);
345347 cmd = am->registerAction(m_d->m_removeCurrentSplitAction, Constants::REMOVE_CURRENT_SPLIT, editManagerContext);
346#ifndef Q_WS_MAC
347 cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,0")));
348#endif
348 cmd->setDefaultKeySequence(QKeySequence(tr("%1,0").arg(prefix)));
349349 mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
350350 connect(m_d->m_removeCurrentSplitAction, SIGNAL(triggered()), this, SLOT(removeCurrentSplit()));
351351
352352 m_d->m_removeAllSplitsAction = new QAction(tr("Remove All Splits"), this);
353353 cmd = am->registerAction(m_d->m_removeAllSplitsAction, Constants::REMOVE_ALL_SPLITS, editManagerContext);
354#ifndef Q_WS_MAC
355 cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,1")));
356#endif
354 cmd->setDefaultKeySequence(QKeySequence(tr("%1,1").arg(prefix)));
357355 mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
358356 connect(m_d->m_removeAllSplitsAction, SIGNAL(triggered()), this, SLOT(removeAllSplits()));
359357
360358 m_d->m_gotoOtherSplitAction = new QAction(tr("Goto Other Split"), this);
361359 cmd = am->registerAction(m_d->m_gotoOtherSplitAction, Constants::GOTO_OTHER_SPLIT, editManagerContext);
362#ifndef Q_WS_MAC
363 cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+E,o")));
364#endif
360 cmd->setDefaultKeySequence(QKeySequence(tr("%1,o").arg(prefix)));
365361 mwindow->addAction(cmd, Constants::G_WINDOW_SPLIT);
366362 connect(m_d->m_gotoOtherSplitAction, SIGNAL(triggered()), this, SLOT(gotoOtherSplit()));
367363
  
113113
114114 m_postAction = new QAction(tr("Paste Snippet..."), this);
115115 command = actionManager->registerAction(m_postAction, "CodePaster.Post", globalcontext);
116#ifndef Q_WS_MAC
117116 command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+P")));
118#endif
119117 connect(m_postAction, SIGNAL(triggered()), this, SLOT(post()));
120118 cpContainer->addAction(command);
121119
122120 m_fetchAction = new QAction(tr("Fetch Snippet..."), this);
123121 command = actionManager->registerAction(m_fetchAction, "CodePaster.Fetch", globalcontext);
124#ifndef Q_WS_MAC
125122 command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+F")));
126#endif
127123 connect(m_fetchAction, SIGNAL(triggered()), this, SLOT(fetch()));
128124 cpContainer->addAction(command);
129125
  
264264 command = ami->registerAction(m_addAction, CMD_ID_ADD,
265265 globalcontext);
266266 command->setAttribute(Core::Command::CA_UpdateText);
267#ifndef Q_WS_MAC
268267 command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+A")));
269#endif
270268 connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
271269 cvsMenu->addAction(command);
272270
294294 command = ami->registerAction(m_diffCurrentAction,
295295 CMD_ID_DIFF_CURRENT, globalcontext);
296296 command->setAttribute(Core::Command::CA_UpdateText);
297#ifndef Q_WS_MAC
298297 command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+D")));
299#endif
300298 connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
301299 cvsMenu->addAction(command);
302300
310310 command = ami->registerAction(m_commitCurrentAction,
311311 CMD_ID_COMMIT_CURRENT, globalcontext);
312312 command->setAttribute(Core::Command::CA_UpdateText);
313#ifndef Q_WS_MAC
314313 command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+C")));
315#endif
316314 connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile()));
317315 cvsMenu->addAction(command);
318316
  
241241 m_diffAction = new Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
242242 command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext);
243243 command->setAttribute(Core::Command::CA_UpdateText);
244#ifndef Q_WS_MAC
245244 command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+D")));
246#endif
247245 connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
248246 gitContainer->addAction(command);
249247
250248 m_statusAction = new Utils::ParameterAction(tr("File Status"), tr("Status Related to \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
251249 command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext);
252#ifndef Q_WS_MAC
253250 command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S")));
254#endif
255251 command->setAttribute(Core::Command::CA_UpdateText);
256252 connect(m_statusAction, SIGNAL(triggered()), this, SLOT(statusFile()));
257253 gitContainer->addAction(command);
258254
259255 m_logAction = new Utils::ParameterAction(tr("Log File"), tr("Log of \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
260256 command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext);
261#ifndef Q_WS_MAC
262257 command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L")));
263#endif
264258 command->setAttribute(Core::Command::CA_UpdateText);
265259 connect(m_logAction, SIGNAL(triggered()), this, SLOT(logFile()));
266260 gitContainer->addAction(command);
267261
268262 m_blameAction = new Utils::ParameterAction(tr("Blame"), tr("Blame for \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
269263 command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext);
270#ifndef Q_WS_MAC
271264 command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B")));
272#endif
273265 command->setAttribute(Core::Command::CA_UpdateText);
274266 connect(m_blameAction, SIGNAL(triggered()), this, SLOT(blameFile()));
275267 gitContainer->addAction(command);
276268
277269 m_undoFileAction = new Utils::ParameterAction(tr("Undo Changes"), tr("Undo Changes for \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
278270 command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext);
279#ifndef Q_WS_MAC
280271 command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U")));
281#endif
282272 command->setAttribute(Core::Command::CA_UpdateText);
283273 connect(m_undoFileAction, SIGNAL(triggered()), this, SLOT(undoFileChanges()));
284274 gitContainer->addAction(command);
285275
286276 m_stageAction = new Utils::ParameterAction(tr("Stage File for Commit"), tr("Stage \"%1\" for Commit"), Utils::ParameterAction::AlwaysEnabled, this);
287277 command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext);
288#ifndef Q_WS_MAC
289278 command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A")));
290#endif
291279 command->setAttribute(Core::Command::CA_UpdateText);
292280 connect(m_stageAction, SIGNAL(triggered()), this, SLOT(stageFile()));
293281 gitContainer->addAction(command);
290290
291291 m_diffProjectAction = new Utils::ParameterAction(tr("Diff Current Project"), tr("Diff Project \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
292292 command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext);
293#ifndef Q_WS_MAC
294293 command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D"));
295#endif
296294 command->setAttribute(Core::Command::CA_UpdateText);
297295 connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
298296 gitContainer->addAction(command);
303303
304304 m_logProjectAction = new Utils::ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
305305 command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext);
306#ifndef Q_WS_MAC
307306 command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K")));
308#endif
309307 command->setAttribute(Core::Command::CA_UpdateText);
310308 connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
311309 gitContainer->addAction(command);
338338
339339 m_commitAction = new QAction(tr("Commit..."), this);
340340 command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext);
341#ifndef Q_WS_MAC
342341 command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C")));
343#endif
344342 command->setAttribute(Core::Command::CA_UpdateText);
345343 connect(m_commitAction, SIGNAL(triggered()), this, SLOT(startCommit()));
346344 gitContainer->addAction(command);
  
260260 m_editAction = new Utils::ParameterAction(tr("Edit"), tr("Edit \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
261261 command = am->registerAction(m_editAction, CMD_ID_EDIT, globalcontext);
262262 command->setAttribute(Core::Command::CA_UpdateText);
263#ifndef Q_WS_MAC
264263 command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+E")));
265#endif
266264 command->setDefaultText(tr("Edit File"));
267265 connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile()));
268266 mperforce->addAction(command);
268268 m_addAction = new Utils::ParameterAction(tr("Add"), tr("Add \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
269269 command = am->registerAction(m_addAction, CMD_ID_ADD, globalcontext);
270270 command->setAttribute(Core::Command::CA_UpdateText);
271#ifndef Q_WS_MAC
272271 command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+A")));
273#endif
274272 command->setDefaultText(tr("Add File"));
275273 connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
276274 mperforce->addAction(command);
283283 m_revertAction = new Utils::ParameterAction(tr("Revert"), tr("Revert \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
284284 command = am->registerAction(m_revertAction, CMD_ID_REVERT, globalcontext);
285285 command->setAttribute(Core::Command::CA_UpdateText);
286#ifndef Q_WS_MAC
287286 command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+R")));
288#endif
289287 command->setDefaultText(tr("Revert File"));
290288 connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
291289 mperforce->addAction(command);
304304 m_diffProjectAction = new Utils::ParameterAction(diffProjectDefaultText, tr("Diff Project \"%1\""), Utils::ParameterAction::AlwaysEnabled, this);
305305 command = am->registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, globalcontext);
306306 command->setAttribute(Core::Command::CA_UpdateText);
307#ifndef Q_WS_MAC
308307 command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+D")));
309#endif
310308 command->setDefaultText(diffProjectDefaultText);
311309 connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
312310 mperforce->addAction(command);
321321
322322 m_openedAction = new QAction(tr("Opened"), this);
323323 command = am->registerAction(m_openedAction, CMD_ID_OPENED, globalcontext);
324#ifndef Q_WS_MAC
325324 command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+O")));
326#endif
327325 connect(m_openedAction, SIGNAL(triggered()), this, SLOT(printOpenedFileList()));
328326 mperforce->addAction(command);
329327
369369 m_filelogCurrentAction = new Utils::ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
370370 command = am->registerAction(m_filelogCurrentAction, CMD_ID_FILELOG_CURRENT, globalcontext);
371371 command->setAttribute(Core::Command::CA_UpdateText);
372#ifndef Q_WS_MAC
373372 command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+F")));
374#endif
375373 command->setDefaultText(tr("Filelog Current File"));
376374 connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile()));
377375 mperforce->addAction(command);
  
293293 command = ami->registerAction(m_addAction, CMD_ID_ADD,
294294 globalcontext);
295295 command->setAttribute(Core::Command::CA_UpdateText);
296#ifndef Q_WS_MAC
297296 command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+A")));
298#endif
299297 connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
300298 subversionMenu->addAction(command);
301299
323323 command = ami->registerAction(m_diffCurrentAction,
324324 CMD_ID_DIFF_CURRENT, globalcontext);
325325 command->setAttribute(Core::Command::CA_UpdateText);
326#ifndef Q_WS_MAC
327326 command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+D")));
328#endif
329327 connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
330328 subversionMenu->addAction(command);
331329
339339 command = ami->registerAction(m_commitCurrentAction,
340340 CMD_ID_COMMIT_CURRENT, globalcontext);
341341 command->setAttribute(Core::Command::CA_UpdateText);
342#ifndef Q_WS_MAC
343342 command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+C")));
344#endif
345343 connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile()));
346344 subversionMenu->addAction(command);
347345
  
141141 advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT);
142142 connect(m_formatAction, SIGNAL(triggered(bool)), this, SLOT(formatAction()));
143143
144#ifdef Q_WS_MAC
145 QString modifier = tr("Meta");
146#else
147 QString modifier = tr("Ctrl");
148#endif
149
144150 m_rewrapParagraphAction = new QAction(tr("&Rewrap Paragraph"), this);
145151 command = am->registerAction(m_rewrapParagraphAction, TextEditor::Constants::REWRAP_PARAGRAPH, m_contextId);
146#ifndef Q_WS_MAC
147 command->setDefaultKeySequence(QKeySequence(tr("Ctrl+E, R")));
148#endif
152 command->setDefaultKeySequence(QKeySequence(tr("%1+E, R").arg(modifier)));
149153 advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT);
150154 connect(m_rewrapParagraphAction, SIGNAL(triggered(bool)), this, SLOT(rewrapParagraphAction()));
151155
158158 m_visualizeWhitespaceAction->setCheckable(true);
159159 command = am->registerAction(m_visualizeWhitespaceAction,
160160 TextEditor::Constants::VISUALIZE_WHITESPACE, m_contextId);
161#ifndef Q_WS_MAC
162 command->setDefaultKeySequence(QKeySequence(tr("Ctrl+E, Ctrl+V")));
163#endif
161 command->setDefaultKeySequence(QKeySequence(tr("%1+E, %2+V").arg(modifier, modifier)));
164162 advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT);
165163 connect(m_visualizeWhitespaceAction, SIGNAL(triggered(bool)), this, SLOT(setVisualizeWhitespace(bool)));
166164
172172 m_textWrappingAction = new QAction(tr("Enable Text &Wrapping"), this);
173173 m_textWrappingAction->setCheckable(true);
174174 command = am->registerAction(m_textWrappingAction, TextEditor::Constants::TEXT_WRAPPING, m_contextId);
175#ifndef Q_WS_MAC
176 command->setDefaultKeySequence(QKeySequence(tr("Ctrl+E, Ctrl+W")));
177#endif
175 command->setDefaultKeySequence(QKeySequence(tr("%1+E, %2+W").arg(modifier, modifier)));
178176 advancedMenu->addAction(command, Core::Constants::G_EDIT_FORMAT);
179177 connect(m_textWrappingAction, SIGNAL(triggered(bool)), this, SLOT(setTextWrapping(bool)));
180178