diff --git a/utils/themeeditor/gui/findreplacedialog.cpp b/utils/themeeditor/gui/findreplacedialog.cpp
index e2b8b9bc43..2a6161189e 100644
--- a/utils/themeeditor/gui/findreplacedialog.cpp
+++ b/utils/themeeditor/gui/findreplacedialog.cpp
@@ -57,13 +57,13 @@ void FindReplaceDialog::closeEvent(QCloseEvent* event)
void FindReplaceDialog::setupUI()
{
- QObject::connect(ui->findButton, SIGNAL(pressed()),
+ QObject::connect(ui->findButton, SIGNAL(clicked()),
this, SLOT(find()));
- QObject::connect(ui->replaceButton, SIGNAL(pressed()),
+ QObject::connect(ui->replaceButton, SIGNAL(clicked()),
this, SLOT(replace()));
- QObject::connect(ui->replaceAllButton, SIGNAL(pressed()),
+ QObject::connect(ui->replaceAllButton, SIGNAL(clicked()),
this, SLOT(replaceAll()));
- QObject::connect(ui->closeButton, SIGNAL(pressed()),
+ QObject::connect(ui->closeButton, SIGNAL(clicked()),
this, SLOT(close()));
QObject::connect(ui->findBox, SIGNAL(textChanged(QString)),
this, SLOT(textChanged()));
@@ -77,10 +77,6 @@ void FindReplaceDialog::find()
if(!editor)
return;
- /* Figuring out the range to search in */
- int begin = editor->textCursor().selectionStart();
- int end = editor->textCursor().selectionEnd();
-
QTextDocument::FindFlags flags = 0;
if(ui->caseBox->isChecked())
flags |= QTextDocument::FindCaseSensitively;
@@ -109,7 +105,7 @@ void FindReplaceDialog::find()
QPalette newPal;
if(!textFound.isNull())
{
- newPal.setColor(QPalette::Foreground, QColor(150, 255, 150));
+ newPal.setColor(QPalette::Foreground, QColor(0, 150, 0));
ui->statusLabel->setPalette(newPal);
ui->statusLabel->setText(tr("Match Found"));
editor->setTextCursor(textFound);
@@ -126,12 +122,31 @@ void FindReplaceDialog::find()
void FindReplaceDialog::replace()
{
+ if(textFound.isNull())
+ find();
+ if(textFound.isNull())
+ return;
+
+ editor->setTextCursor(textFound);
+ editor->insertPlainText(ui->replaceBox->text());
+ textFound = QTextCursor();
}
void FindReplaceDialog::replaceAll()
{
+ do
+ {
+ if(!textFound.isNull())
+ {
+ editor->setTextCursor(textFound);
+ editor->insertPlainText(ui->replaceBox->text());
+ }
+
+ find();
+ }while(!textFound.isNull());
+
}
void FindReplaceDialog::textChanged()
diff --git a/utils/themeeditor/gui/findreplacedialog.ui b/utils/themeeditor/gui/findreplacedialog.ui
index 1c4510788f..5641181a61 100644
--- a/utils/themeeditor/gui/findreplacedialog.ui
+++ b/utils/themeeditor/gui/findreplacedialog.ui
@@ -50,15 +50,15 @@
+ -
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-