[evolution/wip/webkit-composer: 538/966] Refactor EEditorDialog... classes



commit 98db56b3154a72d4879ca3f415fbbe45310242bb
Author: Dan Vrátil <dvratil redhat com>
Date:   Tue Aug 7 14:19:26 2012 +0200

    Refactor EEditorDialog... classes
    
    Move some common code to abstract class EEditorDialog and rename
    EEditorUrlPropertiesDialog to EEditorLinkDialog.

 e-util/Makefile.am                      |    6 +-
 e-util/e-editor-actions.c               |   16 +-
 e-util/e-editor-dialog.c                |   85 +++++++
 e-util/e-editor-dialog.h                |   13 +
 e-util/e-editor-find-dialog.c           |  161 +------------
 e-util/e-editor-find-dialog.h           |   22 --
 e-util/e-editor-link-dialog.c           |  208 +++++++----------
 e-util/e-editor-link-dialog.h           |   13 +
 e-util/e-editor-private.h               |    4 +-
 e-util/e-editor-replace-dialog.c        |  103 --------
 e-util/e-editor-replace-dialog.h        |   23 --
 e-util/e-editor-url-properties-dialog.c |  393 -------------------------------
 e-util/e-editor-url-properties-dialog.h |   70 ------
 e-util/e-util.h                         |    3 +-
 14 files changed, 211 insertions(+), 909 deletions(-)
---
diff --git a/e-util/Makefile.am b/e-util/Makefile.am
index 08b6a13..996c8fe 100644
--- a/e-util/Makefile.am
+++ b/e-util/Makefile.am
@@ -180,10 +180,11 @@ evolution_util_include_HEADERS =  \
        e-dialog-utils.h \
        e-dialog-widgets.h \
        e-editor-actions.h \
+       e-editor-dialog.h \
        e-editor-find-dialog.h \
+       e-editor-link-dialog.h \
        e-editor-replace-dialog.h \
        e-editor-selection.h \
-       e-editor-url-properties-dialog.h \
        e-editor-utils.h \
        e-editor-widget.h \
        e-editor-widgets.h \
@@ -443,11 +444,12 @@ libevolution_util_la_SOURCES = \
        e-dialog-utils.c \
        e-dialog-widgets.c \
        e-editor-actions.c \
+       e-editor-dialog.c \
        e-editor-find-dialog.c \
+       e-editor-link-dialog.c \
        e-editor-private.h \
        e-editor-replace-dialog.c \
        e-editor-selection.c \
-       e-editor-url-properties-dialog.c \
        e-editor-utils.c \
        e-editor-widget.c \
        e-editor.c \
diff --git a/e-util/e-editor-actions.c b/e-util/e-editor-actions.c
index b53db85..adb40e2 100644
--- a/e-util/e-editor-actions.c
+++ b/e-util/e-editor-actions.c
@@ -673,12 +673,12 @@ static void
 action_insert_link_cb (GtkAction *action,
                        EEditor *editor)
 {
-       if (editor->priv->url_properties_dialog == NULL) {
-               editor->priv->url_properties_dialog =
-                       e_editor_url_properties_dialog_new (editor);
+       if (editor->priv->link_dialog == NULL) {
+               editor->priv->link_dialog =
+                       e_editor_link_dialog_new (editor);
        }
 
-       gtk_window_present (GTK_WINDOW (editor->priv->url_properties_dialog));
+       gtk_window_present (GTK_WINDOW (editor->priv->link_dialog));
 }
 
 static void
@@ -969,12 +969,12 @@ static void
 action_properties_link_cb (GtkAction *action,
                            EEditor *editor)
 {
-       if (editor->priv->url_properties_dialog == NULL) {
-               editor->priv->url_properties_dialog =
-                       e_editor_url_properties_dialog_new (editor);
+       if (editor->priv->link_dialog == NULL) {
+               editor->priv->link_dialog =
+                       e_editor_link_dialog_new (editor);
        }
 
-       gtk_window_present (GTK_WINDOW (editor->priv->url_properties_dialog));
+       gtk_window_present (GTK_WINDOW (editor->priv->link_dialog));
 }
 
 static void
diff --git a/e-util/e-editor-dialog.c b/e-util/e-editor-dialog.c
index 3afd2ad..9013149 100644
--- a/e-util/e-editor-dialog.c
+++ b/e-util/e-editor-dialog.c
@@ -1,8 +1,11 @@
 /*
  * e-editor-dialog.h
  *
+<<<<<<< HEAD
  * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
  *
+=======
+>>>>>>> Refactor EEditorDialog... classes
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -24,6 +27,7 @@
 
 #include "e-editor-dialog.h"
 
+<<<<<<< HEAD
 #define E_EDITOR_DIALOG_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_EDITOR_DIALOG, EEditorDialogPrivate))
@@ -33,6 +37,15 @@ struct _EEditorDialogPrivate {
 
        GtkBox *button_box;
        GtkGrid *container;
+=======
+G_DEFINE_ABSTRACT_TYPE (
+       EEditorDialog,
+       e_editor_dialog,
+       GTK_TYPE_WINDOW);
+
+struct _EEditorDialogPrivate {
+       EEditor *editor;
+>>>>>>> Refactor EEditorDialog... classes
 };
 
 enum {
@@ -40,6 +53,7 @@ enum {
        PROP_EDITOR,
 };
 
+<<<<<<< HEAD
 G_DEFINE_ABSTRACT_TYPE (
        EEditorDialog,
        e_editor_dialog,
@@ -51,11 +65,24 @@ editor_dialog_set_editor (EEditorDialog *dialog,
 {
        dialog->priv->editor = g_object_ref (editor);
 
+=======
+static void
+editor_dialog_set_editor (EEditorDialog *dialog,
+                         EEditor *editor)
+{
+       dialog->priv->editor = g_object_ref (editor);
+
+       gtk_window_set_transient_for (
+               GTK_WINDOW (dialog),
+               GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (editor))));
+
+>>>>>>> Refactor EEditorDialog... classes
        g_object_notify (G_OBJECT (dialog), "editor");
 }
 
 static void
 editor_dialog_get_property (GObject *object,
+<<<<<<< HEAD
                             guint property_id,
                             GValue *value,
                             GParamSpec *pspec)
@@ -64,6 +91,15 @@ editor_dialog_get_property (GObject *object,
                case PROP_EDITOR:
                        g_value_set_object (
                                value,
+=======
+                           guint property_id,
+                           GValue *value,
+                           GParamSpec *pspec)
+{
+       switch (property_id) {
+               case PROP_EDITOR:
+                       g_value_set_object (value,
+>>>>>>> Refactor EEditorDialog... classes
                        e_editor_dialog_get_editor (E_EDITOR_DIALOG (object)));
                        return;
        }
@@ -73,9 +109,15 @@ editor_dialog_get_property (GObject *object,
 
 static void
 editor_dialog_set_property (GObject *object,
+<<<<<<< HEAD
                             guint property_id,
                             const GValue *value,
                             GParamSpec *pspec)
+=======
+                           guint property_id,
+                           const GValue *value,
+                           GParamSpec *pspec)
+>>>>>>> Refactor EEditorDialog... classes
 {
        switch (property_id) {
                case PROP_EDITOR:
@@ -89,6 +131,7 @@ editor_dialog_set_property (GObject *object,
 }
 
 static void
+<<<<<<< HEAD
 editor_dialog_constructed (GObject *object)
 {
        EEditorDialog *dialog = E_EDITOR_DIALOG (object);
@@ -121,6 +164,11 @@ editor_dialog_dispose (GObject *object)
        EEditorDialogPrivate *priv;
 
        priv = E_EDITOR_DIALOG_GET_PRIVATE (object);
+=======
+editor_dialog_dispose (GObject *object)
+{
+       EEditorDialogPrivate *priv = E_EDITOR_DIALOG (object)->priv;
+>>>>>>> Refactor EEditorDialog... classes
 
        g_clear_object (&priv->editor);
 
@@ -129,6 +177,7 @@ editor_dialog_dispose (GObject *object)
 }
 
 static void
+<<<<<<< HEAD
 e_editor_dialog_class_init (EEditorDialogClass *class)
 {
        GObjectClass *object_class;
@@ -144,21 +193,42 @@ e_editor_dialog_class_init (EEditorDialogClass *class)
 
        widget_class = GTK_WIDGET_CLASS (class);
        widget_class->show = editor_dialog_show;
+=======
+e_editor_dialog_class_init (EEditorDialogClass *klass)
+{
+       GObjectClass *object_class;
+
+       g_type_class_peek_parent (klass);
+       g_type_class_add_private (klass, sizeof (EEditorDialogPrivate));
+
+       object_class = G_OBJECT_CLASS (klass);
+       object_class->get_property = editor_dialog_get_property;
+       object_class->set_property = editor_dialog_set_property;
+       object_class->dispose = editor_dialog_dispose;
+>>>>>>> Refactor EEditorDialog... classes
 
        g_object_class_install_property (
                object_class,
                PROP_EDITOR,
                g_param_spec_object (
                        "editor",
+<<<<<<< HEAD
                        NULL,
                        NULL,
                        E_TYPE_EDITOR,
                        G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+=======
+                       NULL,
+                       NULL,
+                       E_TYPE_EDITOR,
+                       G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+>>>>>>> Refactor EEditorDialog... classes
 }
 
 static void
 e_editor_dialog_init (EEditorDialog *dialog)
 {
+<<<<<<< HEAD
        GtkBox *main_layout;
        GtkGrid *grid;
        GtkWidget *widget, *button_box;
@@ -189,11 +259,18 @@ e_editor_dialog_init (EEditorDialog *dialog)
        dialog->priv->button_box = GTK_BOX (button_box);
 
        gtk_widget_show_all (GTK_WIDGET (main_layout));
+=======
+       dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
+               dialog, E_TYPE_EDITOR_DIALOG, EEditorDialogPrivate);
+>>>>>>> Refactor EEditorDialog... classes
 
        g_object_set (
                G_OBJECT (dialog),
                "destroy-with-parent", TRUE,
+<<<<<<< HEAD
                "modal", TRUE,
+=======
+>>>>>>> Refactor EEditorDialog... classes
                "resizable", FALSE,
                "type-hint", GDK_WINDOW_TYPE_HINT_POPUP_MENU,
                "window-position", GTK_WIN_POS_CENTER_ON_PARENT,
@@ -205,6 +282,11 @@ e_editor_dialog_init (EEditorDialog *dialog)
                G_CALLBACK (gtk_widget_hide_on_delete), NULL);
 }
 
+<<<<<<< HEAD
+=======
+
+
+>>>>>>> Refactor EEditorDialog... classes
 EEditor *
 e_editor_dialog_get_editor (EEditorDialog *dialog)
 {
@@ -212,6 +294,7 @@ e_editor_dialog_get_editor (EEditorDialog *dialog)
 
        return dialog->priv->editor;
 }
+<<<<<<< HEAD
 
 GtkGrid *
 e_editor_dialog_get_container (EEditorDialog *dialog)
@@ -229,3 +312,5 @@ e_editor_dialog_get_button_box (EEditorDialog *dialog)
        return dialog->priv->button_box;
 }
 
+=======
+>>>>>>> Refactor EEditorDialog... classes
diff --git a/e-util/e-editor-dialog.h b/e-util/e-editor-dialog.h
index 9b6ff5b..cbc4e40 100644
--- a/e-util/e-editor-dialog.h
+++ b/e-util/e-editor-dialog.h
@@ -1,8 +1,11 @@
 /*
  * e-editor-dialog.h
  *
+<<<<<<< HEAD
  * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
  *
+=======
+>>>>>>> Refactor EEditorDialog... classes
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -55,6 +58,10 @@ typedef struct _EEditorDialogPrivate EEditorDialogPrivate;
 
 struct _EEditorDialog {
        GtkWindow parent;
+<<<<<<< HEAD
+=======
+
+>>>>>>> Refactor EEditorDialog... classes
        EEditorDialogPrivate *priv;
 };
 
@@ -62,10 +69,16 @@ struct _EEditorDialogClass {
        GtkWindowClass parent_class;
 };
 
+<<<<<<< HEAD
 GType          e_editor_dialog_get_type        (void) G_GNUC_CONST;
 EEditor *      e_editor_dialog_get_editor      (EEditorDialog *dialog);
 GtkBox *       e_editor_dialog_get_button_box  (EEditorDialog *dialog);
 GtkGrid *      e_editor_dialog_get_container   (EEditorDialog *dialog);
+=======
+GType          e_editor_dialog_get_type        (void);
+
+EEditor *      e_editor_dialog_get_editor      (EEditorDialog *dialog);
+>>>>>>> Refactor EEditorDialog... classes
 
 G_END_DECLS
 
diff --git a/e-util/e-editor-find-dialog.c b/e-util/e-editor-find-dialog.c
index a170c88..b8cb8a3 100644
--- a/e-util/e-editor-find-dialog.c
+++ b/e-util/e-editor-find-dialog.c
@@ -1,11 +1,6 @@
 /*
  * e-editor-find-dialog.h
  *
-<<<<<<< HEAD
- * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
- *
-=======
->>>>>>> Port Find dialog and search functionality
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -30,16 +25,10 @@
 #include <glib/gi18n-lib.h>
 #include <gdk/gdkkeysyms.h>
 
-<<<<<<< HEAD
-#define E_EDITOR_FIND_DIALOG_GET_PRIVATE(obj) \
-       (G_TYPE_INSTANCE_GET_PRIVATE \
-       ((obj), E_TYPE_EDITOR_FIND_DIALOG, EEditorFindDialogPrivate))
-=======
 G_DEFINE_TYPE (
        EEditorFindDialog,
        e_editor_find_dialog,
-       GTK_TYPE_WINDOW);
->>>>>>> Port Find dialog and search functionality
+       E_TYPE_EDITOR_DIALOG);
 
 struct _EEditorFindDialogPrivate {
        GtkWidget *entry;
@@ -48,28 +37,10 @@ struct _EEditorFindDialogPrivate {
        GtkWidget *wrap_search;
 
        GtkWidget *find_button;
-<<<<<<< HEAD
-
-       GtkWidget *result_label;
-};
-
-G_DEFINE_TYPE (
-       EEditorFindDialog,
-       e_editor_find_dialog,
-       E_TYPE_EDITOR_DIALOG);
-=======
        GtkWidget *cancel_button;
 
        GtkWidget *result_label;
-
-       EEditor *editor;
-};
-
-enum {
-       PROP_0,
-       PROP_EDITOR
 };
->>>>>>> Port Find dialog and search functionality
 
 static void
 reset_dialog (EEditorFindDialog *dialog)
@@ -91,16 +62,6 @@ editor_find_dialog_show (GtkWidget *widget)
 }
 
 static void
-<<<<<<< HEAD
-editor_find_dialog_find_cb (EEditorFindDialog *dialog)
-{
-       gboolean found;
-       EEditor *editor;
-       EEditorWidget *editor_widget;
-
-       editor = e_editor_dialog_get_editor (E_EDITOR_DIALOG (dialog));
-       editor_widget = e_editor_get_editor_widget (editor);
-=======
 editor_find_dialog_close_cb (EEditorFindDialog *dialog)
 {
        gtk_widget_hide (GTK_WIDGET (dialog));
@@ -110,10 +71,11 @@ static void
 editor_find_dialog_find_cb (EEditorFindDialog *dialog)
 {
        gboolean found;
+       EEditor *editor;
        EEditorWidget *editor_widget;
 
-       editor_widget = e_editor_get_editor_widget (dialog->priv->editor);
->>>>>>> Port Find dialog and search functionality
+       editor = e_editor_dialog_get_editor (E_EDITOR_DIALOG (dialog));
+       editor_widget = e_editor_get_editor_widget (editor);
        found = webkit_web_view_search_text (
                        WEBKIT_WEB_VIEW (editor_widget),
                        gtk_entry_get_text (
@@ -130,16 +92,6 @@ editor_find_dialog_find_cb (EEditorFindDialog *dialog)
 
        gtk_widget_set_sensitive (dialog->priv->find_button, found);
 
-<<<<<<< HEAD
-       /* We give focus to WebKit so that the selection is highlited.
-        * Without focus selection is not visible (at least with my default
-        * color scheme). The focus in fact is not given to WebKit, because
-        * this dialog is modal, but it satisfies it in a way that it paints
-        * the selection :) */
-       gtk_widget_grab_focus (GTK_WIDGET (editor_widget));
-
-=======
->>>>>>> Port Find dialog and search functionality
        if (!found) {
                gtk_label_set_label (
                        GTK_LABEL (dialog->priv->result_label),
@@ -150,13 +102,8 @@ editor_find_dialog_find_cb (EEditorFindDialog *dialog)
 
 static gboolean
 entry_key_release_event (GtkWidget *widget,
-<<<<<<< HEAD
-                         GdkEvent *event,
-                         gpointer user_data)
-=======
                         GdkEvent *event,
                         gpointer user_data)
->>>>>>> Port Find dialog and search functionality
 {
        GdkEventKey *key = &event->key;
        EEditorFindDialog *dialog = user_data;
@@ -171,48 +118,8 @@ entry_key_release_event (GtkWidget *widget,
 }
 
 static void
-<<<<<<< HEAD
-e_editor_find_dialog_class_init (EEditorFindDialogClass *class)
-{
-       GtkWidgetClass *widget_class;
-
-       g_type_class_add_private (class, sizeof (EEditorFindDialogPrivate));
-
-       widget_class = GTK_WIDGET_CLASS (class);
-       widget_class->show = editor_find_dialog_show;
-=======
-editor_find_dialog_set_property (GObject *object,
-                                guint property_id,
-                                const GValue *value,
-                                GParamSpec *pspec)
-{
-       EEditorFindDialog *dialog = E_EDITOR_FIND_DIALOG (object);
-
-       switch (property_id) {
-               case PROP_EDITOR:
-                       dialog->priv->editor =
-                               g_object_ref (g_value_get_object (value));
-                       return;
-       }
-
-       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-editor_find_dialog_finalize (GObject *object)
-{
-       EEditorFindDialogPrivate *priv = E_EDITOR_FIND_DIALOG (object)->priv;
-
-       g_clear_object (&priv->editor);
-
-       /* Chain up to parent's finalize */
-       G_OBJECT_CLASS (e_editor_find_dialog_parent_class)->finalize (object);
-}
-
-static void
 e_editor_find_dialog_class_init (EEditorFindDialogClass *klass)
 {
-       GObjectClass *object_class;
        GtkWidgetClass *widget_class;
 
        e_editor_find_dialog_parent_class = g_type_class_peek_parent (klass);
@@ -220,39 +127,11 @@ e_editor_find_dialog_class_init (EEditorFindDialogClass *klass)
 
        widget_class = GTK_WIDGET_CLASS (klass);
        widget_class->show = editor_find_dialog_show;
-
-       object_class = G_OBJECT_CLASS (klass);
-       object_class->set_property = editor_find_dialog_set_property;
-       object_class->finalize = editor_find_dialog_finalize;
-
-       g_object_class_install_property (
-               object_class,
-               PROP_EDITOR,
-               g_param_spec_object (
-                       "editor",
-                       NULL,
-                       NULL,
-                       E_TYPE_EDITOR,
-                       G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
->>>>>>> Port Find dialog and search functionality
 }
 
 static void
 e_editor_find_dialog_init (EEditorFindDialog *dialog)
 {
-<<<<<<< HEAD
-       GtkGrid *main_layout;
-       GtkBox *box;
-       GtkWidget *widget;
-
-       dialog->priv = E_EDITOR_FIND_DIALOG_GET_PRIVATE (dialog);
-
-       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
-
-       widget = gtk_entry_new ();
-       gtk_widget_set_hexpand (widget, TRUE);
-       gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
-=======
        GtkBox *main_layout, *box;
        GtkWidget *widget;
 
@@ -265,19 +144,13 @@ e_editor_find_dialog_init (EEditorFindDialog *dialog)
 
        widget = gtk_entry_new ();
        gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
->>>>>>> Port Find dialog and search functionality
        dialog->priv->entry = widget;
        g_signal_connect (
                widget, "key-release-event",
                G_CALLBACK (entry_key_release_event), dialog);
 
-<<<<<<< HEAD
-       box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5));
-       gtk_grid_attach (main_layout, GTK_WIDGET (box), 0, 1, 1, 1);
-=======
        box = GTK_BOX (gtk_hbox_new (FALSE, 5));
        gtk_box_pack_start (main_layout, GTK_WIDGET (box), TRUE, TRUE, 0);
->>>>>>> Port Find dialog and search functionality
 
        widget = gtk_check_button_new_with_mnemonic (N_("Search _backwards"));
        gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
@@ -300,13 +173,8 @@ e_editor_find_dialog_init (EEditorFindDialog *dialog)
                widget, "toggled",
                G_CALLBACK (reset_dialog), dialog);
 
-<<<<<<< HEAD
-       box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5));
-       gtk_grid_attach (main_layout, GTK_WIDGET (box), 0, 2, 1, 1);
-=======
        box = GTK_BOX (gtk_hbox_new (FALSE, 5));
        gtk_box_pack_start (main_layout, GTK_WIDGET (box), TRUE, TRUE, 0);
->>>>>>> Port Find dialog and search functionality
 
        widget = gtk_label_new ("");
        gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
@@ -318,9 +186,6 @@ e_editor_find_dialog_init (EEditorFindDialog *dialog)
        gtk_box_pack_end (box, widget, TRUE, TRUE, 0);
        box = GTK_BOX (widget);
 
-<<<<<<< HEAD
-       box = e_editor_dialog_get_button_box (E_EDITOR_DIALOG (dialog));
-=======
        widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
        gtk_box_pack_start (box, widget, FALSE, FALSE, 5);
        g_signal_connect_swapped (
@@ -328,7 +193,6 @@ e_editor_find_dialog_init (EEditorFindDialog *dialog)
                G_CALLBACK (editor_find_dialog_close_cb), dialog);
        dialog->priv->cancel_button = widget;
 
->>>>>>> Port Find dialog and search functionality
        widget = gtk_button_new_from_stock (GTK_STOCK_FIND);
        gtk_box_pack_start (box, widget, FALSE, FALSE, 5);
        g_signal_connect_swapped (
@@ -340,31 +204,14 @@ e_editor_find_dialog_init (EEditorFindDialog *dialog)
 }
 
 GtkWidget *
-<<<<<<< HEAD
-e_editor_find_dialog_new (EEditor *editor)
-=======
 e_editor_find_dialog_new(EEditor *editor)
->>>>>>> Port Find dialog and search functionality
 {
        return GTK_WIDGET (
                g_object_new (
                        E_TYPE_EDITOR_FIND_DIALOG,
-<<<<<<< HEAD
-                       "editor", editor,
-                       "icon-name", GTK_STOCK_FIND,
-                       "title", N_("Find"),
-=======
-                       "destroy-with-parent", TRUE,
-                       "events", GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK,
                        "editor", editor,
                        "icon-name", GTK_STOCK_FIND,
-                       "resizable", FALSE,
                        "title", N_("Find"),
-                       "transient-for", gtk_widget_get_toplevel (GTK_WIDGET (editor)),
-                       "type", GTK_WINDOW_TOPLEVEL,
-                       "type-hint", GDK_WINDOW_TYPE_HINT_POPUP_MENU,
-                       "window-position", GTK_WIN_POS_CENTER_ON_PARENT,
->>>>>>> Port Find dialog and search functionality
                        NULL));
 }
 
diff --git a/e-util/e-editor-find-dialog.h b/e-util/e-editor-find-dialog.h
index 60d226e..633318b 100644
--- a/e-util/e-editor-find-dialog.h
+++ b/e-util/e-editor-find-dialog.h
@@ -1,11 +1,6 @@
 /*
  * e-editor-find-dialog.h
  *
-<<<<<<< HEAD
- * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
- *
-=======
->>>>>>> Port Find dialog and search functionality
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -28,12 +23,7 @@
 #ifndef E_EDITOR_FIND_DIALOG_H
 #define E_EDITOR_FIND_DIALOG_H
 
-<<<<<<< HEAD
 #include <e-util/e-editor-dialog.h>
-=======
-#include <gtk/gtk.h>
-#include <e-util/e-editor.h>
->>>>>>> Port Find dialog and search functionality
 
 /* Standard GObject macros */
 #define E_TYPE_EDITOR_FIND_DIALOG \
@@ -61,31 +51,19 @@ typedef struct _EEditorFindDialogClass EEditorFindDialogClass;
 typedef struct _EEditorFindDialogPrivate EEditorFindDialogPrivate;
 
 struct _EEditorFindDialog {
-<<<<<<< HEAD
        EEditorDialog parent;
-=======
-       GtkWindow parent;
 
->>>>>>> Port Find dialog and search functionality
        EEditorFindDialogPrivate *priv;
 };
 
 struct _EEditorFindDialogClass {
-<<<<<<< HEAD
        EEditorDialogClass parent_class;
 };
 
-GType          e_editor_find_dialog_get_type   (void) G_GNUC_CONST;
-GtkWidget *    e_editor_find_dialog_new        (EEditor *editor);
-=======
-       GtkWindowClass parent_class;
-};
-
 GType          e_editor_find_dialog_get_type   (void);
 
 GtkWidget*     e_editor_find_dialog_new        (EEditor *editor);
 
->>>>>>> Port Find dialog and search functionality
 void           e_editor_find_dialog_find_next  (EEditorFindDialog *dialog);
 
 G_END_DECLS
diff --git a/e-util/e-editor-link-dialog.c b/e-util/e-editor-link-dialog.c
index a63f4bb..1db2790 100644
--- a/e-util/e-editor-link-dialog.c
+++ b/e-util/e-editor-link-dialog.c
@@ -1,8 +1,6 @@
 /*
  * e-editor-link-dialog.h
  *
- * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -25,14 +23,9 @@
 #include "e-editor-link-dialog.h"
 #include "e-editor-selection.h"
 #include "e-editor-utils.h"
-#include "e-editor-widget.h"
 
 #include <glib/gi18n-lib.h>
 
-#define E_EDITOR_LINK_DIALOG_GET_PRIVATE(obj) \
-       (G_TYPE_INSTANCE_GET_PRIVATE \
-       ((obj), E_TYPE_EDITOR_LINK_DIALOG, EEditorLinkDialogPrivate))
-
 G_DEFINE_TYPE (
        EEditorLinkDialog,
        e_editor_link_dialog,
@@ -44,11 +37,51 @@ struct _EEditorLinkDialogPrivate {
        GtkWidget *test_button;
 
        GtkWidget *remove_link_button;
+       GtkWidget *close_button;
        GtkWidget *ok_button;
-
-       gboolean label_autofill;
 };
 
+static WebKitDOMElement *
+find_anchor_element (WebKitDOMRange *range)
+{
+       WebKitDOMElement *link;
+       WebKitDOMNode *node;
+
+       node = webkit_dom_range_get_start_container (range, NULL);
+
+       /* Try to find if the selection is within a link */
+       link = NULL;
+       link = e_editor_dom_node_get_parent_element (
+                       node, WEBKIT_TYPE_DOM_HTML_ANCHOR_ELEMENT);
+
+       /* ...or if there is a link within selection */
+       if (!link) {
+               WebKitDOMNode *start_node = node;
+               gboolean found = FALSE;
+               do {
+                       if (WEBKIT_DOM_IS_HTML_ANCHOR_ELEMENT (node)) {
+                               found = TRUE;
+                               break;
+                       }
+
+                       if (webkit_dom_node_has_child_nodes (node)) {
+                               node = webkit_dom_node_get_first_child (node);
+                       } else if (webkit_dom_node_get_next_sibling (node)) {
+                               node = webkit_dom_node_get_next_sibling (node);
+                       } else {
+                               node = webkit_dom_node_get_parent_node (node);
+                       }
+               } while (!webkit_dom_node_is_same_node (node, start_node));
+
+               if (found) {
+                       link = WEBKIT_DOM_ELEMENT (node);
+               }
+       }
+
+       return link;
+}
+
+
 static void
 editor_link_dialog_test_link (EEditorLinkDialog *dialog)
 {
@@ -60,28 +93,9 @@ editor_link_dialog_test_link (EEditorLinkDialog *dialog)
 }
 
 static void
-editor_link_dialog_url_changed (EEditorLinkDialog *dialog)
-{
-       if (dialog->priv->label_autofill &&
-           gtk_widget_is_sensitive (dialog->priv->label_edit)) {
-               const gchar *text;
-
-               text = gtk_entry_get_text (
-                       GTK_ENTRY (dialog->priv->url_edit));
-               gtk_entry_set_text (
-                       GTK_ENTRY (dialog->priv->label_edit), text);
-       }
-}
-
-static gboolean
-editor_link_dialog_description_changed (EEditorLinkDialog *dialog)
+editor_link_dialog_close (EEditorLinkDialog *dialog)
 {
-       const gchar *text;
-
-       text = gtk_entry_get_text (GTK_ENTRY (dialog->priv->label_edit));
-       dialog->priv->label_autofill = (*text == '\0');
-
-       return FALSE;
+       gtk_widget_hide (GTK_WIDGET (dialog));
 }
 
 static void
@@ -96,7 +110,7 @@ editor_link_dialog_remove_link (EEditorLinkDialog *dialog)
        selection = e_editor_widget_get_selection (widget);
        e_editor_selection_unlink (selection);
 
-       gtk_widget_hide (GTK_WIDGET (dialog));
+       editor_link_dialog_close (dialog);
 }
 
 static void
@@ -121,49 +135,16 @@ editor_link_dialog_ok (EEditorLinkDialog *dialog)
 
        if (!dom_selection ||
            (webkit_dom_dom_selection_get_range_count (dom_selection) == 0)) {
-               gtk_widget_hide (GTK_WIDGET (dialog));
                return;
        }
 
        range = webkit_dom_dom_selection_get_range_at (dom_selection, 0, NULL);
-       link = e_editor_dom_node_find_parent_element (
-                       webkit_dom_range_get_start_container (range, NULL), "A");
-       if (!link) {
-               if ((webkit_dom_range_get_start_container (range, NULL) !=
-                       webkit_dom_range_get_end_container (range, NULL)) ||
-                   (webkit_dom_range_get_start_offset (range, NULL) !=
-                       webkit_dom_range_get_end_offset (range, NULL))) {
-
-                       WebKitDOMDocumentFragment *fragment;
-                       fragment = webkit_dom_range_extract_contents (range, NULL);
-                       link = e_editor_dom_node_find_child_element (
-                               WEBKIT_DOM_NODE (fragment), "A");
-                       webkit_dom_range_insert_node (
-                               range, WEBKIT_DOM_NODE (fragment), NULL);
-
-                       webkit_dom_dom_selection_set_base_and_extent (
-                               dom_selection,
-                               webkit_dom_range_get_start_container (range, NULL),
-                               webkit_dom_range_get_start_offset (range, NULL),
-                               webkit_dom_range_get_end_container (range, NULL),
-                               webkit_dom_range_get_end_offset (range, NULL),
-                               NULL);
-               } else {
-                       /* get element that was clicked on */
-                       link = e_editor_widget_get_element_under_mouse_click (widget);
-                       if (!WEBKIT_DOM_IS_HTML_ANCHOR_ELEMENT (link))
-                               link = NULL;
-               }
-       }
+       link = find_anchor_element (range);
 
        if (link) {
                webkit_dom_html_anchor_element_set_href (
                        WEBKIT_DOM_HTML_ANCHOR_ELEMENT (link),
                        gtk_entry_get_text (GTK_ENTRY (dialog->priv->url_edit)));
-               webkit_dom_html_element_set_inner_html (
-                       WEBKIT_DOM_HTML_ELEMENT (link),
-                       gtk_entry_get_text (GTK_ENTRY (dialog->priv->label_edit)),
-                       NULL);
        } else {
                gchar *text;
 
@@ -182,8 +163,8 @@ editor_link_dialog_ok (EEditorLinkDialog *dialog)
                                gtk_entry_get_text (
                                        GTK_ENTRY (dialog->priv->label_edit)));
 
-                       e_editor_widget_exec_command (
-                               widget, E_EDITOR_WIDGET_COMMAND_INSERT_HTML, html);
+                       webkit_dom_document_exec_command (
+                               document, "insertHTML", FALSE, html);
 
                        g_free (html);
 
@@ -192,21 +173,7 @@ editor_link_dialog_ok (EEditorLinkDialog *dialog)
                g_free (text);
        }
 
-       gtk_widget_hide (GTK_WIDGET (dialog));
-}
-
-static gboolean
-editor_link_dialog_entry_key_pressed (EEditorLinkDialog *dialog,
-                                      GdkEventKey *event)
-{
-       /* We can't do thins in key_released, because then you could not open
-        * this dialog from main menu by pressing enter on Insert->Link action */
-       if (event->keyval == GDK_KEY_Return) {
-               editor_link_dialog_ok (dialog);
-               return TRUE;
-       }
-
-       return FALSE;
+       editor_link_dialog_close (dialog);
 }
 
 static void
@@ -234,35 +201,16 @@ editor_link_dialog_show (GtkWidget *widget)
        gtk_entry_set_text (GTK_ENTRY (dialog->priv->label_edit), "");
        gtk_widget_set_sensitive (dialog->priv->label_edit, TRUE);
        gtk_widget_set_sensitive (dialog->priv->remove_link_button, TRUE);
-       dialog->priv->label_autofill = TRUE;
 
        /* No selection at all */
        if (!dom_selection ||
            webkit_dom_dom_selection_get_range_count (dom_selection) < 1) {
-               gtk_widget_set_sensitive (dialog->priv->remove_link_button, FALSE);
+
                goto chainup;
        }
 
        range = webkit_dom_dom_selection_get_range_at (dom_selection, 0, NULL);
-       link = e_editor_dom_node_find_parent_element (
-               webkit_dom_range_get_start_container (range, NULL), "A");
-       if (!link) {
-               if ((webkit_dom_range_get_start_container (range, NULL) !=
-                       webkit_dom_range_get_end_container (range, NULL)) ||
-                   (webkit_dom_range_get_start_offset (range, NULL) !=
-                       webkit_dom_range_get_end_offset (range, NULL))) {
-
-                       WebKitDOMDocumentFragment *fragment;
-                       fragment = webkit_dom_range_clone_contents (range, NULL);
-                       link = e_editor_dom_node_find_child_element (
-                                       WEBKIT_DOM_NODE (fragment), "A");
-               } else {
-                       /* get element that was clicked on */
-                       link = e_editor_widget_get_element_under_mouse_click (editor_widget);
-                       if (!WEBKIT_DOM_IS_HTML_ANCHOR_ELEMENT (link))
-                               link = NULL;
-               }
-       }
+       link = find_anchor_element (range);
 
        if (link) {
                gchar *href, *text;
@@ -276,6 +224,7 @@ editor_link_dialog_show (GtkWidget *widget)
                        GTK_ENTRY (dialog->priv->url_edit), href);
                gtk_entry_set_text (
                        GTK_ENTRY (dialog->priv->label_edit), text);
+               gtk_widget_set_sensitive (dialog->priv->label_edit, FALSE);
 
                g_free (text);
                g_free (href);
@@ -300,13 +249,14 @@ editor_link_dialog_show (GtkWidget *widget)
 }
 
 static void
-e_editor_link_dialog_class_init (EEditorLinkDialogClass *class)
+e_editor_link_dialog_class_init (EEditorLinkDialogClass *klass)
 {
        GtkWidgetClass *widget_class;
 
-       g_type_class_add_private (class, sizeof (EEditorLinkDialogPrivate));
+       e_editor_link_dialog_parent_class  = g_type_class_peek_parent (klass);
+       g_type_class_add_private (klass, sizeof (EEditorLinkDialogPrivate));
 
-       widget_class = GTK_WIDGET_CLASS (class);
+       widget_class = GTK_WIDGET_CLASS (klass);
        widget_class->show = editor_link_dialog_show;
 }
 
@@ -317,26 +267,25 @@ e_editor_link_dialog_init (EEditorLinkDialog *dialog)
        GtkBox *button_box;
        GtkWidget *widget;
 
-       dialog->priv = E_EDITOR_LINK_DIALOG_GET_PRIVATE (dialog);
+       dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
+                               dialog, E_TYPE_EDITOR_LINK_DIALOG,
+                               EEditorLinkDialogPrivate);
 
