Commit 8cd6f190 authored by Eike Ziller's avatar Eike Ziller
Browse files

Help: Add shortcut to "Go to Help Mode" button tool tip



Change-Id: Iee56afd5dd78e1e105acffc06d4a0931b0cca036
Reviewed-by: default avatarKarsten Heimrich <karsten.heimrich@digia.com>
parent a892ae03
......@@ -66,8 +66,9 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
{
Utils::StyledBar *toolBar = new Utils::StyledBar();
QAction *switchToHelp = new QAction(tr("Go to Help Mode"), toolBar);
connect(switchToHelp, SIGNAL(triggered()), this, SLOT(helpModeButtonClicked()));
m_switchToHelp = new QAction(tr("Go to Help Mode"), toolBar);
connect(m_switchToHelp, SIGNAL(triggered()), this, SLOT(helpModeButtonClicked()));
updateHelpModeButtonToolTip();
QAction *back = new QAction(QIcon(QLatin1String(":/help/images/previous.png")),
tr("Back"), toolBar);
......@@ -84,7 +85,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
layout->setSpacing(0);
layout->setMargin(0);
layout->addWidget(toolButton(switchToHelp));
layout->addWidget(toolButton(m_switchToHelp));
layout->addWidget(toolButton(back));
layout->addWidget(toolButton(forward));
layout->addStretch();
......@@ -124,6 +125,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
cmd = Core::ActionManager::registerAction(m_openHelpMode,
Help::Constants::CONTEXT_HELP,
context);
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateHelpModeButtonToolTip()));
connect(m_openHelpMode, SIGNAL(triggered()), this, SLOT(helpModeButtonClicked()));
Core::ActionContainer *advancedMenu = Core::ActionManager::actionContainer(Core::Constants::M_EDIT_ADVANCED);
......@@ -214,5 +216,12 @@ void HelpWidget::helpModeButtonClicked()
close();
}
void HelpWidget::updateHelpModeButtonToolTip()
{
Core::Command *cmd = Core::ActionManager::command(Constants::CONTEXT_HELP);
QTC_ASSERT(cmd, return);
m_switchToHelp->setToolTip(cmd->stringWithAppendedShortcut(m_switchToHelp->text()));
}
} // Internal
} // Help
......@@ -72,8 +72,10 @@ private slots:
void updateForwardMenu();
void updateWindowTitle();
void helpModeButtonClicked();
void updateHelpModeButtonToolTip();
private:
QAction *m_switchToHelp;
QMenu *m_backMenu;
QMenu *m_forwardMenu;
QAction *m_openHelpMode;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment