aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/help/indexwindow.cpp
diff options
context:
space:
mode:
authorEike Ziller <[email protected]>2014-10-01 17:52:57 +0200
committerEike Ziller <[email protected]>2014-10-13 11:17:13 +0200
commit3c59cdd0319fbf1099f378907aeac514d1d57810 (patch)
treef23f085d9bd6636bc58feba8556f005c665f0d66 /src/shared/help/indexwindow.cpp
parent286dd71a5d9cf79cb42d70543347fb5a915eddae (diff)
Add index and filter combo box to external help window
Change-Id: Icc815379220c55d9d7dc5d154278ba21ce2e9984 Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/shared/help/indexwindow.cpp')
-rw-r--r--src/shared/help/indexwindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/shared/help/indexwindow.cpp b/src/shared/help/indexwindow.cpp
index 6f5029a927f..bd4fc153cac 100644
--- a/src/shared/help/indexwindow.cpp
+++ b/src/shared/help/indexwindow.cpp
@@ -57,6 +57,7 @@ using namespace Help::Internal;
IndexWindow::IndexWindow()
: m_searchLineEdit(0)
, m_indexWidget(0)
+ , m_isOpenInNewPageActionVisible(true)
{
QVBoxLayout *layout = new QVBoxLayout(this);
@@ -110,6 +111,11 @@ IndexWindow::~IndexWindow()
{
}
+void IndexWindow::setOpenInNewPageActionVisible(bool visible)
+{
+ m_isOpenInNewPageActionVisible = visible;
+}
+
void IndexWindow::filterIndices(const QString &filter)
{
QModelIndex bestMatch;
@@ -154,13 +160,15 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e)
if (idx.isValid()) {
QMenu menu;
QAction *curTab = menu.addAction(tr("Open Link"));
- QAction *newTab = menu.addAction(tr("Open Link as New Page"));
+ QAction *newTab = 0;
+ if (m_isOpenInNewPageActionVisible)
+ newTab = menu.addAction(tr("Open Link as New Page"));
menu.move(m_indexWidget->mapToGlobal(ctxtEvent->pos()));
QAction *action = menu.exec();
if (curTab == action)
open(idx);
- else if (newTab == action)
+ else if (newTab && newTab == action)
open(idx, true/*newPage*/);
}
} else if (m_indexWidget && obj == m_indexWidget->viewport()