aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-shared-folder-picker-dialog.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-08-10 00:38:16 +0800
committerDan Winship <danw@src.gnome.org>2002-08-10 00:38:16 +0800
commita22468499591d5279ed0cfda4455032270f0ba3d (patch)
tree0b5db06bbd018fe05469f695c1de9d282f90c37d /shell/e-shell-shared-folder-picker-dialog.c
parent1d053f6c568b250b58fabcf84b8853dd146bb000 (diff)
downloadgsoc2013-evolution-a22468499591d5279ed0cfda4455032270f0ba3d.tar
gsoc2013-evolution-a22468499591d5279ed0cfda4455032270f0ba3d.tar.gz
gsoc2013-evolution-a22468499591d5279ed0cfda4455032270f0ba3d.tar.bz2
gsoc2013-evolution-a22468499591d5279ed0cfda4455032270f0ba3d.tar.lz
gsoc2013-evolution-a22468499591d5279ed0cfda4455032270f0ba3d.tar.xz
gsoc2013-evolution-a22468499591d5279ed0cfda4455032270f0ba3d.tar.zst
gsoc2013-evolution-a22468499591d5279ed0cfda4455032270f0ba3d.zip
Remove both timeouts when the dialog is destroyed, not just one of them.
* e-shell-shared-folder-picker-dialog.c (create_progress_dialog): Remove both timeouts when the dialog is destroyed, not just one of them. (shared_folder_discovery_listener_callback): Don't try to access fields of discovery_data after destroying it. Interpret the result argument correctly, and put up an error dialog (using e_corba_storage_corba_result_to_storage_result and e_storage_result_to_string) if something went wrong. * e-corba-storage.c (e_corba_storage_corba_result_to_storage_result): convert a GNOME_Evolution_Storage_Result to an EStorageResult. (async_folder_cb): Use that. svn path=/trunk/; revision=17750
Diffstat (limited to 'shell/e-shell-shared-folder-picker-dialog.c')
-rw-r--r--shell/e-shell-shared-folder-picker-dialog.c41
1 files changed, 30 insertions, 11 deletions
diff --git a/shell/e-shell-shared-folder-picker-dialog.c b/shell/e-shell-shared-folder-picker-dialog.c
index c2a5c02160..9141348aca 100644
--- a/shell/e-shell-shared-folder-picker-dialog.c
+++ b/shell/e-shell-shared-folder-picker-dialog.c
@@ -346,7 +346,7 @@ create_progress_dialog (EShell *shell,
GtkWidget *dialog;
GtkWidget *label;
GtkWidget *progress_bar;
- int progress_bar_timeout_id;
+ int timeout_id;
char *text;
dialog = gnome_dialog_new (_("Opening Folder"), GNOME_STOCK_BUTTON_CANCEL, NULL);
@@ -370,12 +370,16 @@ create_progress_dialog (EShell *shell,
gtk_progress_set_activity_mode (GTK_PROGRESS (progress_bar), TRUE);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), progress_bar, FALSE, TRUE, 0);
- progress_bar_timeout_id = g_timeout_add (50, progress_bar_timeout_callback, progress_bar);
+ timeout_id = g_timeout_add (50, progress_bar_timeout_callback, progress_bar);
gtk_signal_connect (GTK_OBJECT (progress_bar), "destroy",
GTK_SIGNAL_FUNC (progress_bar_destroy_callback),
- GINT_TO_POINTER (progress_bar_timeout_id));
+ GINT_TO_POINTER (timeout_id));
+
+ timeout_id = g_timeout_add (PROGRESS_DIALOG_DELAY, progress_dialog_show_timeout_callback, dialog);
+ gtk_signal_connect (GTK_OBJECT (progress_bar), "destroy",
+ GTK_SIGNAL_FUNC (progress_bar_destroy_callback),
+ GINT_TO_POINTER (timeout_id));
- g_timeout_add (PROGRESS_DIALOG_DELAY, progress_dialog_show_timeout_callback, dialog);
return dialog;
}
@@ -432,24 +436,39 @@ shared_folder_discovery_listener_callback (BonoboListener *listener,
{
GNOME_Evolution_Storage_FolderResult *result;
DiscoveryData *discovery_data;
+ EShell *shell;
+ EShellView *parent;
+ EStorage *storage;
discovery_data = (DiscoveryData *) data;
- result = (GNOME_Evolution_Storage_FolderResult *) value->_value;
+ shell = discovery_data->shell;
+ parent = discovery_data->parent;
+ storage = discovery_data->storage;
+ /* Make sure the progress dialog doesn't show up now. */
cleanup_discovery (discovery_data);
- if (result == GNOME_Evolution_Storage_OK) {
+ result = (GNOME_Evolution_Storage_FolderResult *) value->_value;
+ if (result->result == GNOME_Evolution_Storage_OK) {
char *uri;
uri = g_strconcat (E_SHELL_URI_PREFIX, "/",
- e_storage_get_name (discovery_data->storage),
+ e_storage_get_name (storage),
result->path,
NULL);
if (discovery_data->parent != NULL)
- e_shell_view_display_uri (discovery_data->parent, uri);
+ e_shell_view_display_uri (parent, uri);
else
- e_shell_create_view (discovery_data->shell, uri, NULL);
+ e_shell_create_view (shell, uri, NULL);
+ } else {
+ EStorageResult storage_result;
+
+ storage_result = e_corba_storage_corba_result_to_storage_result (result->result);
+ e_notice (parent ? GTK_WINDOW (parent) : NULL,
+ GNOME_MESSAGE_BOX_ERROR,
+ _("Could not open shared folder: %s."),
+ e_storage_result_to_string (storage_result));
}
}
@@ -519,8 +538,8 @@ discover_folder (EShell *shell,
cleanup_discovery (discovery_data);
/* FIXME: Be more verbose? */
- e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
- _("Cannot find open the specified shared folder."));
+ e_notice (GTK_WINDOW (parent), GNOME_MESSAGE_BOX_ERROR,
+ _("Cannot find the specified shared folder."));
CORBA_exception_free (&ev);
}