diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c index 6da32ba3d..3370634d4 100644 --- a/panels/sharing/cc-sharing-panel.c +++ b/panels/sharing/cc-sharing-panel.c @@ -669,25 +669,23 @@ copy_uri_to_clipboard (GtkMenuItem *item, } static void -cc_sharing_panel_setup_label (GtkLabel *label, - const gchar *hostname) +cc_sharing_panel_setup_label (CcSharingPanel *self, + GtkWidget *label, + const gchar *hostname) { + CcSharingPanelPrivate *priv = self->priv; gchar *text; - const gchar *format; - format = g_object_get_data (G_OBJECT (label), "format-label"); - if (!format) - { - format = gtk_label_get_label (label); + if (label == WID ("personal-file-sharing-label")) + text = g_strdup_printf (_("Personal File Sharing allows you to share your Public folder with others on your current network using: dav://%s"), hostname, hostname); + else if (label == WID ("remote-login-label")) + text = g_strdup_printf (_("Allow remote users to connect using the Secure Shell command:\nssh %s"), hostname, hostname); + else if (label == WID ("screen-sharing-label")) + text = g_strdup_printf (_("Allow remote users to view or control your screen by connecting to: vnc://%s"), hostname, hostname); + else + g_assert_not_reached (); - /* save the original format string so that it can be used again later */ - g_object_set_data_full (G_OBJECT (label), "format-label", - g_strdup (format), g_free); - } - - text = g_strdup_printf (format, hostname, hostname); - - gtk_label_set_label (label, text); + gtk_label_set_label (GTK_LABEL (label), text); g_free (text); } @@ -720,7 +718,7 @@ cc_sharing_panel_get_host_name_fqdn_done (GDBusConnection *connection, hostname = cc_hostname_entry_get_hostname (CC_HOSTNAME_ENTRY (data->panel->priv->hostname_entry)); - cc_sharing_panel_setup_label (GTK_LABEL (data->label), hostname); + cc_sharing_panel_setup_label (data->panel, data->label, hostname); g_free (hostname); } @@ -732,7 +730,7 @@ cc_sharing_panel_get_host_name_fqdn_done (GDBusConnection *connection, g_variant_get (variant, "(&s)", &fqdn); - cc_sharing_panel_setup_label (GTK_LABEL (data->label), fqdn); + cc_sharing_panel_setup_label (data->panel, data->label, fqdn); g_variant_unref (variant); g_object_unref (connection); @@ -759,7 +757,7 @@ cc_sharing_panel_bus_ready (GObject *object, hostname = cc_hostname_entry_get_hostname (CC_HOSTNAME_ENTRY (data->panel->priv->hostname_entry)); - cc_sharing_panel_setup_label (GTK_LABEL (data->label), hostname); + cc_sharing_panel_setup_label (data->panel, data->label, hostname); g_free (hostname); } diff --git a/panels/sharing/sharing.ui b/panels/sharing/sharing.ui index 3b0fc02f5..c71efd05f 100644 --- a/panels/sharing/sharing.ui +++ b/panels/sharing/sharing.ui @@ -266,7 +266,7 @@ True False 0 - Personal File Sharing allows you to share your Public folder with others on your current network using: <a href="dav://%s">dav://%s</a> + Personal File Sharing allows you to share your Public folder with others on your current network using: <a href="dav://%s">dav://%s</a> True True 40 @@ -409,7 +409,7 @@ True False 0 - Allow remote users to connect using the Secure Shell command: + Allow remote users to connect using the Secure Shell command: <a href="ssh %s">ssh %s</a> True True @@ -501,7 +501,7 @@ True False 0 - Allow remote users to view or control your screen by connecting to: <a href="vnc://%s">vnc://%s</a> + Allow remote users to view or control your screen by connecting to: <a href="vnc://%s">vnc://%s</a> True True 40