summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-12-17 22:27:47 +0100
committerLuke from DC <[email protected]>2021-12-19 12:11:14 +0000
commit7c00cf317849bfe9e565336e5a911effe16b98bb (patch)
treec62003bb3b4afe8a60df231275da51fb39db6afd
parentfba56a1d49debccb1174ce7f7abbef521116f034 (diff)
downloadcaja-7c00cf317849bfe9e565336e5a911effe16b98bb.tar.bz2
caja-7c00cf317849bfe9e565336e5a911effe16b98bb.tar.xz
Use gresources for ui files
-rw-r--r--configure.ac8
-rw-r--r--data/Makefile.am9
-rw-r--r--data/caja-bookmarks-window.ui (renamed from src/caja-bookmarks-window.ui)0
-rw-r--r--data/caja-file-management-properties.ui (renamed from src/caja-file-management-properties.ui)0
-rw-r--r--data/caja-resources.gresource.xml7
-rw-r--r--data/ui-a11y.suppr (renamed from src/ui-a11y.suppr)0
-rw-r--r--po/POTFILES.in4
-rw-r--r--src/Makefile.am21
-rw-r--r--src/caja-bookmarks-window.c8
-rw-r--r--src/caja-file-management-properties.c2
10 files changed, 41 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index 928a5331..c2319b9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,6 +126,14 @@ GTK_DOC_CHECK([1.4])
dnl ==========================================================================
+AC_ARG_VAR([GLIB_COMPILE_RESOURCES],[glib-compile-resources bin])
+AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources],[])
+if test -z "$GLIB_COMPILE_RESOURCES"; then
+ AC_MSG_ERROR([glib-compile-resources not found])
+fi
+
+dnl ==========================================================================
+
AC_CHECK_PROGS(PERL, perl5 perl)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
diff --git a/data/Makefile.am b/data/Makefile.am
index bf98a1e6..3d57d895 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -70,13 +70,21 @@ else
$(AM_V_GEN) cp -f $< $@
endif
+ui_files = \
+ caja-file-management-properties.ui \
+ caja-bookmarks-window.ui \
+ $(NULL)
+
EXTRA_DIST = \
$(appdata_in_in_files) \
$(cajadata_DATA) \
$(desktop_in_in_files) \
$(mime_in_files) \
$(service_in_files) \
+ $(ui_files) \
+ caja-resources.gresource.xml \
freedesktop-dbus-interfaces.xml \
+ ui-a11y.suppr \
$(NULL)
DISTCLEANFILES = \
@@ -106,4 +114,5 @@ if ENABLE_UPDATE_MIMEDB
$(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime"
endif
+include $(top_srcdir)/gla11y.mk
-include $(top_srcdir)/git.mk
diff --git a/src/caja-bookmarks-window.ui b/data/caja-bookmarks-window.ui
index c8da6090..c8da6090 100644
--- a/src/caja-bookmarks-window.ui
+++ b/data/caja-bookmarks-window.ui
diff --git a/src/caja-file-management-properties.ui b/data/caja-file-management-properties.ui
index 3207c800..3207c800 100644
--- a/src/caja-file-management-properties.ui
+++ b/data/caja-file-management-properties.ui
diff --git a/data/caja-resources.gresource.xml b/data/caja-resources.gresource.xml
new file mode 100644
index 00000000..1c830a6e
--- /dev/null
+++ b/data/caja-resources.gresource.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/mate/caja">
+ <file compressed="true">caja-file-management-properties.ui</file>
+ <file compressed="true">caja-bookmarks-window.ui</file>
+ </gresource>
+</gresources>
diff --git a/src/ui-a11y.suppr b/data/ui-a11y.suppr
index c257b3c7..c257b3c7 100644
--- a/src/ui-a11y.suppr
+++ b/data/ui-a11y.suppr
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 515c3bf7..c069898c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,10 +3,12 @@
data/browser.xml
data/caja.appdata.xml.in.in
data/caja-autorun-software.desktop.in.in
+data/caja-bookmarks-window.ui
data/caja-browser.desktop.in.in
data/caja-computer.desktop.in.in
data/caja.desktop.in.in
data/caja-file-management-properties.desktop.in.in
+data/caja-file-management-properties.ui
data/caja-folder-handler.desktop.in.in
data/caja-home.desktop.in.in
data/caja.xml.in
@@ -58,14 +60,12 @@ src/caja-application.c
src/caja-autorun-software.c
src/caja-bookmarks-sidebar.c
src/caja-bookmarks-window.c
-src/caja-bookmarks-window.ui
src/caja-connect-server-dialog.c
src/caja-connect-server-dialog-main.c
src/caja-desktop-window.c
src/caja-emblem-sidebar.c
src/caja-file-management-properties.c
src/caja-file-management-properties-main.c
-src/caja-file-management-properties.ui
src/caja-history-sidebar.c
src/caja-image-properties-page.c
src/caja-information-panel.c
diff --git a/src/Makefile.am b/src/Makefile.am
index f4ee563f..391df3a2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,6 @@ AM_CPPFLAGS = \
-DLIBDIR=\""$(libdir)"\" \
-DCAJA_DATADIR=\""$(datadir)/caja"\" \
-DMATELOCALEDIR=\""$(datadir)/locale"\" \
- -DUIDIR=\""$(datadir)/caja/ui"\" \
-DCAJA_PIXMAPDIR=\""$(datadir)/pixmaps/caja"\" \
-DPREFIX=\""$(prefix)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
@@ -52,7 +51,15 @@ $(dbus_freedesktop_built_sources) : Makefile.am $(top_srcdir)/data/freedesktop-d
$(top_srcdir)/data/freedesktop-dbus-interfaces.xml \
$(NULL)
+caja-resources.c: $(srcdir)/../data/caja-resources.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/../data --generate-dependencies $(srcdir)/../data/caja-resources.gresource.xml)
+ $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/../data --generate --c-name caja $<
+
+caja-resources.h: $(srcdir)/../data/caja-resources.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/../data --generate-dependencies $(srcdir)/../data/caja-resources.gresource.xml)
+ $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/../data --generate --c-name caja $<
+
BUILT_SOURCES = \
+ caja-resources.c \
+ caja-resources.h \
caja-src-marshal.c \
caja-src-marshal.h \
$(dbus_freedesktop_built_sources) \
@@ -177,6 +184,11 @@ caja_file_management_properties_SOURCES = \
caja-file-management-properties-main.c \
$(NULL)
+nodist_caja_file_management_properties_SOURCES = \
+ caja-resources.c \
+ caja-resources.h \
+ $(NULL)
+
caja_autorun_software_SOURCES = \
caja-autorun-software.c \
$(NULL)
@@ -203,18 +215,12 @@ endif
uidir = $(datadir)/caja/ui
-ui_files = \
- caja-file-management-properties.ui \
- caja-bookmarks-window.ui \
- $(NULL)
-
include $(top_srcdir)/gla11y.mk
ui_DATA = \
caja-shell-ui.xml \
caja-navigation-window-ui.xml \
caja-spatial-window-ui.xml \
- $(ui_files) \
$(NULL)
CLEANFILES = \
@@ -229,7 +235,6 @@ EXTRA_DIST = \
$(ui_DATA) \
check-caja \
$(about_DATA) \
- ui-a11y.suppr \
$(NULL)
dist-hook:
diff --git a/src/caja-bookmarks-window.c b/src/caja-bookmarks-window.c
index 4abff840..d713d483 100644
--- a/src/caja-bookmarks-window.c
+++ b/src/caja-bookmarks-window.c
@@ -264,13 +264,7 @@ create_bookmarks_window (CajaBookmarkList *list, CajaWindow *window_source)
bookmarks = list;
- builder = gtk_builder_new ();
- if (!gtk_builder_add_from_file (builder,
- UIDIR "/caja-bookmarks-window.ui",
- NULL))
- {
- return NULL;
- }
+ builder = gtk_builder_new_from_resource ("/org/mate/caja/caja-bookmarks-window.ui");
window = (GtkWidget *)gtk_builder_get_object (builder, "bookmarks_dialog");
bookmark_list_widget = (GtkTreeView *)gtk_builder_get_object (builder, "bookmark_tree_view");
diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c
index 957a87d2..a01e058a 100644
--- a/src/caja-file-management-properties.c
+++ b/src/caja-file-management-properties.c
@@ -1261,7 +1261,7 @@ caja_file_management_properties_dialog_show (GCallback close_callback, GtkWindow
{
GtkBuilder *builder;
- builder = gtk_builder_new_from_file (UIDIR "/caja-file-management-properties.ui");
+ builder = gtk_builder_new_from_resource ("/org/mate/caja/caja-file-management-properties.ui");
g_signal_connect (gtk_builder_get_object (builder, "file_management_dialog"), "response",
close_callback, NULL);