[vinagre] Show IP addresses of avahi-discovered machines instead of names.
- From: Jonh Wendell <jwendell src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vinagre] Show IP addresses of avahi-discovered machines instead of names.
- Date: Sun, 6 Sep 2009 12:39:52 +0000 (UTC)
commit a986583ba8b7f6a144238298a89d6aa19c03ebb2
Author: Jonh Wendell <jwendell gnome org>
Date: Sun Sep 6 09:36:50 2009 -0300
Show IP addresses of avahi-discovered machines instead of names.
For instance, show 10.0.0.1 instead of wendell-laptop.local.
Closes #593205.
vinagre/vinagre-connect.c | 8 ++++++--
vinagre/vinagre-mdns.c | 6 ++++--
2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/vinagre/vinagre-connect.c b/vinagre/vinagre-connect.c
index 10b76e0..c79784c 100644
--- a/vinagre/vinagre-connect.c
+++ b/vinagre/vinagre-connect.c
@@ -352,10 +352,14 @@ vinagre_connect_find_button_cb (GtkButton *button,
if (gtk_dialog_run(GTK_DIALOG(d)) == GTK_RESPONSE_ACCEPT)
{
gchar *tmp;
+ char a[AVAHI_ADDRESS_STR_MAX];
+ avahi_address_snprint (a,
+ sizeof(a),
+ aui_service_dialog_get_address (AUI_SERVICE_DIALOG (d)));
tmp = g_strdup_printf ("%s::%d",
- aui_service_dialog_get_host_name(AUI_SERVICE_DIALOG(d)),
- aui_service_dialog_get_port(AUI_SERVICE_DIALOG(d)));
+ a,
+ aui_service_dialog_get_port (AUI_SERVICE_DIALOG (d)));
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (dialog->host_entry))),
tmp);
diff --git a/vinagre/vinagre-mdns.c b/vinagre/vinagre-mdns.c
index 0673bec..6d6eb31 100644
--- a/vinagre/vinagre-mdns.c
+++ b/vinagre/vinagre-mdns.c
@@ -62,7 +62,7 @@ mdns_resolver_found (GaServiceResolver *resolver,
gchar *type,
gchar *domain,
gchar *host_name,
- AvahiAddress *a,
+ AvahiAddress *address,
gint port,
AvahiStringList *txt,
GaLookupResultFlags flags,
@@ -71,6 +71,7 @@ mdns_resolver_found (GaServiceResolver *resolver,
VinagreConnection *conn;
VinagreBookmarksEntry *entry;
BrowserEntry *b_entry;
+ char a[AVAHI_ADDRESS_STR_MAX];
b_entry = g_hash_table_lookup (mdns->priv->browsers, type);
if (!b_entry)
@@ -79,11 +80,12 @@ mdns_resolver_found (GaServiceResolver *resolver,
return;
}
+ avahi_address_snprint (a, sizeof(a), address);
conn = vinagre_plugin_new_connection (b_entry->info->plugin);
g_object_set (conn,
"name", name,
"port", port,
- "host", host_name,
+ "host", a,
NULL);
entry = vinagre_bookmarks_entry_new_conn (conn);
g_object_unref (conn);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]