diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 8 | ||||
-rw-r--r-- | shell/evolution-shell-client.c | 47 | ||||
-rw-r--r-- | shell/evolution-shell-client.h | 6 | ||||
-rw-r--r-- | shell/evolution-test-component.c | 39 |
4 files changed, 76 insertions, 24 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 16a8070978..7386b92569 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,13 @@ 2002-05-07 Ettore Perazzoli <ettore@ximian.com> + * evolution-test-component.c (create_new_folder_selector): Use the + new evolution_shell_client_create_storage_set_view() call. + + * evolution-shell-client.c + (evolution_shell_client_create_storage_set_view): New. + +2002-05-07 Ettore Perazzoli <ettore@ximian.com> + * evolution-storage-set-view-factory.c (evolution_storage_set_view_factory_new_view): Put the EStorageSetView in an EScrollFrame. diff --git a/shell/evolution-shell-client.c b/shell/evolution-shell-client.c index d33b5d24e9..ff5386baa4 100644 --- a/shell/evolution-shell-client.c +++ b/shell/evolution-shell-client.c @@ -27,8 +27,10 @@ #include <gdk/gdkx.h> #include <gtk/gtkmain.h> +#include <bonobo/bonobo-exception.h> #include <bonobo/bonobo-main.h> #include <bonobo/bonobo-object.h> +#include <bonobo/bonobo-widget.h> #include <gal/util/e-util.h> @@ -593,4 +595,49 @@ evolution_shell_client_get_pixbuf_for_type (EvolutionShellClient *shell_client, } +GtkWidget * +evolution_shell_client_create_storage_set_view (EvolutionShellClient *shell_client, + Bonobo_UIComponent uic, + Bonobo_Control *bonobo_control_iface_return, + GNOME_Evolution_StorageSetView *storage_set_view_iface_return, + CORBA_Environment *ev) +{ + GNOME_Evolution_Shell corba_shell; + CORBA_Environment my_ev; + Bonobo_Control control; + GtkWidget *control_widget; + + g_return_val_if_fail (EVOLUTION_IS_SHELL_CLIENT (shell_client), NULL); + + CORBA_exception_init (&my_ev); + if (ev == NULL) + ev = &my_ev; + + corba_shell = BONOBO_OBJREF (shell_client); + + control = GNOME_Evolution_Shell_createStorageSetView (corba_shell, ev); + if (BONOBO_EX (ev)) { + g_warning ("Cannot create StorageSetView -- %s", BONOBO_EX_ID (ev)); + CORBA_exception_free (&my_ev); + return NULL; + } + + if (bonobo_control_iface_return != NULL) + *bonobo_control_iface_return = control; + + control_widget = bonobo_widget_new_control_from_objref (control, uic); + + if (storage_set_view_iface_return != NULL) { + *storage_set_view_iface_return = Bonobo_Unknown_queryInterface (control, + "IDL:GNOME/Evolution/StorageSetView:1.0", + ev); + if (BONOBO_EX (ev)) + *storage_set_view_iface_return = NULL; + } + + CORBA_exception_free (&my_ev); + return control_widget; +} + + E_MAKE_TYPE (evolution_shell_client, "EvolutionShellClient", EvolutionShellClient, class_init, init, PARENT_TYPE) diff --git a/shell/evolution-shell-client.h b/shell/evolution-shell-client.h index ab1b3b5b7d..3122c4312c 100644 --- a/shell/evolution-shell-client.h +++ b/shell/evolution-shell-client.h @@ -81,6 +81,12 @@ GdkPixbuf *evolution_shell_client_get_pixbuf_for_type (Evolut const char *folder_type, gboolean mini); +GtkWidget *evolution_shell_client_create_storage_set_view (EvolutionShellClient *shell_client, + Bonobo_UIComponent uic, + Bonobo_Control *bonobo_control_iface_return, + GNOME_Evolution_StorageSetView *storage_set_view_iface_return, + CORBA_Environment *ev); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/shell/evolution-test-component.c b/shell/evolution-test-component.c index c11d2c4607..d083248395 100644 --- a/shell/evolution-test-component.c +++ b/shell/evolution-test-component.c @@ -212,7 +212,6 @@ create_new_folder_selector (EvolutionShellComponent *shell_component) GNOME_Evolution_Shell corba_shell; GNOME_Evolution_StorageSetView storage_set_view_iface; GtkWidget *dialog; - Bonobo_Control control; GtkWidget *control_widget; CORBA_Environment ev; @@ -222,25 +221,13 @@ create_new_folder_selector (EvolutionShellComponent *shell_component) g_assert (shell_client != NULL); corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)); - control = GNOME_Evolution_Shell_createStorageSetView (corba_shell, &ev); - if (BONOBO_EX (&ev)) { - g_warning ("Cannot create StorageSetView -- %s", BONOBO_EX_ID (&ev)); - CORBA_exception_free (&ev); - return; - } - - storage_set_view_iface = Bonobo_Unknown_queryInterface (control, "IDL:GNOME/Evolution/StorageSetView:1.0", &ev); - if (BONOBO_EX (&ev) || storage_set_view_iface == CORBA_OBJECT_NIL) { - g_warning ("Cannot get StorageSetView interface"); - if (BONOBO_EX (&ev)) - g_warning ("CORBA exception -- %s", BONOBO_EX_ID (&ev)); - CORBA_exception_free (&ev); - return; - } - - GNOME_Evolution_StorageSetView__set_showCheckboxes (storage_set_view_iface, TRUE, &ev); - if (BONOBO_EX (&ev)) { - g_warning ("Cannot show checkboxes -- %s", BONOBO_EX_ID (&ev)); + control_widget = evolution_shell_client_create_storage_set_view (shell_client, + CORBA_OBJECT_NIL, + NULL, + &storage_set_view_iface, + &ev); + if (control_widget == NULL) { + g_warning ("Can't create the StorageSetView control -- %s", BONOBO_EX_ID (&ev)); CORBA_exception_free (&ev); return; } @@ -249,19 +236,23 @@ create_new_folder_selector (EvolutionShellComponent *shell_component) gtk_window_set_default_size (GTK_WINDOW (dialog), 200, 400); gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, TRUE, FALSE); - control_widget = bonobo_widget_new_control_from_objref (control, CORBA_OBJECT_NIL); gtk_container_add (GTK_CONTAINER (GNOME_DIALOG (dialog)->vbox), control_widget); - gtk_widget_show (control_widget); - gtk_widget_show (dialog); + GNOME_Evolution_StorageSetView__set_showCheckboxes (storage_set_view_iface, TRUE, &ev); + if (BONOBO_EX (&ev)) + g_warning ("Cannot show checkboxes -- %s", BONOBO_EX_ID (&ev)); gtk_signal_connect (GTK_OBJECT (dialog), "clicked", GTK_SIGNAL_FUNC (dialog_clicked_callback), storage_set_view_iface); - /* This is necessary to unref the StorageSetView iface. */ + /* This is necessary to unref the StorageSetView iface once we are done + with it. */ gtk_signal_connect (GTK_OBJECT (dialog), "destroy", GTK_SIGNAL_FUNC (dialog_destroy_callback), storage_set_view_iface); + gtk_widget_show (control_widget); + gtk_widget_show (dialog); + CORBA_exception_free (&ev); } |