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 @@ -1103,6 +1103,23 @@ prefs_register_uat_preference(module_t *module, const char *name, preference->varp.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. + */ +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. */ diff --git a/epan/prefs.h b/epan/prefs.h index 24445dd4ae..be1ed8d887 100644 --- a/epan/prefs.h +++ b/epan/prefs.h @@ -458,6 +458,17 @@ WS_DLL_PUBLIC void prefs_register_uat_preference(module_t *module, const char *description, 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