aboutsummaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2007-02-03 14:25:02 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2007-02-03 14:25:02 +0000
commitd70a58f881e34d3a83533236d0fe74e425a0700f (patch)
tree683c63d63061635121c0893a08d8320a910299da /epan/prefs.c
parent009d38e6a0accceef00a1209cfe7f6708e8b30ee (diff)
second iteration:
* fields of an uat table now are passed using an array of uat_filed_t * field callbacks take two more userdata arguments * add some macros to define uat field callbacks. * uats can be registered as preferences for a specific protocol - the preference widget is a button that opens the uat's window * dfilter-macro => reflect changes to API svn path=/trunk/; revision=20695
Diffstat (limited to 'epan/prefs.c')
-rw-r--r--epan/prefs.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 434ed00d7e..309d876567 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -48,6 +48,7 @@
#include <wiretap/file_util.h>
#include <epan/prefs-int.h>
+#include <epan/uat-int.h>
/* Internal functions */
static module_t *prefs_register_module_or_subtree(module_t *parent,
@@ -639,6 +640,24 @@ void prefs_register_static_text_preference(module_t *module, const char *name,
}
/*
+ * Register a uat 'preference'. It adds a button that opens the uat's window in the
+ * preferences tab of the module.
+ */
+extern void prefs_register_uat_preference(module_t *module,
+ const char *name,
+ const char *title,
+ const char *description,
+ void* uat) {
+
+ pref_t* preference = register_preference(module, name, title, description, PREF_UAT);
+
+ preference->varp.uat = uat;
+
+}
+
+
+
+/*
* Register a preference that used to be supported but no longer is.
*/
void
@@ -941,6 +960,8 @@ init_prefs(void) {
if (prefs_initialized)
return;
+ uat_load_all();
+
prefs.pr_format = PR_FMT_TEXT;
prefs.pr_dest = PR_DEST_CMD;
prefs.pr_file = g_strdup("wireshark.out");
@@ -1103,7 +1124,7 @@ read_prefs(int *gpf_errno_return, int *gpf_read_errno_return,
FILE *pf;
init_prefs();
-
+
/*
* If we don't already have the pathname of the global preferences
* file, construct it. Then, in either case, try to open the file.
@@ -2133,6 +2154,7 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
}
case PREF_STATIC_TEXT:
+ case PREF_UAT:
{
break;
}
@@ -2248,6 +2270,7 @@ write_pref(gpointer data, gpointer user_data)
}
case PREF_STATIC_TEXT:
+ case PREF_UAT:
{
/* Nothing to do */
break;