[Xfce4-commits] [xfce/libxfce4ui] 01/01: Remove exo dependancy (Bug #13326)
noreply at xfce.org
noreply at xfce.org
Thu May 11 13:03:32 CEST 2017
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository xfce/libxfce4ui.
commit 1a2edb377bc90f2abbf79f5a64b5e9fddd90e72e
Author: Eric Koegel <eric.koegel at gmail.com>
Date: Thu May 11 14:01:59 2017 +0300
Remove exo dependancy (Bug #13326)
exo-csource was accidently added in the Gtk3 port. Switch to
compiling it as a GResource and loading that via GtkBuilder.
---
.gitignore | 2 ++
libxfce4ui/Makefile.am | 15 ++++++++++++---
libxfce4ui/libxfce4ui.gresource.xml | 6 ++++++
libxfce4ui/xfce-dialogs.c | 12 ++++--------
4 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/.gitignore b/.gitignore
index 6c46ac5..77e3083 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,8 @@ libxfce4ui/libxfce4ui-2.pc
libxfce4ui/libxfce4ui-config.h
libxfce4ui/libxfce4ui-dialog-ui.h
libxfce4ui/libxfce4ui-dialog-ui.ui~
+libxfce4ui/libxfce4ui-resources.c
+libxfce4ui/libxfce4ui-resources.h
ltmain.sh
m4/
missing
diff --git a/libxfce4ui/Makefile.am b/libxfce4ui/Makefile.am
index 82bfca6..0a6a59f 100644
--- a/libxfce4ui/Makefile.am
+++ b/libxfce4ui/Makefile.am
@@ -85,7 +85,8 @@ pkgconfig_DATA = libxfce4ui-1.pc
if ENABLE_GTK3_LIBRARY
libxfce4ui_built_sources += \
- libxfce4ui-dialog-ui.h
+ libxfce4ui-resources.c \
+ libxfce4ui-resources.h
libxfce4ui2_includedir = \
$(includedir)/xfce4/libxfce4ui-2/libxfce4ui
@@ -188,8 +189,16 @@ libxfce4ui-enum-types.c: $(libxfce4ui_enum_headers) Makefile
rm -f xgen-letc
if ENABLE_GTK3_LIBRARY
-libxfce4ui-dialog-ui.h: libxfce4ui-dialog-ui.ui
- $(AM_V_GEN) exo-csource --static --strip-comments --strip-content --name=xfce4ui_dialog_ui $< >$@
+LIBXFCE4UI_RESOURCE_FILES = \
+ libxfce4ui-dialog-ui.ui \
+ $(NULL)
+
+libxfce4ui-resources.c: libxfce4ui.gresource.xml $(UI_FILES)
+ glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name libxfce4ui $(srcdir)/libxfce4ui.gresource.xml
+
+libxfce4ui-resources.h: libxfce4ui.gresource.xml
+ glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name libxfce4ui $(srcdir)/libxfce4ui.gresource.xml
+
endif
endif
diff --git a/libxfce4ui/libxfce4ui.gresource.xml b/libxfce4ui/libxfce4ui.gresource.xml
new file mode 100644
index 0000000..d26bf1b
--- /dev/null
+++ b/libxfce4ui/libxfce4ui.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/xfce/libxfce4ui">
+ <file>libxfce4ui-dialog-ui.ui</file>
+ </gresource>
+</gresources>
diff --git a/libxfce4ui/xfce-dialogs.c b/libxfce4ui/xfce-dialogs.c
index bd3464a..186e5e8 100644
--- a/libxfce4ui/xfce-dialogs.c
+++ b/libxfce4ui/xfce-dialogs.c
@@ -43,9 +43,10 @@
#include <libxfce4ui/libxfce4ui-alias.h>
#if GTK_CHECK_VERSION (3, 0, 0)
-#include "libxfce4ui-dialog-ui.h"
+#include "libxfce4ui-resources.h"
#endif
+
static void
xfce_dialog_show_help_auto_toggled (GtkWidget *button)
{
@@ -561,13 +562,8 @@ xfce_message_dialog_new_valist (GtkWindow *parent,
g_return_val_if_fail (primary_text != NULL || secondary_text != NULL, NULL);
g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL);
- gxml = gtk_builder_new();
- if (!gtk_builder_add_from_string (gxml, xfce4ui_dialog_ui, xfce4ui_dialog_ui_length, &error))
- {
- g_printerr ("Failed to parse UI description: %s\n", error->message);
- g_clear_error (&error);
- return NULL;
- }
+
+ gxml = gtk_builder_new_from_resource ("/org/xfce/libxfce4ui/libxfce4ui-dialog-ui.ui");
dialog = GTK_WIDGET(gtk_builder_get_object(gxml, "xfce4ui-dialog"));
label_box = GTK_WIDGET(gtk_builder_get_object(gxml, "label-box"));
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list