aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-01-11 00:18:49 +0800
committerMilan Crha <mcrha@redhat.com>2014-01-11 00:18:49 +0800
commit63a1f0eab3e15e0d64e24bd5a2659a61347cfe9c (patch)
tree4af77bd941992bb173dac1e4480f51fb30fb5b1a /calendar
parent04ed82b0530ca7fa34008876b056378dff6b76fb (diff)
downloadgsoc2013-evolution-63a1f0eab3e15e0d64e24bd5a2659a61347cfe9c.tar
gsoc2013-evolution-63a1f0eab3e15e0d64e24bd5a2659a61347cfe9c.tar.gz
gsoc2013-evolution-63a1f0eab3e15e0d64e24bd5a2659a61347cfe9c.tar.bz2
gsoc2013-evolution-63a1f0eab3e15e0d64e24bd5a2659a61347cfe9c.tar.lz
gsoc2013-evolution-63a1f0eab3e15e0d64e24bd5a2659a61347cfe9c.tar.xz
gsoc2013-evolution-63a1f0eab3e15e0d64e24bd5a2659a61347cfe9c.tar.zst
gsoc2013-evolution-63a1f0eab3e15e0d64e24bd5a2659a61347cfe9c.zip
Bug #333184 - Add Undo support to component editors
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/dialogs/comp-editor.c27
-rw-r--r--calendar/gui/dialogs/event-page.c11
-rw-r--r--calendar/gui/dialogs/memo-page.c9
-rw-r--r--calendar/gui/dialogs/task-page.c11
4 files changed, 58 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index bbf4662275..f635ab739a 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -158,6 +158,9 @@ static const gchar *ui =
" <menuitem action='close'/>"
" </menu>"
" <menu action='edit-menu'>"
+" <menuitem action='undo'/>"
+" <menuitem action='redo'/>"
+" <separator/>"
" <menuitem action='cut-clipboard'/>"
" <menuitem action='copy-clipboard'/>"
" <menuitem action='paste-clipboard'/>"
@@ -179,6 +182,9 @@ static const gchar *ui =
" <toolitem action='save'/>\n"
" <toolitem action='print'/>\n"
" <separator/>"
+" <toolitem action='undo'/>"
+" <toolitem action='redo'/>"
+" <separator/>"
" <placeholder name='content'/>\n"
" </toolbar>"
"</ui>";
@@ -1288,6 +1294,21 @@ static GtkActionEntry core_entries[] = {
N_("Select all text"),
NULL }, /* Handled by EFocusTracker */
+ { "undo",
+ GTK_STOCK_UNDO,
+ NULL,
+ "<Control>z",
+ N_("Undo"),
+ NULL }, /* Handled by EFocusTracker */
+
+ { "redo",
+ GTK_STOCK_REDO,
+ NULL,
+ "<Control>y",
+ N_("Redo"),
+ NULL }, /* Handled by EFocusTracker */
+
+
/* Menus */
{ "classification-menu",
@@ -2199,6 +2220,12 @@ comp_editor_init (CompEditor *editor)
action = comp_editor_get_action (editor, "select-all");
e_focus_tracker_set_select_all_action (focus_tracker, action);
+ action = comp_editor_get_action (editor, "undo");
+ e_focus_tracker_set_undo_action (focus_tracker, action);
+
+ action = comp_editor_get_action (editor, "redo");
+ e_focus_tracker_set_redo_action (focus_tracker, action);
+
priv->focus_tracker = focus_tracker;
/* Fine Tuning */
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 7f2e27e538..0eafc08a9b 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -1384,6 +1384,11 @@ event_page_fill_widgets (CompEditorPage *page,
sensitize_widgets (epage);
+ e_widget_undo_reset (priv->summary);
+ e_widget_undo_reset (priv->location);
+ e_widget_undo_reset (priv->categories);
+ e_widget_undo_reset (priv->description);
+
return validated;
}
@@ -3585,6 +3590,7 @@ event_page_construct (EventPage *epage,
EShell *shell;
CompEditor *editor;
ESourceRegistry *registry;
+ EFocusTracker *focus_tracker;
GtkComboBox *combo_box;
GtkListStore *list_store;
GtkTreeModel *model;
@@ -3593,6 +3599,7 @@ event_page_construct (EventPage *epage,
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage));
shell = comp_editor_get_shell (editor);
+ focus_tracker = comp_editor_get_focus_tracker (editor);
priv = epage->priv;
priv->meeting_store = g_object_ref (meeting_store);
@@ -3614,6 +3621,10 @@ event_page_construct (EventPage *epage,
}
e_spell_text_view_attach (GTK_TEXT_VIEW (priv->description));
+ e_widget_undo_attach (priv->summary, focus_tracker);
+ e_widget_undo_attach (priv->location, focus_tracker);
+ e_widget_undo_attach (priv->categories, focus_tracker);
+ e_widget_undo_attach (priv->description, focus_tracker);
/* Create entry completion and attach it to the entry */
priv->location_completion = gtk_entry_completion_new ();
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index 43b07c4afb..12126a6fc0 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -374,6 +374,10 @@ memo_page_fill_widgets (CompEditorPage *page,
sensitize_widgets (mpage);
+ e_widget_undo_reset (priv->summary_entry);
+ e_widget_undo_reset (priv->categories);
+ e_widget_undo_reset (priv->memo_content);
+
return TRUE;
}
@@ -1213,11 +1217,13 @@ memo_page_construct (MemoPage *mpage)
CompEditor *editor;
CompEditorFlags flags;
ESourceRegistry *registry;
+ EFocusTracker *focus_tracker;
EClientCache *client_cache;
priv = mpage->priv;
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (mpage));
+ focus_tracker = comp_editor_get_focus_tracker (editor);
flags = comp_editor_get_flags (editor);
shell = comp_editor_get_shell (editor);
@@ -1241,6 +1247,9 @@ memo_page_construct (MemoPage *mpage)
}
e_spell_text_view_attach (GTK_TEXT_VIEW (priv->memo_content));
+ e_widget_undo_attach (priv->summary_entry, focus_tracker);
+ e_widget_undo_attach (priv->categories, focus_tracker);
+ e_widget_undo_attach (priv->memo_content, focus_tracker);
if (flags & COMP_EDITOR_IS_SHARED) {
GtkComboBox *combo_box;
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 35bf3aa5af..1acc93f538 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -921,6 +921,11 @@ task_page_fill_widgets (CompEditorPage *page,
sensitize_widgets (tpage);
+ e_widget_undo_reset (priv->summary);
+ e_widget_undo_reset (priv->categories);
+ e_widget_undo_reset (priv->web_page_entry);
+ e_widget_undo_reset (priv->description);
+
return TRUE;
}
@@ -2652,6 +2657,7 @@ task_page_construct (TaskPage *tpage,
EShell *shell;
CompEditor *editor;
ESourceRegistry *registry;
+ EFocusTracker *focus_tracker;
TaskPagePrivate *priv;
GtkComboBox *combo_box;
GtkListStore *list_store;
@@ -2661,6 +2667,7 @@ task_page_construct (TaskPage *tpage,
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage));
shell = comp_editor_get_shell (editor);
+ focus_tracker = comp_editor_get_focus_tracker (editor);
priv = tpage->priv;
priv->meeting_store = g_object_ref (meeting_store);
@@ -2684,6 +2691,10 @@ task_page_construct (TaskPage *tpage,
}
e_spell_text_view_attach (GTK_TEXT_VIEW (priv->description));
+ e_widget_undo_attach (priv->summary, focus_tracker);
+ e_widget_undo_attach (priv->categories, focus_tracker);
+ e_widget_undo_attach (priv->web_page_entry, focus_tracker);
+ e_widget_undo_attach (priv->description, focus_tracker);
combo_box = GTK_COMBO_BOX (priv->organizer);
model = gtk_combo_box_get_model (combo_box);