forked from qt-creator/qt-creator
Restore state of find flags in FindToolWindow.
There was an issue with checkboxes "Case Sensitive", "Whole Word", and "Regular Expression": their state was properly saved in FindPluginPrivate::m_findFlags, but was not properly restored in GUI of FindToolWindow on the next run of Qt Creator. This patch fixes this issue. Change-Id: I31e1e14a4117fbf4f4d17e82b3fa2b90973be339 Reviewed-by: Konstantin Tokarev <annulen@yandex.ru> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
committed by
Eike Ziller
parent
82170f0050
commit
3872597d09
@@ -74,6 +74,8 @@ FindToolWindow::FindToolWindow(FindPlugin *plugin, QWidget *parent)
|
|||||||
layout->setSpacing(0);
|
layout->setSpacing(0);
|
||||||
m_ui.configWidget->setLayout(layout);
|
m_ui.configWidget->setLayout(layout);
|
||||||
updateButtonStates();
|
updateButtonStates();
|
||||||
|
|
||||||
|
connect(m_plugin, SIGNAL(findFlagsChanged()), this, SLOT(updateFindFlags()));
|
||||||
}
|
}
|
||||||
|
|
||||||
FindToolWindow::~FindToolWindow()
|
FindToolWindow::~FindToolWindow()
|
||||||
@@ -130,6 +132,14 @@ void FindToolWindow::updateButtonStates()
|
|||||||
m_ui.searchTerm->setEnabled(filterEnabled);
|
m_ui.searchTerm->setEnabled(filterEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FindToolWindow::updateFindFlags()
|
||||||
|
{
|
||||||
|
m_ui.matchCase->setChecked(m_plugin->hasFindFlag(Find::FindCaseSensitively));
|
||||||
|
m_ui.wholeWords->setChecked(m_plugin->hasFindFlag(Find::FindWholeWords));
|
||||||
|
m_ui.regExp->setChecked(m_plugin->hasFindFlag(Find::FindRegularExpression));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void FindToolWindow::setFindFilters(const QList<IFindFilter *> &filters)
|
void FindToolWindow::setFindFilters(const QList<IFindFilter *> &filters)
|
||||||
{
|
{
|
||||||
qDeleteAll(m_configWidgets);
|
qDeleteAll(m_configWidgets);
|
||||||
@@ -159,10 +169,7 @@ void FindToolWindow::setCurrentFilter(IFindFilter *filter)
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
setCurrentFilter(index);
|
setCurrentFilter(index);
|
||||||
}
|
}
|
||||||
m_ui.matchCase->setChecked(m_plugin->hasFindFlag(Find::FindCaseSensitively));
|
updateFindFlags();
|
||||||
m_ui.wholeWords->setChecked(m_plugin->hasFindFlag(Find::FindWholeWords));
|
|
||||||
m_ui.regExp->setChecked(m_plugin->hasFindFlag(Find::FindRegularExpression));
|
|
||||||
|
|
||||||
m_ui.searchTerm->setFocus();
|
m_ui.searchTerm->setFocus();
|
||||||
m_ui.searchTerm->selectAll();
|
m_ui.searchTerm->selectAll();
|
||||||
}
|
}
|
||||||
|
@@ -70,6 +70,7 @@ private slots:
|
|||||||
void replace();
|
void replace();
|
||||||
void setCurrentFilter(int index);
|
void setCurrentFilter(int index);
|
||||||
void updateButtonStates();
|
void updateButtonStates();
|
||||||
|
void updateFindFlags();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void acceptAndGetParameters(QString *term, IFindFilter **filter);
|
void acceptAndGetParameters(QString *term, IFindFilter **filter);
|
||||||
|
Reference in New Issue
Block a user