[gnac/devel] Rendered the dependency to 'libunique' optional
- From: Benoît Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Rendered the dependency to 'libunique' optional
- Date: Sat, 10 Jul 2010 17:11:50 +0000 (UTC)
commit 2a521944982db0d8528fd6ef166489bab91abb32
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date: Sat Jul 10 18:11:35 2010 +0100
Rendered the dependency to 'libunique' optional
configure.ac | 29 ++++++++++++++---------------
src/gnac-ui.c | 16 +++++++++++++++-
src/profiles/gnac-profiles-properties.c | 2 +-
3 files changed, 30 insertions(+), 17 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 47ef420..dea63c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,10 +72,10 @@ GNOME_MAINTAINER_MODE_DEFINES
dnl Find GLib and GObject
PKG_CHECK_MODULES(GLIB, [
+ gio-2.0
glib-2.0
gobject-2.0
gthread-2.0
- gio-2.0
])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
@@ -84,34 +84,33 @@ dnl Find the UI libraries
PKG_CHECK_MODULES(UI, [
gconf-2.0
gtk+-2.0 >= 2.14
- gmodule-2.0
- gmodule-export-2.0
libxml-2.0
])
AC_SUBST(UI_CFLAGS)
AC_SUBST(UI_LIBS)
-PKG_CHECK_MODULES(UNIQUE, [
- unique-1.0
-])
+PKG_CHECK_MODULES(UNIQUE,
+ [unique-1.0],
+ AC_DEFINE(HAVE_LIBUNIQUE, 1,
+ [Define to 1 if you have the <unique/unique.h> header file.]),
+ AC_MSG_WARN(['libunique' was not found. Multiple instances of Gnac will be allowed.])
+)
AC_SUBST(UNIQUE_CFLAGS)
AC_SUBST(UNIQUE_LIBS)
-dnl Find the Gstreamer libraries
+dnl Find the GStreamer libraries
+GSTREAMER_REQUIRED_VERSION=0.10.12
PKG_CHECK_MODULES(GSTREAMER, [
- gstreamer-0.10 >= 0.10.20
- gstreamer-plugins-base-0.10
- gstreamer-pbutils-0.10
- gstreamer-tag-0.10
+ gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
+ gstreamer-base-0.10 >= $GSTREAMER_REQUIRED_VERSION
+ gstreamer-pbutils-0.10 >= $GSTREAMER_REQUIRED_VERSION
+ gstreamer-plugins-base-0.10 >= $GSTREAMER_REQUIRED_VERSION
+ gstreamer-tag-0.10 >= $GSTREAMER_REQUIRED_VERSION
])
AC_SUBST(GSTREAMER_CFLAGS)
AC_SUBST(GSTREAMER_LIBS)
dnl Find the GStreamer elements we use, and warn if they are not present
-AM_GST_ELEMENT_CHECK(giosrc, , AC_MSG_ERROR([The 'giosrc' element was not found. This will Gnac to fail at runtime.]))
-AM_GST_ELEMENT_CHECK(giosink, , AC_MSG_ERROR([The 'giosink' element was not found. This will cause Gnac to fail at runtime.]))
-AM_GST_ELEMENT_CHECK(decodebin, , AC_MSG_ERROR([The 'decodebin' element was not found. This will cause Gnac to fail at runtime.]))
-AM_GST_ELEMENT_CHECK(vorbisenc, , AC_MSG_WARN([The 'vorbisenc' element was not found. This will cause encoding to Ogg Vorbis to fail.]))
AM_GST_ELEMENT_CHECK(flacenc, , AC_MSG_WARN([The 'flacenc' element was not found. This will cause encoding to FLAC to fail.]))
AM_GST_ELEMENT_CHECK(wavenc, , AC_MSG_WARN([The 'wavenc' element was not found. This will cause encoding to WAV to fail.]))
AM_GST_ELEMENT_CHECK(wavpackenc, , AC_MSG_WARN([The 'wavpackenc' element was not found. This will cause encoding to WAVPACK to fail.]))
diff --git a/src/gnac-ui.c b/src/gnac-ui.c
index 0d618e3..307d859 100644
--- a/src/gnac-ui.c
+++ b/src/gnac-ui.c
@@ -30,7 +30,10 @@
#include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h>
#include <glib/gprintf.h>
+
+#ifdef HAVE_LIBUNIQUE
#include <unique/unique.h>
+#endif /* HAVE_LIBUNIQUE */
#include "gnac-bars.h"
#include "gnac-file-list.h"
@@ -53,7 +56,6 @@ static GtkFileFilter *default_file_filter;
static GtkStatusIcon *trayicon = NULL;
static GtkWidget *gnac_file_chooser;
static gchar *current_directory;
-static UniqueApp *app;
static gchar *status_msg = NULL;
static gchar *tooltip_path = NULL;
static gchar *progress_msg = NULL;
@@ -70,12 +72,16 @@ static GtkTargetEntry target_list[] = {
static guint n_targets = G_N_ELEMENTS(target_list);
+#ifdef HAVE_LIBUNIQUE
+static UniqueApp *app;
+
enum {
UNIQUE_CMD_0, /* unused: 0 is an invalid command */
UNIQUE_CMD_ADD,
UNIQUE_CMD_DEBUG,
UNIQUE_CMD_VERBOSE
};
+#endif /* HAVE_LIBUNIQUE */
static void
gnac_about_url_hook(GtkAboutDialog *dialog,
@@ -766,6 +772,7 @@ gnac_ui_get_action(const gchar *widget_name)
}
+#ifdef HAVE_LIBUNIQUE
static UniqueResponse
gnac_ui_message_received_cb(UniqueApp *app,
gint command,
@@ -812,8 +819,10 @@ gnac_ui_message_received_cb(UniqueApp *app,
return UNIQUE_RESPONSE_OK;
}
+#endif /* HAVE_LIBUNIQUE */
+#ifdef HAVE_LIBUNIQUE
static void
gnac_ui_init_unique(void)
{
@@ -876,12 +885,15 @@ gnac_ui_init_unique(void)
exit(response == UNIQUE_RESPONSE_OK);
}
}
+#endif /* HAVE_LIBUNIQUE */
void
gnac_ui_init(void)
{
+#ifdef HAVE_LIBUNIQUE
gnac_ui_init_unique();
+#endif /* HAVE_LIBUNIQUE */
}
@@ -897,7 +909,9 @@ gnac_ui_show(void)
main_window = GTK_WIDGET(
gtk_builder_get_object(gnac_main_builder, "main_window"));
+#ifdef HAVE_LIBUNIQUE
unique_app_watch_window(app, GTK_WINDOW(main_window));
+#endif /* HAVE_LIBUNIQUE */
gtk_widget_show_all(main_window);
diff --git a/src/profiles/gnac-profiles-properties.c b/src/profiles/gnac-profiles-properties.c
index c204822..13b2376 100644
--- a/src/profiles/gnac-profiles-properties.c
+++ b/src/profiles/gnac-profiles-properties.c
@@ -30,7 +30,7 @@
#include <gdk/gdkkeysyms.h>
#include <gio/gio.h>
#include <glib/gi18n.h>
-#include <gmodule.h>
+//#include <gmodule.h>
#include <stdlib.h>
#include "formats/gnac-profiles-aac.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]