Commit 3872597d authored by Konstantin Tokarev's avatar Konstantin Tokarev Committed by Eike Ziller
Browse files

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: default avatarKonstantin Tokarev <annulen@yandex.ru>
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent 82170f00
......@@ -74,6 +74,8 @@ FindToolWindow::FindToolWindow(FindPlugin *plugin, QWidget *parent)
layout->setSpacing(0);
m_ui.configWidget->setLayout(layout);
updateButtonStates();
connect(m_plugin, SIGNAL(findFlagsChanged()), this, SLOT(updateFindFlags()));
}
FindToolWindow::~FindToolWindow()
......@@ -130,6 +132,14 @@ void FindToolWindow::updateButtonStates()
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)
{
qDeleteAll(m_configWidgets);
......@@ -159,10 +169,7 @@ void FindToolWindow::setCurrentFilter(IFindFilter *filter)
if (index >= 0) {
setCurrentFilter(index);
}
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));
updateFindFlags();
m_ui.searchTerm->setFocus();
m_ui.searchTerm->selectAll();
}
......
......@@ -70,6 +70,7 @@ private slots:
void replace();
void setCurrentFilter(int index);
void updateButtonStates();
void updateFindFlags();
private:
void acceptAndGetParameters(QString *term, IFindFilter **filter);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment