static void text_buffer_refresh_attributes (WPTextBuffer *buffer, ModestMsgEditWindow *window);
static void text_buffer_delete_range (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end, gpointer userdata);
static void text_buffer_can_undo (GtkTextBuffer *buffer, gboolean can_undo, ModestMsgEditWindow *window);
+static void text_buffer_can_redo (GtkTextBuffer *buffer, gboolean can_redo, ModestMsgEditWindow *window);
static void text_buffer_delete_images_by_id (GtkTextBuffer *buffer, const gchar * image_id);
static void subject_field_changed (GtkEditable *editable, ModestMsgEditWindow *window);
static void modest_msg_edit_window_color_button_change (ModestMsgEditWindow *window,
G_CALLBACK (text_buffer_delete_range), obj);
g_signal_connect (G_OBJECT (priv->text_buffer), "can-undo",
G_CALLBACK (text_buffer_can_undo), obj);
+ g_signal_connect (G_OBJECT (priv->text_buffer), "can-redo",
+ G_CALLBACK (text_buffer_can_redo), obj);
g_signal_connect (G_OBJECT (obj), "window-state-event",
G_CALLBACK (modest_msg_edit_window_window_state_event),
NULL);
update_dimmed (self);
text_buffer_can_undo (priv->text_buffer, FALSE, self);
+ text_buffer_can_redo (priv->text_buffer, FALSE, self);
priv->draft_msg = g_object_ref(msg);
}
}
+void
+modest_msg_edit_window_redo (ModestMsgEditWindow *window)
+{
+ ModestMsgEditWindowPrivate *priv;
+
+ g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
+ priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
+
+ wp_text_buffer_redo (WP_TEXT_BUFFER (priv->text_buffer));
+
+ update_dimmed (window);
+
+}
+
static void
update_dimmed (ModestMsgEditWindow *window)
{
gtk_action_set_sensitive (action, can_undo);
}
+static void
+text_buffer_can_redo (GtkTextBuffer *buffer, gboolean can_redo, ModestMsgEditWindow *window)
+{
+ ModestWindowPrivate *parent_priv = MODEST_WINDOW_GET_PRIVATE (window);
+ GtkAction *action;
+
+ action = gtk_ui_manager_get_action (parent_priv->ui_manager, "/MenuBar/EditMenu/RedoMenu");
+ gtk_action_set_sensitive (action, can_redo);
+}
+
static void
text_buffer_delete_images_by_id (GtkTextBuffer *buffer, const gchar * image_id)
{