diff options
author | Milan Crha <mcrha@redhat.com> | 2012-05-10 23:59:21 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-05-10 23:59:21 +0800 |
commit | 3c6919a70c6653c9306900b97f2896fdeed3375a (patch) | |
tree | b604601324ba1caf3aad9bfe5e50486a63356877 | |
parent | 3c7cce96c0a51c908c5819479489003e5b88bf68 (diff) | |
download | gsoc2013-evolution-3c6919a70c6653c9306900b97f2896fdeed3375a.tar.gz gsoc2013-evolution-3c6919a70c6653c9306900b97f2896fdeed3375a.tar.zst gsoc2013-evolution-3c6919a70c6653c9306900b97f2896fdeed3375a.zip |
Spell checking for 'Summary' in Event/Task/Memo editors
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 13 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.ui | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-page.c | 22 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-page.ui | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-editor.c | 58 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 17 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.ui | 2 |
7 files changed, 84 insertions, 32 deletions
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 28f54be901..32f7edd07e 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -50,6 +50,7 @@ #include <misc/e-dateedit.h> #include <misc/e-send-options.h> +#include <misc/e-spell-entry.h> #include <misc/e-buffer-tagger.h> #include "../e-alarm-list.h" @@ -2618,6 +2619,17 @@ get_widgets (EventPage *epage) gtk_entry_set_completion (GTK_ENTRY (priv->categories), completion); g_object_unref (completion); + if (priv->summary) { + EShellSettings *shell_settings; + + shell_settings = e_shell_get_shell_settings (shell); + + g_object_bind_property ( + shell_settings, "composer-inline-spelling", + priv->summary, "checking-enabled", + G_BINDING_SYNC_CREATE); + } + return (priv->summary && priv->location && priv->start_time @@ -3557,6 +3569,7 @@ event_page_construct (EventPage *epage, * GType before we load the GtkBuilder definition file. */ E_TYPE_DATE_EDIT; E_TYPE_TIMEZONE_ENTRY; + E_TYPE_SPELL_ENTRY; priv->builder = gtk_builder_new (); e_load_ui_builder_definition (priv->builder, "event-page.ui"); diff --git a/calendar/gui/dialogs/event-page.ui b/calendar/gui/dialogs/event-page.ui index 9377c836b8..c2e291f558 100644 --- a/calendar/gui/dialogs/event-page.ui +++ b/calendar/gui/dialogs/event-page.ui @@ -343,7 +343,7 @@ </packing> </child> <child> - <object class="GtkEntry" id="summary"> + <object class="ESpellEntry" id="summary"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="editable">True</property> diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 00bf1cc79b..dcc3c94e33 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -47,6 +47,7 @@ #include <e-util/e-util-private.h> #include <misc/e-dateedit.h> +#include <misc/e-spell-entry.h> #include <misc/e-buffer-tagger.h> #include <libemail-utils/e-account-utils.h> @@ -893,6 +894,22 @@ get_widgets (MemoPage *mpage) gtk_entry_set_completion (GTK_ENTRY (priv->categories), completion); g_object_unref (completion); + if (priv->summary_entry) { + EShell *shell; + EShellSettings *shell_settings; + CompEditor *editor; + + editor = comp_editor_page_get_editor (page); + shell = comp_editor_get_shell (editor); + shell_settings = e_shell_get_shell_settings (shell); + + g_object_bind_property ( + shell_settings, "composer-inline-spelling", + priv->summary_entry, "checking-enabled", + G_BINDING_SYNC_CREATE); + } + + return (priv->memo_content && priv->categories_btn && priv->categories @@ -1234,6 +1251,11 @@ memo_page_construct (MemoPage *mpage) editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (mpage)); flags = comp_editor_get_flags (editor); + /* Make sure our custom widget classes are registered with + * GType before we load the GtkBuilder definition file. */ + E_TYPE_DATE_EDIT; + E_TYPE_SPELL_ENTRY; + priv->builder = gtk_builder_new (); e_load_ui_builder_definition (priv->builder, "memo-page.ui"); diff --git a/calendar/gui/dialogs/memo-page.ui b/calendar/gui/dialogs/memo-page.ui index f10dec424d..d30aecf0d5 100644 --- a/calendar/gui/dialogs/memo-page.ui +++ b/calendar/gui/dialogs/memo-page.ui @@ -349,7 +349,7 @@ </packing> </child> <child> - <object class="GtkEntry" id="sum-entry"> + <object class="ESpellEntry" id="sum-entry"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="editable">True</property> diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 927913c898..378aea593a 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -147,6 +147,7 @@ task_editor_constructor (GType type, CompEditor *editor; CompEditorFlags flags; TaskEditorPrivate *priv; + GtkWidget *content_area; GtkActionGroup *action_group; ECalClient *client; gboolean is_assigned; @@ -160,10 +161,37 @@ task_editor_constructor (GType type, client = comp_editor_get_client (editor); flags = comp_editor_get_flags (editor); - action_group = comp_editor_get_action_group (editor, "coordinated"); + + priv->task_page = task_page_new (priv->model, editor); + comp_editor_append_page ( + editor, COMP_EDITOR_PAGE (priv->task_page), + _("Task"), TRUE); + + priv->task_details_window = gtk_dialog_new_with_buttons ( + _("Task Details"), GTK_WINDOW (object), GTK_DIALOG_MODAL, + GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); + g_signal_connect ( + priv->task_details_window, "response", + G_CALLBACK (gtk_widget_hide), NULL); + g_signal_connect ( + priv->task_details_window, "delete-event", + G_CALLBACK (gtk_widget_hide), NULL); + + priv->task_details_page = task_details_page_new (editor); + content_area = gtk_dialog_get_content_area ( + GTK_DIALOG (priv->task_details_window)); + gtk_container_add ( + GTK_CONTAINER (content_area), + comp_editor_page_get_widget ( + (CompEditorPage *) priv->task_details_page)); + gtk_widget_show_all ( + gtk_bin_get_child (GTK_BIN (priv->task_details_window))); + comp_editor_append_page ( + editor, COMP_EDITOR_PAGE (priv->task_details_page), NULL, FALSE); is_assigned = flags & COMP_EDITOR_IS_ASSIGNED; + action_group = comp_editor_get_action_group (editor, "coordinated"); task_page_set_assignment (priv->task_page, is_assigned); gtk_action_group_set_visible (action_group, is_assigned); @@ -305,7 +333,6 @@ task_editor_init (TaskEditor *te) CompEditor *editor = COMP_EDITOR (te); GtkUIManager *ui_manager; GtkActionGroup *action_group; - GtkWidget *content_area; GtkAction *action; const gchar *id; GError *error = NULL; @@ -315,33 +342,6 @@ task_editor_init (TaskEditor *te) te->priv->assignment_shown = TRUE; te->priv->updating = FALSE; - te->priv->task_page = task_page_new (te->priv->model, editor); - comp_editor_append_page ( - editor, COMP_EDITOR_PAGE (te->priv->task_page), - _("Task"), TRUE); - - te->priv->task_details_window = gtk_dialog_new_with_buttons ( - _("Task Details"), GTK_WINDOW (te), GTK_DIALOG_MODAL, - GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); - g_signal_connect ( - te->priv->task_details_window, "response", - G_CALLBACK (gtk_widget_hide), NULL); - g_signal_connect ( - te->priv->task_details_window, "delete-event", - G_CALLBACK (gtk_widget_hide), NULL); - - te->priv->task_details_page = task_details_page_new (editor); - content_area = gtk_dialog_get_content_area ( - GTK_DIALOG (te->priv->task_details_window)); - gtk_container_add ( - GTK_CONTAINER (content_area), - comp_editor_page_get_widget ( - (CompEditorPage *) te->priv->task_details_page)); - gtk_widget_show_all ( - gtk_bin_get_child (GTK_BIN (te->priv->task_details_window))); - comp_editor_append_page ( - editor, COMP_EDITOR_PAGE (te->priv->task_details_page), NULL, FALSE); - action_group = comp_editor_get_action_group (editor, "individual"); gtk_action_group_add_actions ( action_group, task_entries, diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 27be3bd6bd..8b2bd1f98c 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -39,6 +39,7 @@ #include <libedataserverui/e-source-combo-box.h> #include <misc/e-dateedit.h> +#include <misc/e-spell-entry.h> #include <misc/e-buffer-tagger.h> #include <e-util/e-categories-config.h> @@ -1516,6 +1517,21 @@ get_widgets (TaskPage *tpage) gtk_entry_set_completion (GTK_ENTRY (priv->categories), completion); g_object_unref (completion); + if (priv->summary) { + EShell *shell; + EShellSettings *shell_settings; + CompEditor *editor; + + editor = comp_editor_page_get_editor (page); + shell = comp_editor_get_shell (editor); + shell_settings = e_shell_get_shell_settings (shell); + + g_object_bind_property ( + shell_settings, "composer-inline-spelling", + priv->summary, "checking-enabled", + G_BINDING_SYNC_CREATE); + } + return (priv->summary && priv->summary_label && priv->due_date @@ -2143,6 +2159,7 @@ task_page_construct (TaskPage *tpage, E_TYPE_DATE_EDIT; E_TYPE_TIMEZONE_ENTRY; E_TYPE_SOURCE_COMBO_BOX; + E_TYPE_SPELL_ENTRY; priv->builder = gtk_builder_new (); e_load_ui_builder_definition (priv->builder, "task-page.ui"); diff --git a/calendar/gui/dialogs/task-page.ui b/calendar/gui/dialogs/task-page.ui index 32faa1fcc5..f3f85f5177 100644 --- a/calendar/gui/dialogs/task-page.ui +++ b/calendar/gui/dialogs/task-page.ui @@ -254,7 +254,7 @@ </packing> </child> <child> - <object class="GtkEntry" id="summary"> + <object class="ESpellEntry" id="summary"> <property name="visible">True</property> <property name="can_focus">True</property> </object> |