diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2002-10-18 04:47:06 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2002-10-18 04:47:06 +0800 |
commit | d91364b0562ad2d80186c8bc5e94a7792989a53d (patch) | |
tree | de24f00a6102a69bce5047e26726942ab87e895f /shell/e-shell-shared-folder-picker-dialog.c | |
parent | d4e1fb42e0e1017919ca21b5b59cc84b38f794f7 (diff) | |
download | gsoc2013-evolution-d91364b0562ad2d80186c8bc5e94a7792989a53d.tar.gz gsoc2013-evolution-d91364b0562ad2d80186c8bc5e94a7792989a53d.tar.zst gsoc2013-evolution-d91364b0562ad2d80186c8bc5e94a7792989a53d.zip |
New, implementation for the cancel_discover_shared_folder virtual method.
* e-corba-storage.c (cancel_discover_shared_folder): New,
implementation for the cancel_discover_shared_folder virtual
method.
(class_init): Install.
* evolution-test-component.c
(storage_discover_shared_folder_callback): Instead of passing the
listener to the timeout function, just pass the storage. Put the
listener and the timeout ID on the storage object by using
gtk_object_set_data().
(shared_folder_discovery_timeout_callback): Updated accordingly.
(storage_cancel_discover_shared_folder_callback): New, callback
for the cancel_discover_shared_folder signal.
(setup_custom_storage): Connect.
* e-shell-shared-folder-picker-dialog.c: New member storage in
struct DiscoveryData. While I am at it, rename member user to
user_email_address.
(discover_folder): Set the storage member.
(cleanup_discovery): Unref storage member.
(progress_dialog_clicked_callback): New, callback for the
"clicked" signal on the dialog.
(discover_folder): Connect.
* evolution-storage.c (class_init): Install signal
"cancel_discover_shared_folder".
(impl_Storage_cancelDiscoverSharedFolder): New, implementation for
the cancelDiscoverSharedFolder CORBA method; emit
"cancel_discover_shared_folder".
(evolution_storage_get_epv): Install CORBA method implementation.
* evolution-storage.h: Add signal cancel_discover_shared_folder.
* e-storage.c (e_storage_cancel_discover_shared_folder): New.
* e-storage.h: New virtual method cancel_discover_shared_folder.
* Evolution-Storage.idl (cancelDiscoverSharedFolder): New.
svn path=/trunk/; revision=18386
Diffstat (limited to 'shell/e-shell-shared-folder-picker-dialog.c')
-rw-r--r-- | shell/e-shell-shared-folder-picker-dialog.c | 58 |
1 files changed, 41 insertions, 17 deletions
diff --git a/shell/e-shell-shared-folder-picker-dialog.c b/shell/e-shell-shared-folder-picker-dialog.c index 5316b2f8fb..cba839f880 100644 --- a/shell/e-shell-shared-folder-picker-dialog.c +++ b/shell/e-shell-shared-folder-picker-dialog.c @@ -261,11 +261,24 @@ struct _DiscoveryData { EShell *shell; EShellView *parent; GtkWidget *dialog; - char *user; + char *user_email_address; char *folder_name; + EStorage *storage; }; typedef struct _DiscoveryData DiscoveryData; +static void +cleanup_discovery (DiscoveryData *discovery_data) +{ + if (discovery_data->dialog != NULL) + gtk_widget_destroy (discovery_data->dialog); + + g_free (discovery_data->user_email_address); + g_free (discovery_data->folder_name); + gtk_object_unref (GTK_OBJECT (discovery_data->storage)); + g_free (discovery_data); +} + static int progress_bar_timeout_callback (void *data) { @@ -301,6 +314,23 @@ progress_dialog_close_callback (GnomeDialog *dialog, return TRUE; } +/* This is invoked if the "Cancel" button is clicked. */ +static void +progress_dialog_clicked_callback (GnomeDialog *dialog, + int button_number, + void *data) +{ + DiscoveryData *discovery_data; + + discovery_data = (DiscoveryData *) data; + + e_storage_cancel_discover_shared_folder (discovery_data->storage, + discovery_data->user_email_address, + discovery_data->folder_name); + + cleanup_discovery (discovery_data); +} + static int progress_dialog_show_timeout_callback (void *data) { @@ -358,17 +388,6 @@ create_progress_dialog (EShell *shell, } static void -cleanup_discovery (DiscoveryData *discovery_data) -{ - if (discovery_data->dialog != NULL) - gtk_widget_destroy (discovery_data->dialog); - - g_free (discovery_data->user); - g_free (discovery_data->folder_name); - g_free (discovery_data); -} - -static void shell_destroy_callback (GtkObject *object, void *data) { @@ -460,11 +479,13 @@ discover_folder (EShell *shell, dialog = create_progress_dialog (shell, storage, user_email_address, folder_name); discovery_data = g_new (DiscoveryData, 1); - discovery_data->dialog = dialog; - discovery_data->shell = shell; - discovery_data->parent = parent; - discovery_data->user = g_strdup (user_email_address); - discovery_data->folder_name = g_strdup (folder_name); + discovery_data->dialog = dialog; + discovery_data->shell = shell; + discovery_data->parent = parent; + discovery_data->user_email_address = g_strdup (user_email_address); + discovery_data->folder_name = g_strdup (folder_name); + discovery_data->storage = storage; + gtk_object_ref (GTK_OBJECT (storage)); gtk_signal_connect (GTK_OBJECT (shell), "destroy", GTK_SIGNAL_FUNC (shell_destroy_callback), discovery_data); @@ -475,6 +496,9 @@ discover_folder (EShell *shell, gtk_signal_connect (GTK_OBJECT (storage), "destroy", GTK_SIGNAL_FUNC (storage_destroy_callback), discovery_data); + gtk_signal_connect (GTK_OBJECT (dialog), "clicked", + GTK_SIGNAL_FUNC (progress_dialog_clicked_callback), discovery_data); + e_storage_async_discover_shared_folder (storage, user_email_address, folder_name, |