[gtranslator/gtk4: 21/52] File loading now works but with exception of segfault bug due to g_autofree




commit 6877895a88806e8747b57d53381176e2281a3889
Author: afshan ahmed khan <afshanahmeda2k gmail com>
Date:   Mon Jun 13 12:24:44 2022 +0530

    File loading now works but with exception of segfault bug due to g_autofree

 src/gtr-actions-file.c                             |  11 +-
 src/gtr-context-old.ui                             |  46 ++
 src/gtr-context.c                                  |   3 +
 src/gtr-context.ui                                 |  33 +-
 src/gtr-message-table-old.ui                       |  33 +
 src/gtr-message-table.c                            |   2 +
 src/gtr-message-table.ui                           |  23 +-
 src/gtr-progress.c                                 |   5 +-
 src/gtr-projects.ui                                |   1 +
 src/gtr-search-bar-old.ui                          | 290 +++++++++
 src/gtr-search-bar.c                               |   5 +-
 src/gtr-search-bar.ui                              | 239 +++----
 src/gtr-tab-new.ui                                 | 616 ++++++++++++++++++
 src/gtr-tab-old.ui                                 | 499 +++++++++++++++
 src/gtr-tab.c                                      |  13 +-
 src/gtr-tab.ui                                     | 692 ++++++---------------
 src/gtr-view.c                                     |  69 +-
 src/gtr-window.c                                   |   6 +-
 src/gtranslator.gresource.xml                      |   1 -
 src/translation-memory/gtr-translation-memory-ui.c |   4 +-
 20 files changed, 1858 insertions(+), 733 deletions(-)
---
diff --git a/src/gtr-actions-file.c b/src/gtr-actions-file.c
index fbca2e50..a7e3c343 100644
--- a/src/gtr-actions-file.c
+++ b/src/gtr-actions-file.c
@@ -155,18 +155,18 @@ gtr_po_parse_files_from_dialog (GtkNativeDialog * dialog, GtrWindow * window)
     }*/
 
   po_files_model = gtk_file_chooser_get_files (GTK_FILE_CHOOSER (dialog));
-  guint i = 0;
+  g_autofree guint i = 0;
   while (i < g_list_model_get_n_items(po_files_model)) {
-    GFile *file = g_list_model_get_item(po_files_model, i);
+    file = g_list_model_get_item(po_files_model, i);
     locations = g_slist_prepend (locations, file);
+    i++;
   }
-  g_free(i);
 
   /*
    * We store latest directory
    */
-  file = g_file_new_for_uri (po_files->data);
-  g_slist_free_full (po_files, g_free);
+  //file = g_file_new_for_uri (po_files->data);
+  //g_slist_free_full (po_files, g_free);
 
   parent = g_file_get_parent (file);
   g_object_unref (file);
@@ -181,6 +181,7 @@ gtr_po_parse_files_from_dialog (GtkNativeDialog * dialog, GtrWindow * window)
    * Open the file via our centralized opening function.
    */
   load_file_list (window, (const GSList *) locations);
+  g_printf("loaded files\n");
   g_slist_free_full (locations, g_object_unref);
 }
 
diff --git a/src/gtr-context-old.ui b/src/gtr-context-old.ui
new file mode 100644
index 00000000..80adb0fc
--- /dev/null
+++ b/src/gtr-context-old.ui
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.15.3 on Fri Sep  6 09:32:24 2013 -->
+<interface>
+  <!-- interface-requires gtk+ 3.10 -->
+  <object class="GtkTextBuffer" id="textbuffer1"/>
+  <template class="GtrContextPanel" parent="GtkBox">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">2</property>
+    <child>
+      <object class="GtkBox" id="translation_memory_box">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">False</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkScrolledWindow" id="sw">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkTextView" id="context">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="editable">False</property>
+            <property name="wrap_mode">word</property>
+            <property name="buffer">textbuffer1</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </template>
+</interface>
+
diff --git a/src/gtr-context.c b/src/gtr-context.c
index 0b18678a..9c40f633 100644
--- a/src/gtr-context.c
+++ b/src/gtr-context.c
@@ -412,6 +412,7 @@ buffer_end_user_action (GtkTextBuffer *buffer, GtrContextPanel *panel)
 static void
 gtr_context_panel_init (GtrContextPanel *panel)
 {
+  g_printf("init: contextpanel\n");
   GtrContextPanelPrivate *priv;
   GtkTextBuffer *buffer;
   GdkDisplay *display;
@@ -522,6 +523,7 @@ gtr_context_panel_dispose (GObject *object)
 static void
 gtr_context_panel_class_init (GtrContextPanelClass * klass)
 {
+  g_printf("class init: contextpanel\n");
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
@@ -568,6 +570,7 @@ gtr_context_panel_class_init (GtrContextPanelClass * klass)
 GtkWidget *
 gtr_context_panel_new (void)
 {
+  g_printf("creating context\n");
   return g_object_new (GTR_TYPE_CONTEXT_PANEL, NULL);
 }
 
diff --git a/src/gtr-context.ui b/src/gtr-context.ui
index 80adb0fc..60f20810 100644
--- a/src/gtr-context.ui
+++ b/src/gtr-context.ui
@@ -1,46 +1,29 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.15.3 on Fri Sep  6 09:32:24 2013 -->
 <interface>
-  <!-- interface-requires gtk+ 3.10 -->
+  <requires lib="gtk" version="4.0"/>
   <object class="GtkTextBuffer" id="textbuffer1"/>
   <template class="GtrContextPanel" parent="GtkBox">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
     <property name="orientation">vertical</property>
     <property name="spacing">2</property>
     <child>
       <object class="GtkBox" id="translation_memory_box">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
+        <property name="valign">center</property>
         <property name="orientation">vertical</property>
       </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">False</property>
-        <property name="position">0</property>
-      </packing>
     </child>
     <child>
       <object class="GtkScrolledWindow" id="sw">
-        <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <property name="shadow_type">none</property>
-        <child>
+        <property name="vexpand">1</property>
+        <property name="focusable">1</property>
+        <property name="child">
           <object class="GtkTextView" id="context">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="editable">False</property>
+            <property name="focusable">1</property>
+            <property name="editable">0</property>
             <property name="wrap_mode">word</property>
             <property name="buffer">textbuffer1</property>
           </object>
-        </child>
+        </property>
       </object>
-      <packing>
-        <property name="expand">True</property>
-        <property name="fill">True</property>
-        <property name="position">1</property>
-      </packing>
     </child>
   </template>
 </interface>
-
diff --git a/src/gtr-message-table-old.ui b/src/gtr-message-table-old.ui
new file mode 100644
index 00000000..29a81177
--- /dev/null
+++ b/src/gtr-message-table-old.ui
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.15.3 on Thu Sep  5 03:07:11 2013 -->
+<interface>
+  <!-- interface-requires gtk+ 3.10 -->
+  <template class="GtrMessageTable" parent="GtkBox">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="orientation">vertical</property>
+    <child>
+      <object class="GtkScrolledWindow" id="scrolledwindow1">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkTreeView" id="treeview">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="rules_hint">True</property>
+            <child internal-child="selection">
+              <object class="GtkTreeSelection" id="treeview-selection"/>
+            </child>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+  </template>
+  <object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
+</interface>
diff --git a/src/gtr-message-table.c b/src/gtr-message-table.c
index 86ad5c69..d26b14b8 100644
--- a/src/gtr-message-table.c
+++ b/src/gtr-message-table.c
@@ -271,6 +271,7 @@ gtr_message_table_init (GtrMessageTable * table)
 
   g_signal_connect (G_OBJECT (selection), "changed",
                     G_CALLBACK (gtr_message_table_selection_changed), table);
+  g_printf("init: message table\n");
 }
 
 static void
@@ -353,6 +354,7 @@ gtr_message_table_class_init (GtrMessageTableClass * klass)
                                                "/org/gnome/translator/gtr-message-table.ui");
 
   gtk_widget_class_bind_template_child_private (widget_class, GtrMessageTable, treeview);
+  g_printf("class init: message table\n");
 }
 
 /**
diff --git a/src/gtr-message-table.ui b/src/gtr-message-table.ui
index 29a81177..05796e6d 100644
--- a/src/gtr-message-table.ui
+++ b/src/gtr-message-table.ui
@@ -1,32 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.15.3 on Thu Sep  5 03:07:11 2013 -->
 <interface>
-  <!-- interface-requires gtk+ 3.10 -->
+  <requires lib="gtk" version="4.0"/>
   <template class="GtrMessageTable" parent="GtkBox">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
     <property name="orientation">vertical</property>
     <child>
       <object class="GtkScrolledWindow" id="scrolledwindow1">
-        <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <property name="shadow_type">none</property>
-        <child>
+        <property name="vexpand">1</property>
+        <property name="focusable">1</property>
+        <property name="child">
           <object class="GtkTreeView" id="treeview">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="rules_hint">True</property>
+            <property name="focusable">1</property>
             <child internal-child="selection">
               <object class="GtkTreeSelection" id="treeview-selection"/>
             </child>
           </object>
-        </child>
+        </property>
       </object>
-      <packing>
-        <property name="expand">True</property>
-        <property name="fill">True</property>
-        <property name="position">0</property>
-      </packing>
     </child>
   </template>
   <object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
diff --git a/src/gtr-progress.c b/src/gtr-progress.c
index f2333f8e..a7384f8f 100644
--- a/src/gtr-progress.c
+++ b/src/gtr-progress.c
@@ -195,8 +195,9 @@ gtr_progress_init (GtrProgress *self)
   priv->fuzzy = 0;
 
   gtk_widget_set_size_request (GTK_WIDGET (self), -1, 8);
-  g_signal_connect (G_OBJECT (self), "draw",
-                    G_CALLBACK (on_draw), NULL);
+  //g_signal_connect (G_OBJECT (self), "draw",
+                    //G_CALLBACK (on_draw), NULL);
+  gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA(self), on_draw, NULL, NULL);
 }
 
 GtrProgress*
diff --git a/src/gtr-projects.ui b/src/gtr-projects.ui
index c6933d49..b08fb191 100644
--- a/src/gtr-projects.ui
+++ b/src/gtr-projects.ui
@@ -94,6 +94,7 @@
       </object>
     </child>
   </object>
+
   <object class="GtkPopoverMenu" id="main_menu_popover">
     <property name="menu_model">app-menu</property>
   </object>
diff --git a/src/gtr-search-bar-old.ui b/src/gtr-search-bar-old.ui
new file mode 100644
index 00000000..32e917e8
--- /dev/null
+++ b/src/gtr-search-bar-old.ui
@@ -0,0 +1,290 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <template class="GtrSearchBar" parent="AdwBin">
+    <style>
+      <class name="search-frame"/>
+    </style>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">true</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">7</property>
+        <child>
+          <object class="GtkGrid">
+            <property name="visible">true</property>
+            <property name="can-focus">false</property>
+            <property name="row_spacing">8</property>
+            <property name="column_spacing">8</property>
+            <child>
+              <object class="GtkEntry" id="search_entry">
+                <property name="visible">true</property>
+                <property name="can-focus">true</property>
+                <property name="hexpand">true</property>
+                <property name="primary_icon_name">edit-find-symbolic</property>
+                <property name="primary_icon_activatable">false</property>
+                <property name="primary_icon_sensitive">false</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="search_text_error">
+                <property name="visible">false</property>
+                <property name="xalign">0.0</property>
+                <style>
+                  <class name="dim-label"/>
+                </style>
+                <attributes>
+                  <attribute name="scale" value="0.8333"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="width">3</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="replace_entry">
+                <property name="visible">false</property>
+                <property name="can-focus">true</property>
+                <property name="width-chars">20</property>
+                <property name="max-width-chars">30</property>
+                <property name="primary_icon_name">edit-find-replace-symbolic</property>
+                <property name="primary_icon_activatable">false</property>
+                <property name="primary_icon_sensitive">false</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox">
+                <property name="homogeneous">true</property>
+                <property name="visible">true</property>
+                <property name="can-focus">false</property>
+                <property name="valign">center</property>
+                <style>
+                  <class name="linked"/>
+                </style>
+                <child>
+                  <object class="GtkButton" id="previous_button">
+                    <!-- <property name="action-name">editor-search.move-previous</property> -->
+                    <property name="visible">true</property>
+                    <property name="can-focus">false</property>
+                    <child>
+                      <object class="GtkImage">
+                        <property name="visible">true</property>
+                        <property name="can-focus">false</property>
+                        <property name="icon_name">go-up-symbolic</property>
+                        <property name="icon_size">1</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">false</property>
+                    <property name="fill">true</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="next_button">
+                    <!-- <property name="action-name">editor-search.move-next</property> -->
+                    <property name="visible">true</property>
+                    <property name="can-focus">false</property>
+                    <child>
+                      <object class="GtkImage">
+                        <property name="visible">true</property>
+                        <property name="can-focus">false</property>
+                        <property name="icon_name">go-down-symbolic</property>
+                        <property name="icon_size">1</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">false</property>
+                    <property name="fill">true</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="replace_button">
+                <property name="label" translatable="yes">Replace</property>
+                <!-- <property name="action-name">editor-search.replace</property> -->
+                <property name="visible">false</property>
+                <property name="can-focus">true</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="replace_all_button">
+                <property name="label" translatable="yes">Replace All</property>
+                <!-- <property name="action-name">editor-search.replace-all</property> -->
+                <property name="visible">false</property>
+                <property name="can-focus">true</property>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox">
+                <property name="homogeneous">true</property>
+                <property name="visible">true</property>
+                <property name="can-focus">false</property>
+                <property name="valign">center</property>
+                <property name="spacing">8</property>
+                <child>
+                  <object class="GtkToggleButton">
+                    <property name="active" bind-source="GtrSearchBar" bind-property="replace-mode" 
bind-flags="sync-create|bidirectional"/>
+                    <property name="tooltip-text" translatable="yes">Switch between Search and 
Search-and-Replace</property>
+                    <property name="visible">true</property>
+                    <property name="can-focus">true</property>
+                    <property name="image_position">right</property>
+                    <child>
+                      <object class="GtkImage">
+                        <property name="visible">true</property>
+                        <property name="can-focus">false</property>
+                        <property name="icon_name">edit-find-replace-symbolic</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">false</property>
+                    <property name="fill">true</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkToggleButton" id="show_options">
+                    <property name="tooltip-text" translatable="yes">Show or hide search options such as 
case sensitivity</property>
+                    <property name="focus-on-click">false</property>
+                    <property name="visible">true</property>
+                    <property name="can-focus">true</property>
+                    <property name="active" bind-source="GtrSearchBar" bind-property="show-options" 
bind-flags="sync-create|bidirectional"/>
+                    <child>
+                      <object class="GtkImage">
+                        <property name="visible">true</property>
+                        <property name="can-focus">false</property>
+                        <property name="icon_name">emblem-system-symbolic</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">false</property>
+                    <property name="fill">true</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">false</property>
+            <property name="fill">true</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="search_options">
+            <property name="visible">false</property>
+            <property name="can-focus">false</property>
+            <property name="column_spacing">8</property>
+            <child>
+              <object class="GtkCheckButton" id="case_sensitive">
+                <property name="label" translatable="yes">Case sensitive</property>
+                <property name="visible">true</property>
+                <property name="can-focus">false</property>
+                <property name="xalign">0</property>
+                <property name="draw-indicator">true</property>
+                <property name="action-name">search-settings.case-sensitive</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="whole_word">
+                <property name="label" translatable="yes">Match whole word only</property>
+                <property name="visible">true</property>
+                <property name="can-focus">false</property>
+                <property name="xalign">0</property>
+                <property name="draw-indicator">true</property>
+                <property name="action-name">search-settings.at-word-boundaries</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="wrap_around_button">
+                <property name="label" translatable="yes">Wrap Around</property>
+                <property name="visible">true</property>
+                <property name="can-focus">false</property>
+                <property name="xalign">1</property>
+                <property name="draw-indicator">true</property>
+                <property name="action-name">search-settings.wrap-around</property>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="original_text_checkbutton">
+                <property name="label" translatable="yes">Original text</property>
+                <property name="visible">true</property>
+                <property name="can-focus">false</property>
+                <property name="xalign">1</property>
+                <property name="draw-indicator">true</property>
+                <property name="action-name">search-settings.at-original-text</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="translated_text_checkbutton">
+                <property name="label" translatable="yes">Translated text</property>
+                <property name="visible">true</property>
+                <property name="can-focus">false</property>
+                <property name="xalign">1</property>
+                <property name="draw-indicator">true</property>
+                <property name="action-name">search-settings.at-translated-text</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">false</property>
+            <property name="fill">true</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>
diff --git a/src/gtr-search-bar.c b/src/gtr-search-bar.c
index 48206b3f..38cb8f26 100644
--- a/src/gtr-search-bar.c
+++ b/src/gtr-search-bar.c
@@ -681,6 +681,7 @@ gtr_search_bar_class_init (GtrSearchBarClass *klass)
                                 "stop-search", 0);*/
   gtk_widget_class_add_binding_signal (GTK_WIDGET_CLASS(klass), GDK_KEY_Escape, 0, 
                                       "stop-search", NULL);
+  g_printf("class init: search bar\n");
 }
 
 static void
@@ -696,7 +697,8 @@ gtr_search_bar_init (GtrSearchBar *self)
   self->at_original_text = TRUE;
   self->at_translated_text = TRUE;
 
-  g_object_set (G_OBJECT (self->next_button), "can-default", TRUE, NULL);
+  //TODO: Replace in gtk4
+  //g_object_set (G_OBJECT (self->next_button), "can-default", TRUE, NULL);
 
   self->search_bindings = g_binding_group_new ();
 
@@ -747,6 +749,7 @@ gtr_search_bar_init (GtrSearchBar *self)
                             self);
 
   add_actions (self);
+  g_printf("init: search bar\n");
 }
 
 void
diff --git a/src/gtr-search-bar.ui b/src/gtr-search-bar.ui
index 32e917e8..00923f48 100644
--- a/src/gtr-search-bar.ui
+++ b/src/gtr-search-bar.ui
@@ -1,288 +1,211 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
+  <requires lib="gtk" version="4.0"/>
   <template class="GtrSearchBar" parent="AdwBin">
     <style>
       <class name="search-frame"/>
     </style>
     <child>
       <object class="GtkBox">
-        <property name="visible">true</property>
         <property name="orientation">vertical</property>
         <property name="spacing">7</property>
         <child>
           <object class="GtkGrid">
-            <property name="visible">true</property>
-            <property name="can-focus">false</property>
             <property name="row_spacing">8</property>
             <property name="column_spacing">8</property>
             <child>
               <object class="GtkEntry" id="search_entry">
-                <property name="visible">true</property>
-                <property name="can-focus">true</property>
-                <property name="hexpand">true</property>
+                <property name="focusable">1</property>
+                <property name="hexpand">1</property>
                 <property name="primary_icon_name">edit-find-symbolic</property>
-                <property name="primary_icon_activatable">false</property>
-                <property name="primary_icon_sensitive">false</property>
+                <property name="primary_icon_activatable">0</property>
+                <property name="primary_icon_sensitive">0</property>
+                <layout>
+                  <property name="column">0</property>
+                  <property name="row">0</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkLabel" id="search_text_error">
-                <property name="visible">false</property>
+                <property name="visible">0</property>
                 <property name="xalign">0.0</property>
                 <style>
                   <class name="dim-label"/>
                 </style>
                 <attributes>
-                  <attribute name="scale" value="0.8333"/>
+                  <attribute name="scale" value="0.8333"></attribute>
                 </attributes>
+                <layout>
+                  <property name="column">0</property>
+                  <property name="column-span">3</property>
+                  <property name="row">1</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="width">3</property>
-                <property name="top_attach">1</property>
-              </packing>
             </child>
             <child>
               <object class="GtkEntry" id="replace_entry">
-                <property name="visible">false</property>
-                <property name="can-focus">true</property>
+                <property name="visible">0</property>
+                <property name="focusable">1</property>
                 <property name="width-chars">20</property>
                 <property name="max-width-chars">30</property>
                 <property name="primary_icon_name">edit-find-replace-symbolic</property>
-                <property name="primary_icon_activatable">false</property>
-                <property name="primary_icon_sensitive">false</property>
+                <property name="primary_icon_activatable">0</property>
+                <property name="primary_icon_sensitive">0</property>
+                <layout>
+                  <property name="column">0</property>
+                  <property name="row">2</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">2</property>
-              </packing>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="homogeneous">true</property>
-                <property name="visible">true</property>
-                <property name="can-focus">false</property>
+                <property name="homogeneous">1</property>
                 <property name="valign">center</property>
                 <style>
                   <class name="linked"/>
                 </style>
                 <child>
                   <object class="GtkButton" id="previous_button">
-                    <!-- <property name="action-name">editor-search.move-previous</property> -->
-                    <property name="visible">true</property>
-                    <property name="can-focus">false</property>
                     <child>
                       <object class="GtkImage">
-                        <property name="visible">true</property>
-                        <property name="can-focus">false</property>
                         <property name="icon_name">go-up-symbolic</property>
-                        <property name="icon_size">1</property>
+                        <property name="icon_size">normal</property>
                       </object>
                     </child>
                   </object>
-                  <packing>
-                    <property name="expand">false</property>
-                    <property name="fill">true</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkButton" id="next_button">
-                    <!-- <property name="action-name">editor-search.move-next</property> -->
-                    <property name="visible">true</property>
-                    <property name="can-focus">false</property>
                     <child>
                       <object class="GtkImage">
-                        <property name="visible">true</property>
-                        <property name="can-focus">false</property>
                         <property name="icon_name">go-down-symbolic</property>
-                        <property name="icon_size">1</property>
+                        <property name="icon_size">normal</property>
                       </object>
                     </child>
                   </object>
-                  <packing>
-                    <property name="expand">false</property>
-                    <property name="fill">true</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
+                <layout>
+                  <property name="column">1</property>
+                  <property name="row">0</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkButton" id="replace_button">
-                <property name="label" translatable="yes">Replace</property>
-                <!-- <property name="action-name">editor-search.replace</property> -->
-                <property name="visible">false</property>
-                <property name="can-focus">true</property>
+                <property name="label" translatable="1">Replace</property>
+                <property name="visible">0</property>
+                <property name="focusable">1</property>
+                <layout>
+                  <property name="column">1</property>
+                  <property name="row">2</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">2</property>
-              </packing>
             </child>
             <child>
               <object class="GtkButton" id="replace_all_button">
-                <property name="label" translatable="yes">Replace All</property>
-                <!-- <property name="action-name">editor-search.replace-all</property> -->
-                <property name="visible">false</property>
-                <property name="can-focus">true</property>
+                <property name="label" translatable="1">Replace All</property>
+                <property name="visible">0</property>
+                <property name="focusable">1</property>
+                <layout>
+                  <property name="column">2</property>
+                  <property name="row">2</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">2</property>
-                <property name="top_attach">2</property>
-              </packing>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="homogeneous">true</property>
-                <property name="visible">true</property>
-                <property name="can-focus">false</property>
+                <property name="homogeneous">1</property>
                 <property name="valign">center</property>
                 <property name="spacing">8</property>
                 <child>
                   <object class="GtkToggleButton">
                     <property name="active" bind-source="GtrSearchBar" bind-property="replace-mode" 
bind-flags="sync-create|bidirectional"/>
-                    <property name="tooltip-text" translatable="yes">Switch between Search and 
Search-and-Replace</property>
-                    <property name="visible">true</property>
-                    <property name="can-focus">true</property>
-                    <property name="image_position">right</property>
+                    <property name="tooltip-text" translatable="1">Switch between Search and 
Search-and-Replace</property>
+                    <property name="focusable">1</property>
                     <child>
                       <object class="GtkImage">
-                        <property name="visible">true</property>
-                        <property name="can-focus">false</property>
                         <property name="icon_name">edit-find-replace-symbolic</property>
                       </object>
                     </child>
                   </object>
-                  <packing>
-                    <property name="expand">false</property>
-                    <property name="fill">true</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkToggleButton" id="show_options">
-                    <property name="tooltip-text" translatable="yes">Show or hide search options such as 
case sensitivity</property>
-                    <property name="focus-on-click">false</property>
-                    <property name="visible">true</property>
-                    <property name="can-focus">true</property>
+                    <property name="tooltip-text" translatable="1">Show or hide search options such as case 
sensitivity</property>
+                    <property name="focus-on-click">0</property>
+                    <property name="focusable">1</property>
                     <property name="active" bind-source="GtrSearchBar" bind-property="show-options" 
bind-flags="sync-create|bidirectional"/>
                     <child>
                       <object class="GtkImage">
-                        <property name="visible">true</property>
-                        <property name="can-focus">false</property>
                         <property name="icon_name">emblem-system-symbolic</property>
                       </object>
                     </child>
                   </object>
-                  <packing>
-                    <property name="expand">false</property>
-                    <property name="fill">true</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
+                <layout>
+                  <property name="column">2</property>
+                  <property name="row">0</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">2</property>
-                <property name="top_attach">0</property>
-              </packing>
             </child>
           </object>
-          <packing>
-            <property name="expand">false</property>
-            <property name="fill">true</property>
-            <property name="position">0</property>
-          </packing>
         </child>
         <child>
           <object class="GtkGrid" id="search_options">
-            <property name="visible">false</property>
-            <property name="can-focus">false</property>
+            <property name="visible">0</property>
             <property name="column_spacing">8</property>
             <child>
               <object class="GtkCheckButton" id="case_sensitive">
-                <property name="label" translatable="yes">Case sensitive</property>
-                <property name="visible">true</property>
-                <property name="can-focus">false</property>
-                <property name="xalign">0</property>
-                <property name="draw-indicator">true</property>
+                <property name="label" translatable="1">Case sensitive</property>
                 <property name="action-name">search-settings.case-sensitive</property>
+                <layout>
+                  <property name="column">0</property>
+                  <property name="row">0</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkCheckButton" id="whole_word">
-                <property name="label" translatable="yes">Match whole word only</property>
-                <property name="visible">true</property>
-                <property name="can-focus">false</property>
-                <property name="xalign">0</property>
-                <property name="draw-indicator">true</property>
+                <property name="label" translatable="1">Match whole word only</property>
                 <property name="action-name">search-settings.at-word-boundaries</property>
+                <layout>
+                  <property name="column">1</property>
+                  <property name="row">0</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkCheckButton" id="wrap_around_button">
-                <property name="label" translatable="yes">Wrap Around</property>
-                <property name="visible">true</property>
-                <property name="can-focus">false</property>
-                <property name="xalign">1</property>
-                <property name="draw-indicator">true</property>
+                <property name="label" translatable="1">Wrap Around</property>
                 <property name="action-name">search-settings.wrap-around</property>
+                <layout>
+                  <property name="column">2</property>
+                  <property name="row">0</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">2</property>
-                <property name="top_attach">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkCheckButton" id="original_text_checkbutton">
-                <property name="label" translatable="yes">Original text</property>
-                <property name="visible">true</property>
-                <property name="can-focus">false</property>
-                <property name="xalign">1</property>
-                <property name="draw-indicator">true</property>
+                <property name="label" translatable="1">Original text</property>
                 <property name="action-name">search-settings.at-original-text</property>
+                <layout>
+                  <property name="column">0</property>
+                  <property name="row">1</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">1</property>
-              </packing>
             </child>
             <child>
               <object class="GtkCheckButton" id="translated_text_checkbutton">
-                <property name="label" translatable="yes">Translated text</property>
-                <property name="visible">true</property>
-                <property name="can-focus">false</property>
-                <property name="xalign">1</property>
-                <property name="draw-indicator">true</property>
+                <property name="label" translatable="1">Translated text</property>
                 <property name="action-name">search-settings.at-translated-text</property>
+                <layout>
+                  <property name="column">1</property>
+                  <property name="row">1</property>
+                </layout>
               </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">1</property>
-              </packing>
             </child>
           </object>
-          <packing>
-            <property name="expand">false</property>
-            <property name="fill">true</property>
-            <property name="position">1</property>
-          </packing>
         </child>
       </object>
     </child>
diff --git a/src/gtr-tab-new.ui b/src/gtr-tab-new.ui
new file mode 100644
index 00000000..3d607805
--- /dev/null
+++ b/src/gtr-tab-new.ui
@@ -0,0 +1,616 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <requires lib="gtk" version="4.0"/>
+  <template class="GtrTab" parent="GtkBox">
+    <property name="orientation">vertical</property>
+    <child>
+      <object class="GtkOverlay" id="overlay">
+        <property name="hexpand">1</property>
+        <property name="vexpand">1</property>
+        <child type="overlay">
+          <object class="GtkRevealer" id="search_revealer">
+            <property name="width-request">525</property>
+            <property name="halign">end</property>
+            <property name="valign">start</property>
+            <property name="margin-end">12</property>
+            <signal name="notify::child-revealed" handler="gtr_page_notify_child_revealed" swapped="true" 
object="GtrTab"/>
+            <child>
+              <object class="GtrSearchBar" id="search_bar">
+                <property name="visible">True</property>
+                <signal name="stop-search" handler="gtr_page_stop_search" swapped="true" object="GtrTab"/>
+              </object>
+            </child>
+          </object>
+        </child>
+        <property name="child">
+          <object class="GtkPaned" id="hbox">
+            <property name="shrink-end-child">0</property>
+            <property name="resize-end-child">0</property>
+            <property name="shrink-start-child">0</property>
+            <property name="wide_handle">1</property>
+            <child>
+              <object class="GtkPaned" id="vertical_box">
+                <property name="shrink-end-child">0</property>
+                <property name="resize-end-child">0</property>
+                <property name="shrink-start-child">0</property>
+                <property name="orientation">vertical</property>
+                <property name="width_request">450</property>
+                <property name="wide_handle">1</property>
+                <child>
+                  <object class="GtrMessageTable" id="message_table">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="tab">GtrTab</property>
+                    <property name="height_request">350</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkBox" id="translation_box">
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkBox" id="text_vbox">
+                        <property name="vexpand">1</property>
+                        <property name="orientation">vertical</property>
+                        <child>
+                          <object class="GtkBox" id="text_hbox">
+                            <property name="valign">center</property>
+                            <child>
+                              <object class="GtkLabel" id="msgid_label">
+                                <property name="xalign">0</property>
+                                <property name="ypad">5</property>
+                                <property name="label" translatable="1">_Original Message</property>
+                                <property name="use_underline">1</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"></attribute>
+                                </attributes>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="msgid_ctxt">
+                                <property name="xalign">0</property>
+                                <property name="label" translatable="0"></property>
+                                <property name="use_underline">1</property>
+                                <property name="ellipsize">end</property>
+                                <style>
+                                  <class name="msgcontext"/>
+                                </style>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="msgid_tags">
+                                <property name="xalign">0</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"></attribute>
+                                </attributes>
+                                <style>
+                                  <class name="msgtags"/>
+                                </style>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkScrolledWindow" id="text_msgid_scroll">
+                            <property name="vexpand">1</property>
+                            <property name="focusable">1</property>
+                            <property name="shadow_type">in</property>
+                            <child>
+                              <object class="GtrView" id="text_msgid">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="editable">False</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkScrolledWindow" id="text_plural_scroll">
+                            <property name="vexpand">1</property>
+                            <property name="focusable">1</property>
+                            <property name="shadow_type">in</property>
+                            <child>
+                              <object class="GtrView" id="text_msgid_plural">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="editable">False</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="msgstr_label">
+                        <property name="valign">center</property>
+                        <property name="xalign">0</property>
+                        <property name="ypad">5</property>
+                        <property name="label" translatable="1">Translate_d Text</property>
+                        <property name="use_underline">1</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"></attribute>
+                        </attributes>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkNotebook" id="trans_notebook">
+                        <property name="vexpand">1</property>
+                        <property name="focusable">1</property>
+                        <property name="show_border">0</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtrContextPanel" id="context">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tab">GtrTab</property>
+                <property name="width_request">150</property>
+              </object>
+            </child>
+          </object>
+        </property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkEventBox" id="progress_eventbox">
+        <property name="valign">center</property>
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkBox" id="progress_box">
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkRevealer" id="progress_revealer">
+                <property name="reveal_child">1</property>
+                <property name="child">
+                  <object class="GtkBox">
+                    <property name="margin_start">6</property>
+                    <property name="margin_end">6</property>
+                    <property name="margin_top">6</property>
+                    <property name="margin_bottom">6</property>
+                    <property name="homogeneous">1</property>
+                    <child>
+                      <object class="GtkLabel" id="progress_percentage">
+                        <property name="label">translated: 0.00%</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="progress_trans">
+                        <property name="label">Translated: 0</property>
+                        <style>
+                          <class name="progress_trans"/>
+                        </style>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="progress_fuzzy">
+                        <property name="label">fuzzy: 0</property>
+                        <style>
+                          <class name="progress_fuzzy"/>
+                        </style>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="progress_untrans">
+                        <property name="label">untranslated: 0</property>
+                        <style>
+                          <class name="progress_untranslated"/>
+                        </style>
+                      </object>
+                    </child>
+                  </object>
+                </property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </template>
+  <object class="GtkPopoverMenu" id="order_menu_popover">
+    <property name="child">
+      <object class="GtkBox">
+        <property name="margin_start">6</property>
+        <property name="margin_end">6</property>
+        <property name="margin_top">6</property>
+        <property name="margin_bottom">6</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel">
+            <property name="label" translatable="1">Order messages by</property>
+            <property name="margin_top">3</property>
+            <property name="margin_bottom">3</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkSeparator">
+            <property name="margin_top">3</property>
+            <property name="margin_bottom">3</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="sort_id">
+            <property name="action_name">app.sort_by_id</property>
+            <property name="label" translatable="1">Appearance in the original file</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="sort_status">
+            <property name="action_name">app.sort_by_status</property>
+            <property name="label" translatable="1">Message status</property>
+            <property name="group">sort_id</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="sort_msgid">
+            <property name="action_name">app.sort_by_msgid</property>
+            <property name="label" translatable="1">Original message</property>
+            <property name="group">sort_id</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="sort_translated">
+            <property name="action_name">app.sort_by_translated</property>
+            <property name="label" translatable="1">Translated message</property>
+            <property name="group">sort_id</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="submenu">main</property>
+      </packing>
+    </property>
+  </object>
+  <object class="GtkPopoverMenu" id="main_menu_popover">
+    <property name="child">
+      <object class="GtkBox">
+        <property name="margin_start">6</property>
+        <property name="margin_end">6</property>
+        <property name="margin_top">6</property>
+        <property name="margin_bottom">6</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkModelButton" id="find">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.find</property>
+            <property name="text" translatable="1">Find</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="find_and_replace">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.find_and_replace</property>
+            <property name="text" translatable="1">Find and replace</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="translation_memory">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.build_tm</property>
+            <property name="text" translatable="1">Build translation memory</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="edit_header">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.edit_header</property>
+            <property name="text" translatable="1">Edit header</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkSeparator">
+            <property name="margin_top">3</property>
+            <property name="margin_bottom">3</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="new_win">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.new_window</property>
+            <property name="text" translatable="1">New window</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="pref_button1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.preferences</property>
+            <property name="text" translatable="1">Preferences</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkSeparator">
+            <property name="margin_top">3</property>
+            <property name="margin_bottom">3</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="pref_button">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.shortcuts</property>
+            <property name="text" translatable="1">Keyboard Shortcuts</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="about_button">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.about</property>
+            <property name="text" translatable="1">About</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="help_button">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.help</property>
+            <property name="text" translatable="1">Help</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="quit">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.quit</property>
+            <property name="text" translatable="1">Quit</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="submenu">main</property>
+      </packing>
+    </property>
+  </object>
+  <object class="GtkHeaderBar" id="titlebar">
+    <property name="title" translatable="1">Translation Editor</property>
+    <child>
+      <object class="GtkBox">
+        <child>
+          <object class="GtkButton" id="open_button">
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Open a new file (&lt;Ctrl&gt;o)</property>
+            <property name="action_name">app.open</property>
+            <child>
+              <object class="GtkImage">
+                <property name="icon_name">document-open-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton" id="dl_button">
+            <property name="tooltip_text" translatable="1">Open from Damned Lies (&lt;Ctrl&gt;d)</property>
+            <property name="action_name">app.dl</property>
+            <child>
+              <object class="GtkImage">
+                <property name="focusable">1</property>
+                <property name="icon_name">folder-download-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <style>
+          <class name="linked"/>
+        </style>
+      </object>
+    </child>
+    <child>
+      <object class="GtkSeparator"/>
+    </child>
+    <child>
+      <object class="GtkBox">
+        <child>
+          <object class="GtkButton" id="undo">
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Undo (&lt;Ctrl&gt;z)</property>
+            <property name="action_name">app.undo</property>
+            <child>
+              <object class="GtkImage">
+                <property name="icon_name">edit-undo-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton" id="redo">
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Redo (&lt;Ctrl&gt;&lt;Shift&gt;z)</property>
+            <property name="action_name">app.redo</property>
+            <child>
+              <object class="GtkImage">
+                <property name="icon_name">edit-redo-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <style>
+          <class name="linked"/>
+        </style>
+      </object>
+    </child>
+    <child>
+      <object class="GtkSeparator"/>
+    </child>
+    <child>
+      <object class="GtkBox">
+        <child>
+          <object class="GtkButton" id="prev_untranslated">
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Previous message without translation 
(&lt;Alt&gt;&lt;Page Up&gt;)</property>
+            <property name="action_name">app.prev_no</property>
+            <child>
+              <object class="GtkImage">
+                <property name="icon_name">go-up-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton" id="next_untranslated">
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Next message without translation 
(&lt;Alt&gt;&lt;Page Down&gt;)</property>
+            <property name="action_name">app.next_no</property>
+            <child>
+              <object class="GtkImage">
+                <property name="icon_name">go-down-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <style>
+          <class name="linked"/>
+        </style>
+      </object>
+    </child>
+    <child>
+      <object class="GtkSeparator"/>
+    </child>
+    <child>
+      <object class="GtkButton">
+        <property name="focusable">1</property>
+        <property name="receives_default">1</property>
+        <property name="tooltip_text" translatable="1">Toggle fuzzy state (&lt;Ctrl&gt;+u)</property>
+        <property name="action_name">app.fuzzy</property>
+        <child>
+          <object class="GtkImage">
+            <property name="icon_name">weather-fog-symbolic</property>
+          </object>
+        </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuButton" id="sortby_menu">
+        <property name="focusable">1</property>
+        <property name="receives_default">1</property>
+        <property name="popover">order_menu_popover</property>
+        <property name="tooltip_text" translatable="1">Sort messages by</property>
+        <child>
+          <object class="GtkImage">
+            <property name="icon_name">view-sort-ascending-symbolic</property>
+          </object>
+        </child>
+        <child internal-child="accessible">
+          <object class="AtkObject" id="sortby_menu-atkobject">
+            <property name="AtkObject::accessible-name" translatable="1">Order by menu</property>
+          </object>
+        </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuButton" id="main_menu">
+        <property name="focusable">1</property>
+        <property name="receives_default">1</property>
+        <property name="popover">main_menu_popover</property>
+        <child>
+          <object class="GtkImage">
+            <property name="icon_name">open-menu-symbolic</property>
+          </object>
+        </child>
+        <child internal-child="accessible">
+          <object class="AtkObject" id="main_menu-atkobject">
+            <property name="AtkObject::accessible-name" translatable="1">Main Menu</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="pack_type">end</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToggleButton" id="search_toggle">
+        <property name="focusable">1</property>
+        <property name="receives_default">1</property>
+        <property name="tooltip_text" translatable="1">Find (&lt;Ctrl&gt;&lt;f&gt;)</property>
+        <property name="action_name">app.findtoggle</property>
+        <child>
+          <object class="GtkImage">
+            <property name="icon_name">edit-find-symbolic</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="pack_type">end</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkSeparator">
+        <property name="margin_top">3</property>
+        <property name="margin_bottom">3</property>
+      </object>
+      <packing>
+        <property name="pack_type">end</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkBox">
+        <child>
+          <object class="GtkButton" id="save">
+            <property name="label" translatable="1">Save</property>
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Save the current file (&lt;Ctrl&gt;s)</property>
+            <property name="action_name">app.save</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Save as (&lt;Ctrl&gt;&lt;Shift&gt;s)</property>
+            <property name="action_name">app.saveas</property>
+            <child>
+              <object class="GtkImage">
+                <property name="icon_name">document-save-as-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton" id="upload">
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Upload file (&lt;Ctrl&gt;b)</property>
+            <property name="action_name">app.upload_file</property>
+            <child>
+              <object class="GtkImage">
+                <property name="icon_name">document-send-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <style>
+          <class name="linked"/>
+        </style>
+      </object>
+      <packing>
+        <property name="pack_type">end</property>
+      </packing>
+    </child>
+    <style>
+      <class name="titlebar"/>
+    </style>
+  </object>
+</interface>
diff --git a/src/gtr-tab-old.ui b/src/gtr-tab-old.ui
index d24ad33f..00a91ddc 100644
--- a/src/gtr-tab-old.ui
+++ b/src/gtr-tab-old.ui
@@ -312,4 +312,503 @@
       </packing>
     </child>
   </template>
+
+  <object class="GtkPopoverMenu" id="order_menu_popover">
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="margin_start">6</property>
+        <property name="margin_end">6</property>
+        <property name="margin_top">6</property>
+        <property name="margin_bottom">6</property>
+        <property name="orientation">vertical</property>
+
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Order messages by</property>
+            <property name="xalign">0.5</property>
+            <property name="margin_top">3</property>
+            <property name="margin_bottom">3</property>
+          </object>
+        </child>
+
+        <child>
+          <object class="GtkSeparator">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="margin_top">3</property>
+            <property name="margin_bottom">3</property>
+          </object>
+        </child>
+
+        <child>
+          <object class="GtkRadioButton" id="sort_id">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.sort_by_id</property>
+            <property name="label" translatable="yes">Appearance in the original file</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkRadioButton" id="sort_status">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.sort_by_status</property>
+            <property name="label" translatable="yes">Message status</property>
+            <property name="group">sort_id</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkRadioButton" id="sort_msgid">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.sort_by_msgid</property>
+            <property name="label" translatable="yes">Original message</property>
+            <property name="group">sort_id</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkRadioButton" id="sort_translated">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.sort_by_translated</property>
+            <property name="label" translatable="yes">Translated message</property>
+            <property name="group">sort_id</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="submenu">main</property>
+      </packing>
+    </child>
+  </object>
+
+  <object class="GtkPopoverMenu" id="main_menu_popover">
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="margin_start">6</property>
+        <property name="margin_end">6</property>
+        <property name="margin_top">6</property>
+        <property name="margin_bottom">6</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkModelButton" id="find">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.find</property>
+            <property name="text" translatable="yes">Find</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="find_and_replace">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.find_and_replace</property>
+            <property name="text" translatable="yes">Find and replace</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="translation_memory">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.build_tm</property>
+            <property name="text" translatable="yes">Build translation memory</property>
+          </object>
+        </child>
+
+        <child>
+          <object class="GtkModelButton" id="edit_header">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.edit_header</property>
+            <property name="text" translatable="yes">Edit header</property>
+          </object>
+        </child>
+
+        <child>
+          <object class="GtkSeparator">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="margin_top">3</property>
+            <property name="margin_bottom">3</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="new_win">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.new_window</property>
+            <property name="text" translatable="yes">New window</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="pref_button1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.preferences</property>
+            <property name="text" translatable="yes">Preferences</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkSeparator">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="margin_top">3</property>
+            <property name="margin_bottom">3</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="pref_button">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.shortcuts</property>
+            <property name="text" translatable="yes">Keyboard Shortcuts</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="about_button">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.about</property>
+            <property name="text" translatable="yes">About</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="help_button">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.help</property>
+            <property name="text" translatable="yes">Help</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton" id="quit">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="action_name">app.quit</property>
+            <property name="text" translatable="yes">Quit</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="submenu">main</property>
+      </packing>
+    </child>
+  </object>
+
+  <object class="GtkHeaderBar" id="titlebar">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Translation Editor</property>
+    <property name="show_close_button">True</property>
+
+    <child>
+       <object class="GtkBox">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkButton" id="open_button">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="tooltip_text" translatable="yes">Open a new file (&lt;Ctrl&gt;o)</property>
+            <property name="action_name">app.open</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_name">document-open-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton" id="dl_button">
+            <property name="visible">True</property>
+            <property name="tooltip_text" translatable="yes">Open from Damned Lies (&lt;Ctrl&gt;d)</property>
+            <property name="action_name">app.dl</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="icon_name">folder-download-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <style>
+         <class name="linked"/>
+        </style>
+      </object>
+    </child>
+
+    <child>
+      <object class="GtkSeparator">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkButton" id="undo">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="tooltip_text" translatable="yes">Undo (&lt;Ctrl&gt;z)</property>
+            <property name="action_name">app.undo</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_name">edit-undo-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton" id="redo">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="tooltip_text" translatable="yes">Redo (&lt;Ctrl&gt;&lt;Shift&gt;z)</property>
+            <property name="action_name">app.redo</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_name">edit-redo-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <style>
+          <class name="linked"/>
+        </style>
+      </object>
+    </child>
+    <child>
+      <object class="GtkSeparator">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkButton" id="prev_untranslated">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="tooltip_text" translatable="yes">Previous message without translation 
(&lt;Alt&gt;&lt;Page Up&gt;)</property>
+            <property name="action_name">app.prev_no</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_name">go-up-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton" id="next_untranslated">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="tooltip_text" translatable="yes">Next message without translation 
(&lt;Alt&gt;&lt;Page Down&gt;)</property>
+            <property name="action_name">app.next_no</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_name">go-down-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <style>
+          <class name="linked"/>
+        </style>
+      </object>
+    </child>
+    <child>
+      <object class="GtkSeparator">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkButton">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">True</property>
+        <property name="tooltip_text" translatable="yes">Toggle fuzzy state (&lt;Ctrl&gt;+u)</property>
+        <property name="action_name">app.fuzzy</property>
+        <child>
+          <object class="GtkImage">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="icon_name">weather-fog-symbolic</property>
+          </object>
+        </child>
+      </object>
+    </child>
+
+    <child>
+      <object class="GtkMenuButton" id="sortby_menu">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">True</property>
+        <property name="popover">order_menu_popover</property>
+        <property name="tooltip_text" translatable="yes">Sort messages by</property>
+        <child>
+          <object class="GtkImage">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="icon_name">view-sort-ascending-symbolic</property>
+          </object>
+        </child>
+        <child internal-child="accessible">
+          <object class="AtkObject" id="sortby_menu-atkobject">
+            <property name="AtkObject::accessible-name" translatable="yes">Order by menu</property>
+          </object>
+        </child>
+      </object>
+    </child>
+
+    <child>
+      <object class="GtkMenuButton" id="main_menu">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">True</property>
+        <property name="popover">main_menu_popover</property>
+        <child>
+          <object class="GtkImage">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="icon_name">open-menu-symbolic</property>
+          </object>
+        </child>
+        <child internal-child="accessible">
+          <object class="AtkObject" id="main_menu-atkobject">
+            <property name="AtkObject::accessible-name" translatable="yes">Main Menu</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="pack_type">end</property>
+      </packing>
+    </child>
+    <child>
+          <object class="GtkToggleButton" id="search_toggle">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="tooltip_text" translatable="yes">Find (&lt;Ctrl&gt;&lt;f&gt;)</property>
+            <property name="action_name">app.findtoggle</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_name">edit-find-symbolic</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
+    </child>
+    <child>
+          <object class="GtkSeparator">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="margin_top">3</property>
+            <property name="margin_bottom">3</property>
+          </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
+    </child>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkButton" id="save">
+            <property name="label" translatable="yes">Save</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="tooltip_text" translatable="yes">Save the current file (&lt;Ctrl&gt;s)</property>
+            <property name="action_name">app.save</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="tooltip_text" translatable="yes">Save as (&lt;Ctrl&gt;&lt;Shift&gt;s)</property>
+            <property name="action_name">app.saveas</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_name">document-save-as-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+         <child>
+          <object class="GtkButton" id="upload">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="tooltip_text" translatable="yes">Upload file (&lt;Ctrl&gt;b)</property>
+            <property name="action_name">app.upload_file</property>
+            <child>
+              <object class="GtkImage">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon_name">document-send-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <style>
+          <class name="linked"/>
+        </style>
+      </object>
+      <packing>
+        <property name="pack_type">end</property>
+      </packing>
+    </child>
+
+    <style>
+      <class name="titlebar"/>
+    </style>
+  </object>
+
 </interface>
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index 8f438386..80ecc21c 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -260,7 +260,7 @@ gtr_page_notify_child_revealed (GtrTab *tab,
 
 //----------------------------------------------------------------//
 
-static gboolean
+/*static gboolean
 show_hide_revealer (GtkWidget *widget, GdkEvent *ev, GtrTab *tab)
 {
   GtrTabPrivate *priv;
@@ -271,7 +271,7 @@ show_hide_revealer (GtkWidget *widget, GdkEvent *ev, GtrTab *tab)
   gtk_revealer_set_reveal_child (rev, !gtk_revealer_get_reveal_child (rev));
 
   return TRUE;
-}
+}*/
 
 static gboolean
 msg_grab_focus (GtrTab *tab)
@@ -776,7 +776,9 @@ gtr_tab_init (GtrTab * tab)
 
   priv = gtr_tab_get_instance_private (tab);
 
+  g_printf("creating tab widget from template \n");
   gtk_widget_init_template (GTK_WIDGET (tab));
+  g_printf("created tab widget from template \n");
 
   priv->ui_settings = g_settings_new ("org.gnome.gtranslator.preferences.ui");
   priv->files_settings = g_settings_new ("org.gnome.gtranslator.preferences.files");
@@ -810,8 +812,8 @@ gtr_tab_init (GtrTab * tab)
   gtk_widget_show (GTK_WIDGET (priv->progress));
   gtk_box_append (GTK_BOX (priv->progress_box), GTK_WIDGET (priv->progress));
 
-  g_signal_connect (priv->progress_eventbox, "button-press-event",
-                    G_CALLBACK (show_hide_revealer), tab);
+  //g_signal_connect (priv->progress_eventbox, "button-press-event",
+                    //G_CALLBACK (show_hide_revealer), tab);
 
   g_signal_connect (priv->search_revealer, "notify::child-revealed",
                     G_CALLBACK (emit_searchbar_toggled), tab);
@@ -1025,7 +1027,7 @@ gtr_tab_class_init (GtrTabClass * klass)
   gtk_widget_class_bind_template_child_private (widget_class, GtrTab, hbox);
   gtk_widget_class_bind_template_child_private (widget_class, GtrTab, vertical_box);
 
-  gtk_widget_class_bind_template_child_private (widget_class, GtrTab, progress_eventbox);
+  //gtk_widget_class_bind_template_child_private (widget_class, GtrTab, progress_eventbox);
   gtk_widget_class_bind_template_child_private (widget_class, GtrTab, progress_box);
   gtk_widget_class_bind_template_child_private (widget_class, GtrTab, progress_revealer);
   gtk_widget_class_bind_template_child_private (widget_class, GtrTab, progress_trans);
@@ -1136,6 +1138,7 @@ gtr_tab_new (GtrPo * po,
   g_return_val_if_fail (po != NULL, NULL);
 
   tab = g_object_new (GTR_TYPE_TAB, NULL);
+  g_printf("tab created\n");
 
   priv = gtr_tab_get_instance_private (tab);
   gtr_context_init_tm (GTR_CONTEXT_PANEL (priv->context),
diff --git a/src/gtr-tab.ui b/src/gtr-tab.ui
index 00a91ddc..cc7b1766 100644
--- a/src/gtr-tab.ui
+++ b/src/gtr-tab.ui
@@ -1,23 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.15.3 on Wed Sep  4 22:17:30 2013 -->
 <interface>
-  <!-- interface-requires gtk+ 3.10 -->
+  <requires lib="gtk" version="4.0"/>
   <template class="GtrTab" parent="GtkBox">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
     <property name="orientation">vertical</property>
     <child>
       <object class="GtkOverlay" id="overlay">
-        <property name="visible">True</property>
-        <property name="expand">True</property>
+        <property name="hexpand">1</property>
+        <property name="vexpand">1</property>
         <child type="overlay">
           <object class="GtkRevealer" id="search_revealer">
             <property name="width-request">525</property>
             <property name="halign">end</property>
             <property name="valign">start</property>
             <property name="margin-end">12</property>
-            <property name="reveal-child">false</property>
-            <property name="visible">True</property>
             <signal name="notify::child-revealed" handler="gtr_page_notify_child_revealed" swapped="true" 
object="GtrTab"/>
             <child>
               <object class="GtrSearchBar" id="search_bar">
@@ -27,18 +22,20 @@
             </child>
           </object>
         </child>
-        <child>
+        <property name="child">
           <object class="GtkPaned" id="hbox">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="wide_handle">True</property>
+            <property name="shrink-end-child">0</property>
+            <property name="resize-end-child">0</property>
+            <property name="shrink-start-child">0</property>
+            <property name="wide_handle">1</property>
             <child>
               <object class="GtkPaned" id="vertical_box">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="shrink-end-child">0</property>
+                <property name="resize-end-child">0</property>
+                <property name="shrink-start-child">0</property>
                 <property name="orientation">vertical</property>
                 <property name="width_request">450</property>
-                <property name="wide_handle">True</property>
+                <property name="wide_handle">1</property>
                 <child>
                   <object class="GtrMessageTable" id="message_table">
                     <property name="visible">True</property>
@@ -46,45 +43,33 @@
                     <property name="tab">GtrTab</property>
                     <property name="height_request">350</property>
                   </object>
-                  <packing>
-                    <property name="resize">True</property>
-                    <property name="shrink">False</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkBox" id="translation_box">
-                    <property name="visible">True</property>
                     <property name="orientation">vertical</property>
                     <child>
                       <object class="GtkBox" id="text_vbox">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="vexpand">1</property>
                         <property name="orientation">vertical</property>
                         <child>
                           <object class="GtkBox" id="text_hbox">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="orientation">horizontal</property>
+                            <property name="valign">center</property>
                             <child>
                               <object class="GtkLabel" id="msgid_label">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
-                                <property name="ypad">5</property>
-                                <property name="label" translatable="yes">_Original Message</property>
-                                <property name="use_underline">True</property>
+                                <!--<property name="ypad">5</property>-->
+                                <property name="label" translatable="1">_Original Message</property>
+                                <property name="use_underline">1</property>
                                 <attributes>
-                                  <attribute name="weight" value="bold"/>
+                                  <attribute name="weight" value="bold"></attribute>
                                 </attributes>
                               </object>
                             </child>
                             <child>
                               <object class="GtkLabel" id="msgid_ctxt">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
-                                <property name="label" translatable="no"></property>
-                                <property name="use_underline">True</property>
+                                <property name="label" translatable="0"></property>
+                                <property name="use_underline">1</property>
                                 <property name="ellipsize">end</property>
                                 <style>
                                   <class name="msgcontext"/>
@@ -93,12 +78,9 @@
                             </child>
                             <child>
                               <object class="GtkLabel" id="msgid_tags">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
-                                <property name="label"></property>
                                 <attributes>
-                                  <attribute name="weight" value="bold"/>
+                                  <attribute name="weight" value="bold"></attribute>
                                 </attributes>
                                 <style>
                                   <class name="msgtags"/>
@@ -106,437 +88,230 @@
                               </object>
                             </child>
                           </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
                         </child>
                         <child>
                           <object class="GtkScrolledWindow" id="text_msgid_scroll">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="shadow_type">in</property>
+                            <property name="vexpand">1</property>
+                            <property name="focusable">1</property>
+                            <property name="has_frame">1</property>
                             <child>
                               <object class="GtrView" id="text_msgid">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
                                 <property name="editable">False</property>
                               </object>
                             </child>
                           </object>
-                          <packing>
-                            <property name="expand">True</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
                         </child>
                         <child>
                           <object class="GtkScrolledWindow" id="text_plural_scroll">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="shadow_type">in</property>
+                            <property name="vexpand">1</property>
+                            <property name="focusable">1</property>
+                            <property name="has_frame">1</property>
                             <child>
                               <object class="GtrView" id="text_msgid_plural">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
                                 <property name="editable">False</property>
                               </object>
                             </child>
                           </object>
-                          <packing>
-                            <property name="expand">True</property>
-                            <property name="fill">True</property>
-                            <property name="position">2</property>
-                          </packing>
                         </child>
                       </object>
-                      <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="msgstr_label">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="valign">center</property>
                         <property name="xalign">0</property>
-                        <property name="ypad">5</property>
-                        <property name="label" translatable="yes">Translate_d Text</property>
-                        <property name="use_underline">True</property>
+                        <!--<property name="ypad">5</property>-->
+                        <property name="label" translatable="1">Translate_d Text</property>
+                        <property name="use_underline">1</property>
                         <attributes>
-                          <attribute name="weight" value="bold"/>
+                          <attribute name="weight" value="bold"></attribute>
                         </attributes>
                       </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
                     </child>
                     <child>
                       <object class="GtkNotebook" id="trans_notebook">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="show_border">False</property>
+                        <property name="vexpand">1</property>
+                        <property name="focusable">1</property>
+                        <property name="show_border">0</property>
                       </object>
-                      <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
-                        <property name="position">3</property>
-                      </packing>
                     </child>
                   </object>
-                  <packing>
-                    <property name="resize">False</property>
-                    <property name="shrink">False</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="resize">True</property>
-                <property name="shrink">False</property>
-              </packing>
             </child>
             <child>
               <object class="GtrContextPanel" id="context">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
                 <property name="tab">GtrTab</property>
-                <property name="width_request">150</property>
+                <!--<property name="width_request">150</property>-->
               </object>
-              <packing>
-                <property name="resize">False</property>
-                <property name="shrink">False</property>
-              </packing>
             </child>
           </object>
-        </child>
+        </property>
       </object>
     </child>
-    <child >
-      <object class="GtkEventBox" id="progress_eventbox">
-        <property name="visible">True</property>
+    <child>
+      <object class="GtkBox" id="progress_box">
+        <property name="orientation">vertical</property>
         <child>
-          <object class="GtkBox" id="progress_box">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="orientation">vertical</property>
-            <child>
-              <object class="GtkRevealer" id="progress_revealer">
-                <property name="visible">True</property>
-                <property name="reveal_child">True</property>
+          <object class="GtkRevealer" id="progress_revealer">
+            <property name="reveal_child">1</property>
+            <property name="child">
+              <object class="GtkBox">
+                <property name="margin_start">6</property>
+                <property name="margin_end">6</property>
+                <property name="margin_top">6</property>
+                <property name="margin_bottom">6</property>
+                <property name="homogeneous">1</property>
                 <child>
-                  <object class="GtkBox">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="margin_start">6</property>
-                    <property name="margin_end">6</property>
-                    <property name="margin_top">6</property>
-                    <property name="margin_bottom">6</property>
-                    <property name="orientation">horizontal</property>
-                    <property name="homogeneous">True</property>
-                    <child>
-                      <object class="GtkLabel" id="progress_percentage">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label">translated: 0.00%</property>
-                        <property name="xalign">0.5</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="progress_trans">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label">Translated: 0</property>
-                        <property name="xalign">0.5</property>
-                        <style>
-                          <class name="progress_trans"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="progress_fuzzy">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label">fuzzy: 0</property>
-                        <property name="xalign">0.5</property>
-                        <style>
-                          <class name="progress_fuzzy"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="progress_untrans">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label">untranslated: 0</property>
-                        <property name="xalign">0.5</property>
-                        <style>
-                          <class name="progress_untranslated"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
+                  <object class="GtkLabel" id="progress_percentage">
+                    <property name="label">translated: 0.00%</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="progress_trans">
+                    <property name="label">Translated: 0</property>
+                    <style>
+                      <class name="progress_trans"/>
+                    </style>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="progress_fuzzy">
+                    <property name="label">fuzzy: 0</property>
+                    <style>
+                      <class name="progress_fuzzy"/>
+                    </style>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="progress_untrans">
+                    <property name="label">untranslated: 0</property>
+                    <style>
+                      <class name="progress_untranslated"/>
+                    </style>
                   </object>
                 </child>
               </object>
-            </child>
+            </property>
           </object>
         </child>
       </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">False</property>
-        <property name="position">1</property>
-      </packing>
     </child>
   </template>
 
   <object class="GtkPopoverMenu" id="order_menu_popover">
-    <property name="can_focus">False</property>
-    <child>
+    <property name="child">
       <object class="GtkBox">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
         <property name="margin_start">6</property>
         <property name="margin_end">6</property>
         <property name="margin_top">6</property>
         <property name="margin_bottom">6</property>
         <property name="orientation">vertical</property>
-
         <child>
           <object class="GtkLabel">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes">Order messages by</property>
-            <property name="xalign">0.5</property>
+            <property name="label" translatable="1">Order messages by</property>
             <property name="margin_top">3</property>
             <property name="margin_bottom">3</property>
           </object>
         </child>
-
         <child>
           <object class="GtkSeparator">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="margin_top">3</property>
             <property name="margin_bottom">3</property>
           </object>
         </child>
-
         <child>
-          <object class="GtkRadioButton" id="sort_id">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
+          <object class="GtkCheckButton" id="sort_id">
             <property name="action_name">app.sort_by_id</property>
-            <property name="label" translatable="yes">Appearance in the original file</property>
+            <property name="label" translatable="1">Appearance in the original file</property>
           </object>
         </child>
         <child>
-          <object class="GtkRadioButton" id="sort_status">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
+          <object class="GtkCheckButton" id="sort_status">
             <property name="action_name">app.sort_by_status</property>
-            <property name="label" translatable="yes">Message status</property>
+            <property name="label" translatable="1">Message status</property>
             <property name="group">sort_id</property>
           </object>
         </child>
         <child>
-          <object class="GtkRadioButton" id="sort_msgid">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
+          <object class="GtkCheckButton" id="sort_msgid">
             <property name="action_name">app.sort_by_msgid</property>
-            <property name="label" translatable="yes">Original message</property>
+            <property name="label" translatable="1">Original message</property>
             <property name="group">sort_id</property>
           </object>
         </child>
         <child>
-          <object class="GtkRadioButton" id="sort_translated">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
+          <object class="GtkCheckButton" id="sort_translated">
             <property name="action_name">app.sort_by_translated</property>
-            <property name="label" translatable="yes">Translated message</property>
+            <property name="label" translatable="1">Translated message</property>
             <property name="group">sort_id</property>
           </object>
         </child>
       </object>
-      <packing>
-        <property name="submenu">main</property>
-      </packing>
-    </child>
+    </property>
   </object>
 
+  <menu id='main-menu-model'>
+  <section>
+    <item>
+      <attribute name='label' translatable='yes'>Find</attribute>
+      <attribute name='action'>app.find</attribute>
+    </item>
+    <item>
+      <attribute name='label' translatable='yes'>Find and replace</attribute>
+      <attribute name='action'>app.find_and_replace</attribute>
+    </item>
+    <item>
+      <attribute name='label' translatable='yes'>Build translation memory</attribute>
+      <attribute name='action'>app.build_tm</attribute>
+    </item>
+    <item>
+      <attribute name='label' translatable='yes'>Edit header</attribute>
+      <attribute name='action'>app.edit_header</attribute>
+    </item>
+  </section>
+  <section>
+    <item>
+      <attribute name='label' translatable='yes'>New Window</attribute>
+      <attribute name='action'>app.new_window</attribute>
+    </item>
+    <item>
+      <attribute name='label' translatable='yes'>Preferences</attribute>
+      <attribute name='action'>app.preferences</attribute>
+    </item>
+  </section>
+  <section>
+    <item>
+      <attribute name='label' translatable='yes'>Keyboard Shortcuts</attribute>
+      <attribute name='action'>app.shortcuts</attribute>
+    </item>
+    <item>
+      <attribute name='label' translatable='yes'>About</attribute>
+      <attribute name='action'>app.about</attribute>
+    </item>
+    <item>
+      <attribute name='label' translatable='yes'>Help</attribute>
+      <attribute name='action'>app.help</attribute>
+    </item>
+    <item>
+      <attribute name='label' translatable='yes'>Quit</attribute>
+      <attribute name='action'>app.quit</attribute>
+    </item>
+  </section>
+  </menu>
   <object class="GtkPopoverMenu" id="main_menu_popover">
-    <property name="can_focus">False</property>
-    <child>
-      <object class="GtkBox">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="margin_start">6</property>
-        <property name="margin_end">6</property>
-        <property name="margin_top">6</property>
-        <property name="margin_bottom">6</property>
-        <property name="orientation">vertical</property>
-        <child>
-          <object class="GtkModelButton" id="find">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="action_name">app.find</property>
-            <property name="text" translatable="yes">Find</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton" id="find_and_replace">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="action_name">app.find_and_replace</property>
-            <property name="text" translatable="yes">Find and replace</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton" id="translation_memory">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="action_name">app.build_tm</property>
-            <property name="text" translatable="yes">Build translation memory</property>
-          </object>
-        </child>
-
-        <child>
-          <object class="GtkModelButton" id="edit_header">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="action_name">app.edit_header</property>
-            <property name="text" translatable="yes">Edit header</property>
-          </object>
-        </child>
-
-        <child>
-          <object class="GtkSeparator">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="margin_top">3</property>
-            <property name="margin_bottom">3</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton" id="new_win">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="action_name">app.new_window</property>
-            <property name="text" translatable="yes">New window</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton" id="pref_button1">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="action_name">app.preferences</property>
-            <property name="text" translatable="yes">Preferences</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkSeparator">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="margin_top">3</property>
-            <property name="margin_bottom">3</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton" id="pref_button">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="action_name">app.shortcuts</property>
-            <property name="text" translatable="yes">Keyboard Shortcuts</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton" id="about_button">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="action_name">app.about</property>
-            <property name="text" translatable="yes">About</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton" id="help_button">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="action_name">app.help</property>
-            <property name="text" translatable="yes">Help</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton" id="quit">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="action_name">app.quit</property>
-            <property name="text" translatable="yes">Quit</property>
-          </object>
-        </child>
-      </object>
-      <packing>
-        <property name="submenu">main</property>
-      </packing>
-    </child>
+    <property name="menu_model">main-menu-model</property>
   </object>
-
   <object class="GtkHeaderBar" id="titlebar">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="title" translatable="yes">Translation Editor</property>
-    <property name="show_close_button">True</property>
-
     <child>
-       <object class="GtkBox">
-        <property name="visible">True</property>
+      <object class="GtkBox">
         <child>
           <object class="GtkButton" id="open_button">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="tooltip_text" translatable="yes">Open a new file (&lt;Ctrl&gt;o)</property>
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Open a new file (&lt;Ctrl&gt;o)</property>
             <property name="action_name">app.open</property>
             <child>
               <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="icon_name">document-open-symbolic</property>
               </object>
             </child>
@@ -544,44 +319,34 @@
         </child>
         <child>
           <object class="GtkButton" id="dl_button">
-            <property name="visible">True</property>
-            <property name="tooltip_text" translatable="yes">Open from Damned Lies (&lt;Ctrl&gt;d)</property>
+            <property name="tooltip_text" translatable="1">Open from Damned Lies (&lt;Ctrl&gt;d)</property>
             <property name="action_name">app.dl</property>
             <child>
               <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
+                <property name="focusable">1</property>
                 <property name="icon_name">folder-download-symbolic</property>
               </object>
             </child>
           </object>
         </child>
         <style>
-         <class name="linked"/>
+          <class name="linked"/>
         </style>
       </object>
     </child>
-
     <child>
-      <object class="GtkSeparator">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-      </object>
+      <object class="GtkSeparator"/>
     </child>
     <child>
       <object class="GtkBox">
-        <property name="visible">True</property>
         <child>
           <object class="GtkButton" id="undo">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="tooltip_text" translatable="yes">Undo (&lt;Ctrl&gt;z)</property>
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Undo (&lt;Ctrl&gt;z)</property>
             <property name="action_name">app.undo</property>
             <child>
               <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="icon_name">edit-undo-symbolic</property>
               </object>
             </child>
@@ -589,15 +354,12 @@
         </child>
         <child>
           <object class="GtkButton" id="redo">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="tooltip_text" translatable="yes">Redo (&lt;Ctrl&gt;&lt;Shift&gt;z)</property>
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Redo (&lt;Ctrl&gt;&lt;Shift&gt;z)</property>
             <property name="action_name">app.redo</property>
             <child>
               <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="icon_name">edit-redo-symbolic</property>
               </object>
             </child>
@@ -609,25 +371,18 @@
       </object>
     </child>
     <child>
-      <object class="GtkSeparator">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-      </object>
+      <object class="GtkSeparator"/>
     </child>
     <child>
       <object class="GtkBox">
-        <property name="visible">True</property>
         <child>
           <object class="GtkButton" id="prev_untranslated">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="tooltip_text" translatable="yes">Previous message without translation 
(&lt;Alt&gt;&lt;Page Up&gt;)</property>
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Previous message without translation 
(&lt;Alt&gt;&lt;Page Up&gt;)</property>
             <property name="action_name">app.prev_no</property>
             <child>
               <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="icon_name">go-up-symbolic</property>
               </object>
             </child>
@@ -635,15 +390,12 @@
         </child>
         <child>
           <object class="GtkButton" id="next_untranslated">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="tooltip_text" translatable="yes">Next message without translation 
(&lt;Alt&gt;&lt;Page Down&gt;)</property>
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Next message without translation 
(&lt;Alt&gt;&lt;Page Down&gt;)</property>
             <property name="action_name">app.next_no</property>
             <child>
               <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="icon_name">go-down-symbolic</property>
               </object>
             </child>
@@ -655,143 +407,110 @@
       </object>
     </child>
     <child>
-      <object class="GtkSeparator">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-      </object>
+      <object class="GtkSeparator"/>
     </child>
     <child>
       <object class="GtkButton">
-        <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <property name="receives_default">True</property>
-        <property name="tooltip_text" translatable="yes">Toggle fuzzy state (&lt;Ctrl&gt;+u)</property>
+        <property name="focusable">1</property>
+        <property name="receives_default">1</property>
+        <property name="tooltip_text" translatable="1">Toggle fuzzy state (&lt;Ctrl&gt;+u)</property>
         <property name="action_name">app.fuzzy</property>
         <child>
           <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="icon_name">weather-fog-symbolic</property>
           </object>
         </child>
       </object>
     </child>
-
     <child>
       <object class="GtkMenuButton" id="sortby_menu">
-        <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <property name="receives_default">True</property>
+        <property name="focusable">1</property>
+        <property name="receives_default">1</property>
         <property name="popover">order_menu_popover</property>
-        <property name="tooltip_text" translatable="yes">Sort messages by</property>
+        <property name="tooltip_text" translatable="1">Sort messages by</property>
         <child>
           <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="icon_name">view-sort-ascending-symbolic</property>
           </object>
         </child>
-        <child internal-child="accessible">
+
+          <!-- TODO: To be replace in gtk4
+          <child internal-child="accessible">
           <object class="AtkObject" id="sortby_menu-atkobject">
-            <property name="AtkObject::accessible-name" translatable="yes">Order by menu</property>
+            <property name="AtkObject::accessible-name" translatable="1">Order by menu</property>
           </object>
-        </child>
+        </child>-->
       </object>
     </child>
-
-    <child>
+    <child type="end">
       <object class="GtkMenuButton" id="main_menu">
-        <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <property name="receives_default">True</property>
+        <property name="focusable">1</property>
+        <property name="receives_default">1</property>
         <property name="popover">main_menu_popover</property>
         <child>
           <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="icon_name">open-menu-symbolic</property>
           </object>
         </child>
+        <!-- TODO: To be replace in gtk4
         <child internal-child="accessible">
           <object class="AtkObject" id="main_menu-atkobject">
-            <property name="AtkObject::accessible-name" translatable="yes">Main Menu</property>
+            <property name="AtkObject::accessible-name" translatable="1">Main Menu</property>
           </object>
-        </child>
+        </child>-->
       </object>
-      <packing>
-        <property name="pack_type">end</property>
-      </packing>
     </child>
-    <child>
-          <object class="GtkToggleButton" id="search_toggle">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="tooltip_text" translatable="yes">Find (&lt;Ctrl&gt;&lt;f&gt;)</property>
-            <property name="action_name">app.findtoggle</property>
-            <child>
-              <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="icon_name">edit-find-symbolic</property>
-              </object>
-            </child>
+    <child type="end">
+      <object class="GtkToggleButton" id="search_toggle">
+        <property name="focusable">1</property>
+        <property name="receives_default">1</property>
+        <property name="tooltip_text" translatable="1">Find (&lt;Ctrl&gt;&lt;f&gt;)</property>
+        <property name="action_name">app.findtoggle</property>
+        <child>
+          <object class="GtkImage">
+            <property name="icon_name">edit-find-symbolic</property>
           </object>
-          <packing>
-            <property name="pack_type">end</property>
-          </packing>
+        </child>
+      </object>
     </child>
-    <child>
-          <object class="GtkSeparator">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="margin_top">3</property>
-            <property name="margin_bottom">3</property>
-          </object>
-          <packing>
-            <property name="pack_type">end</property>
-          </packing>
+    <child type="end">
+      <object class="GtkSeparator">
+        <property name="margin_top">3</property>
+        <property name="margin_bottom">3</property>
+      </object>
     </child>
-    <child>
+    <child type="end">
       <object class="GtkBox">
-        <property name="visible">True</property>
         <child>
           <object class="GtkButton" id="save">
-            <property name="label" translatable="yes">Save</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="tooltip_text" translatable="yes">Save the current file (&lt;Ctrl&gt;s)</property>
+            <property name="label" translatable="1">Save</property>
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Save the current file (&lt;Ctrl&gt;s)</property>
             <property name="action_name">app.save</property>
           </object>
         </child>
         <child>
           <object class="GtkButton">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="tooltip_text" translatable="yes">Save as (&lt;Ctrl&gt;&lt;Shift&gt;s)</property>
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Save as (&lt;Ctrl&gt;&lt;Shift&gt;s)</property>
             <property name="action_name">app.saveas</property>
             <child>
               <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="icon_name">document-save-as-symbolic</property>
               </object>
             </child>
           </object>
         </child>
-         <child>
+        <child>
           <object class="GtkButton" id="upload">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="tooltip_text" translatable="yes">Upload file (&lt;Ctrl&gt;b)</property>
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+            <property name="tooltip_text" translatable="1">Upload file (&lt;Ctrl&gt;b)</property>
             <property name="action_name">app.upload_file</property>
             <child>
               <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="icon_name">document-send-symbolic</property>
               </object>
             </child>
@@ -801,14 +520,9 @@
           <class name="linked"/>
         </style>
       </object>
-      <packing>
-        <property name="pack_type">end</property>
-      </packing>
     </child>
-
     <style>
       <class name="titlebar"/>
     </style>
   </object>
-
 </interface>
diff --git a/src/gtr-view.c b/src/gtr-view.c
index c9d4466e..996bc5ae 100644
--- a/src/gtr-view.c
+++ b/src/gtr-view.c
@@ -86,10 +86,11 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtrView, gtr_view, GTK_SOURCE_TYPE_VIEW)
 static void
 gtr_view_init (GtrView * view)
 {
+  g_printf("init: view started\n");
   GtkSourceLanguageManager *lm;
   GtkSourceLanguage *lang;
   GPtrArray *dirs;
-  gchar **langs;
+  gchar **langs = NULL;
   const gchar *const *temp;
   gchar *ui_dir;
   GtrViewPrivate *priv;
@@ -118,33 +119,50 @@ gtr_view_init (GtrView * view)
   g_ptr_array_add (dirs, NULL);
   langs = (gchar **) g_ptr_array_free (dirs, FALSE);
 
+  /* CLEANUP: For debugging
+  guint i = 0;
+  while (*(langs+i) != NULL) {
+    g_printf("%s\n",*(langs+i));
+    i++;
+  }
+  i=0;*/
   gtk_source_language_manager_set_search_path (lm, langs);
-  lang = gtk_source_language_manager_get_language (lm, "gtranslator");
+  /* CLEANUP: For debugging
+  gchar * const * lang_id = gtk_source_language_manager_get_language_ids(lm);
+  while (*(lang_id+i) != NULL) {
+    g_printf("%s\n",*(lang_id+i));
+    i++;
+  }*/
+  //There is not any language_id of name gtranslator when I ran above code to get all language_ids 
+  //lang = gtk_source_language_manager_get_language (lm, "gtranslator"); 
   g_strfreev (langs);
 
-  priv->buffer = gtk_source_buffer_new_with_language (lang);
-
-  gtk_text_view_set_buffer (GTK_TEXT_VIEW (view),
-                            GTK_TEXT_BUFFER (priv->buffer));
-  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
-
-  /* Set syntax highlight according to preferences */
-  gtk_source_buffer_set_highlight_syntax (priv->buffer,
-                                          g_settings_get_boolean (priv->editor_settings,
-                                                                  GTR_SETTINGS_HIGHLIGHT_SYNTAX));
-
-  /* Set dot char according to preferences */
-  gtr_view_enable_visible_whitespace (view,
-                                      g_settings_get_boolean (priv->editor_settings,
-                                                              GTR_SETTINGS_VISIBLE_WHITESPACE));
-
-  font = g_settings_get_string (priv->editor_settings, GTR_SETTINGS_FONT);
-  gtr_view_set_font (view, font);
-
-  /* Set scheme color according to preferences */
-  gtr_view_reload_scheme_color (view);
-  gtk_text_view_set_monospace (GTK_TEXT_VIEW (view), TRUE);
-}
+  //if (lang != NULL) {
+    //priv->buffer = gtk_source_buffer_new_with_language (GTK_SOURCE_LANGUAGE(lang));
+    //priv->buffer = gtk_source_buffer_new (NULL);
+    //gtk_text_view_set_buffer (GTK_TEXT_VIEW (view),
+    //                GTK_TEXT_BUFFER (priv->buffer));
+    priv->buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
+    if (priv->buffer == NULL)
+      g_printf("buffer is null\n");
+    gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
+    /* Set syntax highlight according to preferences */
+    //gtk_source_buffer_set_highlight_syntax (priv->buffer,
+                                            //g_settings_get_boolean (priv->editor_settings,
+                                                                    //GTR_SETTINGS_HIGHLIGHT_SYNTAX));
+    /* Set dot char according to preferences */
+    gtr_view_enable_visible_whitespace (view,
+                                        g_settings_get_boolean (priv->editor_settings,
+                                                                GTR_SETTINGS_VISIBLE_WHITESPACE));
+    font = g_settings_get_string (priv->editor_settings, GTR_SETTINGS_FONT);
+    gtr_view_set_font (view, font);
+
+    /* Set scheme color according to preferences */
+    gtr_view_reload_scheme_color (view);
+    gtk_text_view_set_monospace (GTK_TEXT_VIEW (view), TRUE);
+  //}
+  g_printf("init: view\n");
+} 
 
 static void
 gtr_view_dispose (GObject * object)
@@ -167,6 +185,7 @@ gtr_view_class_init (GtrViewClass * klass)
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->dispose = gtr_view_dispose;
+  g_printf("class init: view\n");
 }
 
 /**
diff --git a/src/gtr-window.c b/src/gtr-window.c
index 610c1bb7..838153c6 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -382,7 +382,7 @@ gtr_window_init (GtrWindow *window)
    * With this widgets we have different views in the same window
    */
 
-  // as GtkNotebook has been removed
+  // CLEANUP :  as GtkNotebook has been removed
   /*priv->notebook = GTK_WIDGET (gtr_notebook_new ());
   gtk_widget_show (priv->notebook);
   g_signal_connect (priv->notebook, "switch-page",
@@ -417,7 +417,7 @@ gtr_window_init (GtrWindow *window)
   gtk_widget_show (priv->stack);
 
   // translation memory
-  /*priv->translation_memory = GTR_TRANSLATION_MEMORY (gtr_gda_new());
+  priv->translation_memory = GTR_TRANSLATION_MEMORY (gtr_gda_new());
   priv->tm_settings = g_settings_new ("org.gnome.gtranslator.plugins.translation-memory");
   gtr_translation_memory_set_max_omits (priv->translation_memory,
                                         g_settings_get_int (priv->tm_settings,
@@ -425,7 +425,7 @@ gtr_window_init (GtrWindow *window)
   gtr_translation_memory_set_max_delta (priv->translation_memory,
                                         g_settings_get_int (priv->tm_settings,
                                                             "max-length-diff"));
-  gtr_translation_memory_set_max_items (priv->translation_memory, 10);*/
+  gtr_translation_memory_set_max_items (priv->translation_memory, 10);
 
   gtr_window_show_projects (window);
 }
diff --git a/src/gtranslator.gresource.xml b/src/gtranslator.gresource.xml
index 21272a66..6c32d50e 100644
--- a/src/gtranslator.gresource.xml
+++ b/src/gtranslator.gresource.xml
@@ -18,6 +18,5 @@
     <file preprocess="xml-stripblanks">help-overlay.ui</file>
     <file preprocess="xml-stripblanks">gtr-search-bar.ui</file>
     <file preprocess="xml-stripblanks">gtr-upload-dialog.ui</file>
-    <file preprocess="xml-stripblanks">gtr-preferences-dialog-old.ui</file>
   </gresource>
 </gresources>
diff --git a/src/translation-memory/gtr-translation-memory-ui.c 
b/src/translation-memory/gtr-translation-memory-ui.c
index b3f751f7..f4964f9a 100644
--- a/src/translation-memory/gtr-translation-memory-ui.c
+++ b/src/translation-memory/gtr-translation-memory-ui.c
@@ -120,9 +120,9 @@ showed_message_cb (GtrTab *tab, GtrMsg *msg, GtrTranslationMemoryUi *tm_ui)
 
   model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view)));
 
-  g_signal_connect (priv->tree_view,
+  /*g_signal_connect (priv->tree_view,
                     "size_allocate",
-                    G_CALLBACK (tree_view_size_cb), priv->tree_view);
+                    G_CALLBACK (tree_view_size_cb), priv->tree_view);*/
 
   if (priv->msg)
     g_object_unref (priv->msg);


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