aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mail/e-mail-config-web-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-03-23 00:03:46 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-03-23 00:03:46 +0800
commit7094f32df13b8ddfe0e41c746481efb6d9f750fd (patch)
treee97c4284b0737f976895b60f3879c93e558df90e /modules/mail/e-mail-config-web-view.c
parent5c3c117a73f22054fd981d5011d01bbb3d60e711 (diff)
downloadgsoc2013-evolution-7094f32df13b8ddfe0e41c746481efb6d9f750fd.tar.gz
gsoc2013-evolution-7094f32df13b8ddfe0e41c746481efb6d9f750fd.tar.zst
gsoc2013-evolution-7094f32df13b8ddfe0e41c746481efb6d9f750fd.zip
Add an extension to configure EWebView.
Make EWebView extensible and register an extension to automatically bind every EWebView instance to the appropriate EShellSettings.
Diffstat (limited to 'modules/mail/e-mail-config-web-view.c')
-rw-r--r--modules/mail/e-mail-config-web-view.c100
1 files changed, 100 insertions, 0 deletions
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);
+}
tool for generating HTML code. It workspgj2012-02-194-0/+30 * Shakespeare is a template family for type-safe, efficient templates withpgj2012-02-194-0/+29 * HTTP cookie parsing and rendering.pgj2012-02-194-0/+26 * Focus is on third-party authentication methods, such as OpenID, rpxnowpgj2012-02-194-0/+31 * Update to 11.1r102.62ehaupt2012-02-192-5/+5 * This package uses attoparsec for parsing the actual contents of the HTTPpgj2012-02-194-0/+35 * - Add a new OPTION to enable experimental SSL supportgarga2012-02-181-1/+8 * - Add a new OPTION, to control if php files will be or not installed. Sincegarga2012-02-183-41/+60 * - Update devel/sdl12 to 1.2.15mva2012-02-181-1/+1 * linux-flashplugin-7* no longer existseadler2012-02-182-2/+2 * Gitit is a wiki backed by a git, darcs, or mercurial filestore. Pagespgj2012-02-184-0/+49 * Run untrusted HTML through Text.HTML.SanitizeXSS.sanitizeXSS to preventpgj2012-02-184-0/+28 * - Fix orderingpgj2012-02-181-1/+1 * CSS parser and renderer.pgj2012-02-184-0/+26 * The reCAPTCHA [1] is a service that provides captchas for preventingpgj2012-02-184-0/+30 * - Update to 0.38sunpoet2012-02-182-4/+5 * - Update to 5.9003sunpoet2012-02-182-6/+3 * update to 3.6.27flo2012-02-186-155/+155 * update to 2.7.2flo2012-02-186-51/+51 * update to 10.0.2flo2012-02-1810-339/+339 * - Update to 6.03sunpoet2012-02-182-3/+3 * - Update to 6.02sunpoet2012-02-182-3/+3 * - Update to 1.7jgh2012-02-183-14/+61 * - Connect www/hs-happstack to the buildpgj2012-02-181-0/+1 * The Haskell application server stack.pgj2012-02-183-0/+31 * Unplug your machine and restart and have your app recover to exactlypgj2012-02-184-0/+35 * Happstack Server provides an HTTP server and a rich set of functions forpgj2012-02-18