[Xfce4-commits] [apps/xfce4-screensaver] 01/01: Compile and include the dialog ui file
noreply at xfce.org
noreply at xfce.org
Sat Oct 27 13:32:11 CEST 2018
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-screensaver.
commit 2d1c4d592eda2cbdf77aa08bfa44eab15fdd48d5
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Sat Oct 27 07:32:04 2018 -0400
Compile and include the dialog ui file
---
.gitignore | 1 +
data/Makefile.am | 1 -
po/POTFILES.in | 2 +-
src/Makefile.am | 6 +++-
src/gs-lock-plug.c | 39 +++-------------------
.../xfce4-screensaver-dialog.ui | 0
6 files changed, 12 insertions(+), 37 deletions(-)
diff --git a/.gitignore b/.gitignore
index 0cc514f..82d5a8f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,6 +58,7 @@ src/xfce4-screensaver
src/xfce4-screensaver-command
src/xfce4-screensaver-dialog
src/xfce4-screensaver-dialog-css.h
+src/xfce4-screensaver-dialog-ui.h
src/xfce4-screensaver-gl-helper
src/xfce4-screensaver-preferences
src/xfce4-screensaver.desktop.in
diff --git a/data/Makefile.am b/data/Makefile.am
index ab83733..1bd668a 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -31,7 +31,6 @@ menu_DATA = \
gtkbuilderdir = $(pkgdatadir)
gtkbuilder_DATA = \
xfce4-screensaver-preferences.ui \
- lock-dialog-default.ui \
$(NULL)
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 2f055bd..323c1a4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,5 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
-[type: gettext/glade]data/lock-dialog-default.ui
data/xfce4-screensaver-preferences.desktop.in
[type: gettext/glade]data/xfce4-screensaver-preferences.ui
data/xfce4-screensaver.directory.in
@@ -17,6 +16,7 @@ src/gs-lock-plug.c
src/xfce-rr.c
src/xfce4-screensaver-command.c
src/xfce4-screensaver-dialog.c
+[type: gettext/glade]src/xfce4-screensaver-dialog.ui
src/xfce4-screensaver-preferences.c
src/xfce4-screensaver.c
src/xfce4-screensaver.desktop.in.in
diff --git a/src/Makefile.am b/src/Makefile.am
index ed90552..1c3fa3f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -135,7 +135,8 @@ test_window_LDADD = \
$(NULL)
xfce4_screensaver_dialog_built_sources = \
- xfce4-screensaver-dialog-css.h
+ xfce4-screensaver-dialog-css.h \
+ xfce4-screensaver-dialog-ui.h
xfce4_screensaver_dialog_SOURCES = \
$(xfce4_screensaver_dialog_built_sources) \
@@ -302,6 +303,9 @@ if MAINTAINER_MODE
xfce4-screensaver-dialog-css.h: $(srcdir)/xfce4-screensaver-dialog.css Makefile
$(AM_V_GEN) exo-csource --static --name=xfce4_screensaver_dialog_css $< >$@
+xfce4-screensaver-dialog-ui.h: $(srcdir)/xfce4-screensaver-dialog.ui Makefile
+ $(AM_V_GEN) exo-csource --static --strip-comments --strip-content --name=xfce4_screensaver_dialog_ui $< >$@
+
DISTCLEANFILES = \
$(xfce4_screensaver_dialog_built_sources)
diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
index 37d12f3..3eb728c 100644
--- a/src/gs-lock-plug.c
+++ b/src/gs-lock-plug.c
@@ -53,6 +53,8 @@
#include "gs-debug.h"
#include "xfce-bg.h"
+#include "xfce4-screensaver-dialog-ui.h"
+
#define MDM_FLEXISERVER_COMMAND "mdmflexiserver"
#define MDM_FLEXISERVER_ARGS "--startnew Standard"
@@ -1645,51 +1647,20 @@ redraw_background (GSLockPlug *plug)
static gboolean
load_theme (GSLockPlug *plug)
{
- char *theme;
- char *filename;
- char *gtkbuilder;
- char *css;
GtkBuilder *builder;
GtkWidget *lock_overlay;
GtkWidget *lock_panel;
GtkWidget *lock_dialog;
GError *error=NULL;
- theme = g_strdup("default");
-
- filename = g_strdup_printf ("lock-dialog-%s.ui", theme);
- gtkbuilder = g_build_filename (GTKBUILDERDIR, filename, NULL);
- g_free (filename);
- if (! g_file_test (gtkbuilder, G_FILE_TEST_IS_REGULAR))
- {
- g_free (gtkbuilder);
- g_free (theme);
- return FALSE;
- }
-
- filename = g_strdup_printf ("lock-dialog-%s.css", theme);
- g_free (theme);
-
- css = g_build_filename (GTKBUILDERDIR, filename, NULL);
- g_free (filename);
- if (g_file_test (css, G_FILE_TEST_IS_REGULAR))
- {
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS /* GTK 3.24 */
- GtkCssProvider *style_provider = gtk_css_provider_get_default ();
- G_GNUC_END_IGNORE_DEPRECATIONS
- gtk_css_provider_load_from_path (style_provider, css, NULL);
- }
- g_free (css);
-
builder = gtk_builder_new();
- if (!gtk_builder_add_from_file (builder,gtkbuilder,&error))
+ if (!gtk_builder_add_from_string (builder, xfce4_screensaver_dialog_ui,
+ xfce4_screensaver_dialog_ui_length, &error))
{
- g_warning ("Couldn't load builder file '%s': %s", gtkbuilder, error->message);
+ g_warning ("Error loading UI: %s", error->message);
g_error_free(error);
- g_free (gtkbuilder);
return FALSE;
}
- g_free (gtkbuilder);
lock_overlay = GTK_WIDGET(gtk_builder_get_object(builder, "lock-overlay"));
lock_panel = GTK_WIDGET(gtk_builder_get_object(builder, "lock-panel"));
diff --git a/data/lock-dialog-default.ui b/src/xfce4-screensaver-dialog.ui
similarity index 100%
rename from data/lock-dialog-default.ui
rename to src/xfce4-screensaver-dialog.ui
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list