* src/widget/modest-msg-edit-window.h,
src/maemo/modest-msg-edit-window.c:
* Added implementation for redo action, using wpeditor backend.
* src/widgets/modest-msg-edit-window-ui.h:
* Added redo action.
* src/modest-ui-actions.[ch]:
* Added redo ui action with implementation for editor.
* src/maemo/ui/modest-msg-edit-window-ui.xml:
* Added redo action.
pmo-trunk-r2563
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_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,
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_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);
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);
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);
}
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)
{
static void
update_dimmed (ModestMsgEditWindow *window)
{
gtk_action_set_sensitive (action, can_undo);
}
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)
{
static void
text_buffer_delete_images_by_id (GtkTextBuffer *buffer, const gchar * image_id)
{
<menu name="EditMenu" action="Edit">
<menuitem name="UndoMenu" action="Undo"/>
<menu name="EditMenu" action="Edit">
<menuitem name="UndoMenu" action="Undo"/>
+ <menuitem name="RedoMenu" action="Redo"/>
<separator/>
<menuitem name="CutMenu" action="Cut"/>
<menuitem name="CopyMenu" action="Copy"/>
<separator/>
<menuitem name="CutMenu" action="Cut"/>
<menuitem name="CopyMenu" action="Copy"/>
+void
+modest_ui_actions_on_redo (GtkAction *action,
+ ModestWindow *window)
+{
+ if (MODEST_IS_MSG_EDIT_WINDOW (window)) {
+ modest_msg_edit_window_redo (MODEST_MSG_EDIT_WINDOW (window));
+ }
+ else {
+ g_return_if_reached ();
+ }
+}
+
static void
paste_msgs_cb (const GObject *object, gpointer user_data)
static void
paste_msgs_cb (const GObject *object, gpointer user_data)
void modest_ui_actions_on_undo (GtkAction *action,
ModestWindow *window);
void modest_ui_actions_on_undo (GtkAction *action,
ModestWindow *window);
+void modest_ui_actions_on_redo (GtkAction *action,
+ ModestWindow *window);
+
void modest_ui_actions_on_cut (GtkAction *action,
ModestWindow *window);
void modest_ui_actions_on_cut (GtkAction *action,
ModestWindow *window);
{ "AttachFile", NULL, N_("mcen_me_editor_attachfile"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_attach_file)},
{ "RemoveAttachments", NULL, N_("mcen_me_inbox_remove_attachments"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_remove_attachments) },
{ "Undo", NULL, N_("mcen_me_inbox_undo"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_undo)},
{ "AttachFile", NULL, N_("mcen_me_editor_attachfile"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_attach_file)},
{ "RemoveAttachments", NULL, N_("mcen_me_inbox_remove_attachments"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_remove_attachments) },
{ "Undo", NULL, N_("mcen_me_inbox_undo"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_undo)},
+ { "Redo", NULL, N_("mcen_me_inbox_redo"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_redo)},
{ "Cut", NULL, N_("mcen_me_inbox_cut"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_cut)},
{ "Copy", NULL, N_("mcen_me_inbox_copy"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_copy)},
{ "Paste", NULL, N_("mcen_me_inbox_paste"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_paste)},
{ "Cut", NULL, N_("mcen_me_inbox_cut"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_cut)},
{ "Copy", NULL, N_("mcen_me_inbox_copy"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_copy)},
{ "Paste", NULL, N_("mcen_me_inbox_paste"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_paste)},
void modest_msg_edit_window_undo (ModestMsgEditWindow *window);
/**
void modest_msg_edit_window_undo (ModestMsgEditWindow *window);
/**
+ * modest_msg_edit_window_redo:
+ * @window: a #ModestMsgEditWindow
+ *
+ * Revert last undo
+ */
+void modest_msg_edit_window_redo (ModestMsgEditWindow *window);
+
+/**
* modest_msg_edit_window_select_contacts:
* @window: a #ModestMsgEditWindow
*
* modest_msg_edit_window_select_contacts:
* @window: a #ModestMsgEditWindow
*