diff options
| author | Josh Ferrell <josh@vector35.com> | 2026-01-26 14:23:12 -0500 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2026-02-06 17:53:45 -0500 |
| commit | 70bbb18a9444824a8ec2b9a7ff57fc848e017b6e (patch) | |
| tree | fe87c0976b75a7557986d1ac6bcc2409a839624c /ui/filter.h | |
| parent | 9b7604d13e8bd98c6998facb9326926ed96281b5 (diff) | |
Add regex and case sensitivity options to FilterEdit
Diffstat (limited to 'ui/filter.h')
| -rw-r--r-- | ui/filter.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/ui/filter.h b/ui/filter.h index 98417f65..3178d4b8 100644 --- a/ui/filter.h +++ b/ui/filter.h @@ -14,12 +14,25 @@ \ingroup filter */ +enum BINARYNINJAUIAPI FilterOption { + NoFilterOption = 0, + CaseSensitiveOption = 1, + UseRegexOption = 2, +}; + +Q_DECLARE_FLAGS(FilterOptions, FilterOption) + + +/*! + + \ingroup filter +*/ class BINARYNINJAUIAPI FilterTarget { public: virtual ~FilterTarget() {} - virtual void setFilter(const std::string& filter) = 0; + virtual void setFilter(const std::string& filter, FilterOptions options) = 0; virtual void scrollToFirstItem() = 0; virtual void scrollToCurrentItem() = 0; @@ -44,10 +57,27 @@ class BINARYNINJAUIAPI FilterEdit : public QLineEdit Q_OBJECT FilterTarget* m_target; + FilterOptions m_filterOptions; + + QAction* m_clearAction; + QAction* m_regexAction; + QAction* m_regexWarningAction; + QAction* m_caseSensitivityAction; + + QIcon getActionIcon(const QString& iconName, bool enabled) const; public: FilterEdit(FilterTarget* target); + void showRegexToggle(bool enabled); + + void setRegexValidationError(const QString& error); + + FilterOptions getFilterOptions() const { return m_filterOptions; } + + Q_SIGNALS: + void optionsChanged(FilterOptions options); + protected: virtual void paintEvent(QPaintEvent* event) override; virtual void keyPressEvent(QKeyEvent* event) override; @@ -76,7 +106,7 @@ class BINARYNINJAUIAPI FilteredView : public QWidget void focusAndSelectFilter(); bool hasFilterText() const; - static bool match(const std::string& name, const std::string& filter); + static bool match(const std::string& name, const std::string& filter, bool caseSensitive = false); private Q_SLOTS: void timerStart(); |
