forked from qt-creator/qt-creator
Debugger: Provide keyboard shortcuts for "next" and "previous"
... to applicable analyzers. Rather than inventing separate shortcut categories for all the analyzers, we make use of the fact that only one analyzer view is active at any given time, and make them use the same shortcuts for consistency. Fixes: QTCREATORBUG-20659 Change-Id: Ifa60080def0e6b32395854cff588ab3af9ea33b9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -152,7 +152,12 @@ public:
|
||||
|
||||
void setCurrentPerspective(Perspective *perspective)
|
||||
{
|
||||
const Core::Context oldContext = m_currentPerspective
|
||||
? Context(Id::fromString(m_currentPerspective->id())) : Context();
|
||||
m_currentPerspective = perspective;
|
||||
const Core::Context newContext = m_currentPerspective
|
||||
? Context(Id::fromString(m_currentPerspective->id())) : Context();
|
||||
ICore::updateAdditionalContexts(oldContext, newContext);
|
||||
}
|
||||
|
||||
DebuggerMainWindow *q = nullptr;
|
||||
@@ -861,6 +866,21 @@ void Perspective::addToolbarSeparator()
|
||||
d->m_innerToolBarLayout->addWidget(new StyledSeparator(d->m_innerToolBar));
|
||||
}
|
||||
|
||||
void Perspective::registerNextPrevShortcuts(QAction *next, QAction *prev)
|
||||
{
|
||||
static const char nextId[] = "Analyzer.nextitem";
|
||||
static const char prevId[] = "Analyzer.previtem";
|
||||
|
||||
next->setText(tr("Next Item"));
|
||||
Command * const nextCmd = ActionManager::registerAction(next, nextId,
|
||||
Context(Id::fromString(id())));
|
||||
nextCmd->augmentActionWithShortcutToolTip(next);
|
||||
prev->setText(tr("Previous Item"));
|
||||
Command * const prevCmd = ActionManager::registerAction(prev, prevId,
|
||||
Context(Id::fromString(id())));
|
||||
prevCmd->augmentActionWithShortcutToolTip(prev);
|
||||
}
|
||||
|
||||
QWidget *Perspective::centralWidget() const
|
||||
{
|
||||
return d->m_centralWidget;
|
||||
|
||||
Reference in New Issue
Block a user