From d70b96a659ea78d646664c5c3586d60cea899f86 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Wed, 26 Sep 2007 11:48:28 +0000 Subject: [PATCH] * src/widgets/modest-msg-edit-window.h: * Add new method to interface to reset the modified status. * src/modest-ui-actions.c: * On saving to drafts, we now reset the modified status of the editor (fixes NB#67694). * src/maemo/modest-msg-edit-window.c: * Make reset_modified method public, to be able to access it from the ui actions. pmo-trunk-r3420 --- src/maemo/modest-msg-edit-window.c | 9 ++++----- src/modest-ui-actions.c | 1 + src/widgets/modest-msg-edit-window.h | 8 ++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/maemo/modest-msg-edit-window.c b/src/maemo/modest-msg-edit-window.c index a397436..0ece256 100644 --- a/src/maemo/modest-msg-edit-window.c +++ b/src/maemo/modest-msg-edit-window.c @@ -93,7 +93,6 @@ static void modest_msg_edit_window_finalize (GObject *obj); static gboolean msg_body_focus (GtkWidget *focus, GdkEventFocus *event, gpointer userdata); static void body_changed (GtkTextBuffer *buffer, ModestMsgEditWindow *editor); static void recpt_field_changed (GtkTextBuffer *buffer, ModestMsgEditWindow *editor); -static void reset_modified (ModestMsgEditWindow *editor); static void text_buffer_refresh_attributes (WPTextBuffer *buffer, ModestMsgEditWindow *window); static void text_buffer_can_undo (GtkTextBuffer *buffer, gboolean can_undo, ModestMsgEditWindow *window); @@ -879,7 +878,7 @@ set_msg (ModestMsgEditWindow *self, TnyMsg *msg, gboolean preserve_is_rich) gtk_text_buffer_get_start_iter (priv->text_buffer, &iter); gtk_text_buffer_place_cursor (priv->text_buffer, &iter); - reset_modified (self); + modest_msg_edit_window_reset_modified (self); modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (self)); text_buffer_can_undo (priv->text_buffer, FALSE, self); @@ -1267,7 +1266,7 @@ modest_msg_edit_window_new (TnyMsg *msg, const gchar *account_name, gboolean pre modest_window_check_dimming_rules_group (MODEST_WINDOW (obj), "ModestClipboardDimmingRules"); priv->update_caption_visibility = TRUE; - reset_modified (MODEST_MSG_EDIT_WINDOW (obj)); + modest_msg_edit_window_reset_modified (MODEST_MSG_EDIT_WINDOW (obj)); return (ModestWindow*) obj; } @@ -2685,8 +2684,8 @@ body_changed (GtkTextBuffer *buffer, ModestMsgEditWindow *editor) modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (editor)); } -static void -reset_modified (ModestMsgEditWindow *editor) +void +modest_msg_edit_window_reset_modified (ModestMsgEditWindow *editor) { ModestMsgEditWindowPrivate *priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (editor); GtkTextBuffer *buffer; diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index ca4f44f..022ed9c 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -2179,6 +2179,7 @@ modest_ui_actions_on_save_to_drafts (GtkWidget *widget, ModestMsgEditWindow *edi info_text = g_strdup_printf (_("mail_va_saved_to_drafts"), _("mcen_me_folder_drafts")); modest_platform_information_banner (NULL, NULL, info_text); + modest_msg_edit_window_reset_modified (edit_window); g_free (info_text); } diff --git a/src/widgets/modest-msg-edit-window.h b/src/widgets/modest-msg-edit-window.h index ade9895..29353de 100644 --- a/src/widgets/modest-msg-edit-window.h +++ b/src/widgets/modest-msg-edit-window.h @@ -379,6 +379,14 @@ void modest_msg_edit_window_toggle_find_toolbar (ModestMsgEditWindow */ gboolean modest_msg_edit_window_is_modified (ModestMsgEditWindow *window); +/** + * modest_msg_edit_window_reset_modified: + * @window: a #ModestMsgEditWindow + * + * Resets the message as not modified + */ +void modest_msg_edit_window_reset_modified (ModestMsgEditWindow *window); + gboolean modest_msg_edit_window_get_sent (ModestMsgEditWindow *window); void modest_msg_edit_window_set_sent (ModestMsgEditWindow *window, gboolean sent); -- 1.7.9.5