aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-05-05 05:01:29 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-05-05 05:01:29 +0800
commitf23d7c5fa097a3df630dd36a3c19e659280c726a (patch)
treec6f948da48b752a707ed278411149a6b7eaa75a2 /calendar
parentba2cf0efba5fa98421088b7bb7d0a364aefaf042 (diff)
downloadgsoc2013-evolution-f23d7c5fa097a3df630dd36a3c19e659280c726a.tar.gz
gsoc2013-evolution-f23d7c5fa097a3df630dd36a3c19e659280c726a.tar.zst
gsoc2013-evolution-f23d7c5fa097a3df630dd36a3c19e659280c726a.zip
Mark CompEditor as changed when attachments are added or removed.
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/dialogs/comp-editor.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 68b240cc25..4af998eb26 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -182,6 +182,14 @@ enum {
static guint comp_editor_signals[LAST_SIGNAL] = { 0 };
+static void
+attachment_store_changed_cb (CompEditor *editor)
+{
+ /* Mark the editor as changed so it prompts about unsaved
+ changes on close */
+ comp_editor_set_changed (editor, TRUE);
+}
+
static GSList *
get_attachment_list (CompEditor *editor)
{
@@ -1513,6 +1521,7 @@ comp_editor_init (CompEditor *editor)
{
CompEditorPrivate *priv;
EAttachmentView *view;
+ EAttachmentStore *store;
GdkDragAction drag_actions;
GtkTargetList *target_list;
GtkTargetEntry *targets;
@@ -1646,6 +1655,18 @@ comp_editor_init (CompEditor *editor)
gtk_window_set_type_hint (
GTK_WINDOW (editor), GDK_WINDOW_TYPE_HINT_NORMAL);
+
+ /* Listen for attachment store changes. */
+
+ store = e_attachment_view_get_store (view);
+
+ g_signal_connect_swapped (
+ store, "row-deleted",
+ G_CALLBACK (attachment_store_changed_cb), editor);
+
+ g_signal_connect_swapped (
+ store, "row-inserted",
+ G_CALLBACK (attachment_store_changed_cb), editor);
}
static gboolean
@@ -1698,14 +1719,6 @@ prompt_and_save_changes (CompEditor *editor, gboolean send)
}
}
-static void
-attachment_store_changed_cb (CompEditor *editor)
-{
- /* Mark the editor as changed so it prompts about unsaved
- changes on close */
- comp_editor_set_changed (editor, TRUE);
-}
-
/* Menu callbacks */
static void