Add a function and an enum to register an uat preference for QT only.

svn path=/trunk/; revision=53880
This commit is contained in:
Irene Rüngeler 2013-12-09 10:07:33 +00:00
parent 293e390c61
commit a2b2dd4b28
3 changed files with 35 additions and 0 deletions

View File

@ -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;

View File

@ -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.
*/

View File

@ -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