[evolution/webkit-composer: 165/231] Add e_mail_signature_editor_get_editor().
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/webkit-composer: 165/231] Add e_mail_signature_editor_get_editor().
- Date: Fri, 13 Sep 2013 14:19:51 +0000 (UTC)
commit c7d7299d9ea67fd85d63a3ef725a34d83635ffb6
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Feb 8 11:17:02 2013 -0500
Add e_mail_signature_editor_get_editor().
This is a transitional function which for the moment just calls
e_editor_window_get_editor().
I think we need to get rid of EEditorWindow and just let EMsgComposer
and EMailSignatureEditor pack their own widgets. EEditorWindow assumes
too much about the packing arrangement of its widgets, which just makes
life difficult for subclasses.
.../evolution-util/evolution-util-sections.txt | 1 +
e-util/e-mail-signature-editor.c | 21 +++++++++++++++----
e-util/e-mail-signature-editor.h | 2 +
e-util/e-mail-signature-manager.c | 19 +++++++++++------
4 files changed, 31 insertions(+), 12 deletions(-)
---
diff --git a/doc/reference/evolution-util/evolution-util-sections.txt
b/doc/reference/evolution-util/evolution-util-sections.txt
index cef8ab6..75682c6 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -2578,6 +2578,7 @@ EMailSignatureComboBoxPrivate
<TITLE>EMailSignatureEditor</TITLE>
EMailSignatureEditor
e_mail_signature_editor_new
+e_mail_signature_editor_get_editor
e_mail_signature_editor_get_focus_tracker
e_mail_signature_editor_get_registry
e_mail_signature_editor_get_source
diff --git a/e-util/e-mail-signature-editor.c b/e-util/e-mail-signature-editor.c
index 3977dc9..2b67c8d 100644
--- a/e-util/e-mail-signature-editor.c
+++ b/e-util/e-mail-signature-editor.c
@@ -143,7 +143,7 @@ mail_signature_editor_loaded_cb (GObject *object,
mime_type = e_source_mail_signature_get_mime_type (extension);
is_html = (g_strcmp0 (mime_type, "text/html") == 0);
- editor = e_editor_window_get_editor (E_EDITOR_WINDOW (object));
+ editor = e_mail_signature_editor_get_editor (window);
editor_widget = e_editor_get_editor_widget (editor);
e_editor_widget_set_html_mode (editor_widget, is_html);
@@ -185,7 +185,8 @@ action_close_cb (GtkAction *action,
original_name = window->priv->original_name;
signature_name = gtk_entry_get_text (GTK_ENTRY (window->priv->entry));
- editor = e_editor_window_get_editor (E_EDITOR_WINDOW (window));
+
+ editor = e_mail_signature_editor_get_editor (window);
editor_widget = e_editor_get_editor_widget (editor);
something_changed |= webkit_web_view_can_undo (WEBKIT_WEB_VIEW (editor_widget));
@@ -485,7 +486,7 @@ mail_signature_editor_constructed (GObject *object)
constructed (object);
window = E_MAIL_SIGNATURE_EDITOR (object);
- editor = e_editor_window_get_editor (E_EDITOR_WINDOW (window));
+ editor = e_mail_signature_editor_get_editor (window);
editor_widget = e_editor_get_editor_widget (editor);
ui_manager = e_editor_get_ui_manager (editor);
@@ -674,6 +675,14 @@ e_mail_signature_editor_new (ESourceRegistry *registry,
"source", source, NULL);
}
+EEditor *
+e_mail_signature_editor_get_editor (EMailSignatureEditor *editor)
+{
+ g_return_val_if_fail (E_IS_MAIL_SIGNATURE_EDITOR (editor), NULL);
+
+ return e_editor_window_get_editor (E_EDITOR_WINDOW (editor));
+}
+
EFocusTracker *
e_mail_signature_editor_get_focus_tracker (EMailSignatureEditor *editor)
{
@@ -776,7 +785,8 @@ e_mail_signature_editor_commit (EMailSignatureEditor *window,
registry = e_mail_signature_editor_get_registry (window);
source = e_mail_signature_editor_get_source (window);
- editor = e_editor_window_get_editor (E_EDITOR_WINDOW (window));
+
+ editor = e_mail_signature_editor_get_editor (window);
editor_widget = e_editor_get_editor_widget (editor);
if (e_editor_widget_get_html_mode (editor_widget)) {
@@ -838,6 +848,7 @@ e_mail_signature_editor_get_editor_widget (EMailSignatureEditor *window)
g_return_val_if_fail (E_IS_MAIL_SIGNATURE_EDITOR (window), NULL);
- editor = e_editor_window_get_editor (E_EDITOR_WINDOW (window));
+ editor = e_mail_signature_editor_get_editor (window);
+
return e_editor_get_editor_widget (editor);
}
diff --git a/e-util/e-mail-signature-editor.h b/e-util/e-mail-signature-editor.h
index 0b9cacc..653601f 100644
--- a/e-util/e-mail-signature-editor.h
+++ b/e-util/e-mail-signature-editor.h
@@ -67,6 +67,8 @@ GType e_mail_signature_editor_get_type
(void) G_GNUC_CONST;
GtkWidget * e_mail_signature_editor_new (ESourceRegistry *registry,
ESource *source);
+EEditor * e_mail_signature_editor_get_editor
+ (EMailSignatureEditor *editor);
EFocusTracker * e_mail_signature_editor_get_focus_tracker
(EMailSignatureEditor *editor);
ESourceRegistry *
diff --git a/e-util/e-mail-signature-manager.c b/e-util/e-mail-signature-manager.c
index 9447063..080d3ab 100644
--- a/e-util/e-mail-signature-manager.c
+++ b/e-util/e-mail-signature-manager.c
@@ -401,17 +401,22 @@ mail_signature_manager_constructed (GObject *object)
static void
mail_signature_manager_add_signature (EMailSignatureManager *manager)
{
- ESourceRegistry *registry;
+ EEditor *editor;
EEditorWidget *editor_widget;
- GtkWidget *editor;
+ ESourceRegistry *registry;
+ GtkWidget *widget;
registry = e_mail_signature_manager_get_registry (manager);
- editor = e_mail_signature_editor_new (registry, NULL);
- editor_widget = e_mail_signature_editor_get_editor_widget (
- E_MAIL_SIGNATURE_EDITOR (editor));
- e_editor_widget_set_html_mode (editor_widget, manager->priv->prefer_html);
- mail_signature_manager_emit_editor_created (manager, editor);
+ widget = e_mail_signature_editor_new (registry, NULL);
+
+ editor = e_mail_signature_editor_get_editor (
+ E_MAIL_SIGNATURE_EDITOR (widget));
+ editor_widget = e_editor_get_editor_widget (editor);
+ e_editor_widget_set_html_mode (
+ editor_widget, manager->priv->prefer_html);
+
+ mail_signature_manager_emit_editor_created (manager, widget);
gtk_widget_grab_focus (manager->priv->tree_view);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]