Commit 52a309ed authored by Romain Bouvier's avatar Romain Bouvier

Switch preferences ui file to xdt-csource

- We don't need to install the .ui file on the system anymore, so preferences
  dialog can be tested with built binary !
- We don't need xmllint anymore to build terminal
parent 0d2d33a4
......@@ -56,7 +56,7 @@ terminal/terminal-enum-types.c
terminal/terminal-enum-types.h
terminal/terminal-marshal.c
terminal/terminal-marshal.h
terminal/terminal-preferences.ui
terminal/terminal-preferences-ui.h
terminal/terminal-window-ui.h
terminal/xfce4-terminal
xfce4-terminal-default-apps.xml
......
......@@ -97,11 +97,6 @@ XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.38.0])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.10.0])
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.10.0])
dnl ***********************************
dnl *** Used to compress glade data ***
dnl ***********************************
AC_PATH_PROG([XMLLINT], [xmllint], [no])
dnl ***************************************************
dnl *** Check if we need to build the documentation ***
dnl ***************************************************
......
......@@ -14,7 +14,8 @@ xfce4_terminal_built_sources = \
terminal-enum-types.h \
terminal-marshal.c \
terminal-marshal.h \
terminal-window-ui.h
terminal-window-ui.h \
terminal-preferences-ui.h
xfce4_terminal_headers = \
terminal-app.h \
......@@ -80,7 +81,7 @@ endif
uidir = $(datadir)/xfce4/terminal
ui_DATA = \
terminal-preferences.ui
terminal-preferences-ui.h
##
## Rules to auto-generate built sources
......@@ -107,11 +108,11 @@ DISTCLEANFILES = \
BUILT_SOURCES = \
$(xfce4_terminal_built_sources)
terminal-window-ui.h: Makefile $(srcdir)/terminal-window-ui.xml
$(AM_V_GEN) xdt-csource --strip-comments --strip-content --static --name=terminal_window_ui $(srcdir)/terminal-window-ui.xml > terminal-window-ui.h
terminal-window-ui.h: $(srcdir)/terminal-window-ui.xml Makefile
$(AM_V_GEN) xdt-csource --strip-comments --strip-content --static --name=terminal_window_ui $< >$@
terminal-preferences.ui: $(srcdir)/terminal-preferences.glade Makefile
$(AM_V_GEN) $(XMLLINT) --nonet --noblanks $< > $@ || cat $< > $@
terminal-preferences-ui.h: $(srcdir)/terminal-preferences.glade Makefile
$(AM_V_GEN) xdt-csource --strip-comments --strip-content --static --name=terminal_preferences_ui $< >$@
terminal-enum-types.h: stamp-terminal-enum-types.h
@true
......
......@@ -34,7 +34,7 @@
#include <terminal/terminal-encoding-action.h>
#include <terminal/terminal-private.h>
#include "terminal-preferences-ui.h"
static void terminal_preferences_dialog_finalize (GObject *object);
static void terminal_preferences_dialog_disc_bindings (GtkWidget *widget,
......@@ -158,8 +158,6 @@ terminal_preferences_dialog_init (TerminalPreferencesDialog *dialog)
GObject *object, *object2;
gchar palette_name[16];
GtkFileFilter *filter;
gchar *file;
guint res;
GBinding *binding;
GtkTreeModel *model;
gchar *current;
......@@ -200,28 +198,11 @@ terminal_preferences_dialog_init (TerminalPreferencesDialog *dialog)
dialog->preferences = terminal_preferences_get ();
/* lookup the ui file */
xfce_resource_push_path (XFCE_RESOURCE_DATA, DATADIR);
file = xfce_resource_lookup (XFCE_RESOURCE_DATA, "xfce4/terminal/terminal-preferences.ui");
xfce_resource_pop_path (XFCE_RESOURCE_DATA);
if (G_UNLIKELY (file == NULL))
{
g_set_error (&error, 0, 0, "file not found");
goto error;
}
/* load the builder data into the object */
res = gtk_builder_add_from_file (GTK_BUILDER (dialog), file, &error);
g_free (file);
if (res == 0)
{
error:
g_critical ("Failed to load ui file: %s.", error->message);
g_error_free (error);
return;
}
if (!gtk_builder_add_from_string (GTK_BUILDER (dialog), terminal_preferences_ui,
terminal_preferences_ui_length, &error)) {
g_critical ("Error loading UI: %s", error->message);
g_error_free(error);
}
/* connect response to dialog */
object = gtk_builder_get_object (GTK_BUILDER (dialog), "dialog");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment