From 93987738cd0087f7217a488c2122159b0d2437fe Mon Sep 17 00:00:00 2001 From: Christopher Aillon Date: Tue, 18 Oct 2005 18:31:03 +0000 Subject: [PATCH] 2005-10-18 Christopher Aillon * gnome/applet/other-network-dialog.c: Use g_get_host_name () if we've got GLib 2.8.0 git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1047 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 5 +++++ gnome/applet/other-network-dialog.c | 30 ++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4014704219..a69d873669 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-10-18 Christopher Aillon + + * gnome/applet/other-network-dialog.c: Use g_get_host_name () + if we've got GLib 2.8.0 + 2005-10-18 Robert Love * src/NetworkManagerDevice.c: invoke the long-in-the-tooth named diff --git a/gnome/applet/other-network-dialog.c b/gnome/applet/other-network-dialog.c index 5ff58059c9..b08458e7bc 100644 --- a/gnome/applet/other-network-dialog.c +++ b/gnome/applet/other-network-dialog.c @@ -32,12 +32,15 @@ #include #include -#include #include #include #include +#if !GLIB_CHECK_VERSION(2,8,0) +#include +#endif + #include "NetworkManager.h" #include "applet.h" #include "applet-dbus.h" @@ -231,31 +234,40 @@ static GtkDialog *nmwa_other_network_dialog_init (GladeXML *xml, NMWirelessApple if (create_network) { + gchar *default_essid_text; + +#if GLIB_CHECK_VERSION(2,8,0) + const char *hostname = g_get_host_name (); +#else char hostname[HOST_NAME_MAX] = "hostname"; gethostname (hostname, HOST_NAME_MAX); hostname[HOST_NAME_MAX-1] = '\n'; /* unspecified whether a truncated hostname is terminated */ +#endif gtk_entry_set_text (GTK_ENTRY (essid_entry), hostname); gtk_editable_set_position (GTK_EDITABLE (essid_entry), -1); - label = g_strdup_printf ("%s\n\n%s\n\n%s %s%s", - _("Create new wireless network"), - _("Enter the ESSID and security settings of the wireless network you wish to create."), - _("By default, the ESSID is set to your computer's name,"), - hostname, - _(", with no encryption enabled.")); + default_essid_text = g_strdup_printf (_("By default, the ESSID is set to your computer's name, %s, with no encryption enabled"), + hostname); + + label = g_strdup_printf ("%s\n\n%s\n\n%s", + _("Create new wireless network"), + _("Enter the ESSID and security settings of the wireless network you wish to create."), + default_essid_text); + g_free (default_essid_text); gtk_window_set_title (GTK_WINDOW(dialog), _("Create New Wireless Network")); } else { label = g_strdup_printf ("%s\n\n%s", - _("Custom wireless network"), - _("Enter the ESSID of the wireless network to which you wish to connect.")); + _("Custom wireless network"), + _("Enter the ESSID of the wireless network to which you wish to connect.")); gtk_window_set_title (GTK_WINDOW(dialog), _("Connect to Other Wireless Network")); } + gtk_label_set_markup (GTK_LABEL (glade_xml_get_widget (xml, "essid_label")), label); g_free (label);