summaryrefslogtreecommitdiff
path: root/ui/settingsview.h
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2024-01-10 18:20:23 -0500
committerBrian Potchik <brian@vector35.com>2024-01-10 18:20:23 -0500
commit17aca5059072a5167a0d10eaee70c529083d569b (patch)
tree2bfbe371455bd0ed34862ecf3434bc20ca8a9a88 /ui/settingsview.h
parenta5c15c3ff5d134487ed59301299bdac36f627703 (diff)
Automatically filter settings based on current scope selection in the settings UI.
Diffstat (limited to 'ui/settingsview.h')
-rw-r--r--ui/settingsview.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/ui/settingsview.h b/ui/settingsview.h
index b665b539..8ec548b7 100644
--- a/ui/settingsview.h
+++ b/ui/settingsview.h
@@ -64,6 +64,7 @@ class BINARYNINJAUIAPI SettingsTreeModel : public QAbstractItemModel
Json::Value m_schema;
std::vector<SettingsEntry> m_store;
std::map<std::string, QString> m_filterText;
+ std::map<std::string, int> m_ignoreScope;
public:
SettingsTreeModel(std::string schema, QObject* parent = 0);
@@ -93,6 +94,7 @@ class BINARYNINJAUIAPI SettingsFilterProxyModel : public QSortFilterProxyModel
Q_OBJECT
int m_scopeFilter = SettingsAutoScope;
+ int m_scopeForSchema = SettingsAutoScope;
std::map<std::string, int> m_itemScope;
mutable QRegularExpression m_regExp;
mutable std::map<QString, std::set<QString>> m_subgroupFilterCache;
@@ -107,6 +109,13 @@ class BINARYNINJAUIAPI SettingsFilterProxyModel : public QSortFilterProxyModel
invalidateFilter();
m_subgroupFilterCache.clear();
}
+ int scopeForSchema() { return m_scopeForSchema; }
+ void setScopeForSchema(int scope)
+ {
+ invalidateFilter();
+ m_subgroupFilterCache.clear();
+ m_scopeForSchema = scope;
+ }
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
@@ -454,7 +463,7 @@ class BINARYNINJAUIAPI SettingsView : public QWidget
private Q_SLOTS:
void outlineSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
- void updateScopeFilter();
+ void updateScopeFilter(int scope);
void updateTextFilter();
Q_SIGNALS: