[gtranslator] Install ui files on pkgdatadir/ui



commit ccd6311c6def603665a2674506ece6f0bb0be1c8
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu Feb 4 19:54:35 2010 +0100

    Install ui files on pkgdatadir/ui

 plugins/open-tran/Makefile.am                      |    2 +-
 plugins/open-tran/gtr-open-tran-plugin.c           |    7 +++++--
 plugins/source-code-view/Makefile.am               |    2 +-
 .../source-code-view/gtr-source-code-view-plugin.c |    9 +++++----
 plugins/source-code-view/gtr-viewer.c              |    5 ++++-
 5 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/plugins/open-tran/Makefile.am b/plugins/open-tran/Makefile.am
index 16df769..e4d8e00 100644
--- a/plugins/open-tran/Makefile.am
+++ b/plugins/open-tran/Makefile.am
@@ -27,7 +27,7 @@ libopentran_la_LDFLAGS = \
 	$(GTRANSLATOR_LIBS)					\
 	$(SOUP_LIBS)
 
-uidir = $(pkgdatadir)
+uidir = $(pkgdatadir)/ui
 
 ui_DATA =  \
 	gtr-open-tran-dialog.ui
diff --git a/plugins/open-tran/gtr-open-tran-plugin.c b/plugins/open-tran/gtr-open-tran-plugin.c
index 83a7ab4..6e26b9f 100644
--- a/plugins/open-tran/gtr-open-tran-plugin.c
+++ b/plugins/open-tran/gtr-open-tran-plugin.c
@@ -24,6 +24,7 @@
 #include "gtr-open-tran-plugin.h"
 #include "gtr-open-tran-panel.h"
 #include "gtr-application.h"
+#include "gtr-dirs.h"
 #include "gtr-window.h"
 #include "gtr-utils.h"
 
@@ -33,7 +34,6 @@
 
 #define OPEN_TRAN_PLUGIN_ICON "open-tran.png"
 #define WINDOW_DATA_KEY	"GtrOpenTranPluginWindowData"
-#define UI_FILE DATADIR"/open-tran-dialog.ui"
 
 #define GTR_OPEN_TRAN_PLUGIN_GET_PRIVATE(object) \
 				(G_TYPE_INSTANCE_GET_PRIVATE ((object),	\
@@ -157,12 +157,14 @@ get_configuration_dialog (GtrOpenTranPlugin * plugin)
 
   gboolean ret;
   GtkWidget *error_widget;
+  gchar *path;
   gchar *root_objects[] = {
     "dialog",
     NULL
   };
 
-  ret = gtranslator_utils_get_ui_objects (UI_FILE,
+  path = gtranslator_dirs_get_ui_file ("open-tran-dialog.ui");
+  ret = gtranslator_utils_get_ui_objects (path,
 					  root_objects,
 					  &error_widget,
 					  "dialog", &plugin->priv->dialog,
@@ -172,6 +174,7 @@ get_configuration_dialog (GtrOpenTranPlugin * plugin)
 					  "own_code",
 					  &plugin->priv->own_code_entry,
 					  NULL);
+  g_free (path);
 
   if (!ret)
     {
diff --git a/plugins/source-code-view/Makefile.am b/plugins/source-code-view/Makefile.am
index 26c1aa4..c507988 100644
--- a/plugins/source-code-view/Makefile.am
+++ b/plugins/source-code-view/Makefile.am
@@ -24,7 +24,7 @@ libsourcecodeview_la_LDFLAGS = \
 	$(PLUGIN_LIBTOOL_FLAGS)				\
 	$(GTRANSLATOR_LIBS)
 
-uidir = $(pkgdatadir)
+uidir = $(pkgdatadir)/ui
 
 ui_DATA =  \
         gtr-viewer.ui \
diff --git a/plugins/source-code-view/gtr-source-code-view-plugin.c b/plugins/source-code-view/gtr-source-code-view-plugin.c
index 1f8b8f8..9d72502 100644
--- a/plugins/source-code-view/gtr-source-code-view-plugin.c
+++ b/plugins/source-code-view/gtr-source-code-view-plugin.c
@@ -22,6 +22,7 @@
 
 #include "gtr-source-code-view-plugin.h"
 #include "gtr-context.h"
+#include "gtr-dirs.h"
 #include "gtr-utils.h"
 #include "gtr-viewer.h"
 #include "gtr-window.h"
@@ -39,9 +40,6 @@
 #define PROGRAM_CMD_KEY SOURCE_CODE_VIEW_BASE_KEY "/program_cmd"
 #define LINE_CMD_KEY SOURCE_CODE_VIEW_BASE_KEY "/line_cmd"
 
-/* Glade */
-#define UI_FILE DATADIR"/source-code-view-dialog.ui"
-
 #define GTR_SOURCE_CODE_VIEW_PLUGIN_GET_PRIVATE(object) \
 				(G_TYPE_INSTANCE_GET_PRIVATE ((object),	\
 				GTR_TYPE_SOURCE_CODE_VIEW_PLUGIN,		\
@@ -563,12 +561,14 @@ get_configuration_dialog (GtrSourceCodeViewPlugin * plugin)
   GtkWidget *error_widget;
   gchar *value;
   gboolean use_editor;
+  gchar *path;
   gchar *root_objects[] = {
     "dialog",
     NULL
   };
 
-  ret = gtranslator_utils_get_ui_objects (UI_FILE,
+  path = gtranslator_dirs_get_ui_file ("source-code-view-dialog.ui");
+  ret = gtranslator_utils_get_ui_objects (path,
 					  root_objects,
 					  &error_widget,
 					  "dialog", &plugin->priv->dialog,
@@ -583,6 +583,7 @@ get_configuration_dialog (GtrSourceCodeViewPlugin * plugin)
 					  "line_cmd",
 					  &plugin->priv->line_cmd_entry,
 					  NULL);
+  g_free (path);
 
   if (!ret)
     {
diff --git a/plugins/source-code-view/gtr-viewer.c b/plugins/source-code-view/gtr-viewer.c
index edf3b89..5203189 100644
--- a/plugins/source-code-view/gtr-viewer.c
+++ b/plugins/source-code-view/gtr-viewer.c
@@ -61,6 +61,7 @@ gtranslator_viewer_init (GtrViewer * dlg)
   gboolean ret;
   GtkWidget *error_widget;
   GtkWidget *sw;
+  gchar *path;
   gchar *root_objects[] = {
     "main_box",
     NULL
@@ -88,13 +89,15 @@ gtranslator_viewer_init (GtrViewer * dlg)
 		    "response", G_CALLBACK (dialog_response_handler), NULL);
 
   /*Builder */
-  ret = gtranslator_utils_get_ui_objects (DATADIR "/viewer.ui",
+  path = gtranslator_dirs_get_ui_file ("viewer.ui");
+  ret = gtranslator_utils_get_ui_objects (path,
 					  root_objects,
 					  &error_widget,
 					  "main_box", &dlg->priv->main_box,
 					  "scrolledwindow", &sw,
 					  "filename_label",
 					  &dlg->priv->filename_label, NULL);
+  g_free (path);
 
   if (!ret)
     {



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