diff options
author | Gerald Combs <gerald@wireshark.org> | 2006-10-11 00:37:29 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2006-10-11 00:37:29 +0000 |
commit | 1e480346d1fc8cbeb7fbdfa405ed46ae3bba1380 (patch) | |
tree | e796fe515e76a0cf0fce195428cc783466bcd0f1 /epan | |
parent | b07b29f711a9c74e56791348b5ef55c09837868d (diff) |
Add prefs_apply(), which lets us apply preferences (specifically,
trigger a module's callback) for a specific module.
svn path=/trunk/; revision=19487
Diffstat (limited to 'epan')
-rw-r--r-- | epan/prefs.c | 13 | ||||
-rw-r--r-- | epan/prefs.h | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/epan/prefs.c b/epan/prefs.c index ef612685e1..3f9831cae7 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -397,6 +397,19 @@ prefs_apply_all(void) } /* + * Call the "apply" callback function for a specific module if any of + * its preferences have changed, and then clear the flag saying its + * preferences have changed, as the module has been notified of that + * fact. + */ +void +prefs_apply(module_t *module) +{ + if (module && module->prefs_changed) + call_apply_cb(module, NULL); +} + +/* * Register a preference in a module's list of preferences. * If it has a title, give it an ordinal number; otherwise, it's a * preference that won't show up in the UI, so it shouldn't get an diff --git a/epan/prefs.h b/epan/prefs.h index 4b2187dd7c..2fbeccd4e3 100644 --- a/epan/prefs.h +++ b/epan/prefs.h @@ -235,6 +235,14 @@ extern guint prefs_modules_foreach(module_cb callback, gpointer user_data); */ extern void prefs_apply_all(void); +/* + * Call the "apply" callback function for a specific module if any of + * its preferences have changed, and then clear the flag saying its + * preferences have changed, as the module has been notified of that + * fact. + */ +extern void prefs_apply(module_t *module); + struct preference; typedef struct preference pref_t; |