[evolution/gnome-3-16] Composer - Undo initiated with shortcuts doesn't stop
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-16] Composer - Undo initiated with shortcuts doesn't stop
- Date: Thu, 7 May 2015 11:32:01 +0000 (UTC)
commit 3e07ea6ad71df7de7113009e51c3ff88a9e919c8
Author: Tomas Popela <tpopela redhat com>
Date: Thu May 7 11:49:20 2015 +0200
Composer - Undo initiated with shortcuts doesn't stop
It was repeating the last action.
composer/e-msg-composer.c | 12 ++++++++++++
e-util/e-html-editor-view.c | 8 ++++----
2 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index a0077ce..547acf3 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -2570,6 +2570,18 @@ msg_composer_key_press_event (GtkWidget *widget,
return TRUE;
}
+ if (((event)->state & GDK_CONTROL_MASK) &&
+ ((event)->keyval == GDK_KEY_z)) {
+ e_html_editor_view_undo (view);
+ return TRUE;
+ }
+
+ if (((event)->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) &&
+ ((event)->keyval == GDK_KEY_Z)) {
+ e_html_editor_view_redo (view);
+ return TRUE;
+ }
+
if (((event)->state & GDK_SHIFT_MASK) &&
((event)->keyval == GDK_KEY_Delete)) {
g_signal_emit_by_name (
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index fe92c9c..33c724a 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -12375,10 +12375,10 @@ e_html_editor_view_redo (EHTMLEditorView *view)
EHTMLEditorViewHistoryEvent *event;
GList *history;
- history = view->priv->history;
- if (!history || !history->prev)
+ if (!e_html_editor_view_can_redo (view))
return;
+ history = view->priv->history;
event = history->prev->data;
d (print_history_event (event));
@@ -12470,10 +12470,10 @@ e_html_editor_view_undo (EHTMLEditorView *view)
EHTMLEditorViewHistoryEvent *event;
GList *history;
- history = view->priv->history;
- if (!history)
+ if (!e_html_editor_view_can_undo (view))
return;
+ history = view->priv->history;
event = history->data;
d (print_history_event (event));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]