vinagre r506 - in trunk: . src
- From: jwendell svn gnome org
- To: svn-commits-list gnome org
- Subject: vinagre r506 - in trunk: . src
- Date: Tue, 11 Nov 2008 17:12:30 +0000 (UTC)
Author: jwendell
Date: Tue Nov 11 17:12:30 2008
New Revision: 506
URL: http://svn.gnome.org/viewvc/vinagre?rev=506&view=rev
Log:
2008-11-11 Jonh Wendell <jwendell gnome org>
* lots of files: Make avahi optional by adding an option to
configure script: --disable-avahi. It's enabled by default.
Closes #557740.
Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/src/Makefile.am
trunk/src/vinagre-applet.c
trunk/src/vinagre-connect.c
trunk/src/vinagre-fav.c
trunk/src/vinagre-main.c
trunk/src/vinagre-window.c
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Tue Nov 11 17:12:30 2008
@@ -42,6 +42,23 @@
AVAHI_REQUIRED=0.6.22
PANEL_REQUIRED_VERSION=2.0.0
+# Check for avahi
+AC_ARG_ENABLE(avahi,
+ AC_HELP_STRING([--disable-avahi],
+ [Do not use avahi for auto-discover machines [default=yes]]),
+ enable_avahi=no,
+ enable_avahi=yes)
+
+if test "x$enable_avahi" = "xyes" ; then
+ PKG_CHECK_MODULES(AVAHI,\
+ avahi-ui >= $AVAHI_REQUIRED\
+ avahi-gobject >= $AVAHI_REQUIRED)
+ AC_SUBST(AVAHI_CFLAGS)
+ AC_SUBST(AVAHI_LIBS)
+ AC_DEFINE([VINAGRE_ENABLE_AVAHI],[1],[We want avahi support])
+fi
+AM_CONDITIONAL(AVAHI, test "x$enable_avahi" = "xyes")
+
PKG_CHECK_MODULES(VINAGRE, \
glib-2.0 >= $GLIB_REQUIRED \
gio-2.0 >= $GLIB_REQUIRED \
@@ -50,9 +67,7 @@
gconf-2.0 >= $GCONF_REQUIRED \
gthread-2.0 >= $GTHREAD_REQUIRED \
gnome-keyring-1 \
- gtk-vnc-1.0 >= $GTK_VNC_REQUIRED \
- avahi-ui >= $AVAHI_REQUIRED \
- avahi-gobject >= $AVAHI_REQUIRED)
+ gtk-vnc-1.0 >= $GTK_VNC_REQUIRED)
AC_SUBST(VINAGRE_CFLAGS)
AC_SUBST(VINAGRE_LIBS)
@@ -107,4 +122,6 @@
Compiler ...................: ${CC}
Compiler Flags .............: ${CFLAGS}
+
+ Avahi enabled ..............: ${enable_avahi}
"
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Tue Nov 11 17:12:30 2008
@@ -15,6 +15,7 @@
-DVINAGRE_DATADIR=\""$(datadir)/vinagre"\" \
-DPACKAGE_LOCALE_DIR=\""$(datadir)/locale"\" \
$(VINAGRE_CFLAGS) \
+ $(AVAHI_CFLAGS) \
$(NULL)
bin_PROGRAMS = vinagre
@@ -33,15 +34,19 @@
vinagre-ui.h vinagre-window-private.h \
vinagre-enums.h vinagre-enums.c \
gossip-cell-renderer-expander.c gossip-cell-renderer-expander.h \
- vinagre-mdns.h vinagre-mdns.c \
vinagre-prefs.h vinagre-prefs.c \
bacon-message-connection.h bacon-message-connection.c \
vinagre-app.h vinagre-app.c \
vinagre-bacon.h vinagre-bacon.c \
$(NULL)
+if AVAHI
+vinagre_SOURCES += vinagre-mdns.h vinagre-mdns.c
+endif
+
vinagre_LDADD = \
$(VINAGRE_LIBS) \
+ $(AVAHI_LIBS) \
$(GTKVNC_LIBS) \
view/libview.la \
$(NULL)
@@ -70,6 +75,7 @@
vinagre_applet_CFLAGS = \
$(APPLET_CFLAGS) \
+ $(AVAHI_CFLAGS) \
$(NULL)
vinagre_applet_SOURCES = \
@@ -78,12 +84,16 @@
vinagre-connection.h vinagre-connection.c \
vinagre-utils.h vinagre-utils.c \
vinagre-enums.h vinagre-enums.c \
- vinagre-mdns.h vinagre-mdns.c \
$(NULL)
+if AVAHI
+vinagre_applet_SOURCES += vinagre-mdns.h vinagre-mdns.c
+endif
+
vinagre_applet_LDADD = \
$(APPLET_LIBS) \
$(VINAGRE_LIBS) \
+ $(AVAHI_LIBS) \
$(NULL)
Modified: trunk/src/vinagre-applet.c
==============================================================================
--- trunk/src/vinagre-applet.c (original)
+++ trunk/src/vinagre-applet.c Tue Nov 11 17:12:30 2008
@@ -23,12 +23,15 @@
#include <gtk/gtk.h>
#include <panel-applet.h>
#include "vinagre-bookmarks.h"
-#include "vinagre-mdns.h"
#include "vinagre-utils.h"
#include "vinagre-connection.h"
#include "vinagre-commands.h"
#include <config.h>
+#ifdef VINAGRE_ENABLE_AVAHI
+#include "vinagre-mdns.h"
+#endif
+
static void
menu_position (GtkMenu *menu,
gint *x,
@@ -173,8 +176,10 @@
all = vinagre_bookmarks_get_all (vinagre_bookmarks_get_default ());
fill_menu (all, menu);
+#ifdef VINAGRE_ENABLE_AVAHI
all = vinagre_mdns_get_all (vinagre_mdns_get_default ());
fill_menu (all, menu);
+#endif
gtk_widget_show_all (menu);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, (GtkMenuPositionFunc) menu_position, applet,
@@ -205,13 +210,16 @@
{
GtkWidget *image, *button;
gchar *tmp;
- VinagreMdns *mdns;
static const BonoboUIVerb menu_verbs[] = {
BONOBO_UI_VERB ("VinagreHelp", help_cb),
BONOBO_UI_VERB ("VinagreAbout", about_cb),
BONOBO_UI_VERB_END
};
+#ifdef VINAGRE_ENABLE_AVAHI
+ VinagreMdns *mdns;
+#endif
+
if (strcmp (iid, "OAFIID:GNOME_VinagreApplet") != 0)
return FALSE;
@@ -238,7 +246,9 @@
gtk_container_add (GTK_CONTAINER (applet), image);
gtk_widget_show_all (GTK_WIDGET (applet));
+#ifdef VINAGRE_ENABLE_AVAHI
mdns = vinagre_mdns_get_default ();
+#endif
return TRUE;
}
Modified: trunk/src/vinagre-connect.c
==============================================================================
--- trunk/src/vinagre-connect.c (original)
+++ trunk/src/vinagre-connect.c Tue Nov 11 17:12:30 2008
@@ -18,13 +18,20 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
-#include <avahi-ui/avahi-ui.h>
#include <string.h>
+#ifdef VINAGRE_ENABLE_AVAHI
+#include <avahi-ui/avahi-ui.h>
+#endif
+
#include "vinagre-connect.h"
#include "vinagre-utils.h"
#include "vinagre-bookmarks.h"
@@ -174,6 +181,7 @@
}
}
+#ifdef VINAGRE_ENABLE_AVAHI
static void
vinagre_connect_find_button_cb (GtkButton *button,
VinagreConnectDialog *dialog)
@@ -208,6 +216,7 @@
gtk_widget_destroy (d);
}
+#endif
VinagreConnection *vinagre_connect (VinagreWindow *window)
{
@@ -227,10 +236,15 @@
setup_combo (dialog.host_entry);
+#ifdef VINAGRE_ENABLE_AVAHI
g_signal_connect (dialog.find_button,
"clicked",
G_CALLBACK (vinagre_connect_find_button_cb),
&dialog);
+#else
+ gtk_widget_hide (dialog.find_button);
+ gtk_widget_set_no_show_all (dialog.find_button, TRUE);
+#endif
gtk_widget_show_all (dialog.dialog);
result = gtk_dialog_run (GTK_DIALOG (dialog.dialog));
Modified: trunk/src/vinagre-fav.c
==============================================================================
--- trunk/src/vinagre-fav.c (original)
+++ trunk/src/vinagre-fav.c Tue Nov 11 17:12:30 2008
@@ -26,9 +26,12 @@
#include "vinagre-fav.h"
#include "vinagre-utils.h"
#include "vinagre-bookmarks.h"
-#include "vinagre-mdns.h"
#include "vinagre-window-private.h"
#include "gossip-cell-renderer-expander.h"
+
+#ifdef VINAGRE_ENABLE_AVAHI
+#include "vinagre-mdns.h"
+#endif
#define VINAGRE_FAV_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), VINAGRE_TYPE_FAV, VinagreFavPrivate))
@@ -724,10 +727,12 @@
"changed",
G_CALLBACK (vinagre_fav_update_list),
fav);
+#ifdef VINAGRE_ENABLE_AVAHI
g_signal_connect_swapped (vinagre_mdns_get_default (),
"changed",
G_CALLBACK (vinagre_fav_update_list),
fav);
+#endif
}
GtkWidget *
@@ -797,7 +802,7 @@
gtk_tree_view_expand_row (GTK_TREE_VIEW (fav->priv->tree), path, FALSE);
gtk_tree_path_free (path);
- /* avahi */
+#ifdef VINAGRE_ENABLE_AVAHI
list = vinagre_mdns_get_all (vinagre_mdns_get_default ());
if (!list)
return FALSE;
@@ -841,6 +846,7 @@
path = gtk_tree_path_new_from_string ("1");
gtk_tree_view_expand_row (GTK_TREE_VIEW (fav->priv->tree), path, FALSE);
gtk_tree_path_free (path);
+#endif
return FALSE;
}
Modified: trunk/src/vinagre-main.c
==============================================================================
--- trunk/src/vinagre-main.c (original)
+++ trunk/src/vinagre-main.c Tue Nov 11 17:12:30 2008
@@ -33,10 +33,13 @@
#include "vinagre-app.h"
#include "vinagre-utils.h"
#include "vinagre-prefs.h"
-#include "vinagre-mdns.h"
#include "vinagre-bacon.h"
#include <vncdisplay.h>
+#ifdef VINAGRE_ENABLE_AVAHI
+#include "vinagre-mdns.h"
+#endif
+
/* command line */
static gchar **files = NULL;
static gchar **remaining_args = NULL;
@@ -169,8 +172,10 @@
gtk_main ();
g_object_unref (vinagre_bookmarks_get_default ());
- g_object_unref (vinagre_mdns_get_default ());
g_object_unref (vinagre_prefs_get_default ());
+#ifdef VINAGRE_ENABLE_AVAHI
+ g_object_unref (vinagre_mdns_get_default ());
+#endif
return 0;
}
Modified: trunk/src/vinagre-window.c
==============================================================================
--- trunk/src/vinagre-window.c (original)
+++ trunk/src/vinagre-window.c Tue Nov 11 17:12:30 2008
@@ -36,10 +36,12 @@
#include "vinagre-utils.h"
#include "vinagre-bookmarks.h"
#include "vinagre-ui.h"
-#include "vinagre-mdns.h"
-
#include "vinagre-window-private.h"
+#ifdef VINAGRE_ENABLE_AVAHI
+#include "vinagre-mdns.h"
+#endif
+
#define VINAGRE_WINDOW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),\
VINAGRE_TYPE_WINDOW, \
VinagreWindowPrivate))
@@ -565,7 +567,10 @@
{
VinagreWindowPrivate *p = window->priv;
GList *actions, *l;
- GSList *favs, *mdnss;
+ GSList *favs;
+#ifdef VINAGRE_ENABLE_AVAHI
+ GSList *mdnss;
+#endif
gint n, m, i;
guint id;
@@ -586,9 +591,14 @@
g_list_free (actions);
favs = vinagre_bookmarks_get_all (vinagre_bookmarks_get_default ());
- mdnss = vinagre_mdns_get_all (vinagre_mdns_get_default ());
n = g_slist_length (favs);
+
+#ifdef VINAGRE_ENABLE_AVAHI
+ mdnss = vinagre_mdns_get_all (vinagre_mdns_get_default ());
m = g_slist_length (mdnss);
+#else
+ m = 0;
+#endif
i = 0;
id = (n > 0||m > 0) ? gtk_ui_manager_new_merge_id (p->manager) : 0;
@@ -641,7 +651,7 @@
i++;
}
- /* avahi */
+#ifdef VINAGRE_ENABLE_AVAHI
i = 0;
while (mdnss)
{
@@ -690,6 +700,7 @@
mdnss = mdnss->next;
i++;
}
+#endif
p->bookmarks_list_menu_ui_id = id;
}
@@ -1017,11 +1028,12 @@
"changed",
G_CALLBACK (vinagre_window_update_bookmarks_list_menu),
window);
+#ifdef VINAGRE_ENABLE_AVAHI
g_signal_connect_swapped (vinagre_mdns_get_default (),
"changed",
G_CALLBACK (vinagre_window_update_bookmarks_list_menu),
window);
-
+#endif
vinagre_window_init_clipboard (window);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]