[gtranslator] Kill plugins for now and remove gdl dock



commit e9be1d76119be1de4c70e647e18e359621fa98e8
Author: Seán de Búrca <leftmostcat gmail com>
Date:   Wed Sep 4 15:02:05 2013 -0600

    Kill plugins for now and remove gdl dock

 Makefile.am                   |    2 +-
 configure.ac                  |   59 -------
 src/Makefile.am               |    2 -
 src/gtr-actions-view.c        |    2 +-
 src/gtr-plugins-engine.c      |  150 ------------------
 src/gtr-plugins-engine.h      |   67 --------
 src/gtr-preferences-dialog.c  |   29 ----
 src/gtr-preferences-dialog.ui |   57 +-------
 src/gtr-tab.c                 |  337 ++---------------------------------------
 src/gtr-tab.h                 |   12 --
 src/gtr-window.c              |  100 +------------
 11 files changed, 19 insertions(+), 798 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 37bc6ca..082f617 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 # Point to our macro directory and pick up user flags from the environment
 ACLOCAL_AMFLAGS  = -I m4 ${ACLOCAL_FLAGS}
 
-SUBDIRS = data help man src doc plugins po
+SUBDIRS = data help man src doc po
 
 EXTRA_DIST= \
                HACKING \
diff --git a/configure.ac b/configure.ac
index 3fe9c46..7570e47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,12 +80,6 @@ GTK_REQUIRED=3.4.2
 GLIB_REQUIRED=2.32.0
 LIBXML_REQUIRED=2.4.12
 SOURCEVIEW_REQUIRED=3.0.0
-GDL_REQUIRED=3.6.0
-GDA_REQUIRED=4.2.3
-PEAS_REQUIRED=1.2.0
-GDICT_OPTIONAL=0.11.0
-GTKSPELL_OPTIONAL=3.0.0
-JSON_GLIB_OPTIONAL=0.12.0
 
 AC_ARG_WITH(gda,
        AS_HELP_STRING([--with-gda={4.0|5.0}],[Define which version of libgda to use]),,
@@ -98,11 +92,7 @@ PKG_CHECK_MODULES(GTRANSLATOR, [
        gio-2.0 >= $GLIB_REQUIRED
        gtk+-3.0 >= $GTK_REQUIRED
        gtksourceview-3.0 >= $SOURCEVIEW_REQUIRED
-       gdl-3.0 >= $GDL_REQUIRED
        gsettings-desktop-schemas
-       libgda-sqlite-$with_gda >= $GDA_REQUIRED
-       libpeas-1.0 >= $PEAS_REQUIRED
-       libpeas-gtk-1.0 >= $PEAS_REQUIRED
 ])
 
 AC_SUBST(GTRANSLATOR_CFLAGS)
@@ -132,18 +122,6 @@ AC_MSG_RESULT([$platform_win32])
 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
 
 
-dnl -----------------------------------
-dnl Plugins libraries compilation flags
-dnl -----------------------------------
-# on win32 plugins must be able to resolve all symbols at link time
-# so we create a lib
-if test "$platform_win32" = yes; then
-       PLUGIN_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -mwindows 
-Wl,\$(top_builddir)/src/libgtranslator-\$(GTR_API_VERSION).a"
-else
-       PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
-fi
-AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
-
 dnl ================================================================
 dnl iso-codes
 dnl ================================================================
@@ -239,7 +217,6 @@ dnl -------------------------------------------------------------------
 AC_ARG_ENABLE(debug,
        AS_HELP_STRING([--enable-debug],[Turn on debugging flags (default=yes)]),
        ,enable_debug=yes)
-AC_MSG_CHECKING([if a debug friendly version should be build])
 if test "x$enable_debug" = "xyes" ; then
        CFLAGS="$CFLAGS -ggdb -DDEBUG"
 else
@@ -284,21 +261,6 @@ help/Makefile
 man/Makefile
 man/gtranslator.1
 po/Makefile.in
-plugins/Makefile
-plugins/alternate-language/Makefile
-plugins/charmap/Makefile
-plugins/charmap/charmap/Makefile
-plugins/dictionary/Makefile
-plugins/dictionary/org.gnome.gtranslator.plugins.dictionary.gschema.xml.in
-plugins/fullscreen/Makefile
-plugins/insert-params/Makefile
-plugins/open-tran/Makefile
-plugins/open-tran/org.gnome.gtranslator.plugins.open-tran.gschema.xml.in
-plugins/codeview/Makefile
-plugins/codeview/org.gnome.gtranslator.plugins.codeview.gschema.xml.in
-plugins/translation-memory/Makefile
-plugins/translation-memory/gda/Makefile
-plugins/translation-memory/org.gnome.gtranslator.plugins.translation-memory.gschema.xml.in
 src/Makefile
 src/toolbareditor/Makefile
 ])
