diff --git a/.hgignore b/.hgignore index acd48da3d..44edfcd0f 100644 --- a/.hgignore +++ b/.hgignore @@ -159,3 +159,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Understand IDE file +*.udb \ No newline at end of file diff --git a/ChangeLog.txt b/ChangeLog.txt index 4b8cb815b..edfbb8795 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,5 @@ # Version 0.5.0 +- [#581] User can now filter input lists by keyword in function wizard. - [#24] User can now add labels with different information on the detail - [#505] New installer script based on Inno Setup 5. - Size of preferences dialog in both Valentina and Tape app is now preserved between sessions diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp index b9603cfaa..dc26a0032 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp @@ -95,6 +95,19 @@ DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, const qui connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEditWrongFormula::FormulaChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEditWrongFormula::DeployFormulaTextEdit); + // clear text filter every time when new radio button selected + auto clearFilterFormulaInputs = [=] () { ui->filterFormulaInputs->clear(); }; + + connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, clearFilterFormulaInputs); + connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, clearFilterFormulaInputs); + connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, clearFilterFormulaInputs); + connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, clearFilterFormulaInputs); + connect(ui->radioButtonAngleLine, &QRadioButton::clicked, this, clearFilterFormulaInputs); + connect(ui->radioButtonRadiusesArcs, &QRadioButton::clicked, this, clearFilterFormulaInputs); + connect(ui->radioButtonAnglesCurves, &QRadioButton::clicked, this, clearFilterFormulaInputs); + connect(ui->radioButtonCLength, &QRadioButton::clicked, this, clearFilterFormulaInputs); + connect(ui->radioButtonFunctions, &QRadioButton::clicked, this, clearFilterFormulaInputs); + //Disable Qt::WaitCursor #ifndef QT_NO_CURSOR if (QApplication::overrideCursor() != nullptr) @@ -529,3 +542,18 @@ void DialogEditWrongFormula::ShowFunctions() ui->tableWidget->selectRow(0); ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); } + +void DialogEditWrongFormula::on_filterFormulaInputs_textEdited(const QString &filter) +{ + ui->tableWidget->blockSignals(true); + + // hide all rows + for (auto i = 0; i < ui->tableWidget->rowCount(); i++) + ui->tableWidget->hideRow(i); + + // show rows with matched filter + for (auto item : ui->tableWidget->findItems(filter, Qt::MatchContains)) + ui->tableWidget->showRow(item->row()); + + ui->tableWidget->blockSignals(false); +} diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.h b/src/libs/vtools/dialogs/support/dialogeditwrongformula.h index 2e1255e85..d4d42d076 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.h +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.h @@ -96,6 +96,8 @@ protected: virtual void CheckState() Q_DECL_OVERRIDE; virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; virtual void showEvent( QShowEvent *event ) Q_DECL_OVERRIDE; +private slots: + void on_filterFormulaInputs_textEdited(const QString &filter); private: Q_DISABLE_COPY(DialogEditWrongFormula) Ui::DialogEditWrongFormula *ui; diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui b/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui index 8f952605e..edc6da1ba 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui @@ -355,6 +355,13 @@ + + + + Filter list by keyword + + +