aboutsummaryrefslogtreecommitdiffstats
path: root/epan/prefs.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-01-05 02:30:58 +0000
committerGerald Combs <gerald@wireshark.org>2013-01-05 02:30:58 +0000
commit4a3342e4bac842152cbe73afbbb3593caf6c0e65 (patch)
treed627c5b6aaca63caad8d4ca718d89d1be43f198a /epan/prefs.h
parentbab105d094c6fd89ee542d36f6777681ae96f68b (diff)
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
Diffstat (limited to 'epan/prefs.h')
-rw-r--r--epan/prefs.h37
1 files changed, 37 insertions, 0 deletions
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