diff options
Diffstat (limited to 'modules/mail')
-rw-r--r-- | modules/mail/Makefile.am | 4 | ||||
-rw-r--r-- | modules/mail/e-mail-config-format-html.c | 93 | ||||
-rw-r--r-- | modules/mail/e-mail-config-format-html.h | 30 | ||||
-rw-r--r-- | modules/mail/e-mail-config-web-view.c | 100 | ||||
-rw-r--r-- | modules/mail/e-mail-config-web-view.h | 30 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-backend.c | 26 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-content.c | 6 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-actions.c | 2 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-actions.h | 4 | ||||
-rw-r--r-- | modules/mail/em-composer-prefs.c | 28 | ||||
-rw-r--r-- | modules/mail/em-mailer-prefs.c | 10 | ||||
-rw-r--r-- | modules/mail/evolution-module-mail.c | 6 |
12 files changed, 313 insertions, 26 deletions
diff --git a/modules/mail/Makefile.am b/modules/mail/Makefile.am index 65a5c30d1f..323820217b 100644 --- a/modules/mail/Makefile.am +++ b/modules/mail/Makefile.am @@ -17,8 +17,12 @@ libevolution_module_mail_la_SOURCES = \ evolution-module-mail.c \ e-mail-attachment-handler.c \ e-mail-attachment-handler.h \ + e-mail-config-format-html.c \ + e-mail-config-format-html.h \ e-mail-config-hook.c \ e-mail-config-hook.h \ + e-mail-config-web-view.c \ + e-mail-config-web-view.h \ e-mail-event-hook.c \ e-mail-event-hook.h \ e-mail-junk-hook.c \ diff --git a/modules/mail/e-mail-config-format-html.c b/modules/mail/e-mail-config-format-html.c new file mode 100644 index 0000000000..a92a943976 --- /dev/null +++ b/modules/mail/e-mail-config-format-html.c @@ -0,0 +1,93 @@ +/* + * e-mail-config-format-html.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see <http://www.gnu.org/licenses/> + * + */ + +#include "e-mail-config-format-html.h" + +#include <shell/e-shell.h> +#include <e-util/e-binding.h> +#include <e-util/e-extension.h> +#include <mail/em-format-html.h> + +static void +mail_config_format_html_constructed (GObject *object) +{ + EExtension *extension; + EExtensible *extensible; + EShellSettings *shell_settings; + EShell *shell; + + extension = E_EXTENSION (object); + extensible = e_extension_get_extensible (extension); + + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + + e_binding_new_full ( + shell_settings, "mail-citation-color", + extensible, "citation-color", + e_binding_transform_string_to_color, + NULL, NULL); + + e_binding_new ( + shell_settings, "mail-image-loading-policy", + extensible, "image-loading-policy"); + + e_binding_new ( + shell_settings, "mail-only-local-photos", + extensible, "only-local-photos"); + + e_binding_new ( + shell_settings, "mail-show-sender-photo", + extensible, "show-sender-photo"); + + e_binding_new ( + shell_settings, "mail-show-real-date", + extensible, "show-real-date"); +} + +static void +mail_config_format_html_class_init (EExtensionClass *class) +{ + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (class); + object_class->constructed = mail_config_format_html_constructed; + + class->extensible_type = EM_TYPE_FORMAT_HTML; +} + +void +e_mail_config_format_html_register_type (GTypeModule *type_module) +{ + static const GTypeInfo type_info = { + sizeof (EExtensionClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) mail_config_format_html_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (EExtension), + 0, /* n_preallocs */ + (GInstanceInitFunc) NULL, + NULL /* value_table */ + }; + + g_type_module_register_type ( + type_module, E_TYPE_EXTENSION, + "EMailConfigFormatHTML", &type_info, 0); +} diff --git a/modules/mail/e-mail-config-format-html.h b/modules/mail/e-mail-config-format-html.h new file mode 100644 index 0000000000..bed76d88b7 --- /dev/null +++ b/modules/mail/e-mail-config-format-html.h @@ -0,0 +1,30 @@ +/* + * e-mail-config-format-html.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see <http://www.gnu.org/licenses/> + * + */ + +#ifndef E_MAIL_CONFIG_FORMAT_HTML_H +#define E_MAIL_CONFIG_FORMAT_HTML_H + +#include <glib-object.h> + +G_BEGIN_DECLS + +void e_mail_config_format_html_register_type (GTypeModule *type_module); + +G_END_DECLS + +#endif /* E_MAIL_CONFIG_FORMAT_HTML_H */ diff --git a/modules/mail/e-mail-config-web-view.c b/modules/mail/e-mail-config-web-view.c new file mode 100644 index 0000000000..5cfb648154 --- /dev/null +++ b/modules/mail/e-mail-config-web-view.c @@ -0,0 +1,100 @@ +/* + * e-mail-config-web-view.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see <http://www.gnu.org/licenses/> + * + */ + +#include "e-mail-config-web-view.h" + +#include <shell/e-shell.h> +#include <e-util/e-binding.h> +#include <e-util/e-extension.h> +#include <misc/e-web-view.h> + +static void +mail_config_web_view_realize (GtkWidget *widget) +{ + EShell *shell; + EShellSettings *shell_settings; + + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + + e_binding_new ( + shell_settings, "mail-show-animated-images", + widget, "animate"); + + e_binding_new ( + shell_settings, "composer-inline-spelling", + widget, "inline-spelling"); + + e_binding_new ( + shell_settings, "composer-magic-links", + widget, "magic-links"); + + e_binding_new ( + shell_settings, "composer-magic-smileys", + widget, "magic-smileys"); +} + +static void +mail_config_web_view_constructed (GObject *object) +{ + EExtension *extension; + EExtensible *extensible; + + extension = E_EXTENSION (object); + extensible = e_extension_get_extensible (extension); + + /* Wait to bind shell settings until the EWebView is realized + * so GtkhtmlEditor has a chance to install a GtkHTMLEditorAPI. + * Otherwise our settings will have no effect. */ + + g_signal_connect ( + extensible, "realize", + G_CALLBACK (mail_config_web_view_realize), NULL); +} + +static void +mail_config_web_view_class_init (EExtensionClass *class) +{ + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (class); + object_class->constructed = mail_config_web_view_constructed; + + class->extensible_type = E_TYPE_WEB_VIEW; +} + +void +e_mail_config_web_view_register_type (GTypeModule *type_module) +{ + static const GTypeInfo type_info = { + sizeof (EExtensionClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) mail_config_web_view_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (EExtension), + 0, /* n_preallocs */ + (GInstanceInitFunc) NULL, + NULL /* value_table */ + }; + + g_type_module_register_type ( + type_module, E_TYPE_EXTENSION, + "EMailConfigWebView", &type_info, 0); +} diff --git a/modules/mail/e-mail-config-web-view.h b/modules/mail/e-mail-config-web-view.h new file mode 100644 index 0000000000..c2a8758709 --- /dev/null +++ b/modules/mail/e-mail-config-web-view.h @@ -0,0 +1,30 @@ +/* + * e-mail-config-web-view.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see <http://www.gnu.org/licenses/> + * + */ + +#ifndef E_MAIL_CONFIG_WEB_VIEW_H +#define E_MAIL_CONFIG_WEB_VIEW_H + +#include <glib-object.h> + +G_BEGIN_DECLS + +void e_mail_config_web_view_register_type (GTypeModule *type_module); + +G_END_DECLS + +#endif /* E_MAIL_CONFIG_WEB_VIEW_H */ diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c index de8d4f42d9..b3eb0a97c1 100644 --- a/modules/mail/e-mail-shell-backend.c +++ b/modules/mail/e-mail-shell-backend.c @@ -408,32 +408,28 @@ mail_shell_backend_window_created_cb (EShell *shell, GtkWindow *window, EShellBackend *shell_backend) { - EShellSettings *shell_settings; static gboolean first_time = TRUE; const gchar *backend_name; - shell_settings = e_shell_get_shell_settings (shell); - /* This applies to both the composer and signature editor. */ if (GTKHTML_IS_EDITOR (window)) { + EShellSettings *shell_settings; GList *spell_languages; - - e_binding_new ( - shell_settings, "composer-inline-spelling", - window, "inline-spelling"); - - e_binding_new ( - shell_settings, "composer-magic-links", - window, "magic-links"); - - e_binding_new ( - shell_settings, "composer-magic-smileys", - window, "magic-smileys"); + gboolean active = TRUE; spell_languages = e_load_spell_languages (); gtkhtml_editor_set_spell_languages ( GTKHTML_EDITOR (window), spell_languages); g_list_free (spell_languages); + + shell_settings = e_shell_get_shell_settings (shell); + + /* Express mode does not honor this setting. */ + if (!e_shell_get_express_mode (shell)) + active = e_shell_settings_get_boolean ( + shell_settings, "composer-format-html"); + + gtkhtml_editor_set_html_mode (GTKHTML_EDITOR (window), active); } if (E_IS_MSG_COMPOSER (window)) { diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index 846c1ee854..aa2718dcec 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -621,7 +621,7 @@ mail_shell_content_set_folder (EMailReader *reader, key = STATE_KEY_GROUP_BY_THREADS; value = g_key_file_get_boolean (key_file, group_name, key, &error); if (error != NULL) { - value = FALSE; + value = TRUE; g_clear_error (&error); } @@ -881,6 +881,7 @@ e_mail_shell_content_set_preview_visible (EMailShellContent *mail_shell_content, EShellSearchbar * e_mail_shell_content_get_searchbar (EMailShellContent *mail_shell_content) { + EShellView *shell_view; EShellContent *shell_content; GtkWidget *widget; @@ -888,7 +889,8 @@ e_mail_shell_content_get_searchbar (EMailShellContent *mail_shell_content) E_IS_MAIL_SHELL_CONTENT (mail_shell_content), NULL); shell_content = E_SHELL_CONTENT (mail_shell_content); - widget = e_shell_content_get_searchbar (shell_content); + shell_view = e_shell_content_get_shell_view (shell_content); + widget = e_shell_view_get_searchbar (shell_view); return E_SHELL_SEARCHBAR (widget); } diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c index e92800c660..f534c2a276 100644 --- a/modules/mail/e-mail-shell-view-actions.c +++ b/modules/mail/e-mail-shell-view-actions.c @@ -1223,7 +1223,7 @@ static GtkRadioActionEntry mail_filter_entries[] = { MAIL_FILTER_LAST_5_DAYS_MESSAGES }, { "mail-filter-messages-not-junk", - "mail-mark-notjunk", + "mail-mark-not-junk", N_("Messages Not Junk"), NULL, NULL, /* XXX Add a tooltip! */ diff --git a/modules/mail/e-mail-shell-view-actions.h b/modules/mail/e-mail-shell-view-actions.h index eb11f46013..addd67452b 100644 --- a/modules/mail/e-mail-shell-view-actions.h +++ b/modules/mail/e-mail-shell-view-actions.h @@ -115,8 +115,8 @@ E_SHELL_WINDOW_ACTION ((window), "mail-mark-important") #define E_SHELL_WINDOW_ACTION_MAIL_MARK_JUNK(window) \ E_SHELL_WINDOW_ACTION ((window), "mail-mark-junk") -#define E_SHELL_WINDOW_ACTION_MAIL_MARK_NOTJUNK(window) \ - E_SHELL_WINDOW_ACTION ((window), "mail-mark-notjunk") +#define E_SHELL_WINDOW_ACTION_MAIL_MARK_NOT_JUNK(window) \ + E_SHELL_WINDOW_ACTION ((window), "mail-mark-not-junk") #define E_SHELL_WINDOW_ACTION_MAIL_MARK_READ(window) \ E_SHELL_WINDOW_ACTION ((window), "mail-mark-read") #define E_SHELL_WINDOW_ACTION_MAIL_MARK_UNIMPORTANT(window) \ diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c index 574657806e..49f2fda5b6 100644 --- a/modules/mail/em-composer-prefs.c +++ b/modules/mail/em-composer-prefs.c @@ -36,6 +36,7 @@ #include "em-composer-prefs.h" #include "composer/e-msg-composer.h" +#include "shell/e-shell-utils.h" #include <camel/camel-iconv.h> @@ -398,10 +399,15 @@ em_composer_prefs_construct (EMComposerPrefs *prefs, /* General tab */ /* Default Behavior */ + + /* Express mode does not honor this setting. */ widget = e_builder_get_widget (prefs->builder, "chkSendHTML"); - e_mutual_binding_new ( - shell_settings, "composer-format-html", - widget, "active"); + if (e_shell_get_express_mode (shell)) + gtk_widget_hide (widget); + else + e_mutual_binding_new ( + shell_settings, "composer-format-html", + widget, "active"); widget = e_builder_get_widget (prefs->builder, "chkPromptEmptySubject"); e_mutual_binding_new ( @@ -517,9 +523,11 @@ em_composer_prefs_construct (EMComposerPrefs *prefs, widget, "editor-created", G_CALLBACK (e_shell_watch_window), shell); - e_binding_new ( - shell_settings, "composer-format-html", - widget, "prefer-html"); + /* Express mode does not honor this setting. */ + if (!e_shell_get_express_mode (shell)) + e_binding_new ( + shell_settings, "composer-format-html", + widget, "prefer-html"); #ifndef G_OS_WIN32 e_binding_new_with_negation ( @@ -545,6 +553,14 @@ em_composer_prefs_construct (EMComposerPrefs *prefs, signature_tree_view, "selected", widget, "signature"); + /* Sanitize the dialog for Express mode */ + e_shell_hide_widgets_for_express_mode (shell, prefs->builder, + "chkOutlookFilenames", + "vboxTopPosting", + "labelAlerts", + "chkPromptEmptySubject", + NULL); + /* get our toplevel widget */ target = em_config_target_new_prefs (ec, client); e_config_set_target ((EConfig *)ec, (EConfigTarget *)target); diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c index 89a7f0acc9..a885c72744 100644 --- a/modules/mail/em-mailer-prefs.c +++ b/modules/mail/em-mailer-prefs.c @@ -43,6 +43,7 @@ #include "e-util/e-datetime-format.h" #include "e-util/e-util-private.h" #include "widgets/misc/e-charset-combo-box.h" +#include "shell/e-shell-utils.h" #include "e-mail-label-manager.h" #include "e-mail-reader-utils.h" @@ -1207,6 +1208,15 @@ em_mailer_prefs_construct (EMMailerPrefs *prefs, g_signal_connect (G_OBJECT (prefs->junk_header_add), "clicked", G_CALLBACK (jh_add_cb), prefs); g_signal_connect (G_OBJECT (prefs->junk_header_remove), "clicked", G_CALLBACK (jh_remove_cb), prefs); + /* Sanitize the dialog for Express mode */ + e_shell_hide_widgets_for_express_mode (shell, prefs->builder, + "hboxReadTimeout", + "hboxMailSizeLimit", + "hboxShrinkAddresses", + "magic_spacebar_checkbox", + "hboxEnableSearchFolders", + NULL); + /* get our toplevel widget */ target = em_config_target_new_prefs(ec, prefs->gconf); e_config_set_target((EConfig *)ec, (EConfigTarget *)target); diff --git a/modules/mail/evolution-module-mail.c b/modules/mail/evolution-module-mail.c index 1bb58c7742..9e9744569b 100644 --- a/modules/mail/evolution-module-mail.c +++ b/modules/mail/evolution-module-mail.c @@ -30,6 +30,9 @@ #include "e-mail-shell-sidebar.h" #include "e-mail-shell-view.h" +#include "e-mail-config-format-html.h" +#include "e-mail-config-web-view.h" + /* Module Entry Points */ void e_module_load (GTypeModule *type_module); void e_module_unload (GTypeModule *type_module); @@ -50,6 +53,9 @@ e_module_load (GTypeModule *type_module) e_mail_shell_content_register_type (type_module); e_mail_shell_sidebar_register_type (type_module); e_mail_shell_view_register_type (type_module); + + e_mail_config_format_html_register_type (type_module); + e_mail_config_web_view_register_type (type_module); } G_MODULE_EXPORT void |