evolution r37136 - in branches/kill-bonobo: addressbook/gui/component calendar/modules doc/reference/shell doc/reference/shell/tmpl mail shell



Author: mbarnes
Date: Tue Jan 27 03:50:19 2009
New Revision: 37136
URL: http://svn.gnome.org/viewvc/evolution?rev=37136&view=rev

Log:
Add action groups to support lockdown, starting with printing.
Other categories to follow.  Editors still need lockdown support.


Modified:
   branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c
   branches/kill-bonobo/calendar/modules/e-cal-shell-view-actions.c
   branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c
   branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c
   branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c
   branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c
   branches/kill-bonobo/doc/reference/shell/Makefile.am
   branches/kill-bonobo/doc/reference/shell/eshell-sections.txt
   branches/kill-bonobo/doc/reference/shell/tmpl/action-groups.sgml
   branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-sidebar.sgml
   branches/kill-bonobo/mail/e-mail-reader.c
   branches/kill-bonobo/mail/e-mail-shell-module-settings.c
   branches/kill-bonobo/mail/em-composer-prefs.c
   branches/kill-bonobo/mail/mail-config.c
   branches/kill-bonobo/mail/mail-config.h
   branches/kill-bonobo/shell/e-shell-settings.c
   branches/kill-bonobo/shell/e-shell-settings.h
   branches/kill-bonobo/shell/e-shell-window-actions.c
   branches/kill-bonobo/shell/e-shell-window-actions.h
   branches/kill-bonobo/shell/e-shell-window-private.c
   branches/kill-bonobo/shell/e-shell-window-private.h
   branches/kill-bonobo/shell/e-shell.c

Modified: branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c	(original)
+++ branches/kill-bonobo/addressbook/gui/component/e-book-shell-view-actions.c	Tue Jan 27 03:50:19 2009
@@ -667,20 +667,6 @@
 	  N_("View the current contact"),
 	  G_CALLBACK (action_contact_open_cb) },
 
-	{ "contact-print",
-	  GTK_STOCK_PRINT,
-	  NULL,
-	  "<Control>p",
-	  N_("Print selected contacts"),
-	  G_CALLBACK (action_contact_print_cb) },
-
-	{ "contact-print-preview",
-	  GTK_STOCK_PRINT_PREVIEW,
-	  NULL,
-	  NULL,
-	  N_("Preview the contacts to be printed"),
-	  G_CALLBACK (action_contact_print_preview_cb) },
-
 	{ "contact-save-as",
 	  GTK_STOCK_SAVE_AS,
 	  N_("Save as vCard..."),
@@ -762,10 +748,6 @@
 	  NULL,
 	  "contact-open" },
 
-	{ "contact-popup-print",
-	  NULL,
-	  "contact-print" },
-
 	{ "contact-popup-save-as",
 	  NULL,
 	  "contact-save-as" },
@@ -827,6 +809,30 @@
 	  CONTACT_SEARCH_NAME_CONTAINS }
 };
 
+static GtkActionEntry lockdown_printing_entries[] = {
+
+	{ "contact-print",
+	  GTK_STOCK_PRINT,
+	  NULL,
+	  "<Control>p",
+	  N_("Print selected contacts"),
+	  G_CALLBACK (action_contact_print_cb) },
+
+	{ "contact-print-preview",
+	  GTK_STOCK_PRINT_PREVIEW,
+	  NULL,
+	  NULL,
+	  N_("Preview the contacts to be printed"),
+	  G_CALLBACK (action_contact_print_preview_cb) }
+};
+
+static EPopupActionEntry lockdown_printing_popup_entries[] = {
+
+	{ "contact-popup-print",
+	  NULL,
+	  "contact-print" }
+};
+
 void
 e_book_shell_view_actions_init (EBookShellView *book_shell_view)
 {
@@ -869,6 +875,15 @@
 	gtk_action_group_set_translation_domain (action_group, domain);
 	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
 
+	/* Lockdown Printing Actions */
+	action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
+	gtk_action_group_add_actions (
+		action_group, lockdown_printing_entries,
+		G_N_ELEMENTS (lockdown_printing_entries), book_shell_view);
+	e_action_group_add_popup_actions (
+		action_group, lockdown_printing_popup_entries,
+		G_N_ELEMENTS (lockdown_printing_popup_entries));
+
 	/* Bind GObject properties to GConf keys. */
 
 	bridge = gconf_bridge_get ();

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-actions.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-actions.c	Tue Jan 27 03:50:19 2009
@@ -630,20 +630,6 @@
 	  N_("Create a new calendar"),
 	  G_CALLBACK (action_calendar_new_cb) },
 
-	{ "calendar-print",
-	  GTK_STOCK_PRINT,
-	  NULL,
-	  "<Control>p",
-	  N_("Print this calendar"),
-	  G_CALLBACK (action_calendar_print_cb) },
-
-	{ "calendar-print-preview",
-	  GTK_STOCK_PRINT_PREVIEW,
-	  NULL,
-	  NULL,
-	  N_("Preview the calendar to be printed"),
-	  G_CALLBACK (action_calendar_print_preview_cb) },
-
 	{ "calendar-properties",
 	  GTK_STOCK_PROPERTIES,
 	  NULL,
@@ -777,13 +763,6 @@
 	  N_("View the current appointment"),
 	  G_CALLBACK (action_event_open_cb) },
 
-	{ "event-print",
-	  GTK_STOCK_PRINT,
-	  NULL,
-	  NULL,
-	  NULL,  /* XXX Add a tooltip! */
-	  G_CALLBACK (action_event_print_cb) },
-
 	{ "event-reply",
 	  "mail-reply-sender",
 	  N_("_Reply"),
@@ -904,10 +883,6 @@
 	  NULL,
 	  "event-open" },
 
-	{ "event-popup-print",
-	  NULL,
-	  "event-print" },
-
 	{ "event-popup-reply",
 	  NULL,
 	  "event-reply" },
@@ -1018,6 +993,37 @@
 	  CALENDAR_SEARCH_SUMMARY_CONTAINS }
 };
 
+static GtkActionEntry lockdown_printing_entries[] = {
+
+	{ "calendar-print",
+	  GTK_STOCK_PRINT,
+	  NULL,
+	  "<Control>p",
+	  N_("Print this calendar"),
+	  G_CALLBACK (action_calendar_print_cb) },
+
+	{ "calendar-print-preview",
+	  GTK_STOCK_PRINT_PREVIEW,
+	  NULL,
+	  NULL,
+	  N_("Preview the calendar to be printed"),
+	  G_CALLBACK (action_calendar_print_preview_cb) },
+
+	{ "event-print",
+	  GTK_STOCK_PRINT,
+	  NULL,
+	  NULL,
+	  NULL,  /* XXX Add a tooltip! */
+	  G_CALLBACK (action_event_print_cb) }
+};
+
+static EPopupActionEntry lockdown_printing_popup_entries[] = {
+
+	{ "event-popup-print",
+	  NULL,
+	  "event-print" }
+};
+
 void
 e_cal_shell_view_actions_init (ECalShellView *cal_shell_view)
 {
@@ -1033,6 +1039,7 @@
 	ui_manager = e_shell_window_get_ui_manager (shell_window);
 	domain = GETTEXT_PACKAGE;
 
+	/* Calendar Actions */
 	action_group = cal_shell_view->priv->calendar_actions;
 	gtk_action_group_set_translation_domain (action_group, domain);
 	gtk_action_group_add_actions (
@@ -1052,6 +1059,15 @@
 		NULL, NULL);
 	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
 
+	/* Lockdown Printing Actions */
+	action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
+	gtk_action_group_add_actions (
+		action_group, lockdown_printing_entries,
+		G_N_ELEMENTS (lockdown_printing_entries), cal_shell_view);
+	e_action_group_add_popup_actions (
+		action_group, lockdown_printing_popup_entries,
+		G_N_ELEMENTS (lockdown_printing_popup_entries));
+
 	/* Fine tuning. */
 
         action = ACTION (CALENDAR_GO_TODAY);

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c	Tue Jan 27 03:50:19 2009
@@ -317,13 +317,6 @@
 	  NULL,  /* XXX Add a tooltip! */
 	  G_CALLBACK (action_calendar_memopad_open_url_cb) },
 
-	{ "calendar-memopad-print",
-	  GTK_STOCK_PRINT,
-	  NULL,
-	  NULL,
-	  N_("Print the selected memo"),
-	  G_CALLBACK (action_calendar_memopad_print_cb) },
-
 	{ "calendar-memopad-save-as",
 	  GTK_STOCK_SAVE_AS,
 	  NULL,
@@ -332,6 +325,16 @@
 	  G_CALLBACK (action_calendar_memopad_save_as_cb) }
 };
 
+static GtkActionEntry lockdown_printing_entries[] = {
+
+	{ "calendar-memopad-print",
+	  GTK_STOCK_PRINT,
+	  NULL,
+	  NULL,
+	  N_("Print the selected memo"),
+	  G_CALLBACK (action_calendar_memopad_print_cb) }
+};
+
 void
 e_cal_shell_view_memopad_actions_init (ECalShellView *cal_shell_view)
 {
@@ -344,10 +347,17 @@
 	shell_window = e_shell_view_get_shell_window (shell_view);
 	ui_manager = e_shell_window_get_ui_manager (shell_window);
 
+	/* Calendar Actions */
 	action_group = cal_shell_view->priv->calendar_actions;
 	gtk_action_group_add_actions (
 		action_group, calendar_memopad_entries,
 		G_N_ELEMENTS (calendar_memopad_entries), cal_shell_view);
+
+	/* Lockdown Printing Actions */
+	action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
+	gtk_action_group_add_actions (
+		action_group, lockdown_printing_entries,
+		G_N_ELEMENTS (lockdown_printing_entries), cal_shell_view);
 }
 
 void

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c	Tue Jan 27 03:50:19 2009
@@ -405,13 +405,6 @@
 	  NULL,  /* XXX Add a tooltip! */
 	  G_CALLBACK (action_calendar_taskpad_open_url_cb) },
 
-	{ "calendar-taskpad-print",
-	  GTK_STOCK_PRINT,
-	  NULL,
-	  NULL,
-	  N_("Print the selected task"),
-	  G_CALLBACK (action_calendar_taskpad_print_cb) },
-
 	{ "calendar-taskpad-save-as",
 	  GTK_STOCK_SAVE_AS,
 	  N_("_Save as iCalendar..."),
@@ -420,6 +413,16 @@
 	  G_CALLBACK (action_calendar_taskpad_save_as_cb) }
 };
 
+static GtkActionEntry lockdown_printing_entries[] = {
+
+	{ "calendar-taskpad-print",
+	  GTK_STOCK_PRINT,
+	  NULL,
+	  NULL,
+	  N_("Print the selected task"),
+	  G_CALLBACK (action_calendar_taskpad_print_cb) }
+};
+
 void
 e_cal_shell_view_taskpad_actions_init (ECalShellView *cal_shell_view)
 {
@@ -432,10 +435,17 @@
 	shell_window = e_shell_view_get_shell_window (shell_view);
 	ui_manager = e_shell_window_get_ui_manager (shell_window);
 
+	/* Calendar Actions */
 	action_group = cal_shell_view->priv->calendar_actions;
 	gtk_action_group_add_actions (
 		action_group, calendar_taskpad_entries,
 		G_N_ELEMENTS (calendar_taskpad_entries), cal_shell_view);
+
+	/* Lockdown Printing Actions */
+	action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
+	gtk_action_group_add_actions (
+		action_group, lockdown_printing_entries,
+		G_N_ELEMENTS (lockdown_printing_entries), cal_shell_view);
 }
 
 void

Modified: branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c	Tue Jan 27 03:50:19 2009
@@ -576,20 +576,6 @@
 	  N_("Create a new memo list"),
 	  G_CALLBACK (action_memo_list_new_cb) },
 
-	{ "memo-list-print",
-	  GTK_STOCK_PRINT,
-	  NULL,
-	  "<Control>p",
-	  N_("Print the list of memos"),
-	  G_CALLBACK (action_memo_list_print_cb) },
-
-	{ "memo-list-print-preview",
-	  GTK_STOCK_PRINT_PREVIEW,
-	  NULL,
-	  NULL,
-	  N_("Preview the list of memos to be printed"),
-	  G_CALLBACK (action_memo_list_print_preview_cb) },
-
 	{ "memo-list-properties",
 	  GTK_STOCK_PROPERTIES,
 	  NULL,
@@ -632,13 +618,6 @@
 	  NULL,  /* XXX Add a tooltip! */
 	  G_CALLBACK (action_memo_open_url_cb) },
 
-	{ "memo-print",
-	  GTK_STOCK_PRINT,
-	  NULL,
-	  NULL,
-	  N_("Print the selected memo"),
-	  G_CALLBACK (action_memo_print_cb) },
-
 	{ "memo-save-as",
 	  GTK_STOCK_SAVE_AS,
 	  N_("_Save as iCalendar..."),
@@ -697,10 +676,6 @@
 	  NULL,
 	  "memo-open-url" },
 
-	{ "memo-popup-print",
-	  NULL,
-	  "memo-print" },
-
 	{ "memo-popup-save-as",
 	  NULL,
 	  "memo-save-as" }
@@ -758,6 +733,37 @@
 	  MEMO_SEARCH_SUMMARY_CONTAINS }
 };
 
+static GtkActionEntry lockdown_printing_entries[] = {
+
+	{ "memo-list-print",
+	  GTK_STOCK_PRINT,
+	  NULL,
+	  "<Control>p",
+	  N_("Print the list of memos"),
+	  G_CALLBACK (action_memo_list_print_cb) },
+
+	{ "memo-list-print-preview",
+	  GTK_STOCK_PRINT_PREVIEW,
+	  NULL,
+	  NULL,
+	  N_("Preview the list of memos to be printed"),
+	  G_CALLBACK (action_memo_list_print_preview_cb) },
+
+	{ "memo-print",
+	  GTK_STOCK_PRINT,
+	  NULL,
+	  NULL,
+	  N_("Print the selected memo"),
+	  G_CALLBACK (action_memo_print_cb) }
+};
+
+static EPopupActionEntry lockdown_printing_popup_entries[] = {
+
+	{ "memo-popup-print",
+	  NULL,
+	  "memo-print" }
+};
+
 void
 e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
 {
@@ -776,6 +782,7 @@
 	ui_manager = e_shell_window_get_ui_manager (shell_window);
 	domain = GETTEXT_PACKAGE;
 
+	/* Memo Actions */
 	action_group = memo_shell_view->priv->memo_actions;
 	gtk_action_group_set_translation_domain (action_group, domain);
 	gtk_action_group_add_actions (
@@ -794,6 +801,15 @@
 		NULL, NULL);
 	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
 
+	/* Lockdown Printing Actions */
+	action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
+	gtk_action_group_add_actions (
+		action_group, lockdown_printing_entries,
+		G_N_ELEMENTS (lockdown_printing_entries), memo_shell_view);
+	e_action_group_add_popup_actions (
+		action_group, lockdown_printing_popup_entries,
+		G_N_ELEMENTS (lockdown_printing_popup_entries));
+
 	/* Bind GObject properties to GConf keys. */
 
 	bridge = gconf_bridge_get ();

Modified: branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c	Tue Jan 27 03:50:19 2009
@@ -701,20 +701,6 @@
 	  N_("Create a new task list"),
 	  G_CALLBACK (action_task_list_new_cb) },
 
-	{ "task-list-print",
-	  GTK_STOCK_PRINT,
-	  NULL,
-	  "<Control>p",
-	  N_("Print the list of tasks"),
-	  G_CALLBACK (action_task_list_print_cb) },
-
-	{ "task-list-print-preview",
-	  GTK_STOCK_PRINT_PREVIEW,
-	  NULL,
-	  NULL,
-	  N_("Preview the list of tasks to be printed"),
-	  G_CALLBACK (action_task_list_print_preview_cb) },
-
 	{ "task-list-properties",
 	  GTK_STOCK_PROPERTIES,
 	  NULL,
@@ -771,13 +757,6 @@
 	  NULL,  /* XXX Add a tooltip! */
 	  G_CALLBACK (action_task_open_url_cb) },
 
-	{ "task-print",
-	  GTK_STOCK_PRINT,
-	  NULL,
-	  NULL,
-	  N_("Print the selected task"),
-	  G_CALLBACK (action_task_print_cb) },
-
 	{ "task-purge",
 	  NULL,
 	  N_("Purg_e"),
@@ -864,10 +843,6 @@
 	  NULL,
 	  "task-open-url" },
 
-	{ "task-popup-print",
-	  NULL,
-	  "task-print" },
-
 	{ "task-popup-save-as",
 	  NULL,
 	  "task-save-as" },
@@ -960,6 +935,37 @@
 	  TASK_SEARCH_SUMMARY_CONTAINS }
 };
 
+static GtkActionEntry lockdown_printing_entries[] = {
+
+	{ "task-list-print",
+	  GTK_STOCK_PRINT,
+	  NULL,
+	  "<Control>p",
+	  N_("Print the list of tasks"),
+	  G_CALLBACK (action_task_list_print_cb) },
+
+	{ "task-list-print-preview",
+	  GTK_STOCK_PRINT_PREVIEW,
+	  NULL,
+	  NULL,
+	  N_("Preview the list of tasks to be printed"),
+	  G_CALLBACK (action_task_list_print_preview_cb) },
+
+	{ "task-print",
+	  GTK_STOCK_PRINT,
+	  NULL,
+	  NULL,
+	  N_("Print the selected task"),
+	  G_CALLBACK (action_task_print_cb) }
+};
+
+static EPopupActionEntry lockdown_printing_popup_entries[] = {
+
+	{ "task-popup-print",
+	  NULL,
+	  "task-print" }
+};
+
 void
 e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
 {
@@ -978,6 +984,7 @@
 	ui_manager = e_shell_window_get_ui_manager (shell_window);
 	domain = GETTEXT_PACKAGE;
 
+	/* Task Actions */
 	action_group = task_shell_view->priv->task_actions;
 	gtk_action_group_set_translation_domain (action_group, domain);
 	gtk_action_group_add_actions (
@@ -996,6 +1003,15 @@
 		NULL, NULL);
 	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
 
+	/* Lockdown Printing Actions */
+	action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
+	gtk_action_group_add_actions (
+		action_group, lockdown_printing_entries,
+		G_N_ELEMENTS (lockdown_printing_entries), task_shell_view);
+	e_action_group_add_popup_actions (
+		action_group, lockdown_printing_popup_entries,
+		G_N_ELEMENTS (lockdown_printing_popup_entries));
+
 	/* Bind GObject properties to GConf keys. */
 
 	bridge = gconf_bridge_get ();

Modified: branches/kill-bonobo/doc/reference/shell/Makefile.am
==============================================================================
--- branches/kill-bonobo/doc/reference/shell/Makefile.am	(original)
+++ branches/kill-bonobo/doc/reference/shell/Makefile.am	Tue Jan 27 03:50:19 2009
@@ -82,6 +82,7 @@
 	$(top_builddir)/shell/.libs/e-shell-window-actions.o		\
 	$(top_builddir)/shell/.libs/e-shell-window.o			\
 	$(top_builddir)/e-util/.libs/e-bconf-map.o			\
+	$(top_builddir)/e-util/.libs/e-binding.o			\
 	$(top_builddir)/e-util/.libs/e-dialog-utils.o			\
 	$(top_builddir)/e-util/.libs/e-error.o				\
 	$(top_builddir)/e-util/.libs/e-event.o				\

Modified: branches/kill-bonobo/doc/reference/shell/eshell-sections.txt
==============================================================================
--- branches/kill-bonobo/doc/reference/shell/eshell-sections.txt	(original)
+++ branches/kill-bonobo/doc/reference/shell/eshell-sections.txt	Tue Jan 27 03:50:19 2009
@@ -122,6 +122,7 @@
 EShellSettings
 e_shell_settings_install_property
 e_shell_settings_bind_to_gconf
+e_shell_settings_enable_debug
 e_shell_settings_get_boolean
 e_shell_settings_set_boolean
 e_shell_settings_get_int
@@ -148,6 +149,8 @@
 e_shell_sidebar_new
 e_shell_sidebar_check_state
 e_shell_sidebar_get_shell_view
+e_shell_sidebar_get_icon_name
+e_shell_sidebar_set_icon_name
 e_shell_sidebar_get_primary_text
 e_shell_sidebar_set_primary_text
 e_shell_sidebar_get_secondary_text
@@ -333,4 +336,7 @@
 E_SHELL_WINDOW_ACTION_GROUP_NEW_SOURCE
 E_SHELL_WINDOW_ACTION_GROUP_CUSTOM_RULES
 E_SHELL_WINDOW_ACTION_GROUP_GAL_VIEW
+E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_PRINTING
+E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_PRINT_SETUP
+E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_SAVE_TO_DISK
 </SECTION>

Modified: branches/kill-bonobo/doc/reference/shell/tmpl/action-groups.sgml
==============================================================================
--- branches/kill-bonobo/doc/reference/shell/tmpl/action-groups.sgml	(original)
+++ branches/kill-bonobo/doc/reference/shell/tmpl/action-groups.sgml	Tue Jan 27 03:50:19 2009
@@ -65,3 +65,27 @@
 @window: 
 
 
+<!-- ##### MACRO E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_PRINTING ##### -->
+<para>
+
+</para>
+
+ window: 
+
+
+<!-- ##### MACRO E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_PRINT_SETUP ##### -->
+<para>
+
+</para>
+
+ window: 
+
+
+<!-- ##### MACRO E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_SAVE_TO_DISK ##### -->
+<para>
+
+</para>
+
+ window: 
+
+

Modified: branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-sidebar.sgml
==============================================================================
--- branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-sidebar.sgml	(original)
+++ branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-sidebar.sgml	Tue Jan 27 03:50:19 2009
@@ -70,6 +70,24 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION e_shell_sidebar_get_icon_name ##### -->
+<para>
+
+</para>
+
+ shell_sidebar: 
+ Returns: 
+
+
+<!-- ##### FUNCTION e_shell_sidebar_set_icon_name ##### -->
+<para>
+
+</para>
+
+ shell_sidebar: 
+ icon_name: 
+
+
 <!-- ##### FUNCTION e_shell_sidebar_get_primary_text ##### -->
 <para>
 

Modified: branches/kill-bonobo/mail/e-mail-reader.c
==============================================================================
--- branches/kill-bonobo/mail/e-mail-reader.c	(original)
+++ branches/kill-bonobo/mail/e-mail-reader.c	Tue Jan 27 03:50:19 2009
@@ -2300,6 +2300,9 @@
 void
 e_mail_reader_update_actions (EMailReader *reader)
 {
+	EShell *shell;
+	EShellModule *shell_module;
+	EShellSettings *shell_settings;
 	GtkAction *action;
 	GtkActionGroup *action_group;
 	const gchar *action_name;
@@ -2308,6 +2311,7 @@
 
 	/* Be descriptive. */
 	gboolean any_messages_selected;
+	gboolean disable_printing;
 	gboolean enable_flag_clear;
 	gboolean enable_flag_completed;
 	gboolean enable_flag_for_followup;
@@ -2328,6 +2332,13 @@
 	action_group = e_mail_reader_get_action_group (reader);
 	state = e_mail_reader_check_state (reader);
 
+	shell_module = e_mail_reader_get_shell_module (reader);
+	shell = e_shell_module_get_shell (shell_module);
+	shell_settings = e_shell_get_shell_settings (shell);
+
+	disable_printing = e_shell_settings_get_boolean (
+		shell_settings, "disable-printing");
+
 	single_message_selected =
 		(state & E_MAIL_READER_SELECTION_SINGLE);
 	multiple_messages_selected =
@@ -2478,12 +2489,12 @@
 	gtk_action_set_sensitive (action, sensitive);
 
 	action_name = "mail-print";
-	sensitive = single_message_selected;
+	sensitive = single_message_selected && !disable_printing;
 	action = e_mail_reader_get_action (reader, action_name);
 	gtk_action_set_sensitive (action, sensitive);
 
 	action_name = "mail-print-preview";
-	sensitive = single_message_selected;
+	sensitive = single_message_selected && !disable_printing;
 	action = e_mail_reader_get_action (reader, action_name);
 	gtk_action_set_sensitive (action, sensitive);
 

Modified: branches/kill-bonobo/mail/e-mail-shell-module-settings.c
==============================================================================
--- branches/kill-bonobo/mail/e-mail-shell-module-settings.c	(original)
+++ branches/kill-bonobo/mail/e-mail-shell-module-settings.c	Tue Jan 27 03:50:19 2009
@@ -29,11 +29,8 @@
 void
 e_mail_shell_module_init_settings (EShell *shell)
 {
-	GConfClient *client;
 	EShellSettings *shell_settings;
-	gpointer object;
 
-	client = gconf_client_get_default ();
 	shell_settings = e_shell_get_shell_settings (shell);
 
 	/* XXX Default values should match the GConf schema.
@@ -433,33 +430,4 @@
 	e_shell_settings_bind_to_gconf (
 		shell_settings, "composer-top-signature",
 		"/apps/evolution/mail/composer/top_signature");
-
-	/* These properties are not bound directly to GConf keys.
-	 * XXX Nor should they be stored in GConf to begin with. */
-
-	e_shell_settings_install_property (
-		g_param_spec_object (
-			"accounts",
-			NULL,
-			NULL,
-			E_TYPE_ACCOUNT_LIST,
-			G_PARAM_READWRITE));
-
-	object = e_account_list_new (client);
-	e_shell_settings_set_object (shell_settings, "accounts", object);
-	g_object_unref (object);
-
-	e_shell_settings_install_property (
-		g_param_spec_object (
-			"signatures",
-			NULL,
-			NULL,
-			E_TYPE_SIGNATURE_LIST,
-			G_PARAM_READWRITE));
-
-	object = e_signature_list_new (client);
-	e_shell_settings_set_object (shell_settings, "signatures", object);
-	g_object_unref (object);
-
-	g_object_unref (client);
 }

Modified: branches/kill-bonobo/mail/em-composer-prefs.c
==============================================================================
--- branches/kill-bonobo/mail/em-composer-prefs.c	(original)
+++ branches/kill-bonobo/mail/em-composer-prefs.c	Tue Jan 27 03:50:19 2009
@@ -1044,7 +1044,9 @@
 	prefs->sig_add = GTK_BUTTON (widget);
 
 	widget = glade_xml_get_widget (gui, "cmdSignatureAddScript");
-	gtk_widget_set_sensitive (widget, sensitive && !mail_config_scripts_disabled ());
+	e_binding_new_with_negation (
+		G_OBJECT (shell_settings), "disable-command-line",
+		G_OBJECT (widget), "sensitive");
 	g_signal_connect (
 		widget, "clicked",
 		G_CALLBACK (sig_add_script_cb), prefs);

Modified: branches/kill-bonobo/mail/mail-config.c
==============================================================================
--- branches/kill-bonobo/mail/mail-config.c	(original)
+++ branches/kill-bonobo/mail/mail-config.c	Tue Jan 27 03:50:19 2009
@@ -54,11 +54,7 @@
 #include <misc/e-gui-utils.h>
 #include "e-util/e-util-labels.h"
 #include "e-util/e-account-utils.h"
-
-#include <e-util/e-signature-list.h>
-
-#include "shell/e-shell.h"
-#include "shell/e-shell-settings.h"
+#include "e-util/e-signature-utils.h"
 
 #include <camel/camel-service.h>
 #include <camel/camel-stream-mem.h>
@@ -77,9 +73,6 @@
 
 typedef struct {
 	GConfClient *gconf;
-	EShellSettings *shell_settings;
-
-	gboolean corrupt;
 
 	char *gtkrc;
 
@@ -340,21 +333,13 @@
 mail_config_init (void)
 {
 	GConfClientNotifyFunc func;
-	EShellSettings *shell_settings;
-	EShell *shell;
 	const gchar *key;
 
-	g_return_if_fail (E_IS_SHELL_SETTINGS (shell_settings));
-
 	if (config)
 		return;
 
-	shell = e_shell_get_default ();
-	shell_settings = e_shell_get_shell_settings (shell);
-
 	config = g_new0 (MailConfig, 1);
 	config->gconf = gconf_client_get_default ();
-	config->shell_settings = g_object_ref (shell_settings);
 	config->mime_types = g_ptr_array_new ();
 	config->gtkrc = g_build_filename (
 		e_get_user_data_dir (), "mail",
@@ -554,18 +539,13 @@
 	if (!config)
 		return;
 
-	account_list = e_shell_settings_get_object (
-		config->shell_settings, "accounts");
-	signature_list = e_shell_settings_get_object (
-		config->shell_settings, "signatures");
+	account_list = e_get_account_list ();
+	signature_list = e_get_signature_list ();
 
 	e_account_list_save (account_list);
 	e_signature_list_save (signature_list);
 
 	gconf_client_suggest_sync (config->gconf, NULL);
-
-	g_object_unref (account_list);
-	g_object_unref (signature_list);
 }
 
 void
@@ -649,12 +629,6 @@
 	return config->gconf;
 }
 
-gboolean
-mail_config_is_corrupt (void)
-{
-	return config->corrupt;
-}
-
 int
 mail_config_get_address_count (void)
 {
@@ -1123,15 +1097,6 @@
 	return config->book_lookup_local_only;
 }
 
-gboolean
-mail_config_scripts_disabled (void)
-{
-	if (config == NULL)
-		mail_config_init ();
-
-	return config->scripts_disabled;
-}
-
 char *
 mail_config_signature_run_script (const char *script)
 {
@@ -1140,7 +1105,10 @@
 	int in_fds[2];
 	pid_t pid;
 
-	if (mail_config_scripts_disabled ())
+	if (config == NULL)
+		mail_config_init ();
+
+	if (config->scripts_disabled)
 		return NULL;
 
 	if (pipe (in_fds) == -1) {

Modified: branches/kill-bonobo/mail/mail-config.h
==============================================================================
--- branches/kill-bonobo/mail/mail-config.h	(original)
+++ branches/kill-bonobo/mail/mail-config.h	Tue Jan 27 03:50:19 2009
@@ -96,8 +96,6 @@
 struct _GConfClient *mail_config_get_gconf_client (void);
 
 /* General Accessor functions */
-gboolean mail_config_is_corrupt               (void);
-
 GSList *mail_config_get_labels (void);
 
 const char **mail_config_get_allowable_mime_types (void);
@@ -136,8 +134,6 @@
 gboolean mail_config_get_lookup_book (void);
 gboolean mail_config_get_lookup_book_local_only (void);
 
-gboolean mail_config_scripts_disabled (void);
-
 GType evolution_mail_config_get_type (void);
 
 gboolean evolution_mail_config_factory_init (void);

Modified: branches/kill-bonobo/shell/e-shell-settings.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-settings.c	(original)
+++ branches/kill-bonobo/shell/e-shell-settings.c	Tue Jan 27 03:50:19 2009
@@ -29,6 +29,7 @@
 
 struct _EShellSettingsPrivate {
 	GArray *value_array;
+	guint debug	: 1;
 };
 
 static GList *instances;
@@ -51,6 +52,16 @@
 
 	g_value_copy (value, dest_value);
 	g_object_notify (object, pspec->name);
+
+	if (priv->debug) {
+		gchar *contents;
+
+		contents = g_strdup_value_contents (value);
+		g_debug (
+			"Setting '%s' set to '%s' (%s)",
+			pspec->name, contents, G_VALUE_TYPE_NAME (value));
+		g_free (contents);
+	}
 }
 
 static void
@@ -106,6 +117,8 @@
                      GObjectClass *object_class)
 {
 	GArray *value_array;
+	GParamSpec **pspecs;
+	guint ii;
 
 	instances = g_list_prepend (instances, shell_settings);
 
@@ -114,6 +127,22 @@
 
 	shell_settings->priv = E_SHELL_SETTINGS_GET_PRIVATE (shell_settings);
 	shell_settings->priv->value_array = value_array;
+
+	g_object_freeze_notify (G_OBJECT (shell_settings));
+
+	pspecs = g_object_class_list_properties (object_class, NULL);
+	for (ii = 0; ii < property_count; ii++) {
+		GParamSpec *pspec = pspecs[ii];
+		GValue *value;
+
+		value = &g_array_index (value_array, GValue, ii);
+		g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+		g_param_value_set_default (pspec, value);
+		g_object_notify (G_OBJECT (shell_settings), pspec->name);
+	}
+	g_free (pspecs);
+
+	g_object_thaw_notify (G_OBJECT (shell_settings));
 }
 
 GType
@@ -227,6 +256,20 @@
 }
 
 /**
+ * e_shell_settings_enable_debug:
+ * @shell_settings: an #EShellSettings
+ *
+ * Print a debug message to standard output when a property value changes.
+ **/
+void
+e_shell_settings_enable_debug (EShellSettings *shell_settings)
+{
+	g_return_if_fail (E_IS_SHELL_SETTINGS (shell_settings));
+
+	shell_settings->priv->debug = TRUE;
+}
+
+/**
  * e_shell_settings_get_boolean:
  * @shell_settings: an #EShellSettings
  * @property_name: an installed property name

Modified: branches/kill-bonobo/shell/e-shell-settings.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-settings.h	(original)
+++ branches/kill-bonobo/shell/e-shell-settings.h	Tue Jan 27 03:50:19 2009
@@ -76,6 +76,7 @@
 void		e_shell_settings_bind_to_gconf	(EShellSettings *shell_settings,
 						 const gchar *property_name,
 						 const gchar *gconf_key);
+void		e_shell_settings_enable_debug	(EShellSettings *shell_settings);
 
 /* Getters and setters for common EShellSettings property types.
  * These are more convenient than g_object_get() / g_object_set().
@@ -97,11 +98,6 @@
 void		e_shell_settings_set_string	(EShellSettings *shell_settings,
 						 const gchar *property_name,
 						 const gchar *v_string);
-gpointer	e_shell_settings_get_object	(EShellSettings *shell_settings,
-						 const gchar *property_name);
-void		e_shell_settings_set_object	(EShellSettings *shell_settings,
-						 const gchar *property_name,
-						 gpointer v_object);
 
 G_END_DECLS
 

Modified: branches/kill-bonobo/shell/e-shell-window-actions.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window-actions.c	(original)
+++ branches/kill-bonobo/shell/e-shell-window-actions.c	Tue Jan 27 03:50:19 2009
@@ -1459,13 +1459,6 @@
 	  N_("Create a new window displaying this view"),
 	  G_CALLBACK (action_new_window_cb) },
 
-	{ "page-setup",
-	  GTK_STOCK_PAGE_SETUP,
-	  NULL,
-	  NULL,
-	  N_("Change the page settings for your current printer"),
-	  G_CALLBACK (action_page_setup_cb) },
-
 	{ "preferences",
 	  GTK_STOCK_PREFERENCES,
 	  NULL,
@@ -1745,6 +1738,16 @@
 	  -1 }
 };
 
+static GtkActionEntry shell_lockdown_print_setup_entries[] = {
+
+	{ "page-setup",
+	  GTK_STOCK_PAGE_SETUP,
+	  NULL,
+	  NULL,
+	  N_("Change the page settings for your current printer"),
+	  G_CALLBACK (action_page_setup_cb) }
+};
+
 static void
 shell_window_extract_actions (EShellWindow *shell_window,
                               GList **source_list,
@@ -1864,6 +1867,25 @@
 		-1, G_CALLBACK (action_switcher_cb), shell_window);
 	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
 
+	/* Lockdown Printing Actions */
+	action_group = shell_window->priv->lockdown_printing;
+	gtk_action_group_set_translation_domain (action_group, domain);
+	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
+
+	/* Lockdown Print Setup Actions */
+	action_group = shell_window->priv->lockdown_print_setup;
+	gtk_action_group_set_translation_domain (action_group, domain);
+	gtk_action_group_add_actions (
+		action_group, shell_lockdown_print_setup_entries,
+		G_N_ELEMENTS (shell_lockdown_print_setup_entries),
+		shell_window);
+	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
+
+	/* Lockdown Save-to-Disk Actions */
+	action_group = shell_window->priv->lockdown_save_to_disk;
+	gtk_action_group_set_translation_domain (action_group, domain);
+	gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
+
 	/* Fine tuning. */
 
 	g_object_set (ACTION (SEND_RECEIVE), "is-important", TRUE, NULL);

Modified: branches/kill-bonobo/shell/e-shell-window-actions.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window-actions.h	(original)
+++ branches/kill-bonobo/shell/e-shell-window-actions.h	Tue Jan 27 03:50:19 2009
@@ -103,6 +103,12 @@
 	E_SHELL_WINDOW_ACTION_GROUP ((window), "custom-rules")
 #define E_SHELL_WINDOW_ACTION_GROUP_GAL_VIEW(window) \
 	E_SHELL_WINDOW_ACTION_GROUP ((window), "gal-view")
+#define E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_PRINTING(window) \
+	E_SHELL_WINDOW_ACTION_GROUP ((window), "lockdown-printing")
+#define E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_PRINT_SETUP(window) \
+	E_SHELL_WINDOW_ACTION_GROUP ((window), "lockdown-print-setup")
+#define E_SHELL_WINDOW_ACTION_GROUP_LOCKDOWN_SAVE_TO_DISK(window) \
+	E_SHELL_WINDOW_ACTION_GROUP ((window), "lockdown-save-to-disk")
 #define E_SHELL_WINDOW_ACTION_GROUP_NEW_ITEM(window) \
 	E_SHELL_WINDOW_ACTION_GROUP ((window), "new-item")
 #define E_SHELL_WINDOW_ACTION_GROUP_NEW_SOURCE(window) \

Modified: branches/kill-bonobo/shell/e-shell-window-private.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window-private.c	(original)
+++ branches/kill-bonobo/shell/e-shell-window-private.c	Tue Jan 27 03:50:19 2009
@@ -195,6 +195,12 @@
 	priv->new_source_actions = gtk_action_group_new ("new-source");
 	priv->custom_rule_actions = gtk_action_group_new ("custom-rules");
 	priv->switcher_actions = gtk_action_group_new ("switcher");
+	priv->lockdown_printing =
+		gtk_action_group_new ("lockdown-printing");
+	priv->lockdown_print_setup =
+		gtk_action_group_new ("lockdown-print-setup");
+	priv->lockdown_save_to_disk =
+		gtk_action_group_new ("lockdown-save-to-disk");
 	priv->loaded_views = loaded_views;
 	priv->active_view = "unknown";
 	priv->signal_handler_ids = signal_handler_ids;
@@ -325,15 +331,41 @@
 e_shell_window_private_constructed (EShellWindow *shell_window)
 {
 	EShellWindowPrivate *priv = shell_window->priv;
+	EShellSettings *shell_settings;
+	EShell *shell;
 	GConfBridge *bridge;
+	GtkActionGroup *action_group;
 	GObject *object;
 	const gchar *key;
 
+	shell = e_shell_window_get_shell (shell_window);
+	shell_settings = e_shell_get_shell_settings (shell);
+
 	/* Create the switcher actions before we set the initial
 	 * shell view, because the shell view relies on them for
 	 * default settings during construction. */
 	e_shell_window_create_switcher_actions (shell_window);
 
+	/* Support lockdown. */
+
+	action_group = ACTION_GROUP (LOCKDOWN_PRINTING);
+
+	e_binding_new_with_negation (
+		G_OBJECT (shell_settings), "disable-printing",
+		G_OBJECT (action_group), "sensitive");
+
+	action_group = ACTION_GROUP (LOCKDOWN_PRINT_SETUP);
+
+	e_binding_new_with_negation (
+		G_OBJECT (shell_settings), "disable-print-setup",
+		G_OBJECT (action_group), "sensitive");
+
+	action_group = ACTION_GROUP (LOCKDOWN_SAVE_TO_DISK);
+
+	e_binding_new_with_negation (
+		G_OBJECT (shell_settings), "disable-save-to-disk",
+		G_OBJECT (action_group), "sensitive");
+
 	/* Bind GObject properties to GConf keys. */
 
 	bridge = gconf_bridge_get ();
@@ -398,6 +430,9 @@
 	DISPOSE (priv->new_source_actions);
 	DISPOSE (priv->custom_rule_actions);
 	DISPOSE (priv->switcher_actions);
+	DISPOSE (priv->lockdown_printing);
+	DISPOSE (priv->lockdown_print_setup);
+	DISPOSE (priv->lockdown_save_to_disk);
 
 	g_hash_table_remove_all (priv->loaded_views);
 

Modified: branches/kill-bonobo/shell/e-shell-window-private.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window-private.h	(original)
+++ branches/kill-bonobo/shell/e-shell-window-private.h	Tue Jan 27 03:50:19 2009
@@ -28,6 +28,7 @@
 #include <glib/gi18n.h>
 
 #include <e-util/e-util.h>
+#include <e-util/e-binding.h>
 #include <e-util/gconf-bridge.h>
 #include <widgets/misc/e-menu-tool-button.h>
 #include <widgets/misc/e-online-button.h>
@@ -75,6 +76,9 @@
 	GtkActionGroup *new_source_actions;
 	GtkActionGroup *custom_rule_actions;
 	GtkActionGroup *switcher_actions;
+	GtkActionGroup *lockdown_printing;
+	GtkActionGroup *lockdown_print_setup;
+	GtkActionGroup *lockdown_save_to_disk;
 	guint custom_rule_merge_id;
 	guint gal_view_merge_id;
 

Modified: branches/kill-bonobo/shell/e-shell.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell.c	(original)
+++ branches/kill-bonobo/shell/e-shell.c	Tue Jan 27 03:50:19 2009
@@ -72,6 +72,14 @@
 	LAST_SIGNAL
 };
 
+enum {
+	DEBUG_KEY_SETTINGS = 1 << 0
+};
+
+static GDebugKey debug_keys[] = {
+	{ "settings",	DEBUG_KEY_SETTINGS }
+};
+
 EShell *default_shell = NULL;
 static gpointer parent_class;
 static guint signals[LAST_SIGNAL];
@@ -80,6 +88,19 @@
 void e_shell_dbus_initialize (EShell *shell);
 #endif
 
+static void
+shell_parse_debug_string (EShell *shell)
+{
+	guint flags;
+
+	flags = g_parse_debug_string (
+		g_getenv ("EVOLUTION_DEBUG"),
+		debug_keys, G_N_ELEMENTS (debug_keys));
+
+	if (flags & DEBUG_KEY_SETTINGS)
+		e_shell_settings_enable_debug (shell->priv->settings);
+}
+
 static gboolean
 shell_window_delete_event_cb (EShell *shell,
                               EShellWindow *shell_window)
@@ -663,6 +684,40 @@
 		0, NULL, NULL,
 		g_cclosure_marshal_VOID__VOID,
 		G_TYPE_NONE, 0);
+
+	/* Install some desktop-wide settings. */
+
+	e_shell_settings_install_property (
+		g_param_spec_boolean (
+			"disable-command-line",
+			NULL,
+			NULL,
+			FALSE,
+			G_PARAM_READWRITE));
+
+	e_shell_settings_install_property (
+		g_param_spec_boolean (
+			"disable-printing",
+			NULL,
+			NULL,
+			FALSE,
+			G_PARAM_READWRITE));
+
+	e_shell_settings_install_property (
+		g_param_spec_boolean (
+			"disable-print-setup",
+			NULL,
+			NULL,
+			FALSE,
+			G_PARAM_READWRITE));
+
+	e_shell_settings_install_property (
+		g_param_spec_boolean (
+			"disable-save-to-disk",
+			NULL,
+			NULL,
+			FALSE,
+			G_PARAM_READWRITE));
 }
 
 static void
@@ -687,9 +742,27 @@
 
 	e_file_lock_create ();
 
+	shell_parse_debug_string (shell);
+
 	g_signal_connect (
 		shell, "notify::online-mode",
 		G_CALLBACK (shell_notify_online_mode_cb), NULL);
+
+	e_shell_settings_bind_to_gconf (
+		shell->priv->settings, "disable-command-line",
+		"/desktop/gnome/lockdown/disable_command_line");
+
+	e_shell_settings_bind_to_gconf (
+		shell->priv->settings, "disable-printing",
+		"/desktop/gnome/lockdown/disable_printing");
+
+	e_shell_settings_bind_to_gconf (
+		shell->priv->settings, "disable-print-setup",
+		"/desktop/gnome/lockdown/disable_print_setup");
+
+	e_shell_settings_bind_to_gconf (
+		shell->priv->settings, "disable-save-to-disk",
+		"/desktop/gnome/lockdown/disable_save_to_disk");
 }
 
 GType



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