From: Jim Evins Date: Wed, 24 Feb 2010 05:18:08 +0000 (-0500) Subject: Rename glabels data directory to support parallel installation. X-Git-Tag: glabels-2_3_0~78 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a68f91d57b2eac4a624a0e0c632338b88581d23d;p=glabels Rename glabels data directory to support parallel installation. Renamed glabels data directory from glabels to glabels-3.0 to ultimately support parallel installation with older versions of glabels. --- diff --git a/configure.ac b/configure.ac index c461e8ad..86c7b723 100644 --- a/configure.ac +++ b/configure.ac @@ -32,11 +32,17 @@ AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource) AC_PATH_PROG(UPDATE_MIME_DATABASE, update-mime-database) AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, update-desktop-database) +dnl --------------------------------------------------------------------------- +dnl - GLABELS branch +dnl --------------------------------------------------------------------------- +GLABELS_BRANCH=glabels-3.0 +AC_SUBST(GLABELS_BRANCH) + dnl --------------------------------------------------------------------------- dnl - LIBGLABELS branch dnl --------------------------------------------------------------------------- -LIBGLABELS=libglabels-3.0 -AC_SUBST(LIBGLABELS) +LIBGLABELS_BRANCH=libglabels-3.0 +AC_SUBST(LIBGLABELS_BRANCH) dnl --------------------------------------------------------------------------- dnl - LIBGLABELS API versioning @@ -239,7 +245,7 @@ dnl --------------------------------------------------------------------------- AC_CONFIG_FILES([ Makefile libglabels/Makefile -libglabels/${LIBGLABELS}.pc +libglabels/${LIBGLABELS_BRANCH}.pc src/Makefile src/pixmaps/Makefile src/stock-pixmaps/Makefile diff --git a/data/builder/Makefile.am b/data/builder/Makefile.am index 970e28f3..a4cf3f3f 100644 --- a/data/builder/Makefile.am +++ b/data/builder/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -builderdir = $(datadir)/glabels/builder/ +builderdir = $(datadir)/$(GLABELS_BRANCH)/builder/ builder_DATA = \ property-bar.builder \ diff --git a/data/pixmaps/Makefile.am b/data/pixmaps/Makefile.am index 4cebb802..39aefa0d 100644 --- a/data/pixmaps/Makefile.am +++ b/data/pixmaps/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -glabels_pixmapsdir = $(datadir)/pixmaps/glabels +glabels_pixmapsdir = $(datadir)/$(GLABELS_BRANCH)/pixmaps glabels_pixmaps_DATA = \ glabels-splash.png \ diff --git a/libglabels/Makefile.am b/libglabels/Makefile.am index 30ae37b4..f6e27aa8 100644 --- a/libglabels/Makefile.am +++ b/libglabels/Makefile.am @@ -1,4 +1,4 @@ -templatesdir = $(datadir)/$(LIBGLABELS)/templates +templatesdir = $(datadir)/$(LIBGLABELS_BRANCH)/templates INCLUDES = \ $(LIBGLABELS_CFLAGS) \ @@ -39,12 +39,12 @@ libglabels_3_0_la_SOURCES = \ str.h \ str.c -libglabels_3_0includedir=$(includedir)/$(LIBGLABELS) +libglabels_3_0includedir=$(includedir)/$(LIBGLABELS_BRANCH) libglabels_3_0include_HEADERS = \ libglabels.h -libglabels_3_0subincludedir=$(includedir)/$(LIBGLABELS)/libglabels +libglabels_3_0subincludedir=$(includedir)/$(LIBGLABELS_BRANCH)/libglabels libglabels_3_0subinclude_HEADERS = \ db.h \ @@ -59,8 +59,8 @@ libglabels_3_0subinclude_HEADERS = \ str.h EXTRA_DIST = \ - $(LIBGLABELS).pc.in + $(LIBGLABELS_BRANCH).pc.in pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = $(LIBGLABELS).pc +pkgconfig_DATA = $(LIBGLABELS_BRANCH).pc diff --git a/libglabels/libglabels-3.0.pc.in b/libglabels/libglabels-3.0.pc.in index 8c5637a4..bb07823e 100644 --- a/libglabels/libglabels-3.0.pc.in +++ b/libglabels/libglabels-3.0.pc.in @@ -8,5 +8,5 @@ Description: GLabels Template Library Requires: glib-2.0 libxml-2.0 Version: @VERSION@ Libs: -L${libdir} -lglabels-3.0 -Cflags: -I${includedir}/libglabels-3.0 +Cflags: -I${includedir}/@LIBGLABELS_BRANCH@ diff --git a/src/Makefile.am b/src/Makefile.am index 2ba4c837..13147ca0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,16 +12,15 @@ INCLUDES = \ $(LIBIEC16022_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) \ -DGLABELS_LOCALEDIR=\""$(datadir)/locale"\" \ - -DGLABELS_ICON_DIR=\""$(datadir)/pixmaps/"\" \ - -DGLABELS_BUILDER_DIR=\""$(datadir)/glabels/builder/"\" \ - -DGLABELS_PIXMAP_DIR=\""$(datadir)/pixmaps/glabels/"\" \ + -DGLABELS_ICON_DIR=\""$(datadir)/pixmaps"\" \ + -DGLABELS_DATA_DIR=\""$(datadir)/$(GLABELS_BRANCH)"\" \ -DG_LOG_DOMAIN=\""glabels\"" glabels_LDFLAGS = -export-dynamic glabels_LDADD = \ $(GLABELS_LIBS) \ - ../libglabels/$(LIBGLABELS).la \ + ../libglabels/$(LIBGLABELS_BRANCH).la \ $(LIBEBOOK_LIBS) \ $(LIBBARCODE_LIBS) \ $(LIBQRENCODE_LIBS) \ @@ -31,7 +30,7 @@ glabels_batch_LDFLAGS = -export-dynamic glabels_batch_LDADD = \ $(GLABELS_LIBS) \ - ../libglabels/$(LIBGLABELS).la \ + ../libglabels/$(LIBGLABELS_BRANCH).la \ $(LIBEBOOK_LIBS) \ $(LIBBARCODE_LIBS) \ $(LIBQRENCODE_LIBS) \ @@ -320,8 +319,8 @@ EXTRA_DIST = \ CLEANFILES = $(BUILT_SOURCES) -$(bin_PROGRAMS): ../libglabels/$(LIBGLABELS).la +$(bin_PROGRAMS): ../libglabels/$(LIBGLABELS_BRANCH).la -../libglabels/$(LIBGLABELS).la: +../libglabels/$(LIBGLABELS_BRANCH).la: cd ../libglabels; $(MAKE) diff --git a/src/glabels.c b/src/glabels.c index d2c7d2bd..85f207db 100644 --- a/src/glabels.c +++ b/src/glabels.c @@ -98,7 +98,7 @@ main (int argc, char **argv) gl_warning_handler_init(); /* Set default icon */ - icon_file = GLABELS_ICON_DIR "glabels.png"; + icon_file = g_build_filename (GLABELS_ICON_DIR, "glabels.png", NULL); if (!g_file_test (icon_file, G_FILE_TEST_EXISTS)) { g_message ("Could not find %s", icon_file); @@ -107,6 +107,7 @@ main (int argc, char **argv) { gtk_window_set_default_icon_from_file (icon_file, NULL); } + g_free (icon_file); /* Initialize subsystems */ diff --git a/src/media-select.c b/src/media-select.c index bea0b006..98dc8446 100644 --- a/src/media-select.c +++ b/src/media-select.c @@ -218,6 +218,7 @@ gl_media_select_new (void) static void gl_media_select_construct (glMediaSelect *this) { + gchar *builder_filename; GtkBuilder *builder; static gchar *object_ids[] = { "media_select_hbox", NULL }; GError *error = NULL; @@ -240,10 +241,9 @@ gl_media_select_construct (glMediaSelect *this) g_return_if_fail (this->priv != NULL); builder = gtk_builder_new (); - gtk_builder_add_objects_from_file (builder, - GLABELS_BUILDER_DIR "media-select.builder", - object_ids, - &error); + builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "media-select.builder", NULL); + gtk_builder_add_objects_from_file (builder, builder_filename, object_ids, &error); + g_free (builder_filename); if (error) { g_critical ("%s\n\ngLabels may not be installed correctly!", error->message); g_error_free (error); diff --git a/src/merge-properties-dialog.c b/src/merge-properties-dialog.c index 86e30f13..196cdfc7 100644 --- a/src/merge-properties-dialog.c +++ b/src/merge-properties-dialog.c @@ -142,6 +142,7 @@ gl_merge_properties_dialog_class_init (glMergePropertiesDialogClass *class) static void gl_merge_properties_dialog_init (glMergePropertiesDialog *dialog) { + gchar *builder_filename; GtkBuilder *builder; static gchar *object_ids[] = { "merge_properties_vbox", NULL }; GError *error = NULL; @@ -165,10 +166,9 @@ gl_merge_properties_dialog_init (glMergePropertiesDialog *dialog) gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); builder = gtk_builder_new (); - gtk_builder_add_objects_from_file (builder, - GLABELS_BUILDER_DIR "merge-properties-dialog.builder", - object_ids, - &error); + builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "merge-properties-dialog.builder", NULL); + gtk_builder_add_objects_from_file (builder, builder_filename, object_ids, &error); + g_free (builder_filename); if (error) { g_critical ("%s\n\ngLabels may not be installed correctly!", error->message); g_error_free (error); diff --git a/src/object-editor.c b/src/object-editor.c index 1250d6c8..3f742619 100644 --- a/src/object-editor.c +++ b/src/object-editor.c @@ -112,6 +112,7 @@ gl_object_editor_class_init (glObjectEditorClass *class) static void gl_object_editor_init (glObjectEditor *editor) { + gchar *builder_filename; static gchar *object_ids[] = { "editor_vbox", "adjustment1", "adjustment2", "adjustment3", "adjustment4", "adjustment5", "adjustment6", @@ -128,10 +129,9 @@ gl_object_editor_init (glObjectEditor *editor) editor->priv->builder = gtk_builder_new (); - gtk_builder_add_objects_from_file (editor->priv->builder, - GLABELS_BUILDER_DIR "object-editor.builder", - object_ids, - &error); + builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "object-editor.builder", NULL); + gtk_builder_add_objects_from_file (editor->priv->builder, builder_filename, object_ids, &error); + g_free (builder_filename); if (error) { g_critical ("%s\n\ngLabels may not be installed correctly!", error->message); g_error_free (error); diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index d05f4680..d7973860 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -139,6 +139,7 @@ gl_prefs_dialog_class_init (glPrefsDialogClass *class) static void gl_prefs_dialog_init (glPrefsDialog *dialog) { + gchar *builder_filename; static gchar *object_ids[] = { "prefs_notebook", "adjustment1", "adjustment2", "adjustment3", NULL }; @@ -149,10 +150,9 @@ gl_prefs_dialog_init (glPrefsDialog *dialog) dialog->priv = g_new0 (glPrefsDialogPrivate, 1); dialog->priv->builder = gtk_builder_new (); - gtk_builder_add_objects_from_file (dialog->priv->builder, - GLABELS_BUILDER_DIR "prefs-dialog.builder", - object_ids, - &error); + builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "prefs-dialog.builder", NULL); + gtk_builder_add_objects_from_file (dialog->priv->builder, builder_filename, object_ids, &error); + g_free (builder_filename); if (error) { g_critical ("%s\n\ngLabels may not be installed correctly!", error->message); g_error_free (error); diff --git a/src/print-op-dialog.c b/src/print-op-dialog.c index 1a464147..fc693df2 100644 --- a/src/print-op-dialog.c +++ b/src/print-op-dialog.c @@ -232,6 +232,7 @@ static GObject * create_custom_widget_cb (GtkPrintOperation *operation, glLabel *label) { + gchar *builder_filename; GtkBuilder *builder; static gchar *object_ids[] = { "print_custom_widget_hbox", "adjustment1", "adjustment2", @@ -252,10 +253,9 @@ create_custom_widget_cb (GtkPrintOperation *operation, op->priv->labels_per_sheet = lgl_template_frame_get_n_labels (frame); builder = gtk_builder_new (); - gtk_builder_add_objects_from_file (builder, - GLABELS_BUILDER_DIR "print-op-dialog-custom-widget.builder", - object_ids, - &error); + builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "print-op-dialog-custom-widget.builder", NULL); + gtk_builder_add_objects_from_file (builder, builder_filename, object_ids, &error); + g_free (builder_filename); if (error) { g_critical ("%s\n\ngLabels may not be installed correctly!", error->message); g_error_free (error); diff --git a/src/template-designer.c b/src/template-designer.c index 90c491cd..03528b8a 100644 --- a/src/template-designer.c +++ b/src/template-designer.c @@ -42,14 +42,6 @@ /*========================================================*/ /* Private macros and constants. */ /*========================================================*/ -#define ICON_PIXMAP (GLABELS_ICON_DIR "glabels.png") - -#define EX_RECT_IMAGE (GLABELS_PIXMAP_DIR "ex-rect-size.png") -#define EX_ROUND_IMAGE (GLABELS_PIXMAP_DIR "ex-round-size.png") -#define EX_CD_IMAGE (GLABELS_PIXMAP_DIR "ex-cd-size.png") -#define EX_NLAYOUTS_IMAGE1 (GLABELS_PIXMAP_DIR "ex-1layout.png") -#define EX_NLAYOUTS_IMAGE2 (GLABELS_PIXMAP_DIR "ex-2layouts.png") - #define DEFAULT_MARGIN 9.0 #define DEFAULT_RECT_W 252.0 @@ -289,6 +281,7 @@ gl_template_designer_class_init (glTemplateDesignerClass *class) static void gl_template_designer_init (glTemplateDesigner *dialog) { + gchar *builder_filename; static gchar *object_ids[] = { "start_page", "name_page", "pg_size_page", @@ -317,10 +310,9 @@ gl_template_designer_init (glTemplateDesigner *dialog) dialog->priv = g_new0 (glTemplateDesignerPrivate, 1); dialog->priv->builder = gtk_builder_new (); - gtk_builder_add_objects_from_file (dialog->priv->builder, - GLABELS_BUILDER_DIR "template-designer.builder", - object_ids, - &error); + builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "template-designer.builder", NULL); + gtk_builder_add_objects_from_file (dialog->priv->builder, builder_filename, object_ids, &error); + g_free (builder_filename); if (error) { g_critical ("%s\n\ngLabels may not be installed correctly!", error->message); g_error_free (error); @@ -387,6 +379,7 @@ static void gl_template_designer_construct (glTemplateDesigner *dialog) { lglUnits units; + gchar *logo_filename; GdkPixbuf *logo; gl_debug (DEBUG_TEMPLATE, "START"); @@ -403,7 +396,9 @@ gl_template_designer_construct (glTemplateDesigner *dialog) gtk_window_set_title (GTK_WINDOW(dialog), _("gLabels Template Designer")); - logo = gdk_pixbuf_new_from_file (ICON_PIXMAP, NULL); + logo_filename = g_build_filename (GLABELS_ICON_DIR, "glabels.png", NULL); + logo = gdk_pixbuf_new_from_file (logo_filename, NULL); + g_free (logo_filename); /* Costruct and append pages (must be same order as PAGE_NUM enums. */ construct_start_page (dialog, logo); @@ -628,6 +623,7 @@ static void construct_rect_size_page (glTemplateDesigner *dialog, GdkPixbuf *logo) { + gchar *pixbuf_filename; GdkPixbuf *pixbuf; gl_debug (DEBUG_TEMPLATE, "START"); @@ -664,7 +660,9 @@ construct_rect_size_page (glTemplateDesigner *dialog, TRUE); /* Initialize illustration. */ - pixbuf = gdk_pixbuf_new_from_file (EX_RECT_IMAGE, NULL); + pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-rect-size.png", NULL); + pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL); + g_free (pixbuf_filename); gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->rect_image), pixbuf); /* Apply units to spinbuttons and units labels. */ @@ -730,6 +728,7 @@ static void construct_round_size_page (glTemplateDesigner *dialog, GdkPixbuf *logo) { + gchar *pixbuf_filename; GdkPixbuf *pixbuf; gl_debug (DEBUG_TEMPLATE, "START"); @@ -760,7 +759,9 @@ construct_round_size_page (glTemplateDesigner *dialog, TRUE); /* Initialize illustration. */ - pixbuf = gdk_pixbuf_new_from_file (EX_ROUND_IMAGE, NULL); + pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-round-size.png", NULL); + pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL); + g_free (pixbuf_filename); gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->round_image), pixbuf); /* Apply units to spinbuttons and units labels. */ @@ -802,6 +803,7 @@ static void construct_cd_size_page (glTemplateDesigner *dialog, GdkPixbuf *logo) { + gchar *pixbuf_filename; GdkPixbuf *pixbuf; gl_debug (DEBUG_TEMPLATE, "START"); @@ -838,7 +840,9 @@ construct_cd_size_page (glTemplateDesigner *dialog, TRUE); /* Initialize illustration. */ - pixbuf = gdk_pixbuf_new_from_file (EX_CD_IMAGE, NULL); + pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-cd-size.png", NULL); + pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL); + g_free (pixbuf_filename); gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->cd_image), pixbuf); /* Apply units to spinbuttons and units labels. */ @@ -900,6 +904,7 @@ static void construct_nlayouts_page (glTemplateDesigner *dialog, GdkPixbuf *logo) { + gchar *pixbuf_filename; GdkPixbuf *pixbuf; gl_debug (DEBUG_TEMPLATE, "START"); @@ -930,9 +935,13 @@ construct_nlayouts_page (glTemplateDesigner *dialog, /* Initialize illustrations. */ - pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE1, NULL); + pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-1layout.png", NULL); + pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL); + g_free (pixbuf_filename); gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->nlayouts_image1), pixbuf); - pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE2, NULL); + pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-2layouts.png", NULL); + pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL); + g_free (pixbuf_filename); gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->nlayouts_image2), pixbuf); gl_debug (DEBUG_TEMPLATE, "END"); diff --git a/src/ui-commands.c b/src/ui-commands.c index 666b2e35..f31f87cc 100644 --- a/src/ui-commands.c +++ b/src/ui-commands.c @@ -1126,6 +1126,7 @@ gl_ui_cmd_help_about (GtkAction *action, { static GtkWidget *about = NULL; + gchar *pixbuf_filename; GdkPixbuf *pixbuf = NULL; const gchar *authors[] = { @@ -1181,7 +1182,9 @@ gl_ui_cmd_help_about (GtkAction *action, } else { - pixbuf = gdk_pixbuf_new_from_file (GLABELS_PIXMAP_DIR "glabels-splash.png", NULL); + pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "glabels-splash.png", NULL); + pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL); + g_free (pixbuf_filename); about = gtk_about_dialog_new (); gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG(about), _("glabels")); diff --git a/src/ui-property-bar.c b/src/ui-property-bar.c index 345f21c8..69592fbb 100644 --- a/src/ui-property-bar.c +++ b/src/ui-property-bar.c @@ -230,6 +230,7 @@ gl_ui_property_bar_new (void) static void gl_ui_property_bar_construct (glUIPropertyBar *this) { + gchar *builder_filename; GtkBuilder *builder; static gchar *object_ids[] = { "property_toolbar", "adjustment1", "adjustment2", @@ -242,10 +243,9 @@ gl_ui_property_bar_construct (glUIPropertyBar *this) this->priv->stop_signals = TRUE; builder = gtk_builder_new (); - gtk_builder_add_objects_from_file (builder, - GLABELS_BUILDER_DIR "property-bar.builder", - object_ids, - &error); + builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "property-bar.builder", NULL); + gtk_builder_add_objects_from_file (builder, builder_filename, object_ids, &error); + g_free (builder_filename); if (error) { g_critical ("%s\n\ngLabels may not be installed correctly!", error->message); g_error_free (error); diff --git a/templates/Makefile.am b/templates/Makefile.am index abc597be..d7c81d12 100644 --- a/templates/Makefile.am +++ b/templates/Makefile.am @@ -1,11 +1,11 @@ ## Process this file with automake to produce Makefile.in -dtddir = $(datadir)/$(LIBGLABELS)/dtd +dtddir = $(datadir)/$(LIBGLABELS_BRANCH)/dtd dtd_DATA = \ glabels-2.3.dtd -templatesdir = $(datadir)/$(LIBGLABELS)/templates +templatesdir = $(datadir)/$(LIBGLABELS_BRANCH)/templates templates_DATA = \ paper-sizes.xml \