forked from qt-creator/qt-creator
Show more info about a search and move UI for replacing
Change-Id: I6e024583c0d778a65007eb4590118c4329b2118a Reviewed-on: http://codereview.qt-project.org/4554 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -228,7 +228,8 @@ static void find_helper(QFutureInterface<Usage> &future,
|
|||||||
void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context)
|
void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context)
|
||||||
{
|
{
|
||||||
m_currentSearch = Find::SearchResultWindow::instance()->startNewSearch(Find::SearchResultWindow::SearchOnly);
|
m_currentSearch = Find::SearchResultWindow::instance()->startNewSearch(Find::SearchResultWindow::SearchOnly);
|
||||||
|
Overview overview;
|
||||||
|
m_currentSearch->setInfo(tr("C++ Usages:"), QString(), overview(context.fullyQualifiedName(symbol)));
|
||||||
connect(m_currentSearch, SIGNAL(activated(Find::SearchResultItem)),
|
connect(m_currentSearch, SIGNAL(activated(Find::SearchResultItem)),
|
||||||
this, SLOT(openEditor(Find::SearchResultItem)));
|
this, SLOT(openEditor(Find::SearchResultItem)));
|
||||||
|
|
||||||
@@ -244,6 +245,8 @@ void CppFindReferences::renameUsages(CPlusPlus::Symbol *symbol, const CPlusPlus:
|
|||||||
|
|
||||||
m_currentSearch = Find::SearchResultWindow::instance()->startNewSearch(
|
m_currentSearch = Find::SearchResultWindow::instance()->startNewSearch(
|
||||||
Find::SearchResultWindow::SearchAndReplace, QLatin1String("CppEditor"));
|
Find::SearchResultWindow::SearchAndReplace, QLatin1String("CppEditor"));
|
||||||
|
Overview overview;
|
||||||
|
m_currentSearch->setInfo(tr("C++ Usages:"), QString(), overview(context.fullyQualifiedName(symbol)));
|
||||||
m_currentSearch->setTextToReplace(textToReplace);
|
m_currentSearch->setTextToReplace(textToReplace);
|
||||||
|
|
||||||
connect(m_currentSearch, SIGNAL(activated(Find::SearchResultItem)),
|
connect(m_currentSearch, SIGNAL(activated(Find::SearchResultItem)),
|
||||||
@@ -415,6 +418,7 @@ static void findMacroUses_helper(QFutureInterface<Usage> &future,
|
|||||||
void CppFindReferences::findMacroUses(const Macro ¯o)
|
void CppFindReferences::findMacroUses(const Macro ¯o)
|
||||||
{
|
{
|
||||||
m_currentSearch = Find::SearchResultWindow::instance()->startNewSearch(Find::SearchResultWindow::SearchOnly);
|
m_currentSearch = Find::SearchResultWindow::instance()->startNewSearch(Find::SearchResultWindow::SearchOnly);
|
||||||
|
m_currentSearch->setInfo(tr("C++ Macro Usages:"), QString(), QString::fromLocal8Bit(macro.name()));
|
||||||
|
|
||||||
Find::SearchResultWindow::instance()->popup(true);
|
Find::SearchResultWindow::instance()->popup(true);
|
||||||
|
|
||||||
|
|||||||
@@ -33,15 +33,16 @@
|
|||||||
#ifndef CPPFINDREFERENCES_H
|
#ifndef CPPFINDREFERENCES_H
|
||||||
#define CPPFINDREFERENCES_H
|
#define CPPFINDREFERENCES_H
|
||||||
|
|
||||||
|
#include <utils/filesearch.h>
|
||||||
|
#include <cplusplus/CppDocument.h>
|
||||||
|
#include <cplusplus/DependencyTable.h>
|
||||||
|
#include <cplusplus/FindUsages.h>
|
||||||
|
|
||||||
#include <QtCore/QMutex>
|
#include <QtCore/QMutex>
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QPointer>
|
#include <QtCore/QPointer>
|
||||||
#include <QtCore/QFuture>
|
#include <QtCore/QFuture>
|
||||||
#include <QtCore/QFutureWatcher>
|
#include <QtCore/QFutureWatcher>
|
||||||
#include <utils/filesearch.h>
|
|
||||||
#include <cplusplus/CppDocument.h>
|
|
||||||
#include <cplusplus/DependencyTable.h>
|
|
||||||
#include <cplusplus/FindUsages.h>
|
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QTimer)
|
QT_FORWARD_DECLARE_CLASS(QTimer)
|
||||||
|
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ void SymbolsFindFilter::findAll(const QString &txt, Find::FindFlags findFlags)
|
|||||||
emit changed();
|
emit changed();
|
||||||
Find::SearchResultWindow *window = Find::SearchResultWindow::instance();
|
Find::SearchResultWindow *window = Find::SearchResultWindow::instance();
|
||||||
m_currentSearch = window->startNewSearch();
|
m_currentSearch = window->startNewSearch();
|
||||||
|
m_currentSearch->setInfo(label(), toolTip(findFlags), txt);
|
||||||
connect(m_currentSearch, SIGNAL(activated(Find::SearchResultItem)), this, SLOT(openEditor(Find::SearchResultItem)));
|
connect(m_currentSearch, SIGNAL(activated(Find::SearchResultItem)), this, SLOT(openEditor(Find::SearchResultItem)));
|
||||||
window->popup(true);
|
window->popup(true);
|
||||||
|
|
||||||
@@ -244,6 +245,28 @@ void SymbolsFindFilter::onAllTasksFinished(const QString &type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString SymbolsFindFilter::label() const
|
||||||
|
{
|
||||||
|
return tr("C++ Symbols:");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString SymbolsFindFilter::toolTip(Find::FindFlags findFlags) const
|
||||||
|
{
|
||||||
|
QStringList types;
|
||||||
|
if (m_symbolsToSearch & SearchSymbols::Classes)
|
||||||
|
types.append(tr("Classes"));
|
||||||
|
if (m_symbolsToSearch & SearchSymbols::Functions)
|
||||||
|
types.append(tr("Methods"));
|
||||||
|
if (m_symbolsToSearch & SearchSymbols::Enums)
|
||||||
|
types.append(tr("Enums"));
|
||||||
|
if (m_symbolsToSearch & SearchSymbols::Declarations)
|
||||||
|
types.append(tr("Declarations"));
|
||||||
|
return tr("Scope: %1\nTypes: %2\nFlags: %3")
|
||||||
|
.arg(searchScope() == SearchGlobal ? tr("All") : tr("Projects"))
|
||||||
|
.arg(types.join(tr(", ")))
|
||||||
|
.arg(Find::IFindFilter::descriptionForFindFlags(findFlags));
|
||||||
|
}
|
||||||
|
|
||||||
// #pragma mark -- SymbolsFindFilterConfigWidget
|
// #pragma mark -- SymbolsFindFilterConfigWidget
|
||||||
|
|
||||||
SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter *filter)
|
SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter *filter)
|
||||||
|
|||||||
@@ -91,6 +91,9 @@ private slots:
|
|||||||
void onAllTasksFinished(const QString &type);
|
void onAllTasksFinished(const QString &type);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QString label() const;
|
||||||
|
QString toolTip(Find::FindFlags findFlags) const;
|
||||||
|
|
||||||
CppModelManager *m_manager;
|
CppModelManager *m_manager;
|
||||||
bool m_isRunning;
|
bool m_isRunning;
|
||||||
bool m_enabled;
|
bool m_enabled;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include "findtoolbar.h"
|
#include "findtoolbar.h"
|
||||||
#include "findplugin.h"
|
#include "findplugin.h"
|
||||||
#include "textfindconstants.h"
|
#include "textfindconstants.h"
|
||||||
|
#include "ifindfilter.h"
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
@@ -79,9 +80,6 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
|
|||||||
m_replaceAction(0),
|
m_replaceAction(0),
|
||||||
m_replaceNextAction(0),
|
m_replaceNextAction(0),
|
||||||
m_replacePreviousAction(0),
|
m_replacePreviousAction(0),
|
||||||
m_casesensitiveIcon(":/find/images/casesensitively.png"),
|
|
||||||
m_regexpIcon(":/find/images/regexp.png"),
|
|
||||||
m_wholewordsIcon(":/find/images/wholewords.png"),
|
|
||||||
m_findIncrementalTimer(this), m_findStepTimer(this),
|
m_findIncrementalTimer(this), m_findStepTimer(this),
|
||||||
m_useFakeVim(false),
|
m_useFakeVim(false),
|
||||||
m_eventFiltersInstalled(false)
|
m_eventFiltersInstalled(false)
|
||||||
@@ -539,33 +537,17 @@ void FindToolBar::updateIcons()
|
|||||||
bool casesensitive = effectiveFlags & Find::FindCaseSensitively;
|
bool casesensitive = effectiveFlags & Find::FindCaseSensitively;
|
||||||
bool wholewords = effectiveFlags & Find::FindWholeWords;
|
bool wholewords = effectiveFlags & Find::FindWholeWords;
|
||||||
bool regexp = effectiveFlags & Find::FindRegularExpression;
|
bool regexp = effectiveFlags & Find::FindRegularExpression;
|
||||||
int width = 0;
|
|
||||||
if (casesensitive) width += 6;
|
|
||||||
if (wholewords) width += 6;
|
|
||||||
if (regexp) width += 6;
|
|
||||||
if (width == 0) width = 18;
|
|
||||||
--width;
|
|
||||||
QPixmap pixmap(width, 17);
|
|
||||||
pixmap.fill(Qt::transparent);
|
|
||||||
QPainter painter(&pixmap);
|
|
||||||
int x = 0;
|
|
||||||
|
|
||||||
if (casesensitive) {
|
|
||||||
painter.drawPixmap(x - 6, 0, m_casesensitiveIcon);
|
|
||||||
x += 6;
|
|
||||||
}
|
|
||||||
if (wholewords) {
|
|
||||||
painter.drawPixmap(x - 6, 0, m_wholewordsIcon);
|
|
||||||
x += 6;
|
|
||||||
}
|
|
||||||
if (regexp) {
|
|
||||||
painter.drawPixmap(x - 6, 0, m_regexpIcon);
|
|
||||||
}
|
|
||||||
if (!casesensitive && !wholewords && !regexp) {
|
if (!casesensitive && !wholewords && !regexp) {
|
||||||
|
QPixmap pixmap(17, 17);
|
||||||
|
pixmap.fill(Qt::transparent);
|
||||||
|
QPainter painter(&pixmap);
|
||||||
QPixmap mag(Core::Constants::ICON_MAGNIFIER);
|
QPixmap mag(Core::Constants::ICON_MAGNIFIER);
|
||||||
painter.drawPixmap(0, (pixmap.height() - mag.height()) / 2, mag);
|
painter.drawPixmap(0, (pixmap.height() - mag.height()) / 2, mag);
|
||||||
|
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left, pixmap);
|
||||||
|
} else {
|
||||||
|
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left,
|
||||||
|
IFindFilter::pixmapForFindFlags(effectiveFlags));
|
||||||
}
|
}
|
||||||
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left, pixmap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Find::FindFlags FindToolBar::effectiveFindFlags()
|
Find::FindFlags FindToolBar::effectiveFindFlags()
|
||||||
|
|||||||
@@ -133,10 +133,6 @@ private:
|
|||||||
QAction *m_regularExpressionAction;
|
QAction *m_regularExpressionAction;
|
||||||
Find::FindFlags m_findFlags;
|
Find::FindFlags m_findFlags;
|
||||||
|
|
||||||
QPixmap m_casesensitiveIcon;
|
|
||||||
QPixmap m_regexpIcon;
|
|
||||||
QPixmap m_wholewordsIcon;
|
|
||||||
|
|
||||||
QTimer m_findIncrementalTimer;
|
QTimer m_findIncrementalTimer;
|
||||||
QTimer m_findStepTimer;
|
QTimer m_findStepTimer;
|
||||||
bool m_useFakeVim;
|
bool m_useFakeVim;
|
||||||
|
|||||||
@@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
#include "ifindfilter.h"
|
#include "ifindfilter.h"
|
||||||
|
|
||||||
|
#include <QtGui/QPainter>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Find::IFindFilter
|
\class Find::IFindFilter
|
||||||
\brief The IFindFilter class is the base class for find implementations
|
\brief The IFindFilter class is the base class for find implementations
|
||||||
@@ -220,3 +222,52 @@ Find::FindFlags Find::IFindFilter::supportedFindFlags() const
|
|||||||
return Find::FindCaseSensitively
|
return Find::FindCaseSensitively
|
||||||
| Find::FindRegularExpression | Find::FindWholeWords;
|
| Find::FindRegularExpression | Find::FindWholeWords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPixmap Find::IFindFilter::pixmapForFindFlags(Find::FindFlags flags)
|
||||||
|
{
|
||||||
|
static const QPixmap casesensitiveIcon(":/find/images/casesensitively.png");
|
||||||
|
static const QPixmap regexpIcon(":/find/images/regexp.png");
|
||||||
|
static const QPixmap wholewordsIcon(":/find/images/wholewords.png");
|
||||||
|
bool casesensitive = flags & Find::FindCaseSensitively;
|
||||||
|
bool wholewords = flags & Find::FindWholeWords;
|
||||||
|
bool regexp = flags & Find::FindRegularExpression;
|
||||||
|
int width = 0;
|
||||||
|
if (casesensitive) width += 6;
|
||||||
|
if (wholewords) width += 6;
|
||||||
|
if (regexp) width += 6;
|
||||||
|
if (width > 0) --width;
|
||||||
|
QPixmap pixmap(width, 17);
|
||||||
|
pixmap.fill(Qt::transparent);
|
||||||
|
QPainter painter(&pixmap);
|
||||||
|
int x = 0;
|
||||||
|
|
||||||
|
if (casesensitive) {
|
||||||
|
painter.drawPixmap(x - 6, 0, casesensitiveIcon);
|
||||||
|
x += 6;
|
||||||
|
}
|
||||||
|
if (wholewords) {
|
||||||
|
painter.drawPixmap(x - 6, 0, wholewordsIcon);
|
||||||
|
x += 6;
|
||||||
|
}
|
||||||
|
if (regexp) {
|
||||||
|
painter.drawPixmap(x - 6, 0, regexpIcon);
|
||||||
|
}
|
||||||
|
return pixmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Find::IFindFilter::descriptionForFindFlags(Find::FindFlags flags)
|
||||||
|
{
|
||||||
|
QStringList flagStrings;
|
||||||
|
if (flags & Find::FindCaseSensitively)
|
||||||
|
flagStrings.append(tr("Case sensitive"));
|
||||||
|
if (flags & Find::FindWholeWords)
|
||||||
|
flagStrings.append(tr("Whole words"));
|
||||||
|
if (flags & Find::FindRegularExpression)
|
||||||
|
flagStrings.append(tr("Regular expressions"));
|
||||||
|
QString description = tr("Flags: %1");
|
||||||
|
if (flagStrings.isEmpty())
|
||||||
|
description = description.arg(tr("None"));
|
||||||
|
else
|
||||||
|
description = description.arg(flagStrings.join(tr(", ")));
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,6 +36,8 @@
|
|||||||
#include "find_global.h"
|
#include "find_global.h"
|
||||||
#include "textfindconstants.h"
|
#include "textfindconstants.h"
|
||||||
|
|
||||||
|
#include <QtGui/QPixmap>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QWidget;
|
class QWidget;
|
||||||
class QSettings;
|
class QSettings;
|
||||||
@@ -69,6 +71,8 @@ public:
|
|||||||
virtual void writeSettings(QSettings *settings) { Q_UNUSED(settings) }
|
virtual void writeSettings(QSettings *settings) { Q_UNUSED(settings) }
|
||||||
virtual void readSettings(QSettings *settings) { Q_UNUSED(settings) }
|
virtual void readSettings(QSettings *settings) { Q_UNUSED(settings) }
|
||||||
|
|
||||||
|
static QPixmap pixmapForFindFlags(FindFlags flags);
|
||||||
|
static QString descriptionForFindFlags(FindFlags flags);
|
||||||
signals:
|
signals:
|
||||||
void changed();
|
void changed();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
#include <QtGui/QVBoxLayout>
|
#include <QtGui/QVBoxLayout>
|
||||||
|
#include <QtGui/QHBoxLayout>
|
||||||
|
|
||||||
namespace Find {
|
namespace Find {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -214,10 +215,17 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
|
|||||||
layout->setSpacing(0);
|
layout->setSpacing(0);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
m_noMatchesFoundDisplay = new QListWidget(this);
|
QFrame *topWidget = new QFrame;
|
||||||
m_noMatchesFoundDisplay->addItem(tr("No matches found!"));
|
QPalette pal = topWidget->palette();
|
||||||
m_noMatchesFoundDisplay->setFrameStyle(QFrame::NoFrame);
|
pal.setColor(QPalette::Window, QColor(255, 255, 225));
|
||||||
m_noMatchesFoundDisplay->hide();
|
pal.setColor(QPalette::WindowText, Qt::black);
|
||||||
|
topWidget->setPalette(pal);
|
||||||
|
topWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
|
||||||
|
topWidget->setLineWidth(1);
|
||||||
|
topWidget->setAutoFillBackground(true);
|
||||||
|
QHBoxLayout *topLayout = new QHBoxLayout(topWidget);
|
||||||
|
topLayout->setMargin(2);
|
||||||
|
topWidget->setLayout(topLayout);
|
||||||
|
|
||||||
m_searchResultTreeView = new Internal::SearchResultTreeView(this);
|
m_searchResultTreeView = new Internal::SearchResultTreeView(this);
|
||||||
m_searchResultTreeView->setFrameStyle(QFrame::NoFrame);
|
m_searchResultTreeView->setFrameStyle(QFrame::NoFrame);
|
||||||
@@ -226,21 +234,41 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
|
|||||||
agg->add(m_searchResultTreeView);
|
agg->add(m_searchResultTreeView);
|
||||||
agg->add(new SearchResultFindSupport(m_searchResultTreeView));
|
agg->add(new SearchResultFindSupport(m_searchResultTreeView));
|
||||||
|
|
||||||
layout->addWidget(m_noMatchesFoundDisplay);
|
layout->addWidget(topWidget);
|
||||||
layout->addWidget(m_searchResultTreeView);
|
layout->addWidget(m_searchResultTreeView);
|
||||||
|
|
||||||
m_infoBarDisplay.setTarget(layout, 0);
|
m_infoBarDisplay.setTarget(layout, 1);
|
||||||
m_infoBarDisplay.setInfoBar(&m_infoBar);
|
m_infoBarDisplay.setInfoBar(&m_infoBar);
|
||||||
|
|
||||||
m_replaceLabel = new QLabel(tr("Replace with:"), parent);
|
m_descriptionContainer = new QWidget(topWidget);
|
||||||
m_replaceLabel->setContentsMargins(12, 0, 5, 0);
|
QHBoxLayout *descriptionLayout = new QHBoxLayout(m_descriptionContainer);
|
||||||
m_replaceTextEdit = new WideEnoughLineEdit(parent);
|
m_descriptionContainer->setLayout(descriptionLayout);
|
||||||
m_replaceButton = new QToolButton(parent);
|
descriptionLayout->setMargin(0);
|
||||||
|
m_label = new QLabel(m_descriptionContainer);
|
||||||
|
m_label->setVisible(false);
|
||||||
|
m_searchTerm = new QLabel(m_descriptionContainer);
|
||||||
|
m_searchTerm->setVisible(false);
|
||||||
|
descriptionLayout->addWidget(m_label);
|
||||||
|
descriptionLayout->addWidget(m_searchTerm);
|
||||||
|
|
||||||
|
m_replaceLabel = new QLabel(tr("Replace with:"), topWidget);
|
||||||
|
m_replaceTextEdit = new WideEnoughLineEdit(topWidget);
|
||||||
|
m_replaceButton = new QToolButton(topWidget);
|
||||||
m_replaceButton->setToolTip(tr("Replace all occurrences"));
|
m_replaceButton->setToolTip(tr("Replace all occurrences"));
|
||||||
m_replaceButton->setText(tr("Replace"));
|
m_replaceButton->setText(tr("Replace"));
|
||||||
m_replaceButton->setToolButtonStyle(Qt::ToolButtonTextOnly);
|
m_replaceButton->setToolButtonStyle(Qt::ToolButtonTextOnly);
|
||||||
m_replaceButton->setAutoRaise(true);
|
m_replaceButton->setAutoRaise(true);
|
||||||
m_replaceTextEdit->setTabOrder(m_replaceTextEdit, m_searchResultTreeView);
|
m_replaceTextEdit->setTabOrder(m_replaceTextEdit, m_searchResultTreeView);
|
||||||
|
|
||||||
|
m_matchesFoundLabel = new QLabel(topWidget);
|
||||||
|
updateMatchesFoundLabel();
|
||||||
|
|
||||||
|
topLayout->addWidget(m_descriptionContainer);
|
||||||
|
topLayout->addWidget(m_replaceLabel);
|
||||||
|
topLayout->addWidget(m_replaceTextEdit);
|
||||||
|
topLayout->addWidget(m_replaceButton);
|
||||||
|
topLayout->addStretch(2);
|
||||||
|
topLayout->addWidget(m_matchesFoundLabel);
|
||||||
setShowReplaceUI(false);
|
setShowReplaceUI(false);
|
||||||
|
|
||||||
connect(m_searchResultTreeView, SIGNAL(jumpToSearchResult(SearchResultItem)),
|
connect(m_searchResultTreeView, SIGNAL(jumpToSearchResult(SearchResultItem)),
|
||||||
@@ -249,6 +277,15 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
|
|||||||
connect(m_replaceButton, SIGNAL(clicked()), this, SLOT(handleReplaceButton()));
|
connect(m_replaceButton, SIGNAL(clicked()), this, SLOT(handleReplaceButton()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SearchResultWidget::setInfo(const QString &label, const QString &toolTip, const QString &term)
|
||||||
|
{
|
||||||
|
m_label->setText(label);
|
||||||
|
m_label->setVisible(!label.isEmpty());
|
||||||
|
m_descriptionContainer->setToolTip(toolTip);
|
||||||
|
m_searchTerm->setText(term);
|
||||||
|
m_searchTerm->setVisible(!term.isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
void SearchResultWidget::addResult(const QString &fileName, int lineNumber, const QString &rowText,
|
void SearchResultWidget::addResult(const QString &fileName, int lineNumber, const QString &rowText,
|
||||||
int searchTermStart, int searchTermLength, const QVariant &userData)
|
int searchTermStart, int searchTermLength, const QVariant &userData)
|
||||||
{
|
{
|
||||||
@@ -286,6 +323,7 @@ void SearchResultWidget::addResults(const QList<SearchResultItem> &items, Search
|
|||||||
m_searchResultTreeView->selectionModel()->select(m_searchResultTreeView->model()->index(0, 0, QModelIndex()), QItemSelectionModel::Select);
|
m_searchResultTreeView->selectionModel()->select(m_searchResultTreeView->model()->index(0, 0, QModelIndex()), QItemSelectionModel::Select);
|
||||||
emit navigateStateChanged();
|
emit navigateStateChanged();
|
||||||
}
|
}
|
||||||
|
updateMatchesFoundLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
int SearchResultWidget::count() const
|
int SearchResultWidget::count() const
|
||||||
@@ -398,11 +436,8 @@ void SearchResultWidget::goToPrevious()
|
|||||||
|
|
||||||
void SearchResultWidget::finishSearch()
|
void SearchResultWidget::finishSearch()
|
||||||
{
|
{
|
||||||
if (m_count > 0) {
|
m_replaceTextEdit->setEnabled(m_count > 0);
|
||||||
m_replaceButton->setEnabled(true);
|
m_replaceButton->setEnabled(m_count > 0);
|
||||||
} else {
|
|
||||||
showNoMatchesFound();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultWidget::clear()
|
void SearchResultWidget::clear()
|
||||||
@@ -412,17 +447,12 @@ void SearchResultWidget::clear()
|
|||||||
m_replaceTextEdit->clear();
|
m_replaceTextEdit->clear();
|
||||||
m_searchResultTreeView->clear();
|
m_searchResultTreeView->clear();
|
||||||
m_count = 0;
|
m_count = 0;
|
||||||
m_noMatchesFoundDisplay->hide();
|
m_label->setVisible(false);
|
||||||
|
m_searchTerm->setVisible(false);
|
||||||
|
updateMatchesFoundLabel();
|
||||||
m_infoBar.clear();
|
m_infoBar.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultWidget::showNoMatchesFound()
|
|
||||||
{
|
|
||||||
m_replaceTextEdit->setEnabled(false);
|
|
||||||
m_replaceButton->setEnabled(false);
|
|
||||||
m_noMatchesFoundDisplay->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SearchResultWidget::hideNoUndoWarning()
|
void SearchResultWidget::hideNoUndoWarning()
|
||||||
{
|
{
|
||||||
setShowWarningMessage(false);
|
setShowWarningMessage(false);
|
||||||
@@ -486,4 +516,12 @@ QList<SearchResultItem> SearchResultWidget::checkedItems() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SearchResultWidget::updateMatchesFoundLabel()
|
||||||
|
{
|
||||||
|
if (m_count == 0)
|
||||||
|
m_matchesFoundLabel->setText(tr("No matches found."));
|
||||||
|
else
|
||||||
|
m_matchesFoundLabel->setText(tr("%n matches found.", 0, m_count));
|
||||||
|
}
|
||||||
|
|
||||||
#include "searchresultwidget.moc"
|
#include "searchresultwidget.moc"
|
||||||
|
|||||||
@@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include <QtGui/QLabel>
|
#include <QtGui/QLabel>
|
||||||
#include <QtGui/QLineEdit>
|
#include <QtGui/QLineEdit>
|
||||||
#include <QtGui/QListWidget>
|
|
||||||
#include <QtGui/QToolButton>
|
#include <QtGui/QToolButton>
|
||||||
#include <QtGui/QWidget>
|
#include <QtGui/QWidget>
|
||||||
|
|
||||||
@@ -54,6 +53,8 @@ class SearchResultWidget : public QWidget
|
|||||||
public:
|
public:
|
||||||
explicit SearchResultWidget(QWidget *parent = 0);
|
explicit SearchResultWidget(QWidget *parent = 0);
|
||||||
|
|
||||||
|
void setInfo(const QString &label, const QString &toolTip, const QString &term);
|
||||||
|
|
||||||
void addResult(const QString &fileName, int lineNumber, const QString &lineText,
|
void addResult(const QString &fileName, int lineNumber, const QString &lineText,
|
||||||
int searchTermStart, int searchTermLength, const QVariant &userData = QVariant());
|
int searchTermStart, int searchTermLength, const QVariant &userData = QVariant());
|
||||||
void addResults(const QList<SearchResultItem> &items, SearchResult::AddMode mode);
|
void addResults(const QList<SearchResultItem> &items, SearchResult::AddMode mode);
|
||||||
@@ -82,13 +83,9 @@ public:
|
|||||||
void goToNext();
|
void goToNext();
|
||||||
void goToPrevious();
|
void goToPrevious();
|
||||||
|
|
||||||
// TODO: temporary
|
|
||||||
QList<QWidget*> toolBarWidgets() const { return QList<QWidget*>() << m_replaceLabel << m_replaceTextEdit << m_replaceButton; }
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void finishSearch();
|
void finishSearch();
|
||||||
void clear();
|
void clear();
|
||||||
void showNoMatchesFound();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void activated(const Find::SearchResultItem &item);
|
void activated(const Find::SearchResultItem &item);
|
||||||
@@ -106,17 +103,21 @@ private:
|
|||||||
bool showWarningMessage() const;
|
bool showWarningMessage() const;
|
||||||
void setShowWarningMessage(bool showWarningMessage);
|
void setShowWarningMessage(bool showWarningMessage);
|
||||||
QList<SearchResultItem> checkedItems() const;
|
QList<SearchResultItem> checkedItems() const;
|
||||||
|
void updateMatchesFoundLabel();
|
||||||
|
|
||||||
SearchResultTreeView *m_searchResultTreeView;
|
SearchResultTreeView *m_searchResultTreeView;
|
||||||
int m_count;
|
int m_count;
|
||||||
QString m_dontAskAgainGroup;
|
QString m_dontAskAgainGroup;
|
||||||
Core::InfoBar m_infoBar;
|
Core::InfoBar m_infoBar;
|
||||||
Core::InfoBarDisplay m_infoBarDisplay;
|
Core::InfoBarDisplay m_infoBarDisplay;
|
||||||
QListWidget *m_noMatchesFoundDisplay;
|
|
||||||
bool m_isShowingReplaceUI;
|
bool m_isShowingReplaceUI;
|
||||||
QLabel *m_replaceLabel;
|
QLabel *m_replaceLabel;
|
||||||
QLineEdit *m_replaceTextEdit;
|
QLineEdit *m_replaceTextEdit;
|
||||||
QToolButton *m_replaceButton;
|
QToolButton *m_replaceButton;
|
||||||
|
QWidget *m_descriptionContainer;
|
||||||
|
QLabel *m_label;
|
||||||
|
QLabel *m_searchTerm;
|
||||||
|
QLabel *m_matchesFoundLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Internal
|
} // Internal
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ QWidget *SearchResultWindow::outputWidget(QWidget *)
|
|||||||
*/
|
*/
|
||||||
QList<QWidget*> SearchResultWindow::toolBarWidgets() const
|
QList<QWidget*> SearchResultWindow::toolBarWidgets() const
|
||||||
{
|
{
|
||||||
return QList<QWidget*>() << d->m_expandCollapseButton << d->m_searchResultWidget->toolBarWidgets();
|
return QList<QWidget*>() << d->m_expandCollapseButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -445,6 +445,23 @@ QString SearchResult::textToReplace() const
|
|||||||
return m_widget->textToReplace();
|
return m_widget->textToReplace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn void SearchResult::setInfo(const QString &label, const QString &toolTip, const QString &term)
|
||||||
|
\brief Set the information about the search that is show in the top-left corner of
|
||||||
|
the search result window.
|
||||||
|
|
||||||
|
The \a label should be a string that shortly describes the
|
||||||
|
search, i.e. search filter and a most relevant search options, followed by a colon ':'.
|
||||||
|
E.g. \code{Project 'myproject':}
|
||||||
|
The search \a term will be shown behind the colon.
|
||||||
|
The \a toolTip should elaborate on the search parameters, like file patterns that are searched and
|
||||||
|
find flags.
|
||||||
|
*/
|
||||||
|
void SearchResult::setInfo(const QString &label, const QString &toolTip, const QString &term)
|
||||||
|
{
|
||||||
|
m_widget->setInfo(label, toolTip, term);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void SearchResult::addResult(const QString &fileName, int lineNumber, const QString &rowText, int searchTermStart, int searchTermLength, const QVariant &userData)
|
\fn void SearchResult::addResult(const QString &fileName, int lineNumber, const QString &rowText, int searchTermStart, int searchTermLength, const QVariant &userData)
|
||||||
\brief Adds a single result line to the search results.
|
\brief Adds a single result line to the search results.
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ public:
|
|||||||
void setUserData(const QVariant &data);
|
void setUserData(const QVariant &data);
|
||||||
QVariant userData() const;
|
QVariant userData() const;
|
||||||
QString textToReplace() const;
|
QString textToReplace() const;
|
||||||
|
void setInfo(const QString &label, const QString &toolTip, const QString &term);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addResult(const QString &fileName, int lineNumber, const QString &lineText,
|
void addResult(const QString &fileName, int lineNumber, const QString &lineText,
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
#include <QtGui/QGridLayout>
|
#include <QtGui/QGridLayout>
|
||||||
#include <QtGui/QLabel>
|
#include <QtGui/QLabel>
|
||||||
|
#include <QtGui/QHBoxLayout>
|
||||||
|
|
||||||
using namespace Find;
|
using namespace Find;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -116,6 +117,16 @@ Utils::FileIterator *AllProjectsFind::files() const
|
|||||||
return new Utils::FileIterator(encodings.keys(), encodings.values());
|
return new Utils::FileIterator(encodings.keys(), encodings.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString AllProjectsFind::label() const
|
||||||
|
{
|
||||||
|
return tr("All Projects:");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AllProjectsFind::toolTip() const
|
||||||
|
{
|
||||||
|
return tr("Filter: %1\n%2").arg(fileNameFilters().join(QLatin1String(",")));
|
||||||
|
}
|
||||||
|
|
||||||
QWidget *AllProjectsFind::createConfigWidget()
|
QWidget *AllProjectsFind::createConfigWidget()
|
||||||
{
|
{
|
||||||
if (!m_configWidget) {
|
if (!m_configWidget) {
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual QList<Project *> projects() const;
|
virtual QList<Project *> projects() const;
|
||||||
Utils::FileIterator *files() const;
|
Utils::FileIterator *files() const;
|
||||||
|
QString label() const;
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorerPlugin *m_plugin;
|
ProjectExplorerPlugin *m_plugin;
|
||||||
|
|||||||
@@ -33,11 +33,14 @@
|
|||||||
#include "currentprojectfind.h"
|
#include "currentprojectfind.h"
|
||||||
|
|
||||||
#include "projectexplorer.h"
|
#include "projectexplorer.h"
|
||||||
|
#include "project.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
|
#include <QtGui/QLabel>
|
||||||
|
#include <QtGui/QHBoxLayout>
|
||||||
|
|
||||||
using namespace Find;
|
using namespace Find;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -72,6 +75,11 @@ QList<Project *> CurrentProjectFind::projects() const
|
|||||||
return QList<Project *>() << m_plugin->currentProject();
|
return QList<Project *>() << m_plugin->currentProject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CurrentProjectFind::label() const
|
||||||
|
{
|
||||||
|
return tr("Project '%1':").arg(projects().first()->displayName());
|
||||||
|
}
|
||||||
|
|
||||||
void CurrentProjectFind::writeSettings(QSettings *settings)
|
void CurrentProjectFind::writeSettings(QSettings *settings)
|
||||||
{
|
{
|
||||||
settings->beginGroup(QLatin1String("CurrentProjectFind"));
|
settings->beginGroup(QLatin1String("CurrentProjectFind"));
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
QList<Project *> projects() const;
|
QList<Project *> projects() const;
|
||||||
|
QString label() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorerPlugin *m_plugin;
|
ProjectExplorerPlugin *m_plugin;
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
#include <QtCore/QtConcurrentMap>
|
#include <QtCore/QtConcurrentMap>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtGui/QApplication>
|
#include <QtGui/QApplication>
|
||||||
|
#include <QtGui/QLabel>
|
||||||
#include <qtconcurrent/runextensions.h>
|
#include <qtconcurrent/runextensions.h>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -849,7 +850,7 @@ static void find_helper(QFutureInterface<FindReferences::Usage> &future,
|
|||||||
future.setProgressRange(0, files.size());
|
future.setProgressRange(0, files.size());
|
||||||
|
|
||||||
// report a dummy usage to indicate the search is starting
|
// report a dummy usage to indicate the search is starting
|
||||||
FindReferences::Usage searchStarting(replacement, QString(), 0, 0, 0);
|
FindReferences::Usage searchStarting(replacement, name, 0, 0, 0);
|
||||||
|
|
||||||
if (findTarget.typeKind() == findTarget.TypeKind){
|
if (findTarget.typeKind() == findTarget.TypeKind){
|
||||||
const ObjectValue *typeValue = value_cast<const ObjectValue*>(findTarget.targetValue());
|
const ObjectValue *typeValue = value_cast<const ObjectValue*>(findTarget.targetValue());
|
||||||
@@ -868,6 +869,8 @@ static void find_helper(QFutureInterface<FindReferences::Usage> &future,
|
|||||||
scope->lookupMember(name, context, &scope);
|
scope->lookupMember(name, context, &scope);
|
||||||
if (!scope)
|
if (!scope)
|
||||||
return;
|
return;
|
||||||
|
if (!scope->className().isEmpty())
|
||||||
|
searchStarting.lineText.prepend(scope->className() + QLatin1Char('.'));
|
||||||
future.reportResult(searchStarting);
|
future.reportResult(searchStarting);
|
||||||
|
|
||||||
ProcessFile process(context, name, scope);
|
ProcessFile process(context, name, scope);
|
||||||
@@ -912,6 +915,7 @@ void FindReferences::displayResults(int first, int last)
|
|||||||
if (first == 0) {
|
if (first == 0) {
|
||||||
Usage dummy = m_watcher.future().resultAt(0);
|
Usage dummy = m_watcher.future().resultAt(0);
|
||||||
QString replacement = dummy.path;
|
QString replacement = dummy.path;
|
||||||
|
QString symbolName = dummy.lineText;
|
||||||
|
|
||||||
if (replacement.isEmpty()) {
|
if (replacement.isEmpty()) {
|
||||||
m_currentSearch = Find::SearchResultWindow::instance()->startNewSearch(Find::SearchResultWindow::SearchOnly);
|
m_currentSearch = Find::SearchResultWindow::instance()->startNewSearch(Find::SearchResultWindow::SearchOnly);
|
||||||
@@ -921,6 +925,7 @@ void FindReferences::displayResults(int first, int last)
|
|||||||
connect(m_currentSearch, SIGNAL(replaceButtonClicked(QString,QList<Find::SearchResultItem>)),
|
connect(m_currentSearch, SIGNAL(replaceButtonClicked(QString,QList<Find::SearchResultItem>)),
|
||||||
SLOT(onReplaceButtonClicked(QString,QList<Find::SearchResultItem>)));
|
SLOT(onReplaceButtonClicked(QString,QList<Find::SearchResultItem>)));
|
||||||
}
|
}
|
||||||
|
m_currentSearch->setInfo(tr("Usages:"), QString(), symbolName);
|
||||||
connect(m_currentSearch, SIGNAL(activated(Find::SearchResultItem)),
|
connect(m_currentSearch, SIGNAL(activated(Find::SearchResultItem)),
|
||||||
this, SLOT(openEditor(Find::SearchResultItem)));
|
this, SLOT(openEditor(Find::SearchResultItem)));
|
||||||
Find::SearchResultWindow::instance()->popup(true);
|
Find::SearchResultWindow::instance()->popup(true);
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
#include <QtGui/QFileDialog>
|
#include <QtGui/QFileDialog>
|
||||||
#include <QtGui/QCheckBox>
|
#include <QtGui/QCheckBox>
|
||||||
#include <QtGui/QComboBox>
|
#include <QtGui/QComboBox>
|
||||||
|
#include <QtGui/QHBoxLayout>
|
||||||
#include <QtGui/QLabel>
|
#include <QtGui/QLabel>
|
||||||
#include <QtGui/QMainWindow>
|
#include <QtGui/QMainWindow>
|
||||||
#include <QtGui/QPushButton>
|
#include <QtGui/QPushButton>
|
||||||
@@ -122,6 +123,9 @@ void BaseFileFind::runNewSearch(const QString &txt, Find::FindFlags findFlags,
|
|||||||
? QString::fromLatin1("TextEditor")
|
? QString::fromLatin1("TextEditor")
|
||||||
: QString());
|
: QString());
|
||||||
m_currentSearch->setTextToReplace(txt);
|
m_currentSearch->setTextToReplace(txt);
|
||||||
|
m_currentSearch->setInfo(label(),
|
||||||
|
toolTip().arg(Find::IFindFilter::descriptionForFindFlags(findFlags)),
|
||||||
|
txt);
|
||||||
QVariantList searchParameters;
|
QVariantList searchParameters;
|
||||||
searchParameters << qVariantFromValue(txt) << qVariantFromValue(findFlags);
|
searchParameters << qVariantFromValue(txt) << qVariantFromValue(findFlags);
|
||||||
m_currentSearch->setUserData(searchParameters);
|
m_currentSearch->setUserData(searchParameters);
|
||||||
|
|||||||
@@ -80,6 +80,10 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual Utils::FileIterator *files() const = 0;
|
virtual Utils::FileIterator *files() const = 0;
|
||||||
|
virtual QString label() const = 0; // see Find::SearchResult::setInfo
|
||||||
|
virtual QString toolTip() const = 0; // see Find::SearchResult::setInfo,
|
||||||
|
// add %1 placeholder where the find flags should be put
|
||||||
|
|
||||||
void writeCommonSettings(QSettings *settings);
|
void writeCommonSettings(QSettings *settings);
|
||||||
void readCommonSettings(QSettings *settings, const QString &defaultFilter);
|
void readCommonSettings(QSettings *settings, const QString &defaultFilter);
|
||||||
QWidget *createPatternWidget();
|
QWidget *createPatternWidget();
|
||||||
|
|||||||
@@ -77,6 +77,16 @@ Utils::FileIterator *FindInCurrentFile::files() const
|
|||||||
return new Utils::FileIterator(QStringList() << fileName, QList<QTextCodec *>() << codec);
|
return new Utils::FileIterator(QStringList() << fileName, QList<QTextCodec *>() << codec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString FindInCurrentFile::label() const
|
||||||
|
{
|
||||||
|
return tr("File '%1':").arg(QFileInfo(m_currentFile->fileName()).fileName());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString FindInCurrentFile::toolTip() const
|
||||||
|
{
|
||||||
|
return tr("File path: %1\n%2").arg(QDir::toNativeSeparators(m_currentFile->fileName()));
|
||||||
|
}
|
||||||
|
|
||||||
bool FindInCurrentFile::isEnabled() const
|
bool FindInCurrentFile::isEnabled() const
|
||||||
{
|
{
|
||||||
return m_currentFile && !m_currentFile->fileName().isEmpty();
|
return m_currentFile && !m_currentFile->fileName().isEmpty();
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
Utils::FileIterator *files() const;
|
Utils::FileIterator *files() const;
|
||||||
|
QString label() const;
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleFileChange(Core::IEditor *editor);
|
void handleFileChange(Core::IEditor *editor);
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <QtCore/QDirIterator>
|
#include <QtCore/QDirIterator>
|
||||||
#include <QtGui/QPushButton>
|
#include <QtGui/QPushButton>
|
||||||
#include <QtGui/QFileDialog>
|
#include <QtGui/QFileDialog>
|
||||||
|
#include <QtGui/QHBoxLayout>
|
||||||
#include <QtGui/QVBoxLayout>
|
#include <QtGui/QVBoxLayout>
|
||||||
|
|
||||||
using namespace Find;
|
using namespace Find;
|
||||||
@@ -74,6 +75,17 @@ Utils::FileIterator *FindInFiles::files() const
|
|||||||
Core::EditorManager::instance()->defaultTextCodec());
|
Core::EditorManager::instance()->defaultTextCodec());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString FindInFiles::label() const
|
||||||
|
{
|
||||||
|
return tr("Directory '%1':").arg(QFileInfo(m_directory->currentText()).fileName());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString FindInFiles::toolTip() const
|
||||||
|
{
|
||||||
|
return tr("Path: %1\nFilter: %2\n%3").arg(QFileInfo(m_directory->currentText()).absoluteFilePath())
|
||||||
|
.arg(fileNameFilters().join(QLatin1String(",")));
|
||||||
|
}
|
||||||
|
|
||||||
QWidget *FindInFiles::createConfigWidget()
|
QWidget *FindInFiles::createConfigWidget()
|
||||||
{
|
{
|
||||||
if (!m_configWidget) {
|
if (!m_configWidget) {
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
Utils::FileIterator *files() const;
|
Utils::FileIterator *files() const;
|
||||||
|
QString label() const;
|
||||||
|
QString toolTip() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void openFileBrowser();
|
void openFileBrowser();
|
||||||
|
|||||||
Reference in New Issue
Block a user