[evolution/wip/webkit-composer: 231/372] Add e_mail_signature_editor_get_editor().



commit 0f43fda43a49dbf6f3235b499f1509573926e424
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 2b2eddf..48bce4c 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -2580,6 +2580,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 db35e2b..efcd60b 100644
--- a/e-util/e-mail-signature-editor.c
+++ b/e-util/e-mail-signature-editor.c
@@ -142,7 +142,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);
 
@@ -184,7 +184,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));
@@ -484,7 +485,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);
@@ -673,6 +674,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)
 {
@@ -775,7 +784,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)) {
@@ -837,6 +847,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 fc89856..f8f6515 100644
--- a/e-util/e-mail-signature-editor.h
+++ b/e-util/e-mail-signature-editor.h
@@ -66,6 +66,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 5729c61..e2cbc15 100644
--- a/e-util/e-mail-signature-manager.c
+++ b/e-util/e-mail-signature-manager.c
@@ -400,17 +400,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]