[evolution/wip/webkit-composer: 674/966] Add e_mail_signature_editor_get_editor().



commit 69c75fde5632a846ec36e2d3e85871db9eb03075
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.

 e-util/e-mail-signature-editor.c  |   15 +++++++++------
 e-util/e-mail-signature-manager.c |   17 ++++++++++-------
 2 files changed, 19 insertions(+), 13 deletions(-)
---
diff --git a/e-util/e-mail-signature-editor.c b/e-util/e-mail-signature-editor.c
index 22c52e5..e37515c 100644
--- a/e-util/e-mail-signature-editor.c
+++ b/e-util/e-mail-signature-editor.c
@@ -144,7 +144,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);
 
@@ -186,7 +186,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));
@@ -499,7 +500,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);
@@ -697,7 +698,7 @@ e_mail_signature_editor_get_editor (EMailSignatureEditor *editor)
 {
        g_return_val_if_fail (E_IS_MAIL_SIGNATURE_EDITOR (editor), NULL);
 
-       return editor->priv->editor;
+       return e_editor_window_get_editor (E_EDITOR_WINDOW (editor));
 }
 
 EFocusTracker *
@@ -802,7 +803,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)) {
@@ -864,6 +866,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-manager.c b/e-util/e-mail-signature-manager.c
index 72a1128..26c5ff1 100644
--- a/e-util/e-mail-signature-manager.c
+++ b/e-util/e-mail-signature-manager.c
@@ -401,16 +401,19 @@ mail_signature_manager_add_signature (EMailSignatureManager *manager)
        EEditor *editor;
        EEditorWidget *editor_widget;
        ESourceRegistry *registry;
-       EEditorWidget *editor_widget;
-       GtkWidget *editor;
+       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]