From 44572a1f03e8043d7ab5073a72a04d2fe56086d9 Mon Sep 17 00:00:00 2001 From: Harish Krishnaswamy Date: Thu, 25 Nov 2004 14:49:14 +0000 Subject: [PATCH] Evo UI Hackfest : harish * libedataserverui/e-source-selector.[ch]: (selector_button_press_event): if rt-clicked on a source group, set it as primary on the selector and emit a popup event. (e_source_selector_get_primary_source_group): accessor for primary source group. --- ChangeLog | 8 ++++++++ libedataserverui/e-source-selector.c | 27 +++++++++++++++++++++++++-- libedataserverui/e-source-selector.h | 1 + 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a3e5b9..b16dd62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-11-25 Harish Krishnaswamy + + * libedataserverui/e-source-selector.[ch]: + (selector_button_press_event): if rt-clicked on a source + group, set it as primary on the selector and emit a popup event. + (e_source_selector_get_primary_source_group): accessor for + primary source group. + 2004-11-05 Rodrigo Moya * configure.in: use evolution-data-server-$BASE_VERSION as the diff --git a/libedataserverui/e-source-selector.c b/libedataserverui/e-source-selector.c index e574e03..b481195 100644 --- a/libedataserverui/e-source-selector.c +++ b/libedataserverui/e-source-selector.c @@ -42,6 +42,7 @@ struct _ESourceSelectorPrivate { GHashTable *selected_sources; GtkTreeRowReference *saved_primary_selection; + ESourceGroup *primary_source_group; int rebuild_model_idle_id; @@ -595,9 +596,15 @@ selector_button_press_event (GtkWidget *widget, GdkEventButton *event, ESourceSe /* TODO: we could still emit a popup event for this and let the callee decide? */ if (E_IS_SOURCE_GROUP (data)) { - g_object_unref (data); + /* do i need to ref it here */ + ESourceGroup *group; - return FALSE; + group = E_SOURCE_GROUP (data);g_object_ref (group); + priv->primary_source_group = group; + g_signal_emit(selector, signals[POPUP_EVENT], 0, NULL, event, &res); + /* data shuld be unreffed after creating the + * new source*/ + return res; } source = E_SOURCE (data); @@ -830,6 +837,22 @@ e_source_selector_get_selection (ESourceSelector *selector) } /** + * e_source_selector_get_primary_source_group : + * + * Return the primary source group associated with the selector. + * Return value: primary_source_group if selector is valid, NULL otherwise. + */ + +ESourceGroup * +e_source_selector_get_primary_source_group (ESourceSelector *selector) +{ + g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), NULL); + + return selector->priv->primary_source_group; + +} + +/** * e_source_list_free_selection: * @list: A selection list returned by e_source_selector_get_selection(). * diff --git a/libedataserverui/e-source-selector.h b/libedataserverui/e-source-selector.h index 37580de..b1a45c6 100644 --- a/libedataserverui/e-source-selector.h +++ b/libedataserverui/e-source-selector.h @@ -80,6 +80,7 @@ ESource *e_source_selector_peek_primary_selection (ESourceSelector *selector); void e_source_selector_set_primary_selection (ESourceSelector *selector, ESource *source); +ESourceGroup *e_source_selector_get_primary_source_group (ESourceSelector *selector); G_END_DECLS #endif /* _E_SOURCE_SELECTOR_H_ */ -- 2.7.4