diff options
author | Milan Crha <mcrha@redhat.com> | 2007-10-11 22:03:13 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2007-10-11 22:03:13 +0800 |
commit | eeb89358f6f3aa8f211b33c23842a8deb08171a8 (patch) | |
tree | 5874c18c42397a4a387d6c4aa87718044b31431d /shell/e-shell-view.c | |
parent | aa70b15ea030e8c5a42ea9512c522140e6b8f5e7 (diff) | |
download | gsoc2013-evolution-eeb89358f6f3aa8f211b33c23842a8deb08171a8.tar.gz gsoc2013-evolution-eeb89358f6f3aa8f211b33c23842a8deb08171a8.tar.zst gsoc2013-evolution-eeb89358f6f3aa8f211b33c23842a8deb08171a8.zip |
** Fix for bug #329823
2007-10-11 Milan Crha <mcrha@redhat.com>
** Fix for bug #329823
* Evolution-Shell.idl: (setButtonIcon):
* e-sidebar.h: (e_sidebar_change_button_icon):
* e-sidebar.c: (struct Button), (button_new), (button_free),
(e_sidebar_change_button_icon):
* e-shell.h: (EMainShellFunc), (e_shell_foreach_shell_window):
* e-shell.c: (EMainShellFunc), (e_shell_foreach_shell_window):
* e-component-view.h: (e_component_view_set_button_icon):
* e-component-view.c: (e_component_view_set_button_icon):
* e-shell-window.h: (e_shell_window_change_component_button_icon):
* e-shell-window.c: (e_shell_window_change_component_button_icon):
* e-shell-view.c: (struct change_icon_struct),
(change_button_icon_func), (impl_ShellView_setButtonIcon),
(e_shell_view_class_init):
Added support to change component's button icon.
* mail-component.h: (mail_indicate_new_mail):
* mail-component.c: (mail_indicate_new_mail),
(struct _MailComponentPrivate), (impl_dispose), (impl_createView):
New function to indicate new mails on sidebar's button and storing
component_view in priv struct for later use.
* em-folder-view.c: (emfv_list_done_message_selected):
* mail-folder-cache.c: (real_flush_updates):
Indicate changes like for plugins for new mails.
svn path=/trunk/; revision=34374
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r-- | shell/e-shell-view.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index f386a7c64d..9e4f66b0d0 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -32,6 +32,7 @@ #include "e-shell-view.h" #include "e-shell-window.h" +#include "e-util/e-icon-factory.h" static BonoboObjectClass *parent_class = NULL; @@ -57,6 +58,43 @@ impl_ShellView_setComponent(PortableServer_Servant _servant, const CORBA_char *i e_shell_window_switch_to_component(esw->window, id); } +struct change_icon_struct { + const char *component_name; + GdkPixbuf *icon; +}; + +static gboolean +change_button_icon_func (EShell *shell, EShellWindow *window, gpointer user_data) +{ + struct change_icon_struct *cis = (struct change_icon_struct*)user_data; + + g_return_val_if_fail (window != NULL, FALSE); + g_return_val_if_fail (cis != NULL, FALSE); + + e_shell_window_change_component_button_icon (window, cis->component_name, cis->icon); + + return TRUE; +} + +static void +impl_ShellView_setButtonIcon (PortableServer_Servant _servant, const CORBA_char *id, const CORBA_char * iconName, CORBA_Environment * ev) +{ + EShellView *esw = (EShellView *)bonobo_object_from_servant(_servant); + EShell *shell = e_shell_window_peek_shell (esw->window); + + struct change_icon_struct cis; + cis.component_name = id; + cis.icon = NULL; + + if (iconName) + cis.icon = e_icon_factory_get_icon (iconName, E_ICON_SIZE_BUTTON); + + e_shell_foreach_shell_window (shell, change_button_icon_func, &cis); + + if (cis.icon) + g_object_unref (cis.icon); +} + static void impl_dispose (GObject *object) { @@ -86,6 +124,7 @@ e_shell_view_class_init (EShellViewClass *klass) epv = & klass->epv; epv->setTitle = impl_ShellView_setTitle; epv->setComponent = impl_ShellView_setComponent; + epv->setButtonIcon = impl_ShellView_setButtonIcon; } static void |