2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
#include "searchwidget.h"
|
2014-10-09 16:03:27 +02:00
|
|
|
#include "helpconstants.h"
|
2015-04-21 14:48:04 +02:00
|
|
|
#include "helpplugin.h"
|
2010-11-16 14:15:23 +01:00
|
|
|
#include "localhelpmanager.h"
|
2010-03-30 17:44:28 +02:00
|
|
|
#include "openpagesmanager.h"
|
2010-03-23 18:11:43 +01:00
|
|
|
|
2014-06-12 18:01:43 +02:00
|
|
|
#include <coreplugin/coreconstants.h>
|
2015-11-23 16:41:54 +01:00
|
|
|
#include <coreplugin/coreicons.h>
|
2010-03-23 18:11:43 +01:00
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
|
#include <coreplugin/progressmanager/progressmanager.h>
|
2010-08-17 15:56:27 +02:00
|
|
|
#include <utils/styledbar.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QApplication>
|
2014-06-12 18:01:43 +02:00
|
|
|
#include <QClipboard>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QHelpEngine>
|
|
|
|
|
#include <QHelpSearchEngine>
|
|
|
|
|
#include <QHelpSearchQueryWidget>
|
|
|
|
|
#include <QHelpSearchResultWidget>
|
2014-06-12 18:01:43 +02:00
|
|
|
#include <QKeyEvent>
|
|
|
|
|
#include <QLayout>
|
|
|
|
|
#include <QMap>
|
|
|
|
|
#include <QMenu>
|
|
|
|
|
#include <QString>
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
#include <QTextBrowser>
|
|
|
|
|
#include <QToolButton>
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
using namespace Help::Internal;
|
|
|
|
|
|
2010-03-23 18:11:43 +01:00
|
|
|
SearchWidget::SearchWidget()
|
|
|
|
|
: zoomCount(0)
|
|
|
|
|
, m_progress(0)
|
|
|
|
|
, searchEngine(0)
|
2010-06-02 14:51:03 +02:00
|
|
|
, resultWidget(0)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SearchWidget::~SearchWidget()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SearchWidget::zoomIn()
|
|
|
|
|
{
|
2012-09-20 12:48:50 +02:00
|
|
|
QTextBrowser* browser = resultWidget->findChild<QTextBrowser*>();
|
2008-12-02 12:01:29 +01:00
|
|
|
if (browser && zoomCount != 10) {
|
|
|
|
|
zoomCount++;
|
|
|
|
|
browser->zoomIn();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SearchWidget::zoomOut()
|
|
|
|
|
{
|
2012-09-20 12:48:50 +02:00
|
|
|
QTextBrowser* browser = resultWidget->findChild<QTextBrowser*>();
|
2008-12-02 12:01:29 +01:00
|
|
|
if (browser && zoomCount != -5) {
|
|
|
|
|
zoomCount--;
|
|
|
|
|
browser->zoomOut();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SearchWidget::resetZoom()
|
|
|
|
|
{
|
|
|
|
|
if (zoomCount == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
2012-09-20 12:48:50 +02:00
|
|
|
QTextBrowser* browser = resultWidget->findChild<QTextBrowser*>();
|
2008-12-02 12:01:29 +01:00
|
|
|
if (browser) {
|
|
|
|
|
browser->zoomOut(zoomCount);
|
|
|
|
|
zoomCount = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-22 15:53:20 +02:00
|
|
|
void SearchWidget::reindexDocumentation()
|
|
|
|
|
{
|
|
|
|
|
if (searchEngine)
|
|
|
|
|
searchEngine->reindexDocumentation();
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-23 18:11:43 +01:00
|
|
|
void SearchWidget::showEvent(QShowEvent *event)
|
|
|
|
|
{
|
|
|
|
|
if (!event->spontaneous() && !searchEngine) {
|
|
|
|
|
QVBoxLayout *vLayout = new QVBoxLayout(this);
|
2010-08-17 15:56:27 +02:00
|
|
|
vLayout->setMargin(0);
|
|
|
|
|
vLayout->setSpacing(0);
|
2010-03-23 18:11:43 +01:00
|
|
|
|
2014-10-10 15:32:46 +02:00
|
|
|
searchEngine = new QHelpSearchEngine(&LocalHelpManager::helpEngine(), this);
|
2010-03-23 18:11:43 +01:00
|
|
|
|
2010-08-17 15:56:27 +02:00
|
|
|
Utils::StyledBar *toolbar = new Utils::StyledBar(this);
|
|
|
|
|
toolbar->setSingleRow(false);
|
|
|
|
|
QHelpSearchQueryWidget *queryWidget = searchEngine->queryWidget();
|
|
|
|
|
QLayout *tbLayout = new QVBoxLayout();
|
|
|
|
|
tbLayout->setSpacing(6);
|
|
|
|
|
tbLayout->setMargin(4);
|
|
|
|
|
tbLayout->addWidget(queryWidget);
|
|
|
|
|
toolbar->setLayout(tbLayout);
|
|
|
|
|
|
|
|
|
|
Utils::StyledBar *toolbar2 = new Utils::StyledBar(this);
|
|
|
|
|
toolbar2->setSingleRow(false);
|
|
|
|
|
tbLayout = new QVBoxLayout();
|
|
|
|
|
tbLayout->setSpacing(0);
|
|
|
|
|
tbLayout->setMargin(0);
|
|
|
|
|
tbLayout->addWidget(resultWidget = searchEngine->resultWidget());
|
|
|
|
|
toolbar2->setLayout(tbLayout);
|
|
|
|
|
|
|
|
|
|
vLayout->addWidget(toolbar);
|
|
|
|
|
vLayout->addWidget(toolbar2);
|
2010-03-23 18:11:43 +01:00
|
|
|
|
|
|
|
|
setFocusProxy(queryWidget);
|
|
|
|
|
|
|
|
|
|
connect(queryWidget, SIGNAL(search()), this, SLOT(search()));
|
2014-10-10 15:32:46 +02:00
|
|
|
connect(resultWidget, &QHelpSearchResultWidget::requestShowLink, this,
|
|
|
|
|
[this](const QUrl &url) {
|
2014-10-31 14:20:03 +01:00
|
|
|
emit linkActivated(url, currentSearchTerms(), false/*newPage*/);
|
2014-10-10 15:32:46 +02:00
|
|
|
});
|
2010-03-23 18:11:43 +01:00
|
|
|
|
|
|
|
|
connect(searchEngine, SIGNAL(searchingStarted()), this,
|
|
|
|
|
SLOT(searchingStarted()));
|
|
|
|
|
connect(searchEngine, SIGNAL(searchingFinished(int)), this,
|
|
|
|
|
SLOT(searchingFinished(int)));
|
|
|
|
|
|
2012-09-20 12:48:50 +02:00
|
|
|
QTextBrowser* browser = resultWidget->findChild<QTextBrowser*>();
|
2010-03-23 18:11:43 +01:00
|
|
|
browser->viewport()->installEventFilter(this);
|
|
|
|
|
|
|
|
|
|
connect(searchEngine, SIGNAL(indexingStarted()), this,
|
|
|
|
|
SLOT(indexingStarted()));
|
|
|
|
|
connect(searchEngine, SIGNAL(indexingFinished()), this,
|
|
|
|
|
SLOT(indexingFinished()));
|
|
|
|
|
|
2010-06-11 13:11:37 +02:00
|
|
|
QMetaObject::invokeMethod(&LocalHelpManager::helpEngine(), "setupFinished",
|
2010-03-23 18:11:43 +01:00
|
|
|
Qt::QueuedConnection);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
void SearchWidget::search() const
|
|
|
|
|
{
|
2012-03-16 15:41:59 +01:00
|
|
|
static QStringList charsToEscapeList;
|
|
|
|
|
if (charsToEscapeList.isEmpty()) {
|
|
|
|
|
charsToEscapeList << QLatin1String("\\") << QLatin1String("+")
|
|
|
|
|
<< QLatin1String("-") << QLatin1String("!") << QLatin1String("(")
|
|
|
|
|
<< QLatin1String(")") << QLatin1String(":") << QLatin1String("^")
|
|
|
|
|
<< QLatin1String("[") << QLatin1String("]") << QLatin1String("{")
|
|
|
|
|
<< QLatin1String("}") << QLatin1String("~");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QString escapeChar(QLatin1String("\\"));
|
|
|
|
|
static QRegExp regExp(QLatin1String("[\\+\\-\\!\\(\\)\\^\\[\\]\\{\\}~:]"));
|
|
|
|
|
|
|
|
|
|
QList<QHelpSearchQuery> escapedQueries;
|
|
|
|
|
const QList<QHelpSearchQuery> queries = searchEngine->queryWidget()->query();
|
|
|
|
|
foreach (const QHelpSearchQuery &query, queries) {
|
|
|
|
|
QHelpSearchQuery escapedQuery;
|
|
|
|
|
escapedQuery.fieldName = query.fieldName;
|
|
|
|
|
foreach (QString word, query.wordList) {
|
|
|
|
|
if (word.contains(regExp)) {
|
|
|
|
|
foreach (const QString &charToEscape, charsToEscapeList)
|
|
|
|
|
word.replace(charToEscape, escapeChar + charToEscape);
|
|
|
|
|
}
|
2012-03-16 16:10:21 +01:00
|
|
|
escapedQuery.wordList.append(word);
|
2012-03-16 15:41:59 +01:00
|
|
|
}
|
|
|
|
|
escapedQueries.append(escapedQuery);
|
|
|
|
|
}
|
|
|
|
|
searchEngine->search(escapedQueries);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SearchWidget::searchingStarted()
|
|
|
|
|
{
|
|
|
|
|
qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SearchWidget::searchingFinished(int hits)
|
|
|
|
|
{
|
|
|
|
|
Q_UNUSED(hits)
|
|
|
|
|
qApp->restoreOverrideCursor();
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-23 18:11:43 +01:00
|
|
|
void SearchWidget::indexingStarted()
|
|
|
|
|
{
|
|
|
|
|
Q_ASSERT(!m_progress);
|
|
|
|
|
m_progress = new QFutureInterface<void>();
|
2014-04-17 15:14:14 +02:00
|
|
|
Core::ProgressManager::addTask(m_progress->future(), tr("Indexing Documentation"), "Help.Indexer");
|
2010-03-23 18:11:43 +01:00
|
|
|
m_progress->setProgressRange(0, 2);
|
2014-06-24 12:16:16 +02:00
|
|
|
m_progress->setProgressValueAndText(1, tr("Indexing Documentation"));
|
2010-03-23 18:11:43 +01:00
|
|
|
m_progress->reportStarted();
|
|
|
|
|
|
|
|
|
|
m_watcher.setFuture(m_progress->future());
|
|
|
|
|
connect(&m_watcher, SIGNAL(canceled()), searchEngine, SLOT(cancelIndexing()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SearchWidget::indexingFinished()
|
|
|
|
|
{
|
|
|
|
|
m_progress->reportFinished();
|
|
|
|
|
|
|
|
|
|
delete m_progress;
|
|
|
|
|
m_progress = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-19 10:02:45 +02:00
|
|
|
bool SearchWidget::eventFilter(QObject *o, QEvent *e)
|
2009-05-18 14:03:13 +02:00
|
|
|
{
|
2012-09-20 12:48:50 +02:00
|
|
|
QTextBrowser *browser = resultWidget->findChild<QTextBrowser *>();
|
2009-05-18 14:03:13 +02:00
|
|
|
if (browser && o == browser->viewport()
|
|
|
|
|
&& e->type() == QEvent::MouseButtonRelease){
|
2011-09-19 10:02:45 +02:00
|
|
|
QMouseEvent *me = static_cast<QMouseEvent *>(e);
|
2009-05-18 14:03:13 +02:00
|
|
|
QUrl link = resultWidget->linkAt(me->pos());
|
|
|
|
|
if (!link.isEmpty() || link.isValid()) {
|
|
|
|
|
bool controlPressed = me->modifiers() & Qt::ControlModifier;
|
2011-09-19 10:02:45 +02:00
|
|
|
if ((me->button() == Qt::LeftButton && controlPressed)
|
2009-05-18 14:03:13 +02:00
|
|
|
|| (me->button() == Qt::MidButton)) {
|
2014-10-31 14:20:03 +01:00
|
|
|
emit linkActivated(link, currentSearchTerms(), true/*newPage*/);
|
2009-05-18 14:03:13 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return QWidget::eventFilter(o,e);
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent)
|
|
|
|
|
{
|
2012-09-20 12:48:50 +02:00
|
|
|
QTextBrowser *browser = resultWidget->findChild<QTextBrowser *>();
|
2008-12-02 12:01:29 +01:00
|
|
|
if (!browser)
|
|
|
|
|
return;
|
|
|
|
|
|
2010-03-30 17:44:28 +02:00
|
|
|
QPoint point = browser->mapFromGlobal(contextMenuEvent->globalPos());
|
2008-12-02 12:01:29 +01:00
|
|
|
if (!browser->rect().contains(point, true))
|
|
|
|
|
return;
|
|
|
|
|
|
2010-03-30 17:44:28 +02:00
|
|
|
QAction *openLink = 0;
|
|
|
|
|
QAction *openLinkInNewTab = 0;
|
|
|
|
|
QAction *copyAnchorAction = 0;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-03-30 17:44:28 +02:00
|
|
|
QMenu menu;
|
|
|
|
|
QUrl link = browser->anchorAt(point);
|
|
|
|
|
if (!link.isEmpty() && link.isValid()) {
|
|
|
|
|
if (link.isRelative())
|
|
|
|
|
link = browser->source().resolved(link);
|
|
|
|
|
openLink = menu.addAction(tr("Open Link"));
|
|
|
|
|
openLinkInNewTab = menu.addAction(tr("Open Link as New Page"));
|
|
|
|
|
copyAnchorAction = menu.addAction(tr("Copy Link"));
|
|
|
|
|
} else if (browser->textCursor().hasSelection()) {
|
|
|
|
|
menu.addAction(tr("Copy"), browser, SLOT(copy()));
|
|
|
|
|
} else {
|
|
|
|
|
menu.addAction(tr("Reload"), browser, SLOT(reload()));
|
|
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
QAction *usedAction = menu.exec(mapToGlobal(contextMenuEvent->pos()));
|
Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 03:32:53 +02:00
|
|
|
if (usedAction == openLink)
|
2014-10-31 14:20:03 +01:00
|
|
|
emit linkActivated(link, currentSearchTerms(), false/*newPage*/);
|
Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 03:32:53 +02:00
|
|
|
else if (usedAction == openLinkInNewTab)
|
2014-10-31 14:20:03 +01:00
|
|
|
emit linkActivated(link, currentSearchTerms(), true/*newPage*/);
|
Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 03:32:53 +02:00
|
|
|
else if (usedAction == copyAnchorAction)
|
2010-03-30 17:44:28 +02:00
|
|
|
QApplication::clipboard()->setText(link.toString());
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
2014-06-12 18:01:43 +02:00
|
|
|
|
2014-10-31 14:20:03 +01:00
|
|
|
QStringList SearchWidget::currentSearchTerms() const
|
|
|
|
|
{
|
|
|
|
|
QList<QHelpSearchQuery> queryList = searchEngine->query();
|
|
|
|
|
|
|
|
|
|
QStringList terms;
|
|
|
|
|
foreach (const QHelpSearchQuery &query, queryList) {
|
|
|
|
|
switch (query.fieldName) {
|
|
|
|
|
case QHelpSearchQuery::ALL:
|
|
|
|
|
case QHelpSearchQuery::PHRASE:
|
|
|
|
|
case QHelpSearchQuery::DEFAULT:
|
|
|
|
|
case QHelpSearchQuery::ATLEAST: {
|
|
|
|
|
foreach (QString term, query.wordList)
|
|
|
|
|
terms.append(term.remove(QLatin1Char('"')));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return terms;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-12 18:01:43 +02:00
|
|
|
// #pragma mark -- SearchSideBarItem
|
|
|
|
|
|
|
|
|
|
SearchSideBarItem::SearchSideBarItem()
|
2014-10-09 16:03:27 +02:00
|
|
|
: SideBarItem(new SearchWidget, QLatin1String(Constants::HELP_SEARCH))
|
2014-06-12 18:01:43 +02:00
|
|
|
{
|
2015-04-21 14:48:04 +02:00
|
|
|
widget()->setWindowTitle(HelpPlugin::tr(Constants::SB_SEARCH));
|
2014-10-31 14:20:03 +01:00
|
|
|
connect(widget(), SIGNAL(linkActivated(QUrl,QStringList,bool)),
|
|
|
|
|
this, SIGNAL(linkActivated(QUrl,QStringList,bool)));
|
2014-06-12 18:01:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QList<QToolButton *> SearchSideBarItem::createToolBarWidgets()
|
|
|
|
|
{
|
|
|
|
|
QToolButton *reindexButton = new QToolButton;
|
2015-11-23 16:41:54 +01:00
|
|
|
reindexButton->setIcon(Core::Icons::RELOAD_GRAY.icon());
|
2014-06-12 18:01:43 +02:00
|
|
|
reindexButton->setToolTip(tr("Regenerate Index"));
|
|
|
|
|
connect(reindexButton, SIGNAL(clicked()),
|
2014-10-22 15:53:20 +02:00
|
|
|
widget(), SLOT(reindexDocumentation()));
|
2014-06-12 18:01:43 +02:00
|
|
|
return QList<QToolButton *>() << reindexButton;
|
|
|
|
|
}
|