Skip to content

Commit

Permalink
added setOptions to SearchDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
neoneela committed Sep 26, 2023
1 parent dba9552 commit 1b91945
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions plugins/gui/include/gui/searchbar/searchoptions_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace hal
SearchOptionsDialog(QWidget *parent = nullptr);
void emitOptions();
SearchOptions* getOptions() const;
void setOptions(SearchOptions* opts, bool incSearch, int minIncSearch) const;
QString getText() const;
int getMinIncSearchValue();
bool getIncrementalSearch();
Expand Down
1 change: 1 addition & 0 deletions plugins/gui/src/searchbar/searchbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ namespace hal
//TODO discuss if previous options should be passed back to the dialog to build dialog from them.
// otherwise the use has to enter the same options again
SearchOptionsDialog sd;
sd.setOptions(mCurrentOptions, mIncrementalSearch, mMinCharsToStartIncSearch);
if (sd.exec() == QDialog::Accepted)
{
mCurrentOptions = sd.getOptions();
Expand Down
12 changes: 10 additions & 2 deletions plugins/gui/src/searchbar/searchoptions_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ namespace hal

}



void SearchOptionsDialog::emitStartSearch()
{
qInfo() << "emitStartSearch from searchOptionsDialog";
Expand All @@ -80,6 +78,16 @@ namespace hal
return retval;
}

void SearchOptionsDialog::setOptions(SearchOptions* opts, bool incSearch, int minIncSearch) const
{
mExactMatchBox->setChecked(opts->isMExactMatch());
mCaseSensitiveBox->setChecked(opts->isMCaseSensitive());
mRegExBox->setChecked(opts->isMRegularExpression());
mIncrementalSearchBox->setChecked(incSearch);

mSpinBox->setValue(minIncSearch);
}

QString SearchOptionsDialog::getText() const
{
return mSearchText;
Expand Down

0 comments on commit 1b91945

Please sign in to comment.