call menu_file_save_error when there is an exception while saving.

2001-09-11  Larry Ewing  <lewing@ximian.com>

	* mail-account-gui.c (menu_file_save_cb): call menu_file_save_error
	when there is an exception while saving.
	(menu_file_save_error): pop up a dialog telling the user the file
	has not been saved.

svn path=/trunk/; revision=12765
This commit is contained in:
Larry Ewing
2001-09-11 06:02:43 +00:00
committed by Larry Ewing
parent bf121d6ddb
commit 44968e072f
2 changed files with 27 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2001-09-11 Larry Ewing <lewing@ximian.com>
* mail-account-gui.c (menu_file_save_cb): call menu_file_save_error
when there is an exception while saving.
(menu_file_save_error): pop up a dialog telling the user the file
has not been saved.
2001-09-10 <NotZed@Ximian.com>
* mail-local.c (mail_local_reconfigure_folder): Dynamically create
@ -31,6 +38,7 @@
2001-09-10 Jeffrey Stedfast <fejj@ximian.com>
>>>>>>> 1.1671
* mail-account-gui.c (mail_account_gui_new): Hide the S/MIME frame
if we don't support S/MIME.

View File

@ -939,6 +939,15 @@ destroy_editor (ESignatureEditor *editor)
g_free (editor);
}
static void
menu_file_save_error (BonoboUIComponent *uic, CORBA_Environment *ev) {
e_notice (GTK_WINDOW (uic), GNOME_MESSAGE_BOX_ERROR,
_("Could not save signature file."));
g_warning ("Exception while saving signature (%s)",
bonobo_exception_get_text (ev));
}
static void
menu_file_save_cb (BonoboUIComponent *uic,
void *data,
@ -955,8 +964,10 @@ menu_file_save_cb (BonoboUIComponent *uic,
pfile_iface = bonobo_object_client_query_interface (bonobo_widget_get_server (BONOBO_WIDGET (editor->control)),
"IDL:Bonobo/PersistFile:1.0", NULL);
Bonobo_PersistFile_save (pfile_iface, editor->filename, &ev);
if (ev._major != CORBA_NO_EXCEPTION)
g_warning ("Cannot save.");
menu_file_save_error (uic, &ev);
CORBA_exception_free (&ev);
} else {
BonoboStream *stream;
@ -967,16 +978,17 @@ menu_file_save_cb (BonoboUIComponent *uic,
stream = bonobo_stream_open (BONOBO_IO_DRIVER_FS, editor->filename,
Bonobo_Storage_WRITE | Bonobo_Storage_CREATE, 0);
pstream_iface = bonobo_object_client_query_interface
(bonobo_widget_get_server (BONOBO_WIDGET (editor->control)),
"IDL:Bonobo/PersistStream:1.0", NULL);
Bonobo_PersistStream_save (pstream_iface, (Bonobo_Stream) bonobo_object_corba_objref (BONOBO_OBJECT (stream)),
Bonobo_PersistStream_save (pstream_iface,
(Bonobo_Stream) bonobo_object_corba_objref (BONOBO_OBJECT (stream)),
"text/plain", &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_warning ("Exception while saving signature (%s)",
bonobo_exception_get_text (&ev));
return;
}
if (ev._major != CORBA_NO_EXCEPTION)
menu_file_save_error (uic, &ev);
CORBA_exception_free (&ev);
bonobo_object_unref (BONOBO_OBJECT (stream));