@@ -321,27 +283,6 @@ GObject Introspection        :     $enable_introspection
 ------------------------------------------------------------------
 "
 
-if [ test x"$have_json_glib" = "xyes" ]; then
-       echo "Building open-tran plugin: .............................YES"
-else
-       echo "Building open-tran plugin: .............................NO"
-               echo "        Requires libjson-glib >= $JSON_GLIB_OPTIONAL"
-fi
-
-if [ test x"$have_gdict" = "xyes" ]; then
-       echo "Building dictionary plugin: ............................YES"
-else
-       echo "Building dictionary plugin: ............................NO"
-               echo "        Requires gdict-1.0 >= $GDICT_OPTIONAL"
-fi
-
-if [ test x"$have_gtkspell" = "xyes" ]; then
-       echo "Building spell support: ................................YES"
-else
-       echo "Building spell support: ................................NO"
-               echo "        Requires gtkspell3 >= $GTKSPELL_OPTIONAL"
-fi
-
 echo "
 ------------------------------------------------------------------
 -- For suggestions, problems & bug reports for gtranslator please
diff --git a/src/Makefile.am b/src/Makefile.am
index ce3922f..df65ab8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -91,7 +91,6 @@ NOINST_H_FILES = \
        gtr-language.h \
        gtr-languages-fetcher.h \
        gtr-message-table-model.h \
-       gtr-plugins-engine.h \
        gtr-preferences-dialog.h \
        gtr-profile-dialog.h \
        gtr-profile-manager.h \
@@ -138,7 +137,6 @@ libgtranslator_c_files = \
        gtr-message-table-model.c \
        gtr-msg.c \
        gtr-notebook.c \
-       gtr-plugins-engine.c \
        gtr-po.c \
        gtr-preferences-dialog.c \
        gtr-profile.c \
diff --git a/src/gtr-actions-view.c b/src/gtr-actions-view.c
index 360e4b4..a1bfcd5 100644
--- a/src/gtr-actions-view.c
+++ b/src/gtr-actions-view.c
@@ -26,5 +26,5 @@ gtr_actions_view_context (GtkAction * action, GtrWindow * window)
   tab = gtr_window_get_active_tab (window);
   context = GTK_WIDGET (gtr_tab_get_context_panel (tab));
 
-  gtr_tab_show_widget (tab, context);
+  gtk_widget_show(context);
 }
diff --git a/src/gtr-preferences-dialog.c b/src/gtr-preferences-dialog.c
index 426125b..c16911e 100644
--- a/src/gtr-preferences-dialog.c
+++ b/src/gtr-preferences-dialog.c
@@ -43,8 +43,6 @@
 #include <gtk/gtk.h>
 #include <string.h>
 #include <gtksourceview/gtksourcestyleschememanager.h>
-#include <gdl/gdl.h>
-#include <libpeas-gtk/peas-gtk-plugin-manager.h>
 
 #define GTR_PREFERENCES_DIALOG_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ( \
                                                     (object), \
@@ -87,9 +85,6 @@ struct _GtrPreferencesDialogPrivate
   GtkWidget *add_button;
   GtkWidget *edit_button;
   GtkWidget *delete_button;
-
-  /*Plugins */
-  GtkWidget *plugins_box;
 };
 
 enum
@@ -582,28 +577,6 @@ setup_profile_pages (GtrPreferencesDialog *dlg)
                     "clicked", G_CALLBACK (edit_button_clicked), dlg);
 }
 
-/***************Plugins pages****************/
-static void
-setup_plugin_pages (GtrPreferencesDialog * dlg)
-{
-  GtkWidget *alignment;
-  GtkWidget *page_content;
-
-  alignment = gtk_alignment_new (0., 0., 1., 1.);
-  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 12, 12, 12, 12);
-
-  page_content = peas_gtk_plugin_manager_new (NULL);
-  g_return_if_fail (page_content != NULL);
-
-  gtk_container_add (GTK_CONTAINER (alignment), page_content);
-
-  gtk_box_pack_start (GTK_BOX (dlg->priv->plugins_box),
-                      alignment, TRUE, TRUE, 0);
-
-  gtk_widget_show_all (page_content);
-}
-
-
 static void
 dialog_response_handler (GtkDialog * dlg, gint res_id)
 {
@@ -684,7 +657,6 @@ gtr_preferences_dialog_init (GtrPreferencesDialog * dlg)
   priv->delete_button = GTK_WIDGET (gtk_builder_get_object (builder, "delete-button"));
   profiles_toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "profiles-toolbar"));
   profiles_scrolled_window = GTK_WIDGET (gtk_builder_get_object (builder, "profiles-scrolledwindow"));
-  priv->plugins_box = GTK_WIDGET (gtk_builder_get_object (builder, "plugins_box"));
   g_object_unref (builder);
 
   gtk_box_pack_start (content_area, priv->notebook, FALSE, FALSE, 0);
@@ -700,7 +672,6 @@ gtr_preferences_dialog_init (GtrPreferencesDialog * dlg)
   setup_files_pages (dlg);
   setup_editor_pages (dlg);
   setup_profile_pages (dlg);
-  setup_plugin_pages (dlg);
 }
 
 static void
diff --git a/src/gtr-preferences-dialog.ui b/src/gtr-preferences-dialog.ui
index 16a8b19..2258406 100644
--- a/src/gtr-preferences-dialog.ui
+++ b/src/gtr-preferences-dialog.ui
@@ -63,11 +63,9 @@
             <child>
               <object class="GtkButton" id="help_button">
                 <property name="label">gtk-help</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -79,11 +77,9 @@
             <child>
               <object class="GtkButton" id="close_button">
                 <property name="label">gtk-close</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -140,11 +136,9 @@
                     <child>
                       <object class="GtkCheckButton" id="warn_if_fuzzy_checkbutton">
                         <property name="label" translatable="yes">_Warn if PO file contains fuzzy 
translations</property>
-                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
                         <property name="use_underline">True</property>
                         <property name="xalign">0</property>
                         <property name="draw_indicator">True</property>
@@ -188,11 +182,9 @@
                         <child>
                           <object class="GtkCheckButton" id="create_backup_checkbutton">
                             <property name="label" translatable="yes">Create a _backup copy of files before 
saving</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
                             <property name="use_underline">True</property>
                             <property name="xalign">0</property>
                             <property name="draw_indicator">True</property>
@@ -212,11 +204,9 @@
                             <child>
                               <object class="GtkCheckButton" id="autosave_checkbutton">
                                 <property name="label" translatable="yes">_Autosave files every</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="use_underline">True</property>
                                 <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
@@ -343,11 +333,9 @@
                             <child>
                               <object class="GtkCheckButton" id="highlight_checkbutton">
                                 <property name="label" translatable="yes">_Highlight message 
syntax</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="use_underline">True</property>
                                 <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
@@ -361,11 +349,9 @@
                             <child>
                               <object class="GtkCheckButton" id="visible_whitespace_checkbutton">
                                 <property name="label" translatable="yes">Make _whitespace visible</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="use_underline">True</property>
                                 <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
@@ -379,11 +365,9 @@
                             <child>
                               <object class="GtkCheckButton" id="use_custom_font_checkbutton">
                                 <property name="label" translatable="yes">Use _custom font</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="use_underline">True</property>
                                 <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
@@ -415,13 +399,11 @@
                                 </child>
                                 <child>
                                   <object class="GtkFontButton" id="editor_font_fontbutton">
-                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
-                                    <property name="use_action_appearance">False</property>
                                     <property name="font">Sans 12</property>
-                                    <property name="preview_text"></property>
+                                    <property name="preview_text"/>
                                     <property name="show_preview_entry">False</property>
                                     <property name="use_font">True</property>
                                   </object>
@@ -489,11 +471,9 @@
                             <child>
                               <object class="GtkCheckButton" id="unmark_fuzzy_checkbutton">
                                 <property name="label" translatable="yes">_Remove fuzzy status if message is 
changed</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="use_underline">True</property>
                                 <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
@@ -507,11 +487,9 @@
                             <child>
                               <object class="GtkCheckButton" id="spellcheck_checkbutton">
                                 <property name="label" translatable="yes">Check _spelling</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="use_underline">True</property>
                                 <property name="xalign">0</property>
                                 <property name="draw_indicator">True</property>
@@ -600,21 +578,17 @@
                         </style>
                         <child>
                           <object class="GtkToolItem" id="toolbutton1">
-                            <property name="use_action_appearance">False</property>
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="use_action_appearance">False</property>
                             <child>
                               <object class="GtkBox" id="box1">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <child>
                                   <object class="GtkButton" id="add-button">
-                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
-                                    <property name="use_action_appearance">False</property>
                                     <child>
                                       <object class="GtkImage" id="image1">
                                         <property name="visible">True</property>
@@ -631,11 +605,9 @@
                                 </child>
                                 <child>
                                   <object class="GtkButton" id="delete-button">
-                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
-                                    <property name="use_action_appearance">False</property>
                                     <child>
                                       <object class="GtkImage" id="image2">
                                         <property name="visible">True</property>
@@ -653,11 +625,9 @@
                                 <child>
                                   <object class="GtkButton" id="edit-button">
                                     <property name="label" translatable="yes">Edit Profile</property>
-                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
-                                    <property name="use_action_appearance">False</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -698,31 +668,6 @@
                 <property name="tab_fill">False</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkBox" id="plugins_box">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="orientation">vertical</property>
-                <property name="spacing">6</property>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-              <packing>
-                <property name="position">3</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="label7">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Plugins</property>
-              </object>
-              <packing>
-                <property name="position">3</property>
-                <property name="tab_fill">False</property>
-              </packing>
-            </child>
           </object>
           <packing>
             <property name="expand">False</property>
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index 211c7ff..0668bc6 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -43,7 +43,6 @@
 #include "gtr-settings.h"
 #include "gtr-view.h"
 #include "gtr-dirs.h"
-#include "gtr-plugins-engine.h"
 #include "gtr-debug.h"
 
 #include <glib.h>
@@ -51,13 +50,6 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gtksourceview/gtksource.h>
-#include <libpeas/peas-extension-set.h>
-
-#ifdef G_OS_WIN32
-#include <gdl/libgdltypebuiltins.h>
-#else
-#include <gdl/gdl.h>
-#endif
 
 #define GTR_TAB_GET_PRIVATE(object)    (G_TYPE_INSTANCE_GET_PRIVATE ( \
                                         (object),      \
@@ -80,7 +72,6 @@ struct _GtrTabPrivate
   GtrPo *po;
 
   GtkWidget *dock;
-  GdlDockLayout *layout_manager;
 
   GtkWidget *message_table;
   GtkWidget *context;
@@ -106,8 +97,6 @@ struct _GtrTabPrivate
   GtkWidget *fuzzy;
   GtkWidget *untranslated;
 
-  PeasExtensionSet *extensions;
-
   /* Autosave */
   GTimer *timer;
   gint autosave_interval;
@@ -143,104 +132,6 @@ static guint signals[LAST_SIGNAL];
 static gboolean gtr_tab_autosave (GtrTab * tab);
 
 static void
-gtr_tab_layout_save (GtrTab      *tab,
-                     const gchar *filename,
-                     const gchar *name)
-{
-  g_return_if_fail (GTR_IS_TAB (tab));
-  g_return_if_fail (filename != NULL);
-
-  gdl_dock_layout_save_layout (tab->priv->layout_manager, name);
-  if (!gdl_dock_layout_save_to_file (tab->priv->layout_manager, filename))
-    g_warning ("Saving dock layout to '%s' failed!", filename);
-}
-
-static void
-gtr_tab_layout_load (GtrTab      *tab,
-                     const gchar *layout_filename,
-                     const gchar *name)
-{
-  g_return_if_fail (GTR_IS_TAB (tab));
-
-  if (!layout_filename ||
-      !gdl_dock_layout_load_from_file (tab->priv->layout_manager,
-                                       layout_filename))
-    {
-      gchar *path;
-
-      path = gtr_dirs_get_ui_file ("layout.xml");
-
-      if (!gdl_dock_layout_load_from_file (tab->priv->layout_manager,
-                                           path))
-        g_warning ("Loading layout from '%s' failed!!", path);
-      g_free (path);
-    }
-
-  if (!gdl_dock_layout_load_layout (tab->priv->layout_manager, name))
-    g_warning ("Loading layout failed!!");
-}
-
-static void
-add_widget_to_dock (GtrTab      *tab,
-                    GtkWidget   *widget,
-                    const gchar *name,
-                    const gchar *title,
-                    const gchar *stock_id,
-                    GtrTabPlacement placement,
-                    gboolean locked)
-{
-  GtkWidget *item;
-  guint flags = 0;
-
-  g_return_if_fail (GTR_IS_TAB (tab));
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (name != NULL);
-  g_return_if_fail (title != NULL);
-
-  /* Add the widget to dock */
-  if (stock_id == NULL)
-    item = gdl_dock_item_new (name, title, GDL_DOCK_ITEM_BEH_NORMAL);
-  else
-    item = gdl_dock_item_new_with_stock (name, title, stock_id,
-                                         GDL_DOCK_ITEM_BEH_NORMAL);
-
-  if (locked)
-    {
-      flags |= GDL_DOCK_ITEM_BEH_NO_GRIP;
-    }
-
-  flags |= GDL_DOCK_ITEM_BEH_CANT_CLOSE |
-           GDL_DOCK_ITEM_BEH_CANT_ICONIFY |
-           GDL_DOCK_ITEM_BEH_NEVER_FLOATING;
-  g_object_set (G_OBJECT (item), "behavior", flags, NULL);
-
-  gtk_container_add (GTK_CONTAINER (item), widget);
-  gdl_dock_add_item (GDL_DOCK (tab->priv->dock),
-                     GDL_DOCK_ITEM (item), placement);
-  gtk_widget_show (item);
-
-  /* To remove it */
-  g_object_set_data (G_OBJECT (widget), "dockitem", item);
-}
-
-static void
-remove_widget_from_dock (GtrTab    *tab,
-                         GtkWidget *widget)
-{
-  GtkWidget *dock_item;
-
-  g_return_if_fail (GTR_IS_TAB (tab));
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  dock_item = g_object_get_data (G_OBJECT (widget), "dockitem");
-  g_return_if_fail (dock_item != NULL);
-
-  /* Remove the widget from container */
-  gtk_container_remove (GTK_CONTAINER (dock_item), widget);
-  gdl_dock_item_unbind (GDL_DOCK_ITEM (dock_item));
-}
-
-static void
 install_autosave_timeout (GtrTab * tab)
 {
   gint timeout;
@@ -660,50 +551,11 @@ on_state_notify (GtrPo      *po,
 }
 
 static void
-save_layout (GtrTab *tab)
-{
-  gchar *filename;
-
-  filename = g_build_filename (gtr_dirs_get_user_config_dir (),
-                               "layout.xml", NULL);
-
-  gtr_tab_layout_save (tab, filename, NULL);
-  g_free (filename);
-}
-
-static void
-on_layout_changed (GdlDockMaster *master,
-                   GtrTab        *tab)
-{
-  save_layout (tab);
-}
-
-static void
-extension_added (PeasExtensionSet *extensions,
-                 PeasPluginInfo   *info,
-                 PeasExtension    *exten,
-                 GtrTab           *tab)
-{
-  gtr_tab_activatable_activate (GTR_TAB_ACTIVATABLE (exten));
-}
-
-static void
-extension_removed (PeasExtensionSet *extensions,
-                   PeasPluginInfo   *info,
-                   PeasExtension    *exten,
-                   GtrTab           *tab)
-{
-  gtr_tab_activatable_deactivate (GTR_TAB_ACTIVATABLE (exten));
-}
-
-static void
 gtr_tab_init (GtrTab * tab)
 {
-  GtkWidget *hbox;
   GtkWidget *vertical_box;
   GtkWidget *msgid_label;
   GtkWidget *scroll;
-  GtkWidget *dockbar;
   GtrTabPrivate *priv;
   gchar *markup;
 
@@ -718,41 +570,10 @@ gtr_tab_init (GtrTab * tab)
   g_signal_connect (tab, "message-changed", G_CALLBACK (update_status), NULL);
 
   gtk_orientable_set_orientation (GTK_ORIENTABLE (tab),
-                                  GTK_ORIENTATION_VERTICAL);
-
-  /* Docker */
-  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-  gtk_widget_show (hbox);
-  gtk_box_pack_start (GTK_BOX (tab), hbox, TRUE, TRUE, 0);
-
-  priv->dock = gdl_dock_new ();
-  gtk_widget_show (priv->dock);
-  gtk_box_pack_end (GTK_BOX (hbox), priv->dock, TRUE, TRUE, 0);
-
-  dockbar = gdl_dock_bar_new (G_OBJECT (priv->dock));
-  gtk_widget_show (dockbar);
-  gtk_box_pack_start (GTK_BOX (hbox), dockbar, FALSE, FALSE, 0);
-
-  priv->layout_manager = gdl_dock_layout_new (G_OBJECT (priv->dock));
-  g_settings_bind (priv->ui_settings,
-                   GTR_SETTINGS_PANEL_SWITCHER_STYLE,
-                   gdl_dock_layout_get_master (priv->layout_manager),
-                   "switcher-style",
-                   G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-
-  /* Message table */
-  priv->message_table = gtr_message_table_new (GTK_WIDGET (tab));
-  gtk_widget_show (priv->message_table);
-
-  add_widget_to_dock (tab, priv->message_table,
-                      "GtrMessageTable",
-                      _("Message Table"),
-                      NULL,
-                      GTR_TAB_PLACEMENT_CENTER,
-                      FALSE);
+                                  GTK_ORIENTATION_HORIZONTAL);
 
   /* Orignal text widgets */
-  priv->msgid_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+  priv->msgid_hbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
   gtk_widget_show (priv->msgid_hbox);
 
   msgid_label = gtk_label_new (NULL);
@@ -804,9 +625,17 @@ gtr_tab_init (GtrTab * tab)
   vertical_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
   gtk_widget_show (vertical_box);
 
+  gtk_box_pack_start (GTK_BOX (tab), vertical_box, TRUE, TRUE, 0);
+
+  /* Message table */
+  priv->message_table = gtr_message_table_new (GTK_WIDGET (tab));
+  gtk_widget_show (priv->message_table);
+
+  gtk_box_pack_start (GTK_BOX (vertical_box), priv->message_table, TRUE, TRUE, 0);
+
   gtk_box_pack_start (GTK_BOX (vertical_box), priv->msgid_hbox, FALSE, FALSE,
                       0);
-  gtk_box_pack_start (GTK_BOX (vertical_box), priv->text_vbox, TRUE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX (vertical_box), priv->text_vbox, FALSE, FALSE, 0);
 
   /* Translation widgets */
   priv->msgstr_label = gtk_label_new (NULL);
@@ -824,25 +653,14 @@ gtr_tab_init (GtrTab * tab)
 
   gtk_box_pack_start (GTK_BOX (vertical_box), priv->msgstr_label, FALSE, FALSE,
                       0);
-  gtk_box_pack_start (GTK_BOX (vertical_box), priv->trans_notebook, TRUE,
-                      TRUE, 0);
-
-  add_widget_to_dock (tab, vertical_box,
-                      "GtrTranslationFields",
-                      _("Translation Fields"),
-                      NULL,
-                      GTR_TAB_PLACEMENT_BOTTOM,
-                      TRUE);
+  gtk_box_pack_start (GTK_BOX (vertical_box), priv->trans_notebook, FALSE,
+                      FALSE, 0);
 
   /* Context */
   priv->context = gtr_context_panel_new (GTK_WIDGET (tab));
   gtk_widget_show (priv->context);
-  add_widget_to_dock (tab, priv->context,
-                      "GtrContextPanel",
-                      _("Message Details"),
-                      NULL,
-                      GTR_TAB_PLACEMENT_RIGHT,
-                      FALSE);
+
+  gtk_box_pack_start (GTK_BOX (tab), priv->context, FALSE, FALSE, 0);
 
   /* Manage auto save data */
   priv->autosave = g_settings_get_boolean (priv->files_settings,
@@ -853,21 +671,6 @@ gtr_tab_init (GtrTab * tab)
                                                 GTR_SETTINGS_AUTO_SAVE_INTERVAL);
   if (priv->autosave_interval <= 0)
     priv->autosave_interval = 1;
-
-  /* Plugins */
-  priv->extensions = peas_extension_set_new (PEAS_ENGINE (gtr_plugins_engine_get_default ()),
-                                             GTR_TYPE_TAB_ACTIVATABLE,
-                                             "tab", tab,
-                                             NULL);
-
-  g_signal_connect (priv->extensions,
-                    "extension-added",
-                    G_CALLBACK (extension_added),
-                    tab);
-  g_signal_connect (priv->extensions,
-                    "extension-removed",
-                    G_CALLBACK (extension_removed),
-                    tab);
 }
 
 static void
@@ -893,22 +696,11 @@ gtr_tab_dispose (GObject * object)
 
   DEBUG_PRINT ("Dispose tab");
 
-  if (!priv->dispose_has_run)
-    {
-      g_signal_handlers_disconnect_by_func (gdl_dock_layout_get_master (priv->layout_manager),
-                                            G_CALLBACK (on_layout_changed),
-                                            object);
-      save_layout (GTR_TAB (object));
-      priv->dispose_has_run = TRUE;
-    }
-
-  g_clear_object (&priv->extensions);
   g_clear_object (&priv->po);
   g_clear_object (&priv->ui_settings);
   g_clear_object (&priv->files_settings);
   g_clear_object (&priv->editor_settings);
   g_clear_object (&priv->state_settings);
-  g_clear_object (&priv->layout_manager);
 
   G_OBJECT_CLASS (gtr_tab_parent_class)->dispose (object);
 }
@@ -956,34 +748,7 @@ gtr_tab_set_property (GObject * object,
 static void
 gtr_tab_realize (GtkWidget *widget)
 {
-  GtrTab *tab = GTR_TAB (widget);
-
   GTK_WIDGET_CLASS (gtr_tab_parent_class)->realize (widget);
-
-  if (!tab->priv->tab_realized)
-    {
-      gchar *filename;
-
-      /* We only activate the extensions when the tab is realized,
-       * because most plugins will expect this behaviour. */
-      peas_extension_set_foreach (tab->priv->extensions,
-                                  (PeasExtensionSetForeachFunc) extension_added,
-                                  tab);
-
-      /* Loading dock layout */
-      filename = g_build_filename (gtr_dirs_get_user_config_dir (),
-                                   "layout.xml", NULL);
-
-      gtr_tab_layout_load (tab, filename, NULL);
-      g_free (filename);
-
-      tab->priv->tab_realized = TRUE;
-
-      g_signal_connect (gdl_dock_layout_get_master (tab->priv->layout_manager),
-                        "layout-changed",
-                        G_CALLBACK (on_layout_changed),
-                        tab);
-    }
 }
 
 static void
@@ -1468,78 +1233,6 @@ gtr_tab_set_autosave_interval (GtrTab * tab, gint interval)
 }
 
 /**
- * gtr_tab_add_widget:
- * @tab: a #GtrTab
- * @widget: a #GtkWidget
- * @unique_name: an unique name for the widget
- * @name: the name of @widget
- * @stock_id: (allow-none): stock id for the icon of @widget or %NULL
- * @placement: where to place @widget in the tab
- *
- * Adds a new widget to place in @tab.
- */
-void
-gtr_tab_add_widget (GtrTab         *tab,
-                    GtkWidget      *widget,
-                    const gchar    *unique_name,
-                    const gchar    *name,
-                    const gchar    *stock_id,
-                    GtrTabPlacement placement)
-{
-  g_return_if_fail (GTR_IS_TAB (tab));
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  add_widget_to_dock (tab, widget, unique_name, name, NULL, placement, FALSE);
-}
-
-/**
- * gtr_tab_remove_widget:
- * @tab: a #GtrTab
- * @widget: a #GtkWidget
- *
- * Removes the @widget from @tab.
- */
-void
-gtr_tab_remove_widget (GtrTab    *tab,
-                       GtkWidget *widget)
-{
-  g_return_if_fail (GTR_IS_TAB (tab));
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  remove_widget_from_dock (tab, widget);
-}
-
-/**
- * gtr_tab_show_widget:
- * @tab: a #GtrTab
- * @widget: a #GtkWidget
- *
- * Presents the widget if it is not visible
- */
-void
-gtr_tab_show_widget (GtrTab    *tab,
-                     GtkWidget *widget)
-{
-  GtkWidget *item;
-  GtkWidget *parent;
-
-  g_return_if_fail (GTR_IS_TAB (tab));
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  item = g_object_get_data (G_OBJECT (widget), "dockitem");
-  g_return_if_fail (item != NULL);
-
-  /* FIXME: Hack to present the dock item if it's in a notebook dock item */
-  parent = gtk_widget_get_parent (GTK_WIDGET(item) );
-  if (GTK_IS_NOTEBOOK (parent))
-    {
-      gint pagenum;
-      pagenum = gtk_notebook_page_num (GTK_NOTEBOOK (parent), item);
-      gtk_notebook_set_current_page (GTK_NOTEBOOK (parent), pagenum);
-    }
-}
-
-/**
  * gtr_tab_clear_msgstr_views:
  * @tab: a #GtrTab
  * 
diff --git a/src/gtr-tab.h b/src/gtr-tab.h
index 98b90fa..11435b2 100644
--- a/src/gtr-tab.h
+++ b/src/gtr-tab.h
@@ -123,18 +123,6 @@ gint gtr_tab_get_autosave_interval (GtrTab * tab);
 
 void gtr_tab_set_autosave_interval (GtrTab * tab, gint interval);
 
-void gtr_tab_add_widget (GtrTab         *tab,
-                         GtkWidget      *widget,
-                         const gchar    *unique_name,
-                         const gchar    *name,
-                         const gchar    *stock_id,
-                         GtrTabPlacement placement);
-
-void gtr_tab_remove_widget (GtrTab *tab,
-                            GtkWidget * widget);
-
-void gtr_tab_show_widget (GtrTab * tab, GtkWidget * widget);
-
 void gtr_tab_clear_msgstr_views (GtrTab * tab);
 
 void gtr_tab_copy_to_translation (GtrTab * tab);
diff --git a/src/gtr-window.c b/src/gtr-window.c
index b106bb8..da9fe65 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -32,7 +32,6 @@
 #include "gtr-msg.h"
 #include "gtr-notebook.h"
 #include "gtr-tab.h"
-#include "gtr-plugins-engine.h"
 #include "gtr-po.h"
 #include "gtr-settings.h"
 #include "gtr-statusbar.h"
@@ -51,7 +50,6 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gtksourceview/gtksource.h>
-#include <libpeas/peas-extension-set.h>
 
 #define GTR_STOCK_FUZZY_NEXT "gtranslator-fuzzy-next"
 #define GTR_STOCK_FUZZY_PREV "gtranslator-fuzzy-prev"
@@ -102,8 +100,6 @@ struct _GtrWindowPrivate
   GtrProfileManager *prof_manager;
   GtkWidget *profile_combo;
 
-  PeasExtensionSet *extensions;
-
   guint dispose_has_run : 1;
 };
 
@@ -259,23 +255,6 @@ static void          profile_combo_changed            (GtrStatusComboBox *combo,
                                                        GtkMenuItem       *item,
                                                        GtrWindow         *window);
 
-static void
-extension_update_state (PeasExtensionSet *extensions,
-                        PeasPluginInfo   *info,
-                        PeasExtension    *exten,
-                        GtrWindow        *window)
-{
-  gtr_window_activatable_update_state (GTR_WINDOW_ACTIVATABLE (exten));
-}
-
-static void
-extensions_update_state (GtrWindow *window)
-{
-  peas_extension_set_foreach (window->priv->extensions,
-                              (PeasExtensionSetForeachFunc) extension_update_state,
-                              window);
-}
-
 void
 _gtr_window_set_sensitive_according_to_message (GtrWindow * window,
                                                 GtrPo * po)
@@ -389,8 +368,6 @@ set_sensitive_according_to_tab (GtrWindow * window, GtrTab * tab)
   gtk_action_set_sensitive (action, current_page < pages - 1);
 
   _gtr_window_set_sensitive_according_to_message (window, po);
-
-  extensions_update_state (window);
 }
 
 static void
@@ -787,8 +764,6 @@ notebook_switch_page (GtkNotebook * nb,
    */
   if (action != NULL)
     gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
-
-  extensions_update_state (window);
 }
 
 static void
@@ -809,19 +784,6 @@ notebook_page_removed (GtkNotebook * notebook,
     gtk_widget_hide (window->priv->profile_combo);
 
   update_documents_list_menu (window);
-
-  peas_engine_garbage_collect (PEAS_ENGINE (gtr_plugins_engine_get_default ()));
-}
-
-static void
-notebook_tab_close_request (GtrNotebook * notebook,
-                            GtrTab * tab, GtrWindow * window)
-{
-  /* Note: we are destroying the tab before the default handler
-   * seems to be ok, but we need to keep an eye on this. */
-  gtr_close_tab (tab, window);
-
-  extensions_update_state (window);
 }
 
 static void
@@ -949,8 +911,6 @@ notebook_tab_added (GtkNotebook * notebook,
                     "notify::state", G_CALLBACK (sync_state), window);
 
   update_documents_list_menu (window);
-
-  extensions_update_state (window);
 }
 
 void
@@ -1365,30 +1325,6 @@ on_profile_modified (GtrProfileManager *manager,
 }
 
 static void
-extension_added (PeasExtensionSet *extensions,
-                 PeasPluginInfo   *info,
-                 PeasExtension    *exten,
-                 GtrWindow        *window)
-{
-  gtr_window_activatable_activate (GTR_WINDOW_ACTIVATABLE (exten));
-}
-
-static void
-extension_removed (PeasExtensionSet *extensions,
-                   PeasPluginInfo   *info,
-                   PeasExtension    *exten,
-                   GtrWindow        *window)
-{
-  gtr_window_activatable_deactivate (GTR_WINDOW_ACTIVATABLE (exten));
-
-  /* Ensure update of ui manager, because we suspect it does something
-   * with expected static strings in the type module (when unloaded the
-   * strings don't exist anymore, and ui manager updates in an idle
-   * func) */
-  gtk_ui_manager_ensure_update (window->priv->ui_manager);
-}
-
-static void
 gtr_window_init (GtrWindow * window)
 {
   GtkTargetList *tl;
@@ -1517,7 +1453,7 @@ gtr_window_init (GtrWindow * window)
                     G_CALLBACK (notebook_page_removed), window);
   g_signal_connect (priv->notebook,
                     "tab_close_request",
-                    G_CALLBACK (notebook_tab_close_request), window);
+                    G_CALLBACK (gtr_close_tab), window);
 
   /* statusbar & progress bar */
   create_statusbar (window);
@@ -1548,24 +1484,6 @@ gtr_window_init (GtrWindow * window)
   g_signal_connect (window,
                     "drag_data_received",
                     G_CALLBACK (drag_data_received_cb), NULL);
-
-  /* Plugins */
-  window->priv->extensions = peas_extension_set_new (PEAS_ENGINE (gtr_plugins_engine_get_default ()),
-                                                     GTR_TYPE_WINDOW_ACTIVATABLE,
-                                                     "window", window,
-                                                     NULL);
-  peas_extension_set_foreach (window->priv->extensions,
-                              (PeasExtensionSetForeachFunc) extension_added,
-                              window);
-
-  g_signal_connect (window->priv->extensions,
-                    "extension-added",
-                    G_CALLBACK (extension_added),
-                    window);
-  g_signal_connect (window->priv->extensions,
-                    "extension-removed",
-                    G_CALLBACK (extension_removed),
-                    window);
 }
 
 static void
@@ -1585,21 +1503,10 @@ gtr_window_dispose (GObject * object)
 
   DEBUG_PRINT ("window dispose");
 
-  /* First of all, force collection so that plugins
-   * really drop some of the references.
-   */
-  peas_engine_garbage_collect (PEAS_ENGINE (gtr_plugins_engine_get_default ()));
-
   if (!priv->dispose_has_run)
     {
       save_panes_state (window);
 
-      /* Note that unreffing the extensions will automatically remove
-         all extensions which in turn will deactivate the extension */
-      g_object_unref (priv->extensions);
-
-      peas_engine_garbage_collect (PEAS_ENGINE (gtr_plugins_engine_get_default ()));
-
       priv->dispose_has_run = TRUE;
     }
 
@@ -1608,11 +1515,6 @@ gtr_window_dispose (GObject * object)
   g_clear_object (&priv->action_group);
   g_clear_object (&priv->prof_manager);
 
-  /* Now that there have broken some reference loops,
-   * force collection again.
-   */
-  peas_engine_garbage_collect (PEAS_ENGINE (gtr_plugins_engine_get_default ()));
-
   G_OBJECT_CLASS (gtr_window_parent_class)->dispose (object);
 }
 



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