forked from qt-creator/qt-creator
Help: Fix missing page switching keyboard shortcuts for external window
Which are relevant now that external windows support multiple pages. Change-Id: Ibc748e9e0582c8d54264af535c32aa2702f91631 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -191,8 +191,6 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
|
||||
HelpPluginPrivate::HelpPluginPrivate()
|
||||
{
|
||||
Context modecontext(Help::Constants::C_MODE_HELP);
|
||||
|
||||
const QString &locale = ICore::userInterfaceLanguage();
|
||||
if (!locale.isEmpty()) {
|
||||
auto qtr = new QTranslator(this);
|
||||
@@ -284,29 +282,6 @@ HelpPluginPrivate::HelpPluginPrivate()
|
||||
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_SUPPORT);
|
||||
connect(action, &QAction::triggered, this, &HelpPluginPrivate::slotSystemInformation);
|
||||
|
||||
if (ActionContainer *windowMenu = ActionManager::actionContainer(Core::Constants::M_WINDOW)) {
|
||||
// reuse EditorManager constants to avoid a second pair of menu actions
|
||||
// Goto Previous In History Action
|
||||
action = new QAction(this);
|
||||
Command *ctrlTab = ActionManager::registerAction(action, Core::Constants::GOTOPREVINHISTORY,
|
||||
modecontext);
|
||||
windowMenu->addAction(ctrlTab, Core::Constants::G_WINDOW_NAVIGATE);
|
||||
connect(action,
|
||||
&QAction::triggered,
|
||||
m_centralWidget->openPagesManager(),
|
||||
&OpenPagesManager::gotoPreviousPage);
|
||||
|
||||
// Goto Next In History Action
|
||||
action = new QAction(this);
|
||||
Command *ctrlShiftTab = ActionManager::registerAction(action, Core::Constants::GOTONEXTINHISTORY,
|
||||
modecontext);
|
||||
windowMenu->addAction(ctrlShiftTab, Core::Constants::G_WINDOW_NAVIGATE);
|
||||
connect(action,
|
||||
&QAction::triggered,
|
||||
m_centralWidget->openPagesManager(),
|
||||
&OpenPagesManager::gotoNextPage);
|
||||
}
|
||||
|
||||
connect(&helpIndexFilter, &HelpIndexFilter::linksActivated,
|
||||
this, &HelpPluginPrivate::showLinksInCurrentViewer);
|
||||
|
||||
|
||||
@@ -261,8 +261,35 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
|
||||
layout->addWidget(m_filterComboBox);
|
||||
connect(m_filterComboBox, QOverload<int>::of(&QComboBox::activated),
|
||||
LocalHelpManager::instance(), &LocalHelpManager::setFilterIndex);
|
||||
connect(LocalHelpManager::instance(), &LocalHelpManager::filterIndexChanged,
|
||||
m_filterComboBox, &QComboBox::setCurrentIndex);
|
||||
connect(LocalHelpManager::instance(),
|
||||
&LocalHelpManager::filterIndexChanged,
|
||||
m_filterComboBox,
|
||||
&QComboBox::setCurrentIndex);
|
||||
|
||||
Core::ActionContainer *windowMenu = Core::ActionManager::actionContainer(
|
||||
Core::Constants::M_WINDOW);
|
||||
if (QTC_GUARD(windowMenu)) {
|
||||
// reuse EditorManager constants to avoid a second pair of menu actions
|
||||
m_gotoPrevious = new QAction(this);
|
||||
cmd = Core::ActionManager::registerAction(m_gotoPrevious,
|
||||
Core::Constants::GOTOPREVINHISTORY,
|
||||
context);
|
||||
windowMenu->addAction(cmd, Core::Constants::G_WINDOW_NAVIGATE);
|
||||
connect(m_gotoPrevious,
|
||||
&QAction::triggered,
|
||||
openPagesManager(),
|
||||
&OpenPagesManager::gotoPreviousPage);
|
||||
|
||||
m_gotoNext = new QAction(this);
|
||||
cmd = Core::ActionManager::registerAction(m_gotoNext,
|
||||
Core::Constants::GOTONEXTINHISTORY,
|
||||
context);
|
||||
windowMenu->addAction(cmd, Core::Constants::G_WINDOW_NAVIGATE);
|
||||
connect(m_gotoNext,
|
||||
&QAction::triggered,
|
||||
openPagesManager(),
|
||||
&OpenPagesManager::gotoNextPage);
|
||||
}
|
||||
} else {
|
||||
layout->addWidget(new QLabel(), 10);
|
||||
}
|
||||
|
||||
@@ -161,6 +161,8 @@ private:
|
||||
QAction *m_resetScale = nullptr;
|
||||
QAction *m_printAction = nullptr;
|
||||
QAction *m_copy = nullptr;
|
||||
QAction *m_gotoPrevious = nullptr;
|
||||
QAction *m_gotoNext = nullptr;
|
||||
|
||||
QStackedWidget *m_viewerStack = nullptr;
|
||||
QPrinter *m_printer = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user