aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-06 11:23:26 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-06 19:11:12 -0300
commit0fc4cba2512f2c96bdf2071030d87ca54e81e871 (patch)
tree2eb726e17d9a9d2e57c5a2ed378e169efc8009dc /src
parentbc84d7da7b151bedcc9b9d95117d1e2dadbc4a2e (diff)
Allow having different UIs depending on Gtk version
On Gtk3, several Widgets got obsoleted, being replaced by a different wigdet. For now, keep both gtk2 and gtk3 versions identical, e. g.: copied: camorama.ui -> camorama-gtk3.ui renamed: camorama.ui -> camorama-gtk2.ui The next patch will replace the obsolete widgets. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/Makefile.in3
-rw-r--r--src/main.c5
3 files changed, 6 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 9691eac..6e4f169 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,7 +7,7 @@ AM_CPPFLAGS=\
bin_PROGRAMS = camorama
-AM_CFLAGS = $(WARN_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) -DCAMORAMA_UI='"$(CAMORAMA_UI)"'
AM_LDFLAGS = $(WARN_LDFLAGS)
camorama_SOURCES = \
diff --git a/src/Makefile.in b/src/Makefile.in
index 3f1c8b1..79b5482 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -176,6 +176,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+CAMORAMA_UI = @CAMORAMA_UI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -300,7 +301,7 @@ AM_CPPFLAGS = \
-g \
$(NULL)
-AM_CFLAGS = $(WARN_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) -DCAMORAMA_UI='"$(CAMORAMA_UI)"'
AM_LDFLAGS = $(WARN_LDFLAGS)
camorama_SOURCES = \
callbacks.c \
diff --git a/src/main.c b/src/main.c
index efbd126..491b7a5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -215,9 +215,10 @@ int main(int argc, char *argv[])
}
cam->xml = gtk_builder_new();
+
if (!gtk_builder_add_from_file(cam->xml,
- PACKAGE_DATA_DIR
- "/camorama/camorama.ui", NULL)) {
+ PACKAGE_DATA_DIR "/camorama/" CAMORAMA_UI,
+ NULL)) {
error_dialog(_("Couldn't load builder file"));
exit(1);
}

Privacy Policy