[evolution/wip/webkit-composer: 540/966] Make the 'Table properties' dialog work



commit 1f35cb3b29fa0127f56269e5c38d3cbea2a232c0
Author: Dan Vrátil <dvratil redhat com>
Date:   Wed Aug 8 21:15:04 2012 +0200

    Make the 'Table properties' dialog work
    
    The dialog is implemented in EEditorTableDialog class where
    all the functionality is implemented.

 e-util/Makefile.am             |    2 +
 e-util/e-editor-actions.c      |   45 +---
 e-util/e-editor-builder.ui     |  570 ----------------------------------------
 e-util/e-editor-private.h      |    2 +
 e-util/e-editor-table-dialog.c |  194 ++++++++++++++
 e-util/e-editor-table-dialog.h |   13 +
 e-util/e-editor-utils.c        |   23 ++
 e-util/e-editor-widgets.h      |   26 --
 e-util/e-util.h                |    1 +
 9 files changed, 245 insertions(+), 631 deletions(-)
---
diff --git a/e-util/Makefile.am b/e-util/Makefile.am
index 666f326..0d386dd 100644
--- a/e-util/Makefile.am
+++ b/e-util/Makefile.am
@@ -186,6 +186,7 @@ evolution_util_include_HEADERS =  \
        e-editor-link-dialog.h \
        e-editor-replace-dialog.h \
        e-editor-selection.h \
+       e-editor-table-dialog.h \
        e-editor-utils.h \
        e-editor-widget.h \
        e-editor-widgets.h \
@@ -452,6 +453,7 @@ libevolution_util_la_SOURCES = \
        e-editor-private.h \
        e-editor-replace-dialog.c \
        e-editor-selection.c \
+       e-editor-table-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 b6f6c2f..0e6fdee 100644
--- a/e-util/e-editor-actions.c
+++ b/e-util/e-editor-actions.c
@@ -697,42 +697,12 @@ static void
 action_insert_table_cb (GtkAction *action,
                         EEditor *editor)
 {
-       WebKitDOMDocument *document;
-       WebKitDOMElement *table;
-       WebKitDOMDOMWindow *window;
-       WebKitDOMDOMSelection *selection;
-       WebKitDOMRange *range;
-       gint i;
-
-       document = webkit_web_view_get_dom_document (
-                       WEBKIT_WEB_VIEW (e_editor_get_editor_widget (editor)));
-       window = webkit_dom_document_get_default_view (document);
-       selection = webkit_dom_dom_window_get_selection (window);
-       if (webkit_dom_dom_selection_get_range_count (selection) < 1)
-               return;
-
-       range = webkit_dom_dom_selection_get_range_at (selection, 0, NULL);
-
-       /* Default 3x3 table */
-       table = webkit_dom_document_create_element (document, "TABLE", NULL);
-       for (i = 0; i < 3; i++) {
-               WebKitDOMHTMLElement *row;
-               gint j;
-
-               row = webkit_dom_html_table_element_insert_row (
-                       WEBKIT_DOM_HTML_TABLE_ELEMENT (table), -1, NULL);
-
-               for (j = 0; j < 3; j++) {
-                       webkit_dom_html_table_row_element_insert_cell (
-                               WEBKIT_DOM_HTML_TABLE_ROW_ELEMENT (row),
-                               -1, NULL);
-               }
+       if (editor->priv->table_dialog == NULL) {
+               editor->priv->table_dialog =
+                       e_editor_table_dialog_new (editor);
        }
 
-       webkit_dom_range_insert_node (range, WEBKIT_DOM_NODE (table), NULL);
-
-       /* FIXME WEBKIT - does the action work? */
-       gtk_action_activate (ACTION (PROPERTIES_TABLE));
+       gtk_window_present (GTK_WINDOW (editor->priv->table_dialog));
 }
 
 static void
@@ -1004,7 +974,12 @@ static void
 action_properties_table_cb (GtkAction *action,
                             EEditor *editor)
 {
-       gtk_window_present (GTK_WINDOW (WIDGET (TABLE_PROPERTIES_WINDOW)));
+       if (editor->priv->table_dialog == NULL) {
+               editor->priv->table_dialog =
+                       e_editor_table_dialog_new (editor);
+       }
+
+       gtk_window_present (GTK_WINDOW (editor->priv->table_dialog));
 }
 
 static void
diff --git a/e-util/e-editor-builder.ui b/e-util/e-editor-builder.ui
index c81bdde..cb58225 100644
--- a/e-util/e-editor-builder.ui
+++ b/e-util/e-editor-builder.ui
@@ -731,576 +731,6 @@
       </object>
     </child>
   </object>
-  <object class="GtkWindow" id="table-properties-window">
-    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
-    <property name="border_width">12</property>
-    <property name="title" translatable="yes">Table Properties</property>
-    <property name="resizable">False</property>
-    <property name="modal">True</property>
-    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
-    <property name="destroy_with_parent">True</property>
-    <signal handler="gtk_widget_hide_on_delete" name="delete_event"/>
-    <signal handler="gtkhtml_editor_table_properties_show_window_cb" name="show"/>
-    <child>
-      <object class="GtkVBox" id="table-properties-vbox">
-        <property name="visible">True</property>
-        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-        <property name="spacing">12</property>
-        <child>
-          <object class="GtkVBox" id="table-properties-general-vbox">
-            <property name="visible">True</property>
-            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-            <property name="spacing">6</property>
-            <child>
-              <object class="GtkLabel" id="table-properties-general-header">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">General</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-            </child>
-            <child>
-              <object class="GtkAlignment" id="table-properties-general-alignment">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkHBox" id="table-properties-general-hbox">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="spacing">12</property>
-                    <child>
-                      <object class="GtkHBox" id="table-properties-rows-hbox">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <object class="GtkImage" id="table-properties-rows-image">
-                            <property name="visible">True</property>
-                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="icon_name">stock_select-row</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="table-properties-rows-label">
-                            <property name="visible">True</property>
-                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="label" translatable="yes">_Rows:</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">table-properties-rows-spin-button</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkSpinButton" id="table-properties-rows-spin-button">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="adjustment">adjustment3</property>
-                            <signal handler="gtkhtml_editor_table_properties_rows_changed_cb" 
name="value_changed" object="table-properties-window"/>
-                          </object>
-                          <packing>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkHBox" id="table-properties-cols-hbox">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <object class="GtkImage" id="table-properties-cols-image">
-                            <property name="visible">True</property>
-                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="icon_name">stock_select-column</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="table-properties-cols-label">
-                            <property name="visible">True</property>
-                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="label" translatable="yes">C_olumns:</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">table-properties-cols-spin-button</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkSpinButton" id="table-properties-cols-spin-button">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="adjustment">adjustment4</property>
-                            <signal handler="gtkhtml_editor_table_properties_cols_changed_cb" 
name="value_changed" object="table-properties-window"/>
-                          </object>
-                          <packing>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkVBox" id="table-properties-layout-vbox">
-            <property name="visible">True</property>
-            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-            <property name="spacing">6</property>
-            <child>
-              <object class="GtkLabel" id="table-properties-layout-header">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Layout</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-            </child>
-            <child>
-              <object class="GtkAlignment" id="table-properties-layout-alignment">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkTable" id="table-properties-layout-left-table">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="n_rows">3</property>
-                    <property name="n_columns">7</property>
-                    <property name="column_spacing">6</property>
-                    <property name="row_spacing">6</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="table-properties-border-units-label">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">px</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">6</property>
-                        <property name="right_attach">7</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options"/>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="table-properties-padding-units-label">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">px</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">6</property>
-                        <property name="right_attach">7</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options"/>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="table-properties-spacing-units-label">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">px</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">6</property>
-                        <property name="right_attach">7</property>
-                        <property name="x_options"/>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBox" id="table-properties-width-combo-box">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <signal handler="gtkhtml_editor_table_properties_width_changed_cb" name="changed" 
object="table-properties-window"/>
-                        <property name="model">model3</property>
-                        <child>
-                          <object class="GtkCellRendererText" id="renderer3"/>
-                          <attributes>
-                            <attribute name="text">0</attribute>
-                          </attributes>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                        <property name="x_options"/>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="table-properties-width-spin-button">
-                        <property name="width_request">100</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="adjustment">adjustment5</property>
-                        <signal handler="gtkhtml_editor_table_properties_width_changed_cb" 
name="value_changed" object="table-properties-window"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="table-properties-width-check-button">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="label" translatable="yes">_Width:</property>
-                        <property name="use_underline">True</property>
-                        <property name="xalign">1</property>
-                        <property name="draw_indicator">True</property>
-                        <signal handler="gtkhtml_editor_table_properties_width_changed_cb" name="toggled" 
object="table-properties-window"/>
-                      </object>
-                      <packing>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBox" id="table-properties-alignment-combo-box">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <signal handler="gtkhtml_editor_table_properties_alignment_changed_cb" 
name="changed" object="table-properties-window"/>
-                        <property name="model">model4</property>
-                        <child>
-                          <object class="GtkCellRendererText" id="renderer4"/>
-                          <attributes>
-                            <attribute name="text">0</attribute>
-                          </attributes>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="table-properties-alignment-label">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">_Alignment:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">table-properties-alignment-combo-box</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="table-properties-spacing-label">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">_Spacing:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">table-properties-spacing-spin-button</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">4</property>
-                        <property name="right_attach">5</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="table-properties-padding-label">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">_Padding:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">table-properties-padding-spin-button</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">4</property>
-                        <property name="right_attach">5</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="table-properties-border-label">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">_Border:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">table-properties-border-spin-button</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">4</property>
-                        <property name="right_attach">5</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="table-properties-spacing-spin-button">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="adjustment">adjustment6</property>
-                        <signal handler="gtkhtml_editor_table_properties_spacing_changed_cb" 
name="value_changed" object="table-properties-window"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">5</property>
-                        <property name="right_attach">6</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="table-properties-padding-spin-button">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="adjustment">adjustment7</property>
-                        <signal handler="gtkhtml_editor_table_properties_padding_changed_cb" 
name="value_changed" object="table-properties-window"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">5</property>
-                        <property name="right_attach">6</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkSpinButton" id="table-properties-border-spin-button">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="adjustment">adjustment8</property>
-                        <signal handler="gtkhtml_editor_table_properties_border_changed_cb" 
name="value_changed" object="table-properties-window"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">5</property>
-                        <property name="right_attach">6</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkVBox" id="table-properties-background-vbox">
-            <property name="visible">True</property>
-            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-            <property name="spacing">6</property>
-            <child>
-              <object class="GtkLabel" id="table-properties-background-header">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Background</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-            </child>
-            <child>
-              <object class="GtkAlignment" id="table-properties-background-alignment">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="left_padding">12</property>
-                <child>
-                  <object class="GtkTable" id="table-properties-background-table">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="n_rows">2</property>
-                    <property name="n_columns">2</property>
-                    <property name="column_spacing">6</property>
-                    <property name="row_spacing">6</property>
-                    <child>
-                      <object class="GtkLabel" id="table-properties-color-label">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">Co_lor:</property>
-                        <property name="use_underline">True</property>
-                      </object>
-                      <packing>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="table-properties-image-label">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">_Image:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">table-properties-image-button</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkFileChooserButton" id="table-properties-image-button">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <signal handler="gtkhtml_editor_table_properties_image_changed_cb" 
name="selection_changed" object="table-properties-window"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="EColorCombo" id="table-properties-color-combo" 
type-func="e_color_combo_get_type">
-                        <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="default_color">#000000000000</property>
-                        <property name="default_label">Transparent</property>
-                        <property name="default_transparent">True</property>
-                        <signal handler="gtkhtml_editor_table_properties_color_changed_cb" name="changed" 
object="table-properties-window"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkHButtonBox" id="table-properties-button-box">
-            <property name="visible">True</property>
-            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-            <property name="spacing">12</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <object class="GtkButton" id="table-properties-close-button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label">gtk-close</property>
-                <property name="use_stock">True</property>
-                <signal handler="gtk_widget_hide" name="clicked" object="table-properties-window"/>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
-            <property name="position">3</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-  </object>
   <object class="GtkWindow" id="page-properties-window">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
     <property name="border_width">12</property>
diff --git a/e-util/e-editor-private.h b/e-util/e-editor-private.h
index 0eabc08..2c5b476 100644
--- a/e-util/e-editor-private.h
+++ b/e-util/e-editor-private.h
@@ -28,6 +28,7 @@
 #include <e-editor-replace-dialog.h>
 #include <e-editor-link-dialog.h>
 #include <e-editor-hrule-dialog.h>
+#include <e-editor-table-dialog.h>
 
 #ifdef HAVE_XFREE
 #include <X11/XF86keysym.h>
@@ -60,6 +61,7 @@ struct _EEditorPrivate {
        GtkWidget *replace_dialog;
        GtkWidget *link_dialog;
        GtkWidget *hrule_dialog;
+       GtkWidget *table_dialog;
 
        GtkWidget *color_combo_box;
        GtkWidget *mode_combo_box;
diff --git a/e-util/e-editor-table-dialog.c b/e-util/e-editor-table-dialog.c
index 679b778..06e4a80 100644
--- a/e-util/e-editor-table-dialog.c
+++ b/e-util/e-editor-table-dialog.c
@@ -1,8 +1,11 @@
 /*
  * e-editor-table-dialog.h
  *
+<<<<<<< HEAD
  * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
  *
+=======
+>>>>>>> Make the 'Table properties' dialog work
  * 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
@@ -31,9 +34,16 @@
 #include "e-image-chooser-dialog.h"
 #include "e-misc-utils.h"
 
+<<<<<<< HEAD
 #define E_EDITOR_TABLE_DIALOG_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_EDITOR_TABLE_DIALOG, EEditorTableDialogPrivate))
+=======
+G_DEFINE_TYPE (
+       EEditorTableDialog,
+       e_editor_table_dialog,
+       E_TYPE_EDITOR_DIALOG);
+>>>>>>> Make the 'Table properties' dialog work
 
 struct _EEditorTableDialogPrivate {
        GtkWidget *rows_edit;
@@ -53,16 +63,24 @@ struct _EEditorTableDialogPrivate {
        GtkWidget *background_image_button;
        GtkWidget *image_chooser_dialog;
 
+<<<<<<< HEAD
+=======
+       GtkWidget *close_button;
+
+>>>>>>> Make the 'Table properties' dialog work
        WebKitDOMHTMLTableElement *table_element;
 };
 
 static GdkRGBA white = { 1, 1, 1, 1 };
 
+<<<<<<< HEAD
 G_DEFINE_TYPE (
        EEditorTableDialog,
        e_editor_table_dialog,
        E_TYPE_EDITOR_DIALOG);
 
+=======
+>>>>>>> Make the 'Table properties' dialog work
 static WebKitDOMElement *
 editor_table_dialog_create_table (EEditorTableDialog *dialog)
 {
@@ -88,11 +106,19 @@ editor_table_dialog_create_table (EEditorTableDialog *dialog)
                gint j;
 
                row = webkit_dom_html_table_element_insert_row (
+<<<<<<< HEAD
                        WEBKIT_DOM_HTML_TABLE_ELEMENT (table), -1, NULL);
 
                for (j = 0; j < 3; j++) {
                        webkit_dom_html_table_row_element_insert_cell (
                                WEBKIT_DOM_HTML_TABLE_ROW_ELEMENT (row), -1, NULL);
+=======
+                       (WebKitDOMHTMLTableElement *) table, -1, NULL);
+
+               for (j = 0; j < 3; j++) {
+                       webkit_dom_html_table_row_element_insert_cell (
+                               (WebKitDOMHTMLTableRowElement *) row, -1, NULL);
+>>>>>>> Make the 'Table properties' dialog work
                }
        }
 
@@ -159,7 +185,11 @@ editor_table_dialog_set_column_count (EEditorTableDialog *dialog)
                WebKitDOMHTMLCollection *cells;
                gulong jj, current_columns;
 
+<<<<<<< HEAD
                row = WEBKIT_DOM_HTML_TABLE_ROW_ELEMENT (
+=======
+               row = (WebKitDOMHTMLTableRowElement *) (
+>>>>>>> Make the 'Table properties' dialog work
                        webkit_dom_html_collection_item (rows, ii));
 
                cells = webkit_dom_html_table_row_element_get_cells (row);
@@ -191,7 +221,11 @@ editor_table_dialog_get_column_count (EEditorTableDialog *dialog)
        row = webkit_dom_html_collection_item (rows, 0);
 
        columns = webkit_dom_html_table_row_element_get_cells (
+<<<<<<< HEAD
                                WEBKIT_DOM_HTML_TABLE_ROW_ELEMENT (row));
+=======
+                               (WebKitDOMHTMLTableRowElement *) row);
+>>>>>>> Make the 'Table properties' dialog work
 
        gtk_spin_button_set_value (
                GTK_SPIN_BUTTON (dialog->priv->columns_edit),
@@ -207,16 +241,25 @@ editor_table_dialog_set_width (EEditorTableDialog *dialog)
 
        if (gtk_toggle_button_get_active (
                        GTK_TOGGLE_BUTTON (dialog->priv->width_check))) {
+<<<<<<< HEAD
                gchar *units;
 
                units = gtk_combo_box_text_get_active_text (
                                GTK_COMBO_BOX_TEXT (dialog->priv->width_units));
+=======
+
+>>>>>>> Make the 'Table properties' dialog work
                width = g_strdup_printf (
                        "%d%s",
                        gtk_spin_button_get_value_as_int (
                                GTK_SPIN_BUTTON (dialog->priv->width_edit)),
+<<<<<<< HEAD
                        units);
                g_free (units);
+=======
+                       gtk_combo_box_text_get_active_text (
+                               GTK_COMBO_BOX_TEXT (dialog->priv->width_units)));
+>>>>>>> Make the 'Table properties' dialog work
 
                gtk_widget_set_sensitive (dialog->priv->width_edit, TRUE);
                gtk_widget_set_sensitive (dialog->priv->width_units, TRUE);
@@ -257,7 +300,10 @@ editor_table_dialog_get_width (EEditorTableDialog *dialog)
                        ((strstr (width, "%") == NULL) ?
                                "units-px" : "units-percent"));
        }
+<<<<<<< HEAD
        g_free (width);
+=======
+>>>>>>> Make the 'Table properties' dialog work
 }
 
 static void
@@ -294,8 +340,12 @@ editor_table_dialog_set_padding (EEditorTableDialog *dialog)
 
        g_return_if_fail (dialog->priv->table_element);
 
+<<<<<<< HEAD
        padding = g_strdup_printf (
                "%d",
+=======
+       padding = g_strdup_printf ("%d",
+>>>>>>> Make the 'Table properties' dialog work
                        gtk_spin_button_get_value_as_int (
                                GTK_SPIN_BUTTON (dialog->priv->padding_edit)));
 
@@ -334,8 +384,12 @@ editor_table_dialog_set_spacing (EEditorTableDialog *dialog)
 
        g_return_if_fail (dialog->priv->table_element);
 
+<<<<<<< HEAD
        spacing = g_strdup_printf (
                "%d",
+=======
+       spacing = g_strdup_printf ("%d",
+>>>>>>> Make the 'Table properties' dialog work
                        gtk_spin_button_get_value_as_int (
                                GTK_SPIN_BUTTON (dialog->priv->spacing_edit)));
 
@@ -374,8 +428,12 @@ editor_table_dialog_set_border (EEditorTableDialog *dialog)
 
        g_return_if_fail (dialog->priv->table_element);
 
+<<<<<<< HEAD
        border = g_strdup_printf (
                "%d",
+=======
+       border = g_strdup_printf ("%d",
+>>>>>>> Make the 'Table properties' dialog work
                        gtk_spin_button_get_value_as_int (
                                GTK_SPIN_BUTTON (dialog->priv->border_edit)));
 
@@ -474,7 +532,11 @@ editor_table_dialog_get_background_image (EEditorTableDialog *dialog)
        if (!webkit_dom_element_has_attribute (
                WEBKIT_DOM_ELEMENT (dialog->priv->table_element), "background")) {
 
+<<<<<<< HEAD
                gtk_file_chooser_unselect_all (
+=======
+               gtk_file_chooser_unselect_all(
+>>>>>>> Make the 'Table properties' dialog work
                        GTK_FILE_CHOOSER (dialog->priv->background_image_button));
                return;
        } else {
@@ -492,6 +554,17 @@ editor_table_dialog_get_background_image (EEditorTableDialog *dialog)
 }
 
 static void
+<<<<<<< HEAD
+=======
+editor_table_dialog_close (EEditorTableDialog *dialog)
+{
+       gtk_widget_hide (GTK_WIDGET (dialog));
+
+       dialog->priv->table_element = NULL;
+}
+
+static void
+>>>>>>> Make the 'Table properties' dialog work
 editor_table_dialog_get_values (EEditorTableDialog *dialog)
 {
        editor_table_dialog_get_row_count (dialog);
@@ -545,6 +618,10 @@ editor_table_dialog_reset_values (EEditorTableDialog *dialog)
        editor_table_dialog_set_background_image (dialog);
 }
 
+<<<<<<< HEAD
+=======
+
+>>>>>>> Make the 'Table properties' dialog work
 static void
 editor_table_dialog_show (GtkWidget *widget)
 {
@@ -567,6 +644,7 @@ editor_table_dialog_show (GtkWidget *widget)
                WebKitDOMRange *range;
 
                range = webkit_dom_dom_selection_get_range_at (selection, 0, NULL);
+<<<<<<< HEAD
                table = e_editor_dom_node_find_parent_element (
                        webkit_dom_range_get_start_container (range, NULL), "TABLE");
 
@@ -577,6 +655,19 @@ editor_table_dialog_show (GtkWidget *widget)
                } else {
                        dialog->priv->table_element =
                                WEBKIT_DOM_HTML_TABLE_ELEMENT (table);
+=======
+               table = e_editor_dom_node_get_parent_element (
+                       webkit_dom_range_get_start_container (range, NULL),
+                       WEBKIT_TYPE_DOM_HTML_TABLE_ELEMENT);
+
+               if (!table) {
+                       dialog->priv->table_element = (WebKitDOMHTMLTableElement *)
+                               editor_table_dialog_create_table (dialog);
+                       editor_table_dialog_reset_values (dialog);
+               } else {
+                       dialog->priv->table_element =
+                               (WebKitDOMHTMLTableElement *) table;
+>>>>>>> Make the 'Table properties' dialog work
                        editor_table_dialog_get_values (dialog);
                }
        }
@@ -586,6 +677,7 @@ editor_table_dialog_show (GtkWidget *widget)
 }
 
 static void
+<<<<<<< HEAD
 editor_table_dialog_hide (GtkWidget *widget)
 {
        EEditorTableDialogPrivate *priv;
@@ -607,11 +699,23 @@ e_editor_table_dialog_class_init (EEditorTableDialogClass *class)
        widget_class = GTK_WIDGET_CLASS (class);
        widget_class->show = editor_table_dialog_show;
        widget_class->hide = editor_table_dialog_hide;
+=======
+e_editor_table_dialog_class_init (EEditorTableDialogClass *klass)
+{
+       GtkWidgetClass *widget_class;
+
+       g_type_class_peek_parent (klass);
+       g_type_class_add_private (klass, sizeof (EEditorTableDialogPrivate));
+
+       widget_class = GTK_WIDGET_CLASS (klass);
+       widget_class->show = editor_table_dialog_show;
+>>>>>>> Make the 'Table properties' dialog work
 }
 
 static void
 e_editor_table_dialog_init (EEditorTableDialog *dialog)
 {
+<<<<<<< HEAD
        GtkGrid *main_layout, *grid;
        GtkWidget *widget;
        GtkFileFilter *file_filter;
@@ -619,17 +723,38 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv = E_EDITOR_TABLE_DIALOG_GET_PRIVATE (dialog);
 
        main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
+=======
+       GtkBox *main_layout, *box;
+       GtkGrid *grid;
+       GtkWidget *widget;
+       GtkFileFilter *file_filter;
+
+       dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
+               dialog, E_TYPE_EDITOR_TABLE_DIALOG, EEditorTableDialogPrivate);
+
+       main_layout = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 5));
+       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
+       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+>>>>>>> Make the 'Table properties' dialog work
 
        /* == General == */
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>General</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
+<<<<<<< HEAD
        gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
+=======
+       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+>>>>>>> Make the 'Table properties' dialog work
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
+<<<<<<< HEAD
        gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 1, 1, 1);
+=======
+       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+>>>>>>> Make the 'Table properties' dialog work
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Rows */
@@ -645,7 +770,10 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->rows_edit = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Rows:"));
+<<<<<<< HEAD
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
+=======
+>>>>>>> Make the 'Table properties' dialog work
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->rows_edit);
        gtk_grid_attach (grid, widget, 1, 0, 1, 1);
 
@@ -662,24 +790,43 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->columns_edit = widget;
 
        widget = gtk_label_new_with_mnemonic (_("C_olumns:"));
+<<<<<<< HEAD
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->columns_edit);
        gtk_grid_attach (grid, widget, 4, 0, 1, 1);
 
+=======
+       gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->columns_edit);
+       gtk_grid_attach (grid, widget, 4, 0, 1, 1);
+
+
+>>>>>>> Make the 'Table properties' dialog work
        /* == Layout == */
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Layout</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
+<<<<<<< HEAD
        gtk_grid_attach (main_layout, widget, 0, 2, 1, 1);
+=======
+       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+>>>>>>> Make the 'Table properties' dialog work
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
+<<<<<<< HEAD
        gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 3, 1, 1);
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Width */
        widget = gtk_check_button_new_with_mnemonic (_("_Width:"));
+=======
+       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+       gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
+
+       /* Width */
+       widget = gtk_check_button_new_with_mnemonic (_("Width:"));
+>>>>>>> Make the 'Table properties' dialog work
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
        g_signal_connect_swapped (
                widget, "toggled",
@@ -713,7 +860,10 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->spacing_edit = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Spacing:"));
+<<<<<<< HEAD
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
+=======
+>>>>>>> Make the 'Table properties' dialog work
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->spacing_edit);
        gtk_grid_attach (grid, widget, 4, 0, 1, 1);
 
@@ -730,7 +880,10 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->padding_edit = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Padding:"));
+<<<<<<< HEAD
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
+=======
+>>>>>>> Make the 'Table properties' dialog work
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->padding_edit);
        gtk_grid_attach (grid, widget, 4, 1, 1, 1);
 
@@ -747,7 +900,10 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->border_edit = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Border:"));
+<<<<<<< HEAD
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
+=======
+>>>>>>> Make the 'Table properties' dialog work
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->border_edit);
        gtk_grid_attach (grid, widget, 4, 2, 1, 1);
 
@@ -766,7 +922,10 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->alignment_combo = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Alignment:"));
+<<<<<<< HEAD
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
+=======
+>>>>>>> Make the 'Table properties' dialog work
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->alignment_combo);
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
 
@@ -774,12 +933,20 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        widget = gtk_label_new ("");
        gtk_label_set_markup (GTK_LABEL (widget), _("<b>Background</b>"));
        gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
+<<<<<<< HEAD
        gtk_grid_attach (main_layout, widget, 0, 4, 1, 1);
+=======
+       gtk_box_pack_start (main_layout, widget, TRUE, TRUE, 5);
+>>>>>>> Make the 'Table properties' dialog work
 
        grid = GTK_GRID (gtk_grid_new ());
        gtk_grid_set_row_spacing (grid, 5);
        gtk_grid_set_column_spacing (grid, 5);
+<<<<<<< HEAD
        gtk_grid_attach (main_layout, GTK_WIDGET (grid), 0, 5, 1, 1);
+=======
+       gtk_box_pack_start (main_layout, GTK_WIDGET (grid), TRUE, TRUE, 0);
+>>>>>>> Make the 'Table properties' dialog work
        gtk_widget_set_margin_left (GTK_WIDGET (grid), 10);
 
        /* Color */
@@ -793,7 +960,10 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
        dialog->priv->background_color_button = widget;
 
        widget = gtk_label_new_with_mnemonic (_("_Color:"));
+<<<<<<< HEAD
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
+=======
+>>>>>>> Make the 'Table properties' dialog work
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->background_color_button);
        gtk_grid_attach (grid, widget, 0, 0, 1, 1);
@@ -818,12 +988,32 @@ e_editor_table_dialog_init (EEditorTableDialog *dialog)
                G_CALLBACK (editor_table_dialog_set_background_image), dialog);
        dialog->priv->background_image_button = widget;
 
+<<<<<<< HEAD
        widget =gtk_label_new_with_mnemonic (_("Image:"));
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
+=======
+
+       widget =gtk_label_new_with_mnemonic (_("Image:"));
+>>>>>>> Make the 'Table properties' dialog work
        gtk_label_set_mnemonic_widget (
                GTK_LABEL (widget), dialog->priv->background_image_button);
        gtk_grid_attach (grid, widget, 0, 1, 1, 1);
 
+<<<<<<< HEAD
+=======
+       /* == Button box == */
+       box = GTK_BOX (gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL));
+       gtk_button_box_set_layout (GTK_BUTTON_BOX (box), GTK_BUTTONBOX_END);
+       gtk_box_pack_start (main_layout, GTK_WIDGET (box), TRUE, TRUE, 0);
+
+       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
+       gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
+       g_signal_connect_swapped (
+               widget, "clicked",
+               G_CALLBACK (editor_table_dialog_close), dialog);
+       dialog->priv->close_button = widget;
+
+>>>>>>> Make the 'Table properties' dialog work
        gtk_widget_show_all (GTK_WIDGET (main_layout));
 }
 
@@ -835,6 +1025,10 @@ e_editor_table_dialog_new (EEditor *editor)
                        E_TYPE_EDITOR_TABLE_DIALOG,
                        "editor", editor,
                        "title", N_("Table Properties"),
+<<<<<<< HEAD
                        NULL));
+=======
+                       NULL)); 
+>>>>>>> Make the 'Table properties' dialog work
 }
 
diff --git a/e-util/e-editor-table-dialog.h b/e-util/e-editor-table-dialog.h
index 834b3c4..d164cb6 100644
--- a/e-util/e-editor-table-dialog.h
+++ b/e-util/e-editor-table-dialog.h
@@ -1,8 +1,11 @@
 /*
  * e-editor-table-dialog.h
  *
+<<<<<<< HEAD
  * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
  *
+=======
+>>>>>>> Make the 'Table properties' dialog work
  * 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 _EEditorTableDialogPrivate EEditorTableDialogPrivate;
 
 struct _EEditorTableDialog {
        EEditorDialog parent;
+<<<<<<< HEAD
+=======
+
+>>>>>>> Make the 'Table properties' dialog work
        EEditorTableDialogPrivate *priv;
 };
 
@@ -61,8 +68,14 @@ struct _EEditorTableDialogClass {
        EEditorDialogClass parent_class;
 };
 
+<<<<<<< HEAD
 GType          e_editor_table_dialog_get_type  (void) G_GNUC_CONST;
 GtkWidget *    e_editor_table_dialog_new       (EEditor *editor);
+=======
+GType          e_editor_table_dialog_get_type  (void);
+
+GtkWidget*     e_editor_table_dialog_new       (EEditor *editor);
+>>>>>>> Make the 'Table properties' dialog work
 
 G_END_DECLS
 
diff --git a/e-util/e-editor-utils.c b/e-util/e-editor-utils.c
index 8509e03..29ca04c 100644
--- a/e-util/e-editor-utils.c
+++ b/e-util/e-editor-utils.c
@@ -37,3 +37,26 @@ e_editor_dom_node_get_parent_element (WebKitDOMNode *node,
 
        return NULL;
 }
+
+WebKitDOMElement *
+e_editor_dom_node_find_child_element (WebKitDOMNode *node,
+                                     GType child_type)
+{
+       WebKitDOMNode *start_node = node;
+
+       do {
+               if (G_TYPE_CHECK_INSTANCE_TYPE (node, child_type)) {
+                       return WEBKIT_DOM_ELEMENT (node);
+               }
+
+               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));
+
+       return NULL;
+}
diff --git a/e-util/e-editor-widgets.h b/e-util/e-editor-widgets.h
index 5901c4e..ee8f818 100644
--- a/e-util/e-editor-widgets.h
+++ b/e-util/e-editor-widgets.h
@@ -117,32 +117,6 @@
 #define E_EDITOR_WIDGETS_SPELL_WINDOW(editor) \
        E_EDITOR_WIDGETS ((editor), "spell-window")
 
-/* Table Properties Window */
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_ALIGNMENT_COMBO_BOX(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-alignment-combo-box")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_BORDER_SPIN_BUTTON(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-border-spin-button")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_COLOR_COMBO(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-color-combo")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_COLS_SPIN_BUTTON(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-cols-spin-button")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_IMAGE_BUTTON(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-image-button")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_PADDING_SPIN_BUTTON(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-padding-spin-button")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_ROWS_SPIN_BUTTON(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-rows-spin-button")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_SPACING_SPIN_BUTTON(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-spacing-spin-button")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_WIDTH_CHECK_BUTTON(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-width-check-button")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_WIDTH_COMBO_BOX(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-width-combo-box")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_WIDTH_SPIN_BUTTON(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-width-spin-button")
-#define E_EDITOR_WIDGETS_TABLE_PROPERTIES_WINDOW(editor) \
-       E_EDITOR_WIDGETS ((editor), "table-properties-window")
-
 /* Text Properties Window */
 #define E_EDITOR_WIDGETS_TEXT_PROPERTIES_BOLD_BUTTON(editor) \
        E_EDITOR_WIDGETS ((editor), "text-properties-bold-button")
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 5348909..329a859 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -98,6 +98,7 @@
 #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-table-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]