sharing: Fix "format not a string literal" error
https://bugzilla.gnome.org/show_bug.cgi?id=764150
This commit is contained in:
parent
afc0a1b142
commit
70672c3658
2 changed files with 19 additions and 21 deletions
|
@ -669,25 +669,23 @@ copy_uri_to_clipboard (GtkMenuItem *item,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cc_sharing_panel_setup_label (GtkLabel *label,
|
cc_sharing_panel_setup_label (CcSharingPanel *self,
|
||||||
const gchar *hostname)
|
GtkWidget *label,
|
||||||
|
const gchar *hostname)
|
||||||
{
|
{
|
||||||
|
CcSharingPanelPrivate *priv = self->priv;
|
||||||
gchar *text;
|
gchar *text;
|
||||||
const gchar *format;
|
|
||||||
|
|
||||||
format = g_object_get_data (G_OBJECT (label), "format-label");
|
if (label == WID ("personal-file-sharing-label"))
|
||||||
if (!format)
|
text = g_strdup_printf (_("Personal File Sharing allows you to share your Public folder with others on your current network using: <a href=\"dav://%s\">dav://%s</a>"), hostname, hostname);
|
||||||
{
|
else if (label == WID ("remote-login-label"))
|
||||||
format = gtk_label_get_label (label);
|
text = g_strdup_printf (_("Allow remote users to connect using the Secure Shell command:\n<a href=\"ssh %s\">ssh %s</a>"), 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: <a href=\"vnc://%s\">vnc://%s</a>"), hostname, hostname);
|
||||||
|
else
|
||||||
|
g_assert_not_reached ();
|
||||||
|
|
||||||
/* save the original format string so that it can be used again later */
|
gtk_label_set_label (GTK_LABEL (label), text);
|
||||||
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);
|
|
||||||
|
|
||||||
g_free (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));
|
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);
|
g_free (hostname);
|
||||||
}
|
}
|
||||||
|
@ -732,7 +730,7 @@ cc_sharing_panel_get_host_name_fqdn_done (GDBusConnection *connection,
|
||||||
|
|
||||||
g_variant_get (variant, "(&s)", &fqdn);
|
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_variant_unref (variant);
|
||||||
g_object_unref (connection);
|
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));
|
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);
|
g_free (hostname);
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,7 +266,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Personal File Sharing allows you to share your Public folder with others on your current network using: <a href="dav://%s">dav://%s</a></property>
|
<property name="label">Personal File Sharing allows you to share your Public folder with others on your current network using: <a href="dav://%s">dav://%s</a></property>
|
||||||
<property name="use_markup">True</property>
|
<property name="use_markup">True</property>
|
||||||
<property name="wrap">True</property>
|
<property name="wrap">True</property>
|
||||||
<property name="max-width-chars">40</property>
|
<property name="max-width-chars">40</property>
|
||||||
|
@ -409,7 +409,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Allow remote users to connect using the Secure Shell command:
|
<property name="label">Allow remote users to connect using the Secure Shell command:
|
||||||
<a href="ssh %s">ssh %s</a></property>
|
<a href="ssh %s">ssh %s</a></property>
|
||||||
<property name="use_markup">True</property>
|
<property name="use_markup">True</property>
|
||||||
<property name="wrap">True</property>
|
<property name="wrap">True</property>
|
||||||
|
@ -501,7 +501,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Allow remote users to view or control your screen by connecting to: <a href="vnc://%s">vnc://%s</a></property>
|
<property name="label">Allow remote users to view or control your screen by connecting to: <a href="vnc://%s">vnc://%s</a></property>
|
||||||
<property name="use_markup">True</property>
|
<property name="use_markup">True</property>
|
||||||
<property name="wrap">True</property>
|
<property name="wrap">True</property>
|
||||||
<property name="max-width-chars">40</property>
|
<property name="max-width-chars">40</property>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue