aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-account-combo-box.c22
-rw-r--r--widgets/misc/e-account-combo-box.h2
-rw-r--r--widgets/misc/e-calendar-item.c7
-rw-r--r--widgets/misc/e-calendar-item.h24
-rw-r--r--widgets/misc/e-dateedit.c39
-rw-r--r--widgets/misc/e-preferences-window.c89
-rw-r--r--widgets/misc/e-preferences-window.h2
-rw-r--r--widgets/misc/e-web-view.c230
-rw-r--r--widgets/misc/e-web-view.h11
-rw-r--r--widgets/table/e-cell-text.c2
10 files changed, 339 insertions, 89 deletions
diff --git a/widgets/misc/e-account-combo-box.c b/widgets/misc/e-account-combo-box.c
index 0ded393e72..786478a5e3 100644
--- a/widgets/misc/e-account-combo-box.c
+++ b/widgets/misc/e-account-combo-box.c
@@ -41,6 +41,7 @@ enum {
struct _EAccountComboBoxPrivate {
EAccountList *account_list;
GHashTable *index;
+ int num_displayed_accounts;
};
static gpointer parent_class;
@@ -150,6 +151,8 @@ account_combo_box_refresh_cb (EAccountList *account_list,
GList *list = NULL;
GList *iter;
+ combo_box->priv->num_displayed_accounts = 0;
+
store = gtk_list_store_new (2, G_TYPE_STRING, E_TYPE_ACCOUNT);
model = GTK_TREE_MODEL (store);
index = combo_box->priv->index;
@@ -182,6 +185,7 @@ account_combo_box_refresh_cb (EAccountList *account_list,
gchar *string;
account = iter->data;
+ combo_box->priv->num_displayed_accounts++;
/* Show the account name for duplicate email addresses. */
if (account_combo_box_has_dupes (list, account->id->address))
@@ -514,3 +518,21 @@ e_account_combo_box_set_active_name (EAccountComboBox *combo_box,
return e_account_combo_box_set_active (combo_box, account);
}
+
+/**
+ * e_account_combo_box_count_displayed_accounts:
+ * @combo_box: an #EAccountComboBox
+ *
+ * Counts the number of accounts that are displayed in the @combo_box. This may not
+ * be the actual number of accounts that are configured, as some of those accounts
+ * may be disabled by the user.
+ *
+ * Return value: number of active and valid accounts as shown in the @combo_box.
+ */
+int
+e_account_combo_box_count_displayed_accounts (EAccountComboBox *combo_box)
+{
+ g_return_val_if_fail (E_IS_ACCOUNT_COMBO_BOX (combo_box), -1);
+
+ return combo_box->priv->num_displayed_accounts;
+}
diff --git a/widgets/misc/e-account-combo-box.h b/widgets/misc/e-account-combo-box.h
index 12d4be6c72..60078690e9 100644
--- a/widgets/misc/e-account-combo-box.h
+++ b/widgets/misc/e-account-combo-box.h
@@ -78,6 +78,8 @@ gboolean e_account_combo_box_set_active_name
(EAccountComboBox *combo_box,
const gchar *account_name);
+int e_account_combo_box_count_displayed_accounts (EAccountComboBox *combo_box);
+
G_END_DECLS
#endif /* E_ACCOUNT_COMBO_BOX_H */
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c
index def7019c21..4d7506e05d 100644
--- a/widgets/misc/e-calendar-item.c
+++ b/widgets/misc/e-calendar-item.c
@@ -35,6 +35,7 @@
#include <glib/gi18n.h>
#include <libedataserver/e-data-server-util.h>
#include <e-util/e-util.h>
+#include <e-util/e-extensible.h>
static const gint e_calendar_item_days_in_month[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
@@ -228,7 +229,9 @@ enum {
static guint e_calendar_item_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (ECalendarItem, e_calendar_item, GNOME_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_CODE (
+ ECalendarItem, e_calendar_item, GNOME_TYPE_CANVAS_ITEM,
+ G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL))
static void
e_calendar_item_class_init (ECalendarItemClass *class)
@@ -844,6 +847,8 @@ e_calendar_item_realize (GnomeCanvasItem *item)
calitem = E_CALENDAR_ITEM (item);
e_calendar_item_style_set (GTK_WIDGET(item->canvas), calitem);
+
+ e_extensible_load_extensions (E_EXTENSIBLE (calitem));
}
static void
diff --git a/widgets/misc/e-calendar-item.h b/widgets/misc/e-calendar-item.h
index 6a3b74fccb..4aab58ea2e 100644
--- a/widgets/misc/e-calendar-item.h
+++ b/widgets/misc/e-calendar-item.h
@@ -109,12 +109,24 @@ typedef void (*ECalendarItemStyleCallback) (ECalendarItem *calitem,
typedef struct tm (*ECalendarItemGetTimeCallback) (ECalendarItem *calitem,
gpointer data);
-#define E_CALENDAR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
- e_calendar_item_get_type (), ECalendarItem))
-#define E_CALENDAR_ITEM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k),\
- e_calendar_item_get_type ()))
-#define E_IS_CALENDAR_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
- e_calendar_item_get_type ()))
+/* Standard GObject macros */
+#define E_TYPE_CALENDAR_ITEM \
+ (e_calendar_item_get_type ())
+#define E_CALENDAR_ITEM(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_CALENDAR_ITEM, ECalendarItem))
+#define E_CALENDAR_ITEM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_CALENDAR_ITEM, ECalendarItemClass))
+#define E_IS_CALENDAR_ITEM(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_CALENDAR_ITEM))
+#define E_IS_CALENDAR_ITEM_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_CALENDAR_ITEM))
+#define E_CALENDAR_ITEM_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_CALENDAR_ITEM, ECalendarItemClass))
struct _ECalendarItem
{
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index db63ffaaf8..03c8f2fd47 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -41,6 +41,7 @@
#include <libedataserver/e-data-server-util.h>
#include <e-util/e-util.h>
#include <e-util/e-binding.h>
+#include <e-util/e-extensible.h>
#include "e-calendar.h"
#define E_DATE_EDIT_GET_PRIVATE(obj) \
@@ -205,9 +206,12 @@ static gboolean e_date_edit_set_time_internal (EDateEdit *dedit,
gint hour,
gint minute);
-static gpointer parent_class;
static gint signals[LAST_SIGNAL];
+G_DEFINE_TYPE_WITH_CODE (
+ EDateEdit, e_date_edit, GTK_TYPE_HBOX,
+ G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL))
+
static void
date_edit_set_property (GObject *object,
guint property_id,
@@ -334,16 +338,15 @@ date_edit_dispose (GObject *object)
}
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_date_edit_parent_class)->dispose (object);
}
static void
-date_edit_class_init (EDateEditClass *class)
+e_date_edit_class_init (EDateEditClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EDateEditPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -448,7 +451,7 @@ date_edit_class_init (EDateEditClass *class)
}
static void
-date_edit_init (EDateEdit *dedit)
+e_date_edit_init (EDateEdit *dedit)
{
dedit->priv = E_DATE_EDIT_GET_PRIVATE (dedit);
@@ -476,32 +479,8 @@ date_edit_init (EDateEdit *dedit)
/* Set it to the current time. */
e_date_edit_set_time (dedit, 0);
-}
-
-GType
-e_date_edit_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EDateEditClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) date_edit_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EDateEdit),
- 0, /* n_preallocs */
- (GInstanceInitFunc) date_edit_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GTK_TYPE_HBOX, "EDateEdit", &type_info, 0);
- }
- return type;
+ e_extensible_load_extensions (E_EXTENSIBLE (dedit));
}
/**
diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c
index f40dee180b..8fa4fcf85f 100644
--- a/widgets/misc/e-preferences-window.c
+++ b/widgets/misc/e-preferences-window.c
@@ -33,11 +33,17 @@
struct _EPreferencesWindowPrivate {
GtkWidget *icon_view;
+ GtkWidget *scroll;
GtkWidget *notebook;
GHashTable *index;
+
+ GtkListStore *store;
+ GtkTreeModelFilter *filter;
+ const char *filter_view;
};
enum {
+ COLUMN_ID, /* G_TYPE_STRING */
COLUMN_TEXT, /* G_TYPE_STRING */
COLUMN_PIXBUF, /* GDK_TYPE_PIXBUF */
COLUMN_PAGE, /* G_TYPE_INT */
@@ -102,7 +108,7 @@ preferences_window_selection_changed_cb (EPreferencesWindow *window)
if (list == NULL)
return;
- model = gtk_icon_view_get_model (icon_view);
+ model = window->priv->store;
gtk_tree_model_get_iter (model, &iter, list->data);
gtk_tree_model_get (model, &iter, COLUMN_PAGE, &page, -1);
@@ -190,6 +196,40 @@ preferences_window_class_init (EPreferencesWindowClass *class)
widget_class->show = preferences_window_show;
}
+static gboolean
+filter_view (GtkTreeModel *model,
+ GtkTreeIter *iter,
+ gpointer data)
+{
+ EPreferencesWindow *window = (EPreferencesWindow *)data;
+ gchar *str;
+ gboolean visible = FALSE;
+
+ if (!window->priv->filter_view)
+ return TRUE;
+
+ gtk_tree_model_get (model, iter, COLUMN_ID, &str, -1);
+ if (strncmp(window->priv->filter_view, "mail", 4) == 0) {
+ /* Show everything except calendar */
+ if (str && (strncmp (str, "cal", 3) == 0))
+ visible = FALSE;
+ else
+ visible = TRUE;
+ } else if (strncmp(window->priv->filter_view, "cal", 3) == 0) {
+ /* Show only calendar and nothing else */
+ if (str && (strncmp (str, "cal", 3) != 0))
+ visible = FALSE;
+ else
+ visible = TRUE;
+
+ } else /* In any other case, show everything */
+ visible = TRUE;
+
+ g_free (str);
+
+ return visible;
+}
+
static void
preferences_window_init (EPreferencesWindow *window)
{
@@ -209,11 +249,16 @@ preferences_window_init (EPreferencesWindow *window)
window->priv = E_PREFERENCES_WINDOW_GET_PRIVATE (window);
window->priv->index = index;
+ window->priv->filter_view = NULL;
store = gtk_list_store_new (
- 4, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT);
+ 5, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT);
gtk_tree_sortable_set_sort_column_id (
GTK_TREE_SORTABLE (store), COLUMN_SORT, GTK_SORT_ASCENDING);
+ window->priv->store = store;
+
+ window->priv->filter = (GtkTreeModelFilter *)gtk_tree_model_filter_new ((GtkTreeModel *)store, NULL);
+ gtk_tree_model_filter_set_visible_func (window->priv->filter, filter_view, window, NULL);
title = _("Evolution Preferences");
gtk_window_set_title (GTK_WINDOW (window), title);
@@ -243,11 +288,12 @@ preferences_window_init (EPreferencesWindow *window)
gtk_scrolled_window_set_shadow_type (
GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, TRUE, 0);
+ window->priv->scroll = widget;
gtk_widget_show (widget);
-
+
container = widget;
- widget = gtk_icon_view_new_with_model (GTK_TREE_MODEL (store));
+ widget = gtk_icon_view_new_with_model (GTK_TREE_MODEL (window->priv->filter));
gtk_icon_view_set_columns (GTK_ICON_VIEW (widget), 1);
gtk_icon_view_set_text_column (GTK_ICON_VIEW (widget), COLUMN_TEXT);
gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (widget), COLUMN_PIXBUF);
@@ -359,13 +405,14 @@ e_preferences_window_add_page (EPreferencesWindow *window,
notebook = GTK_NOTEBOOK (window->priv->notebook);
page = gtk_notebook_get_n_pages (notebook);
- model = gtk_icon_view_get_model (icon_view);
+ model = window->priv->store;
pixbuf = preferences_window_load_pixbuf (icon_name);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (
GTK_LIST_STORE (model), &iter,
+ COLUMN_ID, page_name,
COLUMN_TEXT, caption, COLUMN_PIXBUF, pixbuf,
COLUMN_PAGE, page, COLUMN_SORT, sort_order, -1);
@@ -405,3 +452,35 @@ e_preferences_window_show_page (EPreferencesWindow *window,
gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0);
gtk_tree_path_free (path);
}
+
+void
+e_preferences_window_filter_page (EPreferencesWindow *window,
+ const gchar *page_name)
+{
+ GtkTreeRowReference *reference;
+ GtkIconView *icon_view;
+ GtkTreePath *path;
+
+ g_return_if_fail (E_IS_PREFERENCES_WINDOW (window));
+ g_return_if_fail (page_name != NULL);
+
+ icon_view = GTK_ICON_VIEW (window->priv->icon_view);
+ reference = g_hash_table_lookup (window->priv->index, page_name);
+ g_return_if_fail (reference != NULL);
+
+ path = gtk_tree_row_reference_get_path (reference);
+ gtk_icon_view_select_path (icon_view, path);
+ gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0);
+ gtk_tree_path_free (path);
+
+ window->priv->filter_view = page_name;
+ gtk_tree_model_filter_refilter (window->priv->filter);
+
+ /* XXX: We need a better solution to hide the icon view when
+ * there is just one entry */
+ if (strncmp(page_name, "cal", 3) == 0) {
+ gtk_widget_hide (window->priv->scroll);
+ } else
+ gtk_widget_show (window->priv->scroll);
+}
+
diff --git a/widgets/misc/e-preferences-window.h b/widgets/misc/e-preferences-window.h
index 4944a89e58..97f0da85e2 100644
--- a/widgets/misc/e-preferences-window.h
+++ b/widgets/misc/e-preferences-window.h
@@ -68,6 +68,8 @@ void e_preferences_window_add_page (EPreferencesWindow *window,
gint sort_order);
void e_preferences_window_show_page (EPreferencesWindow *window,
const gchar *page_name);
+void e_preferences_window_filter_page (EPreferencesWindow *window,
+ const gchar *page_name);
G_END_DECLS
diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c
index e9fc71d7ca..beb865b98b 100644
--- a/widgets/misc/e-web-view.c
+++ b/widgets/misc/e-web-view.c
@@ -28,9 +28,10 @@
#include <camel/camel-internet-address.h>
#include <camel/camel-url.h>
-#include "e-util/e-util.h"
-#include "e-util/e-binding.h"
-#include "e-util/e-plugin-ui.h"
+#include <e-util/e-util.h>
+#include <e-util/e-binding.h>
+#include <e-util/e-extensible.h>
+#include <e-util/e-plugin-ui.h>
#include "e-popup-action.h"
#include "e-selectable.h"
@@ -75,6 +76,9 @@ enum {
PROP_DISABLE_PRINTING,
PROP_DISABLE_SAVE_TO_DISK,
PROP_EDITABLE,
+ PROP_INLINE_SPELLING,
+ PROP_MAGIC_LINKS,
+ PROP_MAGIC_SMILEYS,
PROP_OPEN_PROXY,
PROP_PASTE_TARGET_LIST,
PROP_PRINT_PROXY,
@@ -118,6 +122,14 @@ static const gchar *ui =
" </popup>"
"</ui>";
+/* Forward Declarations */
+static void e_web_view_selectable_init (ESelectableInterface *interface);
+
+G_DEFINE_TYPE_WITH_CODE (
+ EWebView, e_web_view, GTK_TYPE_HTML,
+ G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL)
+ G_IMPLEMENT_INTERFACE (E_TYPE_SELECTABLE, e_web_view_selectable_init))
+
static EWebViewRequest *
web_view_request_new (EWebView *web_view,
const gchar *uri,
@@ -503,6 +515,24 @@ web_view_set_property (GObject *object,
g_value_get_boolean (value));
return;
+ case PROP_INLINE_SPELLING:
+ e_web_view_set_inline_spelling (
+ E_WEB_VIEW (object),
+ g_value_get_boolean (value));
+ return;
+
+ case PROP_MAGIC_LINKS:
+ e_web_view_set_magic_links (
+ E_WEB_VIEW (object),
+ g_value_get_boolean (value));
+ return;
+
+ case PROP_MAGIC_SMILEYS:
+ e_web_view_set_magic_smileys (
+ E_WEB_VIEW (object),
+ g_value_get_boolean (value));
+ return;
+
case PROP_OPEN_PROXY:
e_web_view_set_open_proxy (
E_WEB_VIEW (object),
@@ -574,6 +604,24 @@ web_view_get_property (GObject *object,
E_WEB_VIEW (object)));
return;
+ case PROP_INLINE_SPELLING:
+ g_value_set_boolean (
+ value, e_web_view_get_inline_spelling (
+ E_WEB_VIEW (object)));
+ return;
+
+ case PROP_MAGIC_LINKS:
+ g_value_set_boolean (
+ value, e_web_view_get_magic_links (
+ E_WEB_VIEW (object)));
+ return;
+
+ case PROP_MAGIC_SMILEYS:
+ g_value_set_boolean (
+ value, e_web_view_get_magic_smileys (
+ E_WEB_VIEW (object)));
+ return;
+
case PROP_OPEN_PROXY:
g_value_set_object (
value, e_web_view_get_open_proxy (
@@ -809,6 +857,16 @@ web_view_extract_uri (EWebView *web_view,
}
static void
+web_view_load_string (EWebView *web_view,
+ const gchar *string)
+{
+ if (string != NULL && *string != '\0')
+ gtk_html_load_from_string (GTK_HTML (web_view), string, -1);
+ else
+ e_web_view_clear (web_view);
+}
+
+static void
web_view_copy_clipboard (EWebView *web_view)
{
gtk_html_command (GTK_HTML (web_view), "copy");
@@ -1004,7 +1062,7 @@ web_view_selectable_select_all (ESelectable *selectable)
}
static void
-web_view_class_init (EWebViewClass *class)
+e_web_view_class_init (EWebViewClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
@@ -1030,6 +1088,7 @@ web_view_class_init (EWebViewClass *class)
html_class->iframe_created = web_view_iframe_created;
class->extract_uri = web_view_extract_uri;
+ class->load_string = web_view_load_string;
class->copy_clipboard = web_view_copy_clipboard;
class->cut_clipboard = web_view_cut_clipboard;
class->paste_clipboard = web_view_paste_clipboard;
@@ -1072,7 +1131,8 @@ web_view_class_init (EWebViewClass *class)
"Disable Printing",
NULL,
FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
g_object_class_install_property (
object_class,
@@ -1082,7 +1142,8 @@ web_view_class_init (EWebViewClass *class)
"Disable Save-to-Disk",
NULL,
FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
#endif
g_object_class_install_property (
@@ -1097,6 +1158,36 @@ web_view_class_init (EWebViewClass *class)
g_object_class_install_property (
object_class,
+ PROP_INLINE_SPELLING,
+ g_param_spec_boolean (
+ "inline-spelling",
+ "Inline Spelling",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_MAGIC_LINKS,
+ g_param_spec_boolean (
+ "magic-links",
+ "Magic Links",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_MAGIC_SMILEYS,
+ g_param_spec_boolean (
+ "magic-smileys",
+ "Magic Smileys",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
PROP_OPEN_PROXY,
g_param_spec_object (
"open-proxy",
@@ -1209,7 +1300,7 @@ web_view_class_init (EWebViewClass *class)
}
static void
-web_view_selectable_init (ESelectableInterface *interface)
+e_web_view_selectable_init (ESelectableInterface *interface)
{
interface->update_actions = web_view_selectable_update_actions;
interface->cut_clipboard = web_view_selectable_cut_clipboard;
@@ -1219,7 +1310,7 @@ web_view_selectable_init (ESelectableInterface *interface)
}
static void
-web_view_init (EWebView *web_view)
+e_web_view_init (EWebView *web_view)
{
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
@@ -1335,41 +1426,8 @@ web_view_init (EWebView *web_view)
id = "org.gnome.evolution.webview";
e_plugin_ui_register_manager (ui_manager, id, web_view);
e_plugin_ui_enable_manager (ui_manager, id);
-}
-
-GType
-e_web_view_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EWebViewClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) web_view_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EWebView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) web_view_init,
- NULL /* value_table */
- };
-
- static const GInterfaceInfo selectable_info = {
- (GInterfaceInitFunc) web_view_selectable_init,
- (GInterfaceFinalizeFunc) NULL,
- NULL /* interface_data */
- };
-
- type = g_type_register_static (
- GTK_TYPE_HTML, "EWebView", &type_info, 0);
-
- g_type_add_interface_static (
- type, E_TYPE_SELECTABLE, &selectable_info);
- }
- return type;
+ e_extensible_load_extensions (E_EXTENSIBLE (web_view));
}
GtkWidget *
@@ -1390,12 +1448,14 @@ void
e_web_view_load_string (EWebView *web_view,
const gchar *string)
{
+ EWebViewClass *class;
+
g_return_if_fail (E_IS_WEB_VIEW (web_view));
- if (string != NULL && *string != '\0')
- gtk_html_load_from_string (GTK_HTML (web_view), string, -1);
- else
- e_web_view_clear (web_view);
+ class = E_WEB_VIEW_GET_CLASS (web_view);
+ g_return_if_fail (class->load_string != NULL);
+
+ class->load_string (web_view, string);
}
gboolean
@@ -1522,6 +1582,84 @@ e_web_view_set_editable (EWebView *web_view,
g_object_notify (G_OBJECT (web_view), "editable");
}
+gboolean
+e_web_view_get_inline_spelling (EWebView *web_view)
+{
+ /* XXX This is just here to maintain symmetry
+ * with e_web_view_set_inline_spelling(). */
+
+ g_return_val_if_fail (E_IS_WEB_VIEW (web_view), FALSE);
+
+ return gtk_html_get_inline_spelling (GTK_HTML (web_view));
+}
+
+void
+e_web_view_set_inline_spelling (EWebView *web_view,
+ gboolean inline_spelling)
+{
+ /* XXX GtkHTML does not utilize GObject properties as well
+ * as it could. This just wraps gtk_html_set_inline_spelling()
+ * so we get a "notify::inline-spelling" signal. */
+
+ g_return_if_fail (E_IS_WEB_VIEW (web_view));
+
+ gtk_html_set_inline_spelling (GTK_HTML (web_view), inline_spelling);
+
+ g_object_notify (G_OBJECT (web_view), "inline-spelling");
+}
+
+gboolean
+e_web_view_get_magic_links (EWebView *web_view)
+{
+ /* XXX This is just here to maintain symmetry
+ * with e_web_view_set_magic_links(). */
+
+ g_return_val_if_fail (E_IS_WEB_VIEW (web_view), FALSE);
+
+ return gtk_html_get_magic_links (GTK_HTML (web_view));
+}
+
+void
+e_web_view_set_magic_links (EWebView *web_view,
+ gboolean magic_links)
+{
+ /* XXX GtkHTML does not utilize GObject properties as well
+ * as it could. This just wraps gtk_html_set_magic_links()
+ * so we can get a "notify::magic-links" signal. */
+
+ g_return_if_fail (E_IS_WEB_VIEW (web_view));
+
+ gtk_html_set_magic_links (GTK_HTML (web_view), magic_links);
+
+ g_object_notify (G_OBJECT (web_view), "magic-links");
+}
+
+gboolean
+e_web_view_get_magic_smileys (EWebView *web_view)
+{
+ /* XXX This is just here to maintain symmetry
+ * with e_web_view_set_magic_smileys(). */
+
+ g_return_val_if_fail (E_IS_WEB_VIEW (web_view), FALSE);
+
+ return gtk_html_get_magic_smileys (GTK_HTML (web_view));
+}
+
+void
+e_web_view_set_magic_smileys (EWebView *web_view,
+ gboolean magic_smileys)
+{
+ /* XXX GtkHTML does not utilize GObject properties as well
+ * as it could. This just wraps gtk_html_set_magic_smileys()
+ * so we can get a "notify::magic-smileys" signal. */
+
+ g_return_if_fail (E_IS_WEB_VIEW (web_view));
+
+ gtk_html_set_magic_smileys (GTK_HTML (web_view), magic_smileys);
+
+ g_object_notify (G_OBJECT (web_view), "magic-smileys");
+}
+
const gchar *
e_web_view_get_selected_uri (EWebView *web_view)
{
diff --git a/widgets/misc/e-web-view.h b/widgets/misc/e-web-view.h
index 788eadb1b7..7d8eb4c8d0 100644
--- a/widgets/misc/e-web-view.h
+++ b/widgets/misc/e-web-view.h
@@ -69,6 +69,8 @@ struct _EWebViewClass {
gchar * (*extract_uri) (EWebView *web_view,
GdkEventButton *event,
GtkHTML *frame);
+ void (*load_string) (EWebView *web_view,
+ const gchar *load_string);
/* Signals */
void (*copy_clipboard) (EWebView *web_view);
@@ -106,6 +108,15 @@ void e_web_view_set_disable_save_to_disk
gboolean e_web_view_get_editable (EWebView *web_view);
void e_web_view_set_editable (EWebView *web_view,
gboolean editable);
+gboolean e_web_view_get_inline_spelling (EWebView *web_view);
+void e_web_view_set_inline_spelling (EWebView *web_view,
+ gboolean inline_spelling);
+gboolean e_web_view_get_magic_links (EWebView *web_view);
+void e_web_view_set_magic_links (EWebView *web_view,
+ gboolean magic_links);
+gboolean e_web_view_get_magic_smileys (EWebView *web_view);
+void e_web_view_set_magic_smileys (EWebView *web_view,
+ gboolean magic_smileys);
const gchar * e_web_view_get_selected_uri (EWebView *web_view);
void e_web_view_set_selected_uri (EWebView *web_view,
const gchar *selected_uri);
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index f9d3441d6f..f0509e4590 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -1421,7 +1421,7 @@ ect_print_height (ECellView *ecell_view, GtkPrintContext *context,
* should be 16 + 4.
* Height of some special font is much higher than others,
* such as Arabic. So leave some more margin for cell.
-` */
+ */
return 16 + 8;
}