[evolution] Bug 594153 (1/3) - Allow setting alarms on any meeting



commit 9b9899d5c249c6b01deb97e8b2099943a3f1b37d
Author: Jim Ramsay <i am jimramsay com>
Date:   Tue May 18 16:39:47 2010 -0400

    Bug 594153 (1/3) - Allow setting alarms on any meeting
    
    This introduces a new action_group called "editable" in the comp-editor
    that can be used by other components to assign actions that should be
    sensitized separately from the existing "individual" group, such as the
    "Alarms" and "Show Time as Busy" event actions.
    
    This fixes a bug introduced in 0597b877c5bf4d21ac4048742ddf6b11e24877ba
    where these two actions were accidentally grouped with other actions that
    should legitimately be in the "individual" group.

 calendar/gui/dialogs/comp-editor.c  |   15 +++++++++++----
 calendar/gui/dialogs/event-editor.c |   32 +++++++++++++++++++++++---------
 calendar/gui/dialogs/event-page.c   |    3 +++
 calendar/gui/dialogs/memo-page.c    |    3 +++
 calendar/gui/dialogs/task-page.c    |    3 +++
 5 files changed, 43 insertions(+), 13 deletions(-)
---
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 261b0b3..ded759e 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -1063,7 +1063,7 @@ static GtkActionEntry individual_entries[] = {
 	  G_CALLBACK (action_attach_cb) }
 };
 
-static GtkToggleActionEntry individual_toggle_entries[] = {
+static GtkToggleActionEntry personal_toggle_entries[] = {
 
 	{ "view-categories",
 	  NULL,
@@ -1634,9 +1634,6 @@ comp_editor_init (CompEditor *editor)
 	gtk_action_group_add_actions (
 		action_group, individual_entries,
 		G_N_ELEMENTS (individual_entries), editor);
-	gtk_action_group_add_toggle_actions (
-		action_group, individual_toggle_entries,
-		G_N_ELEMENTS (individual_toggle_entries), editor);
 	gtk_action_group_add_radio_actions (
 		action_group, classification_radio_entries,
 		G_N_ELEMENTS (classification_radio_entries),
@@ -1646,6 +1643,16 @@ comp_editor_init (CompEditor *editor)
 		priv->ui_manager, action_group, 0);
 	g_object_unref (action_group);
 
+	action_group = gtk_action_group_new ("editable");
+	gtk_action_group_set_translation_domain (
+		action_group, GETTEXT_PACKAGE);
+	gtk_action_group_add_toggle_actions (
+		action_group, personal_toggle_entries,
+		G_N_ELEMENTS (personal_toggle_entries), editor);
+	gtk_ui_manager_insert_action_group (
+		priv->ui_manager, action_group, 0);
+	g_object_unref (action_group);
+
 	action_group = gtk_action_group_new ("coordinated");
 	gtk_action_group_set_translation_domain (
 		action_group, GETTEXT_PACKAGE);
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index dd292ef..70fee85 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -198,7 +198,7 @@ action_show_time_busy_cb (GtkToggleAction *action,
 	event_page_set_show_time_busy (editor->priv->event_page, active);
 }
 
-static GtkActionEntry event_entries[] = {
+static GtkActionEntry editable_entries[] = {
 
 	{ "alarms",
 	  "appointment-soon",
@@ -206,6 +206,20 @@ static GtkActionEntry event_entries[] = {
 	  NULL,
 	  N_("Click here to set or unset alarms for this event"),
 	  G_CALLBACK (action_alarms_cb) },
+};
+
+static GtkToggleActionEntry editable_toggle_entries[] = {
+
+	{ "show-time-busy",
+	  GTK_STOCK_DIALOG_ERROR,
+	  N_("Show Time as _Busy"),
+	  NULL,
+	  N_("Toggles whether to show time as busy"),
+	  G_CALLBACK (action_show_time_busy_cb),
+	  FALSE }
+};
+
+static GtkActionEntry event_entries[] = {
 
 	{ "recurrence",
 	  "stock_task-recurring",
@@ -231,14 +245,6 @@ static GtkToggleActionEntry event_toggle_entries[] = {
 	  N_("Toggles whether to have All Day Event"),
 	  G_CALLBACK (action_all_day_event_cb),
 	  FALSE },
-
-	{ "show-time-busy",
-	  GTK_STOCK_DIALOG_ERROR,
-	  N_("Show Time as _Busy"),
-	  NULL,
-	  N_("Toggles whether to show time as busy"),
-	  G_CALLBACK (action_show_time_busy_cb),
-	  FALSE }
 };
 
 static GtkActionEntry meeting_entries[] = {
@@ -493,6 +499,14 @@ event_editor_init (EventEditor *ee)
 		action_group, event_toggle_entries,
 		G_N_ELEMENTS (event_toggle_entries), ee);
 
+	action_group = comp_editor_get_action_group (editor, "editable");
+	gtk_action_group_add_actions (
+		action_group, editable_entries,
+		G_N_ELEMENTS (editable_entries), ee);
+	gtk_action_group_add_toggle_actions (
+		action_group, editable_toggle_entries,
+		G_N_ELEMENTS (editable_toggle_entries), ee);
+
 	action_group = comp_editor_get_action_group (editor, "coordinated");
 	gtk_action_group_add_actions (
 		action_group, meeting_entries,
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index f3ae17d..cf1bc62 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -809,6 +809,9 @@ sensitize_widgets (EventPage *epage)
 	gtk_widget_set_sensitive (priv->invite, (!read_only &&  sens) || delegate);
 	gtk_widget_set_sensitive (GTK_WIDGET (priv->list_view), !read_only);
 
+	action_group = comp_editor_get_action_group (editor, "editable");
+	gtk_action_group_set_sensitive (action_group, !read_only);
+
 	action_group = comp_editor_get_action_group (editor, "individual");
 	gtk_action_group_set_sensitive (action_group, sensitize);
 
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index b022074..8ffe45d 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -376,6 +376,9 @@ sensitize_widgets (MemoPage *mpage)
 		}
 	}
 
+	action_group = comp_editor_get_action_group (editor, "editable");
+	gtk_action_group_set_sensitive (action_group, !read_only);
+
 	action_group = comp_editor_get_action_group (editor, "individual");
 	gtk_action_group_set_sensitive (action_group, sensitize);
 }
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 8ac3860..9747501 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -365,6 +365,9 @@ sensitize_widgets (TaskPage *tpage)
 	gtk_widget_set_sensitive (priv->invite, (!read_only &&  sens));
 	gtk_widget_set_sensitive (GTK_WIDGET (priv->list_view), !read_only);
 
+	action_group = comp_editor_get_action_group (editor, "editable");
+	gtk_action_group_set_sensitive (action_group, !read_only);
+
 	action_group = comp_editor_get_action_group (editor, "individual");
 	gtk_action_group_set_sensitive (action_group, sensitize);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]