diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-02-23 11:21:04 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-02-23 11:21:04 +0800 |
commit | a63a9dbb82cddad30c25cec46df4220a94e6f296 (patch) | |
tree | 4031162b55e77a45a2439c78480e9826762b305b /shell/e-shell-module.c | |
parent | e0ffe55ce596c6319016004dfe3350b0d7cc762d (diff) | |
download | gsoc2013-evolution-a63a9dbb82cddad30c25cec46df4220a94e6f296.tar gsoc2013-evolution-a63a9dbb82cddad30c25cec46df4220a94e6f296.tar.gz gsoc2013-evolution-a63a9dbb82cddad30c25cec46df4220a94e6f296.tar.bz2 gsoc2013-evolution-a63a9dbb82cddad30c25cec46df4220a94e6f296.tar.lz gsoc2013-evolution-a63a9dbb82cddad30c25cec46df4220a94e6f296.tar.xz gsoc2013-evolution-a63a9dbb82cddad30c25cec46df4220a94e6f296.tar.zst gsoc2013-evolution-a63a9dbb82cddad30c25cec46df4220a94e6f296.zip |
Make filter options for mail labels work again.
Define a new shell module method named start() that tells the module when to
start loading data and running background tasks. Only really applies to the
mail module right now since the others use evolution-data-server. Basically
it prevents the mail module from loading and refreshing mail stores until
you actually switch to the mail view.
svn path=/branches/kill-bonobo/; revision=37309
Diffstat (limited to 'shell/e-shell-module.c')
-rw-r--r-- | shell/e-shell-module.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/shell/e-shell-module.c b/shell/e-shell-module.c index 11226557c2..e3f6fe37b9 100644 --- a/shell/e-shell-module.c +++ b/shell/e-shell-module.c @@ -53,6 +53,8 @@ struct _EShellModulePrivate { /* Initializes the loaded type module. */ void (*init) (GTypeModule *type_module); + + guint started : 1; }; enum { @@ -445,6 +447,30 @@ e_shell_module_add_activity (EShellModule *shell_module, } /** + * e_shell_module_start: + * @shell_module: an #EShellModule + * + * Tells the @shell_module to begin loading data or running background + * tasks which may consume significant resources. This gets called in + * reponse to the user switching to the corresponding shell view for + * the first time. The function is idempotent for each shell module. + **/ +void +e_shell_module_start (EShellModule *shell_module) +{ + EShellModuleInfo *module_info; + + g_return_if_fail (E_IS_SHELL_MODULE (shell_module)); + + module_info = &shell_module->priv->info; + + if (module_info->start != NULL && !shell_module->priv->started) + module_info->start (shell_module); + + shell_module->priv->started = TRUE; +} + +/** * e_shell_module_is_busy: * @shell_module: an #EShellModule * @@ -576,6 +602,7 @@ e_shell_module_set_info (EShellModule *shell_module, module_info->schemes = g_intern_string (info->schemes); module_info->sort_order = info->sort_order; + module_info->start = info->start; module_info->is_busy = info->is_busy; module_info->shutdown = info->shutdown; module_info->migrate = info->migrate; |