summaryrefslogtreecommitdiff
path: root/libedataserverui
diff options
context:
space:
mode:
authorHarish Krishnaswamy <kharish@src.gnome.org>2004-11-25 14:49:14 +0000
committerHarish Krishnaswamy <kharish@src.gnome.org>2004-11-25 14:49:14 +0000
commit44572a1f03e8043d7ab5073a72a04d2fe56086d9 (patch)
tree0ca0b38f8456ba4e2b4c1621124803197f8d2fe1 /libedataserverui
parent34be7404671cf173ca3ed50c03528e4268d0acba (diff)
downloadevolution-data-server-44572a1f03e8043d7ab5073a72a04d2fe56086d9.tar.gz
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.
Diffstat (limited to 'libedataserverui')
-rw-r--r--libedataserverui/e-source-selector.c27
-rw-r--r--libedataserverui/e-source-selector.h1
2 files changed, 26 insertions, 2 deletions
diff --git a/libedataserverui/e-source-selector.c b/libedataserverui/e-source-selector.c
index e574e03eb..b48119564 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 37580de36..b1a45c6e8 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_ */