summaryrefslogtreecommitdiffstats
path: root/ui/qt/models/pref_models.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
commitc4e8a3222648fcf22ca207f1815ebbf7cd144eeb (patch)
tree93d5c6aa93d9987680dd1adad5685e2ad698f223 /ui/qt/models/pref_models.h
parentAdding upstream version 4.2.6. (diff)
downloadwireshark-c4e8a3222648fcf22ca207f1815ebbf7cd144eeb.tar.xz
wireshark-c4e8a3222648fcf22ca207f1815ebbf7cd144eeb.zip
Adding upstream version 4.4.0.upstream/4.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ui/qt/models/pref_models.h')
-rw-r--r--ui/qt/models/pref_models.h60
1 files changed, 33 insertions, 27 deletions
diff --git a/ui/qt/models/pref_models.h b/ui/qt/models/pref_models.h
index 775da0d0..601c7623 100644
--- a/ui/qt/models/pref_models.h
+++ b/ui/qt/models/pref_models.h
@@ -19,32 +19,7 @@
#include <QSortFilterProxyModel>
#include <QTreeView>
-class PrefsItem : public ModelHelperTreeItem<PrefsItem>
-{
-public:
- PrefsItem(module_t *module, pref_t *pref, PrefsItem* parent);
- PrefsItem(const QString name, PrefsItem* parent);
- virtual ~PrefsItem();
-
- QString getName() const {return name_;}
- pref_t* getPref() const {return pref_;}
- int getPrefType() const;
- bool isPrefDefault() const;
- QString getPrefTypeName() const;
- module_t* getModule() const {return module_;}
- QString getModuleName() const;
- QString getModuleTitle() const;
- void setChanged(bool changed = true);
-
-private:
- pref_t *pref_;
- module_t *module_;
- QString name_;
- //set to true if changed during module manipulation
- //Used to determine proper "default" for comparison
- bool changed_;
-};
-
+class PrefsItem;
class PrefsModel : public QAbstractItemModel
{
@@ -83,6 +58,7 @@ public:
int columnCount(const QModelIndex &parent = QModelIndex()) const;
static QString typeToString(int type);
+ static QString typeToHelp(int type);
private:
void populate();
@@ -90,6 +66,35 @@ private:
PrefsItem* root_;
};
+class PrefsItem : public ModelHelperTreeItem<PrefsItem>
+{
+public:
+ PrefsItem(module_t *module, pref_t *pref, PrefsItem* parent);
+ PrefsItem(const QString name, PrefsItem* parent);
+ PrefsItem(PrefsModel::PrefsModelType type, PrefsItem* parent);
+ virtual ~PrefsItem();
+
+ QString getName() const {return name_;}
+ pref_t* getPref() const {return pref_;}
+ int getPrefType() const;
+ bool isPrefDefault() const;
+ QString getPrefTypeName() const;
+ module_t* getModule() const {return module_;}
+ QString getModuleName() const;
+ QString getModuleTitle() const;
+ QString getModuleHelp() const;
+ void setChanged(bool changed = true);
+
+private:
+ pref_t *pref_;
+ module_t *module_;
+ QString name_;
+ QString help_;
+ //set to true if changed during module manipulation
+ //Used to determine proper "default" for comparison
+ bool changed_;
+};
+
class AdvancedPrefsModel : public QSortFilterProxyModel
{
Q_OBJECT
@@ -143,7 +148,8 @@ public:
};
enum ModulePrefsRoles {
- ModuleName = Qt::UserRole + 1
+ ModuleName = Qt::UserRole + 1,
+ ModuleHelp = Qt::UserRole + 2
};
QVariant data(const QModelIndex &index, int role) const;