Skip to content
Snippets Groups Projects
Commit e8161ebd authored by con's avatar con
Browse files

Fixes: Copy from help sidebar doesn't work

parent fcc271b6
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,25 @@ public:
virtual QString contextHelpId() const { return QString(); }
};
class BaseContext : public Core::IContext
{
public:
BaseContext(QWidget *widget, const QList<int> &context, QObject *parent = 0)
: Core::IContext(parent),
m_widget(widget),
m_context(context)
{
}
QList<int> context() const { return m_context; }
QWidget *widget() { return m_widget; }
private:
QWidget *m_widget;
QList<int> m_context;
};
} // namespace Core
#endif //ICONTEXT_H
......@@ -374,6 +374,17 @@ void HelpPlugin::createRightPaneSideBar()
m_helpViewerForSideBar = new HelpViewer(m_helpEngine, 0);
rightPaneLayout->addWidget(m_helpViewerForSideBar);
m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar, QList<int>()
<< m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR),
this));
QAction *copyActionSideBar = new QAction(this);
Core::Command *cmd = m_core->actionManager()->registerAction(copyActionSideBar,
Core::Constants::COPY, QList<int>()
<< m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR));
connect(copyActionSideBar, SIGNAL(triggered()), this, SLOT(copyFromSideBar()));
copyActionSideBar->setText(cmd->action()->text());
copyActionSideBar->setIcon(cmd->action()->icon());
m_rightPaneSideBar = new QWidget;
m_rightPaneSideBar->setLayout(rightPaneLayout);
......@@ -381,6 +392,11 @@ void HelpPlugin::createRightPaneSideBar()
addAutoReleasedObject(new Core::BaseRightPaneWidget(m_rightPaneSideBar));
}
void HelpPlugin::copyFromSideBar()
{
m_helpViewerForSideBar->copy();
}
void HelpPlugin::rightPaneBackward()
{
m_helpViewerForSideBar->backward();
......
......@@ -64,10 +64,10 @@ class SideBarItem;
namespace Help {
namespace Constants {
const char * const HELPVIEWER_KIND = "Qt Help Viewer";
const char * const C_MODE_HELP = "Help Mode";
const int P_MODE_HELP = 70;
const char * const ID_MODE_HELP = "Help";
const char * const C_MODE_HELP = "Help Mode";
const char * const C_HELP_SIDEBAR = "Help Sidebar";
const int P_MODE_HELP = 70;
const char * const ID_MODE_HELP = "Help";
}
class HELP_EXPORT HelpManager : public QObject
......@@ -124,6 +124,7 @@ private slots:
void switchToHelpMode(const QUrl &source);
void switchToHelpMode(const QMap<QString, QUrl> &urls, const QString &keyword);
void slotHideRightPane();
void copyFromSideBar();
void openGettingStarted();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment