forked from qt-creator/qt-creator
Fix Ctrl+M (bookmark) in editor when help mode is visible
For external windows we need to separate the contexts in which help mode's "add bookmark" and editor's "toggle bookmark" are present. Task-number: QTCREATORBUG-16286 Change-Id: I2a7a28c75dc53e1dd0b21c0a8833bd4594d5afad Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -71,9 +71,11 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
mbm->menu()->setTitle(tr("&Bookmarks"));
|
||||
mtools->addMenu(mbm);
|
||||
|
||||
const Context editorManagerContext(Core::Constants::C_EDITORMANAGER);
|
||||
|
||||
//Toggle
|
||||
m_toggleAction = new QAction(tr("Toggle Bookmark"), this);
|
||||
Command *cmd = ActionManager::registerAction(m_toggleAction, BOOKMARKS_TOGGLE_ACTION);
|
||||
Command *cmd = ActionManager::registerAction(m_toggleAction, BOOKMARKS_TOGGLE_ACTION, editorManagerContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+M") : tr("Ctrl+M")));
|
||||
mbm->addAction(cmd);
|
||||
|
||||
@@ -81,13 +83,13 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
|
||||
//Previous
|
||||
m_prevAction = new QAction(tr("Previous Bookmark"), this);
|
||||
cmd = ActionManager::registerAction(m_prevAction, BOOKMARKS_PREV_ACTION);
|
||||
cmd = ActionManager::registerAction(m_prevAction, BOOKMARKS_PREV_ACTION, editorManagerContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+,") : tr("Ctrl+,")));
|
||||
mbm->addAction(cmd);
|
||||
|
||||
//Next
|
||||
m_nextAction = new QAction(tr("Next Bookmark"), this);
|
||||
cmd = ActionManager::registerAction(m_nextAction, BOOKMARKS_NEXT_ACTION);
|
||||
cmd = ActionManager::registerAction(m_nextAction, BOOKMARKS_NEXT_ACTION, editorManagerContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+.") : tr("Ctrl+.")));
|
||||
mbm->addAction(cmd);
|
||||
|
||||
@@ -95,12 +97,12 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
|
||||
//Previous Doc
|
||||
m_docPrevAction = new QAction(tr("Previous Bookmark in Document"), this);
|
||||
cmd = ActionManager::registerAction(m_docPrevAction, BOOKMARKS_PREVDOC_ACTION);
|
||||
cmd = ActionManager::registerAction(m_docPrevAction, BOOKMARKS_PREVDOC_ACTION, editorManagerContext);
|
||||
mbm->addAction(cmd);
|
||||
|
||||
//Next Doc
|
||||
m_docNextAction = new QAction(tr("Next Bookmark in Document"), this);
|
||||
cmd = ActionManager::registerAction(m_docNextAction, BOOKMARKS_NEXTDOC_ACTION);
|
||||
cmd = ActionManager::registerAction(m_docNextAction, BOOKMARKS_NEXTDOC_ACTION, editorManagerContext);
|
||||
mbm->addAction(cmd);
|
||||
|
||||
m_editBookmarkAction = new QAction(tr("Edit Bookmark"), this);
|
||||
|
@@ -150,7 +150,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
addAutoReleasedObject(new GeneralSettingsPage());
|
||||
addAutoReleasedObject(m_searchTaskHandler = new SearchTaskHandler);
|
||||
|
||||
m_centralWidget = new CentralWidget(modecontext);
|
||||
m_centralWidget = new CentralWidget(Context("Help.CentralHelpWidget"));
|
||||
connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this,
|
||||
SLOT(updateSideBarSource(QUrl)));
|
||||
connect(m_centralWidget, &CentralWidget::closeButtonClicked,
|
||||
|
Reference in New Issue
Block a user