aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2001-10-31 05:58:16 +0800
committerLarry Ewing <lewing@src.gnome.org>2001-10-31 05:58:16 +0800
commitd66b90437bc7e63bd4e75e7fe2da517f32b71ec3 (patch)
tree685e9b645d2f4a5d3cef34628c1a4089ffcd07e1
parent8ab23573e7476045751de8b3c2a5e31656234a85 (diff)
downloadgsoc2013-evolution-d66b90437bc7e63bd4e75e7fe2da517f32b71ec3.tar
gsoc2013-evolution-d66b90437bc7e63bd4e75e7fe2da517f32b71ec3.tar.gz
gsoc2013-evolution-d66b90437bc7e63bd4e75e7fe2da517f32b71ec3.tar.bz2
gsoc2013-evolution-d66b90437bc7e63bd4e75e7fe2da517f32b71ec3.tar.lz
gsoc2013-evolution-d66b90437bc7e63bd4e75e7fe2da517f32b71ec3.tar.xz
gsoc2013-evolution-d66b90437bc7e63bd4e75e7fe2da517f32b71ec3.tar.zst
gsoc2013-evolution-d66b90437bc7e63bd4e75e7fe2da517f32b71ec3.zip
add dirty prototype.
001-10-30 Larry Ewing <lewing@ximian.com> * e-msg-composer.h: add dirty prototype. * e-msg-composer.c: add dirty implementation. svn path=/trunk/; revision=14485
-rw-r--r--composer/ChangeLog6
-rw-r--r--composer/e-msg-composer.c21
-rw-r--r--composer/e-msg-composer.h1
3 files changed, 24 insertions, 4 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 0d97cc7926..02ab55baaa 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-30 Larry Ewing <lewing@ximian.com>
+
+ * e-msg-composer.h: add dirty prototype.
+
+ * e-msg-composer.c: add dirty implementation.
+
2001-10-30 Radek Doulik <rodo@ximian.com>
* listener.c (insert_paragraph_before): new helper function,
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index fbf2827896..0a081593d0 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1027,9 +1027,6 @@ save_draft (EMsgComposer *composer, int quitok)
mail_append_mail (folder, msg, info, save_done, si);
camel_object_unref (CAMEL_OBJECT (msg));
-
- /* Reset the "changed" state to FALSE */
- composer->has_changed = FALSE;
}
#define AUTOSAVE_SEED ".evolution-composer.autosave-XXXXXX"
@@ -1317,6 +1314,7 @@ static void
menu_file_save_draft_cb (BonoboUIComponent *uic, void *data, const char *path)
{
save_draft (E_MSG_COMPOSER (data), FALSE);
+ e_msg_composer_unset_changed (E_MSG_COMPOSER (data));
}
static void
@@ -1326,6 +1324,7 @@ exit_dialog_cb (int reply, EMsgComposer *composer)
case REPLY_YES:
/* this has to be done async */
save_draft (composer, TRUE);
+ e_msg_composer_unset_changed (composer);
break;
case REPLY_NO:
gtk_widget_destroy (GTK_WIDGET (composer));
@@ -1341,7 +1340,7 @@ do_exit (EMsgComposer *composer)
GtkWidget *dialog;
gint button;
- if (composer->has_changed) {
+ if (e_msg_composer_is_dirty (composer)) {
dialog = gnome_message_box_new (_("This message has not been sent.\n\nDo you wish to save your changes?"),
GNOME_MESSAGE_BOX_QUESTION,
GNOME_STOCK_BUTTON_YES, /* Save */
@@ -3839,3 +3838,17 @@ e_msg_composer_unset_changed (EMsgComposer *composer)
composer->has_changed = FALSE;
}
+
+gboolean
+e_msg_composer_is_dirty (EMsgComposer *composer)
+{
+ CORBA_Environment ev;
+ gboolean dirty = composer->has_changed;
+ CORBA_exception_init (&ev);
+
+ dirty = dirty || Bonobo_PersistStream_isDirty (composer->persist_stream_interface, &ev);
+
+ return dirty;
+}
+
+
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index 4e73509207..395cf0a4ce 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -158,6 +158,7 @@ gchar * e_msg_composer_guess_mime_type (const gchar *file_name);
void e_msg_composer_set_changed (EMsgComposer *composer);
void e_msg_composer_unset_changed (EMsgComposer *composer);
+gboolean e_msg_composer_is_dirty (EMsgComposer *composer);
/* PGP */
void e_msg_composer_set_pgp_sign (EMsgComposer *composer,