diff options
author | Chris Toshok <toshok@helixcode.com> | 2000-10-03 10:53:08 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2000-10-03 10:53:08 +0800 |
commit | cc6dbb8f3cf2f9d64e0f0577a08177630e72219b (patch) | |
tree | 83e6c04ea986f69de94f268c793601773db4d54a | |
parent | 78320752289da1ace70bf6bfe3edef1671a3be61 (diff) | |
download | gsoc2013-evolution-cc6dbb8f3cf2f9d64e0f0577a08177630e72219b.tar gsoc2013-evolution-cc6dbb8f3cf2f9d64e0f0577a08177630e72219b.tar.gz gsoc2013-evolution-cc6dbb8f3cf2f9d64e0f0577a08177630e72219b.tar.bz2 gsoc2013-evolution-cc6dbb8f3cf2f9d64e0f0577a08177630e72219b.tar.lz gsoc2013-evolution-cc6dbb8f3cf2f9d64e0f0577a08177630e72219b.tar.xz gsoc2013-evolution-cc6dbb8f3cf2f9d64e0f0577a08177630e72219b.tar.zst gsoc2013-evolution-cc6dbb8f3cf2f9d64e0f0577a08177630e72219b.zip |
add storage_selected behavior - loop over the listeners calling
2000-10-02 Chris Toshok <toshok@helixcode.com>
* evolution-storage-set-view.c: add storage_selected behavior -
loop over the listeners calling _storage_selected.
* Evolution-StorageSetView.idl: add storage_selected to the
Listener interface.
* e-storage-set-view.c add storage_selected signal.
(on_cursor_change): if the depth is less than 2, emit
"storage_selected", otherwise emit "folder_selected".
* e-storage-set-view.h: add storage_selected signal.
* evolution-storage-set-view-listener.h: add storage_selected
signal.
* evolution-storage-set-view-listener.c: add storage_selected
signal.
svn path=/trunk/; revision=5686
-rw-r--r-- | shell/ChangeLog | 20 | ||||
-rw-r--r-- | shell/Evolution-StorageSetView.idl | 1 | ||||
-rw-r--r-- | shell/e-storage-set-view.c | 26 | ||||
-rw-r--r-- | shell/e-storage-set-view.h | 2 | ||||
-rw-r--r-- | shell/evolution-storage-set-view-listener.c | 22 | ||||
-rw-r--r-- | shell/evolution-storage-set-view-listener.h | 2 | ||||
-rw-r--r-- | shell/evolution-storage-set-view.c | 29 |
7 files changed, 96 insertions, 6 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 3c6a2b95b2..8f017cc002 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,23 @@ +2000-10-02 Chris Toshok <toshok@helixcode.com> + + * evolution-storage-set-view.c: add storage_selected behavior - + loop over the listeners calling _storage_selected. + + * Evolution-StorageSetView.idl: add storage_selected to the + Listener interface. + + * e-storage-set-view.c add storage_selected signal. + (on_cursor_change): if the depth is less than 2, emit + "storage_selected", otherwise emit "folder_selected". + + * e-storage-set-view.h: add storage_selected signal. + + * evolution-storage-set-view-listener.h: add storage_selected + signal. + + * evolution-storage-set-view-listener.c: add storage_selected + signal. + 2000-10-02 Ettore Perazzoli <ettore@helixcode.com> * evolution-storage-set-view-listener.c: New. diff --git a/shell/Evolution-StorageSetView.idl b/shell/Evolution-StorageSetView.idl index 490da848e9..3d95b075be 100644 --- a/shell/Evolution-StorageSetView.idl +++ b/shell/Evolution-StorageSetView.idl @@ -13,6 +13,7 @@ module Evolution { interface StorageSetViewListener { void folder_selected (in string uri); + void storage_selected (in string uri); }; /* FIXME: Maybe we should have a generic Bonobo::Listener interface. */ diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index 3fb50f4b13..040e2dc571 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -69,6 +69,7 @@ struct _EStorageSetViewPrivate { enum { FOLDER_SELECTED, + STORAGE_SELECTED, LAST_SIGNAL }; @@ -678,6 +679,15 @@ class_init (EStorageSetViewClass *klass) GTK_TYPE_NONE, 1, GTK_TYPE_STRING); + signals[FOLDER_SELECTED] + = gtk_signal_new ("storage_selected", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (EStorageSetViewClass, storage_selected), + gtk_marshal_NONE__STRING, + GTK_TYPE_NONE, 1, + GTK_TYPE_STRING); + gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); /* Set up DND. */ @@ -859,14 +869,18 @@ on_cursor_change (EStorageSetView *storage_set_view, int row, gpointer user_data node = e_tree_model_node_at_row (priv->etree_model, row); - /* don't emit the folder selected signal for storages */ - if (e_tree_model_node_depth (priv->etree_model, node) < 2) - return; - priv->selected_row_path = e_tree_model_node_get_data (priv->etree_model, node); - gtk_signal_emit (GTK_OBJECT (storage_set_view), signals[FOLDER_SELECTED], - priv->selected_row_path); + if (e_tree_model_node_depth (priv->etree_model, node) >= 2) { + /* it was a folder */ + gtk_signal_emit (GTK_OBJECT (storage_set_view), signals[FOLDER_SELECTED], + priv->selected_row_path); + } + else { + /* it was a storage */ + gtk_signal_emit (GTK_OBJECT (storage_set_view), signals[STORAGE_SELECTED], + priv->selected_row_path); + } } void diff --git a/shell/e-storage-set-view.h b/shell/e-storage-set-view.h index af5f1710ab..f1aac5acdc 100644 --- a/shell/e-storage-set-view.h +++ b/shell/e-storage-set-view.h @@ -60,6 +60,8 @@ struct _EStorageSetViewClass { void (* folder_selected) (EStorageSetView *storage_set_view, const char *uri); + void (* storage_selected) (EStorageSetView *storage_set_view, + const char *uri); }; diff --git a/shell/evolution-storage-set-view-listener.c b/shell/evolution-storage-set-view-listener.c index eb1edbfd4a..a6b6d89f8e 100644 --- a/shell/evolution-storage-set-view-listener.c +++ b/shell/evolution-storage-set-view-listener.c @@ -43,6 +43,7 @@ struct _EvolutionStorageSetViewListenerPrivate { enum { FOLDER_SELECTED, + STORAGE_SELECTED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = { 0 }; @@ -73,6 +74,18 @@ impl_Evolution_StorageSetViewListener_folder_selected (PortableServer_Servant se gtk_signal_emit (GTK_OBJECT (listener), signals[FOLDER_SELECTED], uri); } +static void +impl_Evolution_StorageSetViewListener_storage_selected (PortableServer_Servant servant, + const CORBA_char *uri, + CORBA_Environment *ev) +{ + EvolutionStorageSetViewListener *listener; + + listener = gtk_object_from_servant (servant); + + gtk_signal_emit (GTK_OBJECT (listener), signals[STORAGE_SELECTED], uri); +} + static EvolutionStorageSetViewListenerServant * create_servant (EvolutionStorageSetViewListener *listener) { @@ -172,6 +185,7 @@ corba_class_init (void) epv = g_new0 (POA_Evolution_StorageSetViewListener__epv, 1); epv->folder_selected = impl_Evolution_StorageSetViewListener_folder_selected; + epv->storage_selected = impl_Evolution_StorageSetViewListener_storage_selected; vepv = & my_Evolution_StorageSetViewListener_vepv; vepv->_base_epv = base_epv; @@ -196,6 +210,14 @@ class_init (EvolutionStorageSetViewListenerClass *klass) GTK_TYPE_NONE, 1, GTK_TYPE_STRING); + signals[STORAGE_SELECTED] = gtk_signal_new ("storage_selected", + GTK_RUN_FIRST, + object_class->type, + GTK_SIGNAL_OFFSET (EvolutionStorageSetViewListenerClass, storage_selected), + gtk_marshal_NONE__STRING, + GTK_TYPE_NONE, 1, + GTK_TYPE_STRING); + gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); corba_class_init (); diff --git a/shell/evolution-storage-set-view-listener.h b/shell/evolution-storage-set-view-listener.h index 8492079d48..662acc8f4c 100644 --- a/shell/evolution-storage-set-view-listener.h +++ b/shell/evolution-storage-set-view-listener.h @@ -55,6 +55,8 @@ struct _EvolutionStorageSetViewListenerClass { void (* folder_selected) (EvolutionStorageSetViewListener *listener, const char *uri); + void (* storage_selected) (EvolutionStorageSetViewListener *listener, + const char *uri); }; diff --git a/shell/evolution-storage-set-view.c b/shell/evolution-storage-set-view.c index 2e320c9ee5..70892c686d 100644 --- a/shell/evolution-storage-set-view.c +++ b/shell/evolution-storage-set-view.c @@ -67,6 +67,33 @@ storage_set_view_widget_folder_selected_cb (EStorageSetView *storage_set_view_wi } } +static void +storage_set_view_widget_storage_selected_cb (EStorageSetView *storage_set_view_widget, + const char *uri, + void *data) +{ + EvolutionStorageSetView *storage_set_view; + EvolutionStorageSetViewPrivate *priv; + GList *p; + + storage_set_view = EVOLUTION_STORAGE_SET_VIEW (data); + priv = storage_set_view->priv; + + for (p = priv->listeners; p != NULL; p = p->next) { + CORBA_Environment ev; + Evolution_StorageSetViewListener listener; + + CORBA_exception_init (&ev); + + listener = (Evolution_StorageSetViewListener) p->data; + Evolution_StorageSetViewListener_storage_selected (listener, uri, &ev); + + /* FIXME: What if we fail? */ + + CORBA_exception_free (&ev); + } +} + /* Listener handling. */ @@ -345,6 +372,8 @@ evolution_storage_set_view_construct (EvolutionStorageSetView *storage_set_view, gtk_signal_connect (GTK_OBJECT (priv->storage_set_view_widget), "folder_selected", GTK_SIGNAL_FUNC (storage_set_view_widget_folder_selected_cb), storage_set_view); + gtk_signal_connect (GTK_OBJECT (priv->storage_set_view_widget), "storage_selected", + GTK_SIGNAL_FUNC (storage_set_view_widget_storage_selected_cb), storage_set_view); } EvolutionStorageSetView * |