-       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
+       main_layout = GTK_GRID (gtk_grid_new ());
+       gtk_grid_set_row_spacing (main_layout, 10);
+       gtk_grid_set_column_spacing (main_layout, 10);
+       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
+       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
 
        widget = gtk_entry_new ();
        gtk_grid_attach (main_layout, widget, 1, 0, 1, 1);
-       g_signal_connect_swapped (
-               widget, "notify::text",
-               G_CALLBACK (editor_link_dialog_url_changed), dialog);
-       g_signal_connect_swapped (
-               widget, "key-press-event",
-               G_CALLBACK (editor_link_dialog_entry_key_pressed), dialog);
        dialog->priv->url_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("_URL:"));
-       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
+       widget = gtk_label_new_with_mnemonic (_("LINK:"));
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->url_edit);
        gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
 
-       widget = gtk_button_new_with_mnemonic (_("_Test URL..."));
+       widget = gtk_button_new_with_label (_("Test LINK..."));
        gtk_grid_attach (main_layout, widget, 2, 0, 1, 1);
        g_signal_connect_swapped (
                widget, "clicked",
@@ -345,22 +294,25 @@ e_editor_link_dialog_init (EEditorLinkDialog *dialog)
 
        widget = gtk_entry_new ();
        gtk_grid_attach (main_layout, widget, 1, 1, 2, 1);
-       g_signal_connect_swapped (
-               widget, "key-release-event",
-               G_CALLBACK (editor_link_dialog_description_changed), dialog);
-       g_signal_connect_swapped (
-               widget, "key-press-event",
-               G_CALLBACK (editor_link_dialog_entry_key_pressed), dialog);
        dialog->priv->label_edit = widget;
 
-       widget = gtk_label_new_with_mnemonic (_("_Description:"));
-       gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
+       widget = gtk_label_new_with_mnemonic (_("Description:"));
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->label_edit);
        gtk_grid_attach (main_layout, widget, 0, 1, 1, 1);
 
-       button_box = e_editor_dialog_get_button_box (E_EDITOR_DIALOG (dialog));
+       button_box = GTK_BOX (gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL));
+       gtk_box_set_spacing (button_box, 5);
+       gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_END);
+       gtk_grid_attach (main_layout, GTK_WIDGET (button_box), 0, 2, 3, 1);
+
+       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
+       g_signal_connect_swapped (
+               widget, "clicked",
+               G_CALLBACK (editor_link_dialog_close), dialog);
+       gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5);
+       dialog->priv->close_button = widget;
 
-       widget = gtk_button_new_with_mnemonic (_("_Remove Link"));
+       widget = gtk_button_new_with_label (_("Remove Link"));
        g_signal_connect_swapped (
                widget, "clicked",
                G_CALLBACK (editor_link_dialog_remove_link), dialog);
@@ -371,7 +323,7 @@ e_editor_link_dialog_init (EEditorLinkDialog *dialog)
        g_signal_connect_swapped (
                widget, "clicked",
                G_CALLBACK (editor_link_dialog_ok), dialog);
-       gtk_box_pack_end (button_box, widget, FALSE, FALSE, 5);
+       gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5);
        dialog->priv->ok_button = widget;
 
        gtk_widget_show_all (GTK_WIDGET (main_layout));
diff --git a/e-util/e-editor-link-dialog.h b/e-util/e-editor-link-dialog.h
index 99141b0..5c1d0c7 100644
--- a/e-util/e-editor-link-dialog.h
+++ b/e-util/e-editor-link-dialog.h
@@ -1,8 +1,11 @@
 /*
  * e-editor-link-dialog.h
  *
+<<<<<<< HEAD
  * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
  *
+=======
+>>>>>>> Refactor EEditorDialog... classes
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -54,6 +57,10 @@ typedef struct _EEditorLinkDialogPrivate EEditorLinkDialogPrivate;
 
 struct _EEditorLinkDialog {
        EEditorDialog parent;
+<<<<<<< HEAD
+=======
+
+>>>>>>> Refactor EEditorDialog... classes
        EEditorLinkDialogPrivate *priv;
 };
 
@@ -61,8 +68,14 @@ struct _EEditorLinkDialogClass {
        EEditorDialogClass parent_class;
 };
 
+<<<<<<< HEAD
 GType          e_editor_link_dialog_get_type   (void) G_GNUC_CONST;
 GtkWidget *    e_editor_link_dialog_new        (EEditor *editor);
+=======
+GType          e_editor_link_dialog_get_type   (void);
+
+GtkWidget*     e_editor_link_dialog_new        (EEditor *editor);
+>>>>>>> Refactor EEditorDialog... classes
 
 G_END_DECLS
 
diff --git a/e-util/e-editor-private.h b/e-util/e-editor-private.h
index 25df5ef..5872a8a 100644
--- a/e-util/e-editor-private.h
+++ b/e-util/e-editor-private.h
@@ -26,7 +26,7 @@
 #include <e-editor-widget.h>
 #include <e-editor-find-dialog.h>
 #include <e-editor-replace-dialog.h>
-#include <e-editor-url-properties-dialog.h>
+#include <e-editor-link-dialog.h>
 
 #ifdef HAVE_XFREE
 #include <X11/XF86keysym.h>
@@ -57,7 +57,7 @@ struct _EEditorPrivate {
 
        GtkWidget *find_dialog;
        GtkWidget *replace_dialog;
-       GtkWidget *url_properties_dialog;
+       GtkWidget *link_dialog;
 
        GtkWidget *color_combo_box;
        GtkWidget *mode_combo_box;
diff --git a/e-util/e-editor-replace-dialog.c b/e-util/e-editor-replace-dialog.c
index 4e1b726..150af90 100644
--- a/e-util/e-editor-replace-dialog.c
+++ b/e-util/e-editor-replace-dialog.c
@@ -1,11 +1,6 @@
 /*
  * e-editor-replace-dialog.h
  *
-<<<<<<< HEAD
- * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
- *
-=======
->>>>>>> Port Replace dialog and it's functionality
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -29,21 +24,10 @@
 
 #include <glib/gi18n-lib.h>
 
-<<<<<<< HEAD
-#define E_EDITOR_REPLACE_DIALOG_GET_PRIVATE(obj) \
-       (G_TYPE_INSTANCE_GET_PRIVATE \
-       ((obj), E_TYPE_EDITOR_REPLACE_DIALOG, EEditorReplaceDialogPrivate))
-
-G_DEFINE_TYPE (
-       EEditorReplaceDialog,
-       e_editor_replace_dialog,
-       E_TYPE_EDITOR_DIALOG);
-=======
 G_DEFINE_TYPE (
        EEditorReplaceDialog,
        e_editor_replace_dialog,
        GTK_TYPE_WINDOW);
->>>>>>> Port Replace dialog and it's functionality
 
 struct _EEditorReplaceDialogPrivate {
        GtkWidget *search_entry;
@@ -55,11 +39,6 @@ struct _EEditorReplaceDialogPrivate {
 
        GtkWidget *result_label;
 
-<<<<<<< HEAD
-       GtkWidget *skip_button;
-       GtkWidget *replace_button;
-       GtkWidget *replace_all_button;
-=======
        GtkWidget *close_button;
        GtkWidget *skip_button;
        GtkWidget *replace_button;
@@ -71,27 +50,16 @@ struct _EEditorReplaceDialogPrivate {
 enum {
        PROP_0,
        PROP_EDITOR
->>>>>>> Port Replace dialog and it's functionality
 };
 
 static gboolean
 jump (EEditorReplaceDialog *dialog)
 {
-<<<<<<< HEAD
-       EEditor *editor;
-       WebKitWebView *webview;
-       gboolean found;
-
-       editor = e_editor_dialog_get_editor (E_EDITOR_DIALOG (dialog));
-       webview = WEBKIT_WEB_VIEW (
-                       e_editor_get_editor_widget (editor));
-=======
        WebKitWebView *webview;
        gboolean found;
 
        webview = WEBKIT_WEB_VIEW (
                        e_editor_get_editor_widget (dialog->priv->editor));
->>>>>>> Port Replace dialog and it's functionality
 
        found = webkit_web_view_search_text (
                webview,
@@ -122,10 +90,6 @@ editor_replace_dialog_skip_cb (EEditorReplaceDialog *dialog)
 static void
 editor_replace_dialog_replace_cb (EEditorReplaceDialog *dialog)
 {
-<<<<<<< HEAD
-       EEditor *editor;
-=======
->>>>>>> Port Replace dialog and it's functionality
        EEditorWidget *editor_widget;
        EEditorSelection *selection;
 
@@ -140,12 +104,7 @@ editor_replace_dialog_replace_cb (EEditorReplaceDialog *dialog)
                gtk_widget_hide (dialog->priv->result_label);
        }
 
-<<<<<<< HEAD
-       editor = e_editor_dialog_get_editor (E_EDITOR_DIALOG (dialog));
-       editor_widget = e_editor_get_editor_widget (editor);
-=======
        editor_widget = e_editor_get_editor_widget (dialog->priv->editor);
->>>>>>> Port Replace dialog and it's functionality
        selection = e_editor_widget_get_selection (editor_widget);
 
        e_editor_selection_replace (
@@ -158,32 +117,17 @@ editor_replace_dialog_replace_all_cb (EEditorReplaceDialog *dialog)
 {
        gint i = 0;
        gchar *result;
-<<<<<<< HEAD
-       EEditor *editor;
-=======
->>>>>>> Port Replace dialog and it's functionality
        EEditorWidget *widget;
        EEditorSelection *selection;
        const gchar *replacement;
 
-<<<<<<< HEAD
-       editor = e_editor_dialog_get_editor (E_EDITOR_DIALOG (dialog));
-       widget = e_editor_get_editor_widget (editor);
-=======
        widget = e_editor_get_editor_widget (dialog->priv->editor);
->>>>>>> Port Replace dialog and it's functionality
        selection = e_editor_widget_get_selection (widget);
        replacement = gtk_entry_get_text (GTK_ENTRY (dialog->priv->replace_entry));
 
        while (jump (dialog)) {
                e_editor_selection_replace (selection, replacement);
                i++;
-<<<<<<< HEAD
-
-               /* Jump behind the word */
-               e_editor_selection_move (selection, TRUE, E_EDITOR_SELECTION_GRANULARITY_WORD);
-=======
->>>>>>> Port Replace dialog and it's functionality
        }
 
        result = g_strdup_printf (_("%d occurences replaced"), i);
@@ -193,15 +137,12 @@ editor_replace_dialog_replace_all_cb (EEditorReplaceDialog *dialog)
 }
 
 static void
-<<<<<<< HEAD
-=======
 editor_replace_dialog_close_cb (EEditorReplaceDialog *dialog)
 {
        gtk_widget_hide (GTK_WIDGET (dialog));
 }
 
 static void
->>>>>>> Port Replace dialog and it's functionality
 editor_replace_dialog_entry_changed (EEditorReplaceDialog *dialog)
 {
        gboolean ready;
@@ -228,16 +169,6 @@ editor_replace_dialog_show (GtkWidget *widget)
 }
 
 static void
-<<<<<<< HEAD
-e_editor_replace_dialog_class_init (EEditorReplaceDialogClass *class)
-{
-       GtkWidgetClass *widget_class;
-
-       g_type_class_add_private (class, sizeof (EEditorReplaceDialogPrivate));
-
-       widget_class = GTK_WIDGET_CLASS (class);
-       widget_class->show = editor_replace_dialog_show;
-=======
 editor_replace_dialog_set_property (GObject *object,
                                    guint property_id,
                                    const GValue *value,
@@ -289,7 +220,6 @@ e_editor_replace_dialog_class_init (EEditorReplaceDialogClass *klass)
                        NULL,
                        E_TYPE_EDITOR,
                        G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
->>>>>>> Port Replace dialog and it's functionality
 }
 
 static void
@@ -297,13 +227,6 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
 {
        GtkGrid *main_layout;
        GtkWidget *widget, *layout;
-<<<<<<< HEAD
-       GtkBox *button_box;
-
-       dialog->priv = E_EDITOR_REPLACE_DIALOG_GET_PRIVATE (dialog);
-
-       main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
-=======
 
        dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
                                dialog, E_TYPE_EDITOR_REPLACE_DIALOG,
@@ -314,7 +237,6 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
        gtk_grid_set_column_spacing (main_layout, 10);
        gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
        gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
->>>>>>> Port Replace dialog and it's functionality
 
        widget = gtk_entry_new ();
        gtk_grid_attach (main_layout, widget, 1, 0, 2, 1);
@@ -340,11 +262,7 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_grid_attach (main_layout, widget, 0, 1, 1, 1);
 
-<<<<<<< HEAD
-       layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
-=======
        layout = gtk_hbox_new (FALSE, 5);
->>>>>>> Port Replace dialog and it's functionality
        gtk_grid_attach (main_layout, layout, 1, 2, 2, 1);
 
        widget = gtk_check_button_new_with_mnemonic (_("Search _backwards"));
@@ -363,12 +281,6 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
        gtk_grid_attach (main_layout, widget, 0, 3, 2, 1);
        dialog->priv->result_label = widget;
 
-<<<<<<< HEAD
-       button_box = e_editor_dialog_get_button_box (E_EDITOR_DIALOG (dialog));
-
-       widget = gtk_button_new_with_mnemonic (_("_Skip"));
-       gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5);
-=======
        layout = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
        gtk_box_set_spacing (GTK_BOX (layout), 5);
        gtk_button_box_set_layout (GTK_BUTTON_BOX (layout), GTK_BUTTONBOX_START);
@@ -383,7 +295,6 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
 
        widget = gtk_button_new_with_mnemonic (_("_Skip"));
        gtk_box_pack_start (GTK_BOX (layout), widget, FALSE, FALSE, 5);
->>>>>>> Port Replace dialog and it's functionality
        gtk_widget_set_sensitive (widget, FALSE);
        dialog->priv->skip_button = widget;
        g_signal_connect_swapped (
@@ -391,11 +302,7 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
                G_CALLBACK (editor_replace_dialog_skip_cb), dialog);
 
        widget = gtk_button_new_with_mnemonic (_("_Replace"));
-<<<<<<< HEAD
-       gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5);
-=======
        gtk_box_pack_start (GTK_BOX (layout), widget, FALSE, FALSE, 5);
->>>>>>> Port Replace dialog and it's functionality
        gtk_widget_set_sensitive (widget, FALSE);
        dialog->priv->replace_button = widget;
        g_signal_connect_swapped (
@@ -403,11 +310,7 @@ e_editor_replace_dialog_init (EEditorReplaceDialog *dialog)
                G_CALLBACK (editor_replace_dialog_replace_cb), dialog);
 
        widget = gtk_button_new_with_mnemonic (_("Replace _All"));
-<<<<<<< HEAD
-       gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5);
-=======
        gtk_box_pack_start (GTK_BOX (layout), widget, FALSE, FALSE, 5);
->>>>>>> Port Replace dialog and it's functionality
        gtk_widget_set_sensitive (widget, FALSE);
        dialog->priv->replace_all_button = widget;
        g_signal_connect_swapped (
@@ -423,11 +326,6 @@ e_editor_replace_dialog_new (EEditor *editor)
        return GTK_WIDGET (
                g_object_new (
                        E_TYPE_EDITOR_REPLACE_DIALOG,
-<<<<<<< HEAD
-                       "editor", editor,
-                       "icon-name", GTK_STOCK_FIND_AND_REPLACE,
-                       "title", N_("Replace"),
-=======
                        "destroy-with-parent", TRUE,
                        "events", GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK,
                        "editor", editor,
@@ -437,6 +335,5 @@ e_editor_replace_dialog_new (EEditor *editor)
                        "transient-for", gtk_widget_get_toplevel (GTK_WIDGET (editor)),
                        "type", GTK_WINDOW_TOPLEVEL,
                        "window-position", GTK_WIN_POS_CENTER_ON_PARENT,
->>>>>>> Port Replace dialog and it's functionality
                        NULL));
 }
diff --git a/e-util/e-editor-replace-dialog.h b/e-util/e-editor-replace-dialog.h
index 807b64d..8912751 100644
--- a/e-util/e-editor-replace-dialog.h
+++ b/e-util/e-editor-replace-dialog.h
@@ -1,11 +1,6 @@
 /*
  * e-editor-replace-dialog.h
  *
-<<<<<<< HEAD
- * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
- *
-=======
->>>>>>> Port Replace dialog and it's functionality
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -28,12 +23,7 @@
 #ifndef E_EDITOR_REPLACE_DIALOG_H
 #define E_EDITOR_REPLACE_DIALOG_H
 
-<<<<<<< HEAD
 #include <e-util/e-editor-dialog.h>
-=======
-#include <gtk/gtk.h>
-#include <e-util/e-editor.h>
->>>>>>> Port Replace dialog and it's functionality
 
 /* Standard GObject macros */
 #define E_TYPE_EDITOR_REPLACE_DIALOG \
@@ -61,31 +51,18 @@ typedef struct _EEditorReplaceDialogClass EEditorReplaceDialogClass;
 typedef struct _EEditorReplaceDialogPrivate EEditorReplaceDialogPrivate;
 
 struct _EEditorReplaceDialog {
-<<<<<<< HEAD
        EEditorDialog parent;
-=======
-       GtkWindow parent;
 
->>>>>>> Port Replace dialog and it's functionality
        EEditorReplaceDialogPrivate *priv;
 };
 
 struct _EEditorReplaceDialogClass {
-<<<<<<< HEAD
        EEditorDialogClass parent_class;
 };
 
-GType          e_editor_replace_dialog_get_type
-                                               (void) G_GNUC_CONST;
-GtkWidget *    e_editor_replace_dialog_new     (EEditor *editor);
-=======
-       GtkWindowClass parent_class;
-};
-
 GType          e_editor_replace_dialog_get_type        (void);
 
 GtkWidget*     e_editor_replace_dialog_new             (EEditor *editor);
->>>>>>> Port Replace dialog and it's functionality
 
 G_END_DECLS
 
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 045ca17..4c5c742 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -92,10 +92,11 @@
 #include <e-util/e-dialog-utils.h>
 #include <e-util/e-dialog-widgets.h>
 #include <e-util/e-editor-actions.h>
+#include <e-util/e-editor-dialog.h>
 #include <e-util/e-editor-find-dialog.h>
+#include <e-util/e-editor-link-dialog.h>
 #include <e-util/e-editor-replace-dialog.h>
 #include <e-util/e-editor-selection.h>
-#include <e-util/e-editor-url-properties-dialog.h>
 #include <e-util/e-editor-utils.h>
 #include <e-util/e-editor-widget.h>
 #include <e-util/e-editor-widgets.h>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]