Add prefs_apply(), which lets us apply preferences (specifically,

trigger a module's callback) for a specific module.

svn path=/trunk/; revision=19487
This commit is contained in:
Gerald Combs 2006-10-11 00:37:29 +00:00
parent b07b29f711
commit 1e480346d1
2 changed files with 21 additions and 0 deletions

View File

@ -396,6 +396,19 @@ prefs_apply_all(void)
g_list_foreach(modules, call_apply_cb, NULL);
}
/*
* 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

View File

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