You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
3.2 KiB
93 lines
3.2 KiB
12 years ago
|
From 518716ca99ce82bcf6732e1a69c9d19b878f48ea Mon Sep 17 00:00:00 2001
|
||
|
From: Alexandre Rostovtsev <tetromino@gentoo.org>
|
||
|
Date: Thu, 12 Apr 2012 03:13:25 -0400
|
||
|
Subject: [PATCH] Make avahi support optional
|
||
|
|
||
|
---
|
||
|
configure.ac | 21 ++++++++++++++++++++-
|
||
|
src/gdu-gtk/gdu-connect-to-server-dialog.c | 7 +++++++
|
||
|
2 files changed, 27 insertions(+), 1 deletions(-)
|
||
|
|
||
|
diff --git a/configure.ac b/configure.ac
|
||
|
index 7dc3630..aa487fc 100644
|
||
|
--- a/configure.ac
|
||
|
+++ b/configure.ac
|
||
|
@@ -149,7 +149,26 @@ PKG_CHECK_MODULES(GTK3, [gtk+-3.0 >= $GTK3_REQUIRED])
|
||
|
PKG_CHECK_MODULES(LIBNOTIFY, [libnotify >= $LIBNOTIFY_REQUIRED])
|
||
|
PKG_CHECK_MODULES(UDISKS, [udisks >= $UDISKS_REQUIRED udisks < $UDISKS_NEXT_ABI_INCOMPATIBLE_VERSION])
|
||
|
PKG_CHECK_MODULES(LIBATASMART, [libatasmart >= 0.14])
|
||
|
-PKG_CHECK_MODULES(AVAHI_UI, [avahi-ui-gtk3 >= $AVAHI_UI_REQUIRED])
|
||
|
+
|
||
|
+# *************
|
||
|
+# Avahi
|
||
|
+# *************
|
||
|
+
|
||
|
+have_avahi_ui=no
|
||
|
+AC_ARG_ENABLE(avahi-ui, AS_HELP_STRING([--disable-avahi-ui], [disable use of Avahi for server searching]))
|
||
|
+
|
||
|
+if test "x$enable_avahi_ui" != "xno"; then
|
||
|
+ PKG_CHECK_MODULES(AVAHI_UI, avahi-ui-gtk3 >= $AVAHI_UI_REQUIRED,
|
||
|
+ [AC_DEFINE(HAVE_AVAHI_UI, 1, [Define if avahi-ui-gtk3 is available])
|
||
|
+ have_avahi_ui=yes], have_avahi_ui=no)
|
||
|
+ if test "x$have_avahi_ui" = xno -a "x$enable_avahi_ui" = xyes; then
|
||
|
+ AC_MSG_ERROR([avahi-ui-gtk3 support requested but libraries not found])
|
||
|
+ fi
|
||
|
+fi
|
||
|
+
|
||
|
+AC_SUBST(AVAHI_UI_LIBS)
|
||
|
+AC_SUBST(AVAHI_UI_CFLAGS)
|
||
|
+AM_CONDITIONAL(ENABLE_AVAHI_UI, [test "$have_avahi_ui" = "yes"])
|
||
|
|
||
|
# *************
|
||
|
# GNOME Keyring
|
||
|
diff --git a/src/gdu-gtk/gdu-connect-to-server-dialog.c b/src/gdu-gtk/gdu-connect-to-server-dialog.c
|
||
|
index e4c1a83..a715bb7 100644
|
||
|
--- a/src/gdu-gtk/gdu-connect-to-server-dialog.c
|
||
|
+++ b/src/gdu-gtk/gdu-connect-to-server-dialog.c
|
||
|
@@ -24,7 +24,10 @@
|
||
|
|
||
|
#include "config.h"
|
||
|
#include <glib/gi18n-lib.h>
|
||
|
+
|
||
|
+#ifdef HAVE_AVAHI_UI
|
||
|
#include <avahi-ui/avahi-ui.h>
|
||
|
+#endif
|
||
|
|
||
|
#include "gdu-connect-to-server-dialog.h"
|
||
|
|
||
|
@@ -143,6 +146,7 @@ gdu_connect_to_server_dialog_get_address (GduConnectToServerDialog *dialog)
|
||
|
|
||
|
/* ---------------------------------------------------------------------------------------------------- */
|
||
|
|
||
|
+#ifdef HAVE_AVAHI_UI
|
||
|
static void
|
||
|
on_dns_sd_clicked (GtkButton *button,
|
||
|
gpointer user_data)
|
||
|
@@ -171,6 +175,7 @@ on_dns_sd_clicked (GtkButton *button,
|
||
|
|
||
|
gtk_widget_destroy (service_dialog);
|
||
|
}
|
||
|
+#endif
|
||
|
|
||
|
/* ---------------------------------------------------------------------------------------------------- */
|
||
|
|
||
|
@@ -217,6 +222,7 @@ gdu_connect_to_server_dialog_constructed (GObject *object)
|
||
|
GTK_STOCK_CONNECT,
|
||
|
GTK_RESPONSE_OK);
|
||
|
|
||
|
+#ifdef HAVE_AVAHI_UI
|
||
|
button = gtk_button_new_with_mnemonic (_("_Browse..."));
|
||
|
image = gtk_image_new_from_stock (GTK_STOCK_NETWORK, GTK_ICON_SIZE_BUTTON);
|
||
|
gtk_button_set_image (GTK_BUTTON (button), image);
|
||
|
@@ -234,6 +240,7 @@ gdu_connect_to_server_dialog_constructed (GObject *object)
|
||
|
"clicked",
|
||
|
G_CALLBACK (on_dns_sd_clicked),
|
||
|
dialog);
|
||
|
+#endif
|
||
|
|
||
|
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
|
||
|
|
||
|
--
|
||
|
1.7.8.5
|
||
|
|