diff options
author | Irene RĂ¼ngeler <I.Ruengeler@fh-muenster.de> | 2013-12-09 10:07:33 +0000 |
---|---|---|
committer | Irene RĂ¼ngeler <I.Ruengeler@fh-muenster.de> | 2013-12-09 10:07:33 +0000 |
commit | a2b2dd4b284e43a98dacf742fc0801d3bdc03028 (patch) | |
tree | 45bd95ab7a0c59eeafc0fc484c777f69339913ac /epan | |
parent | 293e390c6129d7badce01279b4b9facb9f701fc8 (diff) |
Add a function and an enum to register an uat preference for QT only.
svn path=/trunk/; revision=53880
Diffstat (limited to 'epan')
-rw-r--r-- | epan/prefs-int.h | 7 | ||||
-rw-r--r-- | epan/prefs.c | 17 | ||||
-rw-r--r-- | epan/prefs.h | 11 |
3 files changed, 35 insertions, 0 deletions
diff --git a/epan/prefs-int.h b/epan/prefs-int.h index 52fc65fa6e..ae2772e600 100644 --- a/epan/prefs-int.h +++ b/epan/prefs-int.h @@ -108,6 +108,12 @@ typedef enum { PREF_DIRNAME } pref_type_t; +typedef enum { + GUI_ALL, + GUI_GTK, + GUI_QT +} gui_type_t; + /** Struct to hold preference data */ struct preference { const char *name; /**< name of preference */ @@ -115,6 +121,7 @@ struct preference { const char *description; /**< human-readable description of preference */ int ordinal; /**< ordinal number of this preference */ pref_type_t type; /**< type of that preference */ + gui_type_t gui; /**< type of the GUI (QT, GTK or both) the preference is registered for */ union { /* The Qt preference code assumes that these will all be pointers (and unique) */ guint *uint; gboolean *boolp; diff --git a/epan/prefs.c b/epan/prefs.c index ea4c40b0b2..b3e210df43 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -1104,6 +1104,23 @@ prefs_register_uat_preference(module_t *module, const char *name, } /* + * Register a uat 'preference' for QT only. It adds a button that opens the uat's window in the + * preferences tab of the module. + */ +extern void +prefs_register_uat_preference_qt(module_t *module, const char *name, + const char *title, const char *description, + uat_t* uat) +{ + + pref_t* preference = register_preference(module, name, title, description, PREF_UAT); + + preference->varp.uat = uat; + + preference->gui = GUI_QT; +} + +/* * Register a color preference. */ void diff --git a/epan/prefs.h b/epan/prefs.h index 24445dd4ae..be1ed8d887 100644 --- a/epan/prefs.h +++ b/epan/prefs.h @@ -459,6 +459,17 @@ WS_DLL_PUBLIC void prefs_register_uat_preference(module_t *module, struct epan_uat* uat); /* + * Register a uat 'preference' for QT only. It adds a button that opens the uat's window in the + * preferences tab of the module. + */ +WS_DLL_PUBLIC void prefs_register_uat_preference_qt(module_t *module, + const char *name, + const char* title, + const char *description, + struct epan_uat* uat); + + +/* * Register a color preference. Currently does not have any "GUI Dialog" support * so the color data needs to be managed independently. Currently used by the * "GUI preferences" to aid in reading/writing the preferences file, but the |