diff options
author | Ondrej Jirman <megous@megous.com> | 2008-04-07 17:55:11 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-04-07 17:55:11 +0800 |
commit | 0732374acc936f29afb4bb9c2fb731bf5054f6a5 (patch) | |
tree | 7d149e5f77dce2e496d01a53adec3a30c655aa2e /shell | |
parent | d4ec8ecc409c339e0a2e7777965cfa1596e38655 (diff) | |
download | gsoc2013-evolution-0732374acc936f29afb4bb9c2fb731bf5054f6a5.tar gsoc2013-evolution-0732374acc936f29afb4bb9c2fb731bf5054f6a5.tar.gz gsoc2013-evolution-0732374acc936f29afb4bb9c2fb731bf5054f6a5.tar.bz2 gsoc2013-evolution-0732374acc936f29afb4bb9c2fb731bf5054f6a5.tar.lz gsoc2013-evolution-0732374acc936f29afb4bb9c2fb731bf5054f6a5.tar.xz gsoc2013-evolution-0732374acc936f29afb4bb9c2fb731bf5054f6a5.tar.zst gsoc2013-evolution-0732374acc936f29afb4bb9c2fb731bf5054f6a5.zip |
** Fix for bug #525238
2008-04-07 Ondrej Jirman <megous@megous.com>
** Fix for bug #525238
* e-shell-window.c: (switch_view):
* es-event.c:
* es-event.h:
Add new "component.activated" event. Event is emitted whenever
component is activated. ESEventTargetComponent contains an id
of the component being activated.
svn path=/trunk/; revision=35332
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 11 | ||||
-rw-r--r-- | shell/e-shell-window.c | 10 | ||||
-rw-r--r-- | shell/es-event.c | 11 | ||||
-rw-r--r-- | shell/es-event.h | 11 |
4 files changed, 42 insertions, 1 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 910bbb9ee8..7c26a8a006 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,14 @@ +2008-04-07 Ondrej Jirman <megous@megous.com> + + ** Fix for bug #525238 + + * e-shell-window.c: (switch_view): + * es-event.c: + * es-event.h: + Add new "component.activated" event. Event is emitted whenever + component is activated. ESEventTargetComponent contains an id + of the component being activated. + 2008-03-25 Veerapuram Varadhan <vvaradhan@novell.com> ** Added configurable Proxy settings for Evolution. diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 788aaf2004..887ced0c87 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -36,6 +36,7 @@ #include "e-shell-marshal.h" #include "e-sidebar.h" #include "es-menu.h" +#include "es-event.h" #include <gtk/gtkbutton.h> #include <gtk/gtkhbox.h> @@ -356,6 +357,15 @@ switch_view (EShellWindow *window, ComponentView *component_view) g_object_unref (gconf_client); + /** @Event: Shell component activated or switched to. + * @Id: component.activated + * @Target: ESEventTargetComponent + * + * This event is emitted whenever the shell successfully activates component + * view. + */ + e_event_emit ((EEvent *) es_event_peek (), "component.activated", (EEventTarget *) es_event_target_new_component (es_event_peek (), component_view->component_id)); + g_signal_emit (window, signals[COMPONENT_CHANGED], 0); } diff --git a/shell/es-event.c b/shell/es-event.c index 5d4c5366d8..78b601092e 100644 --- a/shell/es-event.c +++ b/shell/es-event.c @@ -152,6 +152,16 @@ es_event_target_new_upgrade(ESEvent *eme, int major, int minor, int revision) return t; } +ESEventTargetComponent * +es_event_target_new_component (ESEvent *eme, const char *id) +{ + ESEventTargetComponent *t = e_event_target_new (&eme->event, ES_EVENT_TARGET_COMPONENT, sizeof (*t)); + + t->id = id; + + return t; +} + /* ********************************************************************** */ static void *emeh_parent_class; @@ -167,6 +177,7 @@ static const EEventHookTargetMap emeh_targets[] = { { "state", ES_EVENT_TARGET_STATE, emeh_state_masks }, { "upgrade", ES_EVENT_TARGET_UPGRADE, NULL }, { "shell", ES_EVENT_TARGET_SHELL, NULL }, + { "component", ES_EVENT_TARGET_COMPONENT, NULL }, { NULL } }; diff --git a/shell/es-event.h b/shell/es-event.h index 518fd44e52..10b74ef163 100644 --- a/shell/es-event.h +++ b/shell/es-event.h @@ -41,7 +41,8 @@ typedef struct _ESEventClass ESEventClass; enum _es_event_target_t { ES_EVENT_TARGET_STATE, ES_EVENT_TARGET_UPGRADE, - ES_EVENT_TARGET_SHELL + ES_EVENT_TARGET_SHELL, + ES_EVENT_TARGET_COMPONENT }; /* Flags that qualify TARGET_STATE */ @@ -53,6 +54,7 @@ enum { typedef struct _ESEventTargetState ESEventTargetState; typedef struct _ESEventTargetUpgrade ESEventTargetUpgrade; typedef struct _ESEventTargetShell ESEventTargetShell; +typedef struct _ESEventTargetComponent ESEventTargetComponent; struct _ESEventTargetShell { EEventTarget target; @@ -74,6 +76,12 @@ struct _ESEventTargetUpgrade { int revision; }; +struct _ESEventTargetComponent { + EEventTarget target; + + const char *id; +}; + typedef struct _EEventItem ESEventItem; /* The object */ @@ -94,6 +102,7 @@ ESEvent *es_event_peek(void); ESEventTargetState *es_event_target_new_state(ESEvent *emp, int state); ESEventTargetShell *es_event_target_new_shell(ESEvent *eme, struct _EShell *shell); ESEventTargetUpgrade *es_event_target_new_upgrade(ESEvent *emp, int major, int minor, int revision); +ESEventTargetComponent *es_event_target_new_component(ESEvent *eme, const char *id); /* ********************************************************************** */ |