* src/widgets/modest-msg-edit-window.h:
authorJose Dapena Paz <jdapena@igalia.com>
Wed, 26 Sep 2007 11:48:28 +0000 (11:48 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Wed, 26 Sep 2007 11:48:28 +0000 (11:48 +0000)
        * 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
src/modest-ui-actions.c
src/widgets/modest-msg-edit-window.h

index a397436..0ece256 100644 (file)
@@ -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;
index ca4f44f..022ed9c 100644 (file)
@@ -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);
 }
 
index ade9895..29353de 100644 (file)
@@ -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);