Skip to content
Snippets Groups Projects
Commit c27230b6 authored by albrecpe's avatar albrecpe
Browse files

Change search button to filter and search

parent 7639b169
Branches feature/skillMemoryGUI
No related tags found
1 merge request!442Fix: skill gui live search
Pipeline #18374 passed
...@@ -12,6 +12,13 @@ namespace armarx::skills::gui ...@@ -12,6 +12,13 @@ namespace armarx::skills::gui
emit searchRequest(search); emit searchRequest(search);
} }
void
SkillGroupBox::filterAndFetch()
{
memory->updateFromMemory();
handleSearch();
}
void void
SkillGroupBox::connectGui(std::string observerName) SkillGroupBox::connectGui(std::string observerName)
{ {
...@@ -55,7 +62,12 @@ namespace armarx::skills::gui ...@@ -55,7 +62,12 @@ namespace armarx::skills::gui
// text // text
this->searchBar->setPlaceholderText(QString::fromStdString("Search ...")); this->searchBar->setPlaceholderText(QString::fromStdString("Search ..."));
this->acceptSearchButton->setText(QString::fromStdString("Search")); this->acceptSearchButton->setText(QString::fromStdString("Update and Search"));
// some further information to explain the search bar
this->searchBar->setToolTip(
QString::fromStdString("Accepting the search (with Enter) searches all currently known "
"skills. This is not the same as 'Update & Search'!"));
connectSignals(); connectSignals();
} }
...@@ -64,7 +76,7 @@ namespace armarx::skills::gui ...@@ -64,7 +76,7 @@ namespace armarx::skills::gui
SkillGroupBox::connectSignals() SkillGroupBox::connectSignals()
{ {
connect( connect(
this->acceptSearchButton, &QPushButton::clicked, this, &SkillGroupBox::handleSearch); this->acceptSearchButton, &QPushButton::clicked, this, &SkillGroupBox::filterAndFetch);
connect(this->searchBar, &QLineEdit::editingFinished, this, &SkillGroupBox::handleSearch); connect(this->searchBar, &QLineEdit::editingFinished, this, &SkillGroupBox::handleSearch);
connect(this, connect(this,
&SkillGroupBox::searchRequest, &SkillGroupBox::searchRequest,
......
...@@ -50,6 +50,11 @@ namespace armarx::skills::gui ...@@ -50,6 +50,11 @@ namespace armarx::skills::gui
*/ */
void handleSearch(); void handleSearch();
/**
* @brief Applies the update, and requests an update from memory.
*/
void filterAndFetch();
private: private:
void setupUi(); void setupUi();
void connectSignals(); void connectSignals();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment