[gtranslator] UI manager using Gresource
- From: Daniel Mustieles GarcÃa <dmustieles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator] UI manager using Gresource
- Date: Thu, 19 Apr 2012 11:12:24 +0000 (UTC)
commit 919ddcea83866a6451d58f6e135148e4010ceb69
Author: Daniel Mustieles <daniel mustieles gmail com>
Date: Wed Apr 18 12:50:23 2012 +0200
UI manager using Gresource
data/Makefile.am | 1 -
src/gtr-window.c | 11 +++++------
{data => src}/gtranslator-ui.xml | 0
src/gtranslator.gresource.xml | 1 +
4 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index fc34c8a..af7f28a 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -9,7 +9,6 @@ pkgconfig_DATA = gtranslator.pc
uidir = $(pkgdatadir)/ui
ui_DATA = \
- gtranslator-ui.xml \
gtr-toolbar.xml \
gtr-plural-forms.ini \
po.lang \
diff --git a/src/gtr-window.c b/src/gtr-window.c
index da8565a..c1a4067 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -1374,8 +1374,6 @@ gtr_window_draw (GtrWindow * window)
GtkWidget *widget;
GError *error = NULL;
GtkActionGroup *action_group;
- gchar *path;
-
GtrWindowPrivate *priv = window->priv;
/* Main box */
@@ -1417,14 +1415,15 @@ gtr_window_draw (GtrWindow * window)
gtk_ui_manager_insert_action_group (priv->ui_manager, action_group, 0);
g_object_unref (action_group);
- path = gtr_dirs_get_ui_file ("gtranslator-ui.xml");
+ gtk_ui_manager_add_ui_from_resource (priv->ui_manager,
+ "/org/gnome/gtranslator/ui/gtranslator-ui.xml",
+ &error);
- if (!gtk_ui_manager_add_ui_from_file (priv->ui_manager, path, &error))
+ if (error != NULL)
{
- g_warning ("building menus failed: %s", error->message);
+ g_warning ("Could not add ui definition: %s", error->message);
g_error_free (error);
}
- g_free (path);
/* show tooltips in the statusbar */
g_signal_connect (priv->ui_manager,
diff --git a/data/gtranslator-ui.xml b/src/gtranslator-ui.xml
similarity index 100%
rename from data/gtranslator-ui.xml
rename to src/gtranslator-ui.xml
diff --git a/src/gtranslator.gresource.xml b/src/gtranslator.gresource.xml
index 31d4129..3608c65 100644
--- a/src/gtranslator.gresource.xml
+++ b/src/gtranslator.gresource.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/gtranslator/ui">
+ <file preprocess="xml-stripblanks">gtranslator-ui.xml</file>
<file preprocess="xml-stripblanks">gtr-header-dialog.ui</file>
<file preprocess="xml-stripblanks">gtr-jump-dialog.ui</file>
<file preprocess="xml-stripblanks">gtr-languages-fetcher.ui</file>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]