mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-05 12:28:19 +02:00
2005-08-15 Christopher Aillon <caillon@redhat.com>
* gnome/vpn-properties/nm-vpn-properties.c:
* gnome/vpn-properties/nm-vpn-ui-interface.h:
* vpn-daemons/vpnc/properties/nm-vpnc.c:
Makeshift fix to remove newlines from translatable strings.
Note that we now return an allocated string, so callers of
get_confirmation_details () must now call g_free () on the
result. (fixes #309033).
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@846 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
2a8b371b28
commit
6df6b19135
4 changed files with 51 additions and 32 deletions
10
ChangeLog
10
ChangeLog
|
|
@ -1,3 +1,13 @@
|
|||
2005-08-15 Christopher Aillon <caillon@redhat.com>
|
||||
|
||||
* gnome/vpn-properties/nm-vpn-properties.c:
|
||||
* gnome/vpn-properties/nm-vpn-ui-interface.h:
|
||||
* vpn-daemons/vpnc/properties/nm-vpnc.c:
|
||||
Makeshift fix to remove newlines from translatable strings.
|
||||
Note that we now return an allocated string, so callers of
|
||||
get_confirmation_details () must now call g_free () on the
|
||||
result. (fixes #309033).
|
||||
|
||||
2005-08-12 Robert Love <rml@novell.com>
|
||||
|
||||
* gnome/applet/applet-dbus.c: remove newlines from translatable
|
||||
|
|
|
|||
|
|
@ -310,12 +310,14 @@ static void vpn_druid_vpn_confirm_page_prepare (GnomeDruidPage *druidpage,
|
|||
|
||||
vpn_ui = (NetworkManagerVpnUI *) g_slist_nth_data (vpn_types, gtk_combo_box_get_active (vpn_type_combo_box));
|
||||
if (vpn_ui != NULL) {
|
||||
const char *confirm_text;
|
||||
gchar *confirm_text;
|
||||
|
||||
confirm_text = vpn_ui->get_confirmation_details (vpn_ui);
|
||||
vpn_ui->get_confirmation_details (vpn_ui, &confirm_text);
|
||||
|
||||
gnome_druid_page_edge_set_text (druid_confirm_page,
|
||||
confirm_text);
|
||||
|
||||
g_free (confirm_text);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,8 +59,11 @@ struct _NetworkManagerVpnUI {
|
|||
|
||||
gboolean (*is_valid) (NetworkManagerVpnUI *self);
|
||||
|
||||
const char *(*get_confirmation_details)(NetworkManagerVpnUI *self);
|
||||
|
||||
/*
|
||||
* get_confirmation_details:
|
||||
* retval is allocated and must be freed
|
||||
*/
|
||||
void (*get_confirmation_details)(NetworkManagerVpnUI *self, gchar **retval);
|
||||
|
||||
char *(*get_connection_name) (NetworkManagerVpnUI *self);
|
||||
|
||||
|
|
|
|||
|
|
@ -417,13 +417,10 @@ impl_set_validity_changed_callback (NetworkManagerVpnUI *self,
|
|||
impl->callback_user_data = user_data;
|
||||
}
|
||||
|
||||
static const char *
|
||||
impl_get_confirmation_details (NetworkManagerVpnUI *self)
|
||||
static void
|
||||
impl_get_confirmation_details (NetworkManagerVpnUI *self, gchar **retval)
|
||||
{
|
||||
static char buf[512];
|
||||
static char buf2[128];
|
||||
static char buf3[128];
|
||||
static char buf4[128];
|
||||
GString *buf;
|
||||
NetworkManagerVpnUIImpl *impl = (NetworkManagerVpnUIImpl *) self->data;
|
||||
const char *connectionname;
|
||||
const char *gateway;
|
||||
|
|
@ -445,30 +442,37 @@ impl_get_confirmation_details (NetworkManagerVpnUI *self)
|
|||
use_domain = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (impl->w_use_domain));
|
||||
domain = gtk_entry_get_text (impl->w_domain);
|
||||
|
||||
g_snprintf (buf2, sizeof (buf2), _("\tUsername: %s\n"), username);
|
||||
g_snprintf (buf3, sizeof (buf2), _("\tRoutes: %s\n"), routes);
|
||||
g_snprintf (buf4, sizeof (buf4), _("\tDomain: %s\n"), domain);
|
||||
buf = g_string_sized_new (512);
|
||||
|
||||
g_snprintf (buf, sizeof (buf),
|
||||
_("The following vpnc VPN connection will be created:\n"
|
||||
"\n"
|
||||
"\tName: %s\n"
|
||||
"\n"
|
||||
"\tGateway: %s\n"
|
||||
"\tGroup Name: %s\n"
|
||||
"%s"
|
||||
"%s"
|
||||
"%s"
|
||||
"\n"
|
||||
"The connection details can be changed using the \"Edit\" button.\n"),
|
||||
connectionname,
|
||||
gateway,
|
||||
groupname,
|
||||
use_alternate_username ? buf2 : "",
|
||||
use_domain ? buf4 : "",
|
||||
use_routes ? buf3 : "");
|
||||
g_string_append (buf, _("The following vpnc VPN connection will be created:"));
|
||||
g_string_append (buf, "\n\n\t");
|
||||
g_string_append_printf (buf, _("Name: %s"), connectionname);
|
||||
g_string_append (buf, "\n\n\t");
|
||||
|
||||
return buf;
|
||||
g_string_append_printf (buf, _("Gateway: %s"), gateway);
|
||||
g_string_append (buf, "\n\t");
|
||||
g_string_append_printf (buf, _("Group Name: %s"), groupname);
|
||||
|
||||
if (use_alternate_username) {
|
||||
g_string_append (buf, "\n\t");
|
||||
g_string_append_printf (buf, _("Username: %s"), username);
|
||||
}
|
||||
|
||||
if (use_domain) {
|
||||
g_string_append (buf, "\n\t");
|
||||
g_string_append_printf (buf, _("Domain: %s"), domain);
|
||||
}
|
||||
|
||||
if (use_routes) {
|
||||
g_string_append (buf, "\n\t");
|
||||
g_string_append_printf (buf, _("Routes: %s"), routes);
|
||||
}
|
||||
|
||||
g_string_append (buf, "\n\n");
|
||||
g_string_append (buf, _("The connection details can be changed using the \"Edit\" button."));
|
||||
g_string_append (buf, "\n");
|
||||
|
||||
*retval = g_string_free (buf, FALSE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue