From 9a8f21c44bfe5d0efad1ae0ca1758c0d7c41f590 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 3 Feb 2011 14:09:50 -0500 Subject: Composer: Add Edit -> Preferences Opens the Preferences window to the Composer Preferences section. --- composer/e-composer-actions.c | 75 +++++++++++++++++++++++++++++++----------- composer/e-composer-private.h | 1 + composer/evolution-composer.ui | 4 +++ 3 files changed, 60 insertions(+), 20 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c index 1f1cb44a7c..bbd2aacfd0 100644 --- a/composer/e-composer-actions.c +++ b/composer/e-composer-actions.c @@ -60,6 +60,19 @@ action_close_cb (GtkAction *action, gtk_widget_destroy (GTK_WIDGET (composer)); } +static void +action_new_message_cb (GtkAction *action, + EMsgComposer *composer) +{ + EMsgComposer *new_composer; + EShell *shell; + + shell = e_msg_composer_get_shell (composer); + + new_composer = e_msg_composer_new (shell); + gtk_widget_show (GTK_WIDGET (new_composer)); +} + static void action_pgp_encrypt_cb (GtkToggleAction *action, EMsgComposer *composer) @@ -80,6 +93,34 @@ action_pgp_sign_cb (GtkToggleAction *action, gtkhtml_editor_set_changed (editor, TRUE); } +static void +action_preferences_cb (GtkAction *action, + EMsgComposer *composer) +{ + EShell *shell; + GtkWidget *preferences_window; + const gchar *page_name = "composer"; + + shell = e_msg_composer_get_shell (composer); + preferences_window = e_shell_get_preferences_window (shell); + e_preferences_window_setup (E_PREFERENCES_WINDOW (preferences_window)); + + gtk_window_set_transient_for ( + GTK_WINDOW (preferences_window), + GTK_WINDOW (composer)); + gtk_window_set_position ( + GTK_WINDOW (preferences_window), + GTK_WIN_POS_CENTER_ON_PARENT); + gtk_window_present (GTK_WINDOW (preferences_window)); + + if (e_shell_get_express_mode (shell)) + e_preferences_window_filter_page ( + E_PREFERENCES_WINDOW (preferences_window), page_name); + else + e_preferences_window_show_page ( + E_PREFERENCES_WINDOW (preferences_window), page_name); +} + static void action_print_cb (GtkAction *action, EMsgComposer *composer) @@ -217,19 +258,6 @@ action_send_cb (GtkAction *action, } } -static void -action_new_message_cb (GtkAction *action, - EMsgComposer *composer) -{ - EMsgComposer *new_composer; - EShell *shell; - - shell = e_msg_composer_get_shell (composer); - - new_composer = e_msg_composer_new (shell); - gtk_widget_show (GTK_WIDGET (new_composer)); -} - static void action_smime_encrypt_cb (GtkToggleAction *action, EMsgComposer *composer) @@ -266,6 +294,20 @@ static GtkActionEntry entries[] = { N_("Close the current file"), G_CALLBACK (action_close_cb) }, + { "new-message", + "mail-message-new", + N_("New _Message"), + "n", + N_("Open New Message window"), + G_CALLBACK (action_new_message_cb) }, + + { "preferences", + GTK_STOCK_PREFERENCES, + NULL, + NULL, + N_("Configure Evolution"), + G_CALLBACK (action_preferences_cb) }, + { "save", GTK_STOCK_SAVE, N_("_Save"), @@ -280,13 +322,6 @@ static GtkActionEntry entries[] = { N_("Save the current file with a different name"), G_CALLBACK (action_save_as_cb) }, - { "new-message", - "mail-message-new", - N_("New _Message"), - "n", - N_("Open New Message window"), - G_CALLBACK (action_new_message_cb) }, - /* Menus */ { "charset-menu", diff --git a/composer/e-composer-private.h b/composer/e-composer-private.h index 5cf503e735..9ed3b11c59 100644 --- a/composer/e-composer-private.h +++ b/composer/e-composer-private.h @@ -52,6 +52,7 @@ #include "widgets/misc/e-attachment-paned.h" #include "widgets/misc/e-attachment-store.h" #include "widgets/misc/e-picture-gallery.h" +#include "widgets/misc/e-preferences-window.h" #include "widgets/misc/e-signature-combo-box.h" #include "widgets/misc/e-web-view.h" #include "shell/e-shell.h" diff --git a/composer/evolution-composer.ui b/composer/evolution-composer.ui index d1eb10c76c..91fce38a2b 100644 --- a/composer/evolution-composer.ui +++ b/composer/evolution-composer.ui @@ -20,6 +20,10 @@ + + + + -- cgit v1.2.3