From 4a3342e4bac842152cbe73afbbb3593caf6c0e65 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Sat, 5 Jan 2013 02:30:58 +0000 Subject: Break out preference type names, type descriptions, string representations, and default status out of write_prefs and into their own routines. Split the corresponding custom preference write callbacks. Fix an apparent memory leak in the hidden column callback. Add an initial preferences dialog to the Qt port. Use the new preference routines to implement an "Adavanced" page similar to the "about:config" page available in many web browsers. Standard pages will hopefully follow soon. Remove some QDebug includes and make sure our QTreeWidgets have uniform row heights set. svn path=/trunk/; revision=46942 --- epan/prefs.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'epan/prefs.h') diff --git a/epan/prefs.h b/epan/prefs.h index 9ca301c5d4..de0909eac1 100644 --- a/epan/prefs.h +++ b/epan/prefs.h @@ -456,6 +456,43 @@ extern void prefs_clear_string_list(GList *sl); */ extern void prefs_register_modules(void); +/** Fetch a short preference type name, e.g. "Integer". + * + * @param pref A preference. + * + * @return The preference type name. May be NULL. + */ +const char *prefs_pref_type_name(pref_t *pref); + +/** Fetch a long description of the preference type + * + * @param pref A preference. + * + * @return A description of the preference type including allowed + * values for enums. The description may include newlines. Must be + * g_free()d. + */ +char *prefs_pref_type_description(pref_t *pref); + +/** Check if a preference differs from its default value + * + * @param pref A preference. + * + * @return TRUE if the current value of the preference is the same as + * its default value or FALSE if they differ. + */ +gboolean prefs_pref_is_default(pref_t *pref); + +/** Fetch a string representation of the preference. + * + * @param pref A preference. + * @param default_val Return the default value if TRUE or the current value + * if FALSE. + * + * @return A string representation of the preference. Must be g_free()d. + */ +char *prefs_pref_to_str(pref_t *pref, gboolean default_val); + /* Read the preferences file, fill in "prefs", and return a pointer to it. If we got an error (other than "it doesn't exist") trying to read -- cgit v1.2.3