summaryrefslogtreecommitdiff
path: root/src/plugins/help
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/help')
-rw-r--r--src/plugins/help/centralwidget.cpp13
-rw-r--r--src/plugins/help/centralwidget.h5
-rw-r--r--src/plugins/help/helpplugin.cpp8
3 files changed, 19 insertions, 7 deletions
diff --git a/src/plugins/help/centralwidget.cpp b/src/plugins/help/centralwidget.cpp
index 23e4d98292..fa052a69d8 100644
--- a/src/plugins/help/centralwidget.cpp
+++ b/src/plugins/help/centralwidget.cpp
@@ -31,6 +31,7 @@
#include "helpviewer.h"
#include "localhelpmanager.h"
+#include "openpagesmanager.h"
#include "topicchooser.h"
#include <utils/qtcassert.h>
@@ -76,10 +77,18 @@ CentralWidget *CentralWidget::instance()
return gStaticCentralWidget;
}
+void CentralWidget::open(const QUrl &url, bool newPage)
+{
+ if (newPage)
+ OpenPagesManager::instance().createPage(url);
+ else
+ setSource(url);
+}
+
void CentralWidget::showTopicChooser(const QMap<QString, QUrl> &links,
- const QString &keyword)
+ const QString &keyword, bool newPage)
{
TopicChooser tc(this, keyword, links);
if (tc.exec() == QDialog::Accepted)
- setSource(tc.link());
+ open(tc.link(), newPage);
}
diff --git a/src/plugins/help/centralwidget.h b/src/plugins/help/centralwidget.h
index 37d310459e..808175a0c9 100644
--- a/src/plugins/help/centralwidget.h
+++ b/src/plugins/help/centralwidget.h
@@ -50,8 +50,11 @@ public:
static CentralWidget *instance();
+ void open(const QUrl &url, bool newPage = false);
+
public slots:
- void showTopicChooser(const QMap<QString, QUrl> &links, const QString &key);
+ void showTopicChooser(const QMap<QString, QUrl> &links, const QString &key,
+ bool newPage = false);
};
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index 1a1a3e0bb1..429541278b 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -299,10 +299,10 @@ void HelpPlugin::setupUi()
indexWindow->setWindowTitle(tr(SB_INDEX));
m_indexItem = new SideBarItem(indexWindow, QLatin1String(SB_INDEX));
- connect(indexWindow, SIGNAL(linkActivated(QUrl)), m_centralWidget,
- SLOT(setSource(QUrl)));
- connect(indexWindow, SIGNAL(linksActivated(QMap<QString,QUrl>,QString)),
- m_centralWidget, SLOT(showTopicChooser(QMap<QString,QUrl>,QString)));
+ connect(indexWindow, &IndexWindow::linkActivated,
+ m_centralWidget, &CentralWidget::open);
+ connect(indexWindow, &IndexWindow::linksActivated,
+ m_centralWidget, &CentralWidget::showTopicChooser);
QMap<QString, Command*> shortcutMap;
QAction *action = new QAction(tr("Activate Index in Help mode"), m_splitter);