2005-06-16 David Zeuthen <davidz@redhat.com>
* properties/nm-vpnc.c: Include w_use_domain and w_domain (impl_get_widget): Reset w_domain, w_use_domain (impl_get_properties): Also pass Domain option if applicable (impl_is_valid): Add validation code for Domain (use_domain_toggled): New function (impl_get_confirmation_details): Also put out info about Domain if applicable (impl_get_object): Get w_domain, w_use_domain widgets and set up event listeners for them * properties/nm-vpnc-dialog.glade: Added the Domain optional setting git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@686 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
2005-06-16 David Zeuthen <davidz@redhat.com>
|
||||
|
||||
* properties/nm-vpnc.c: Include w_use_domain and w_domain
|
||||
(impl_get_widget): Reset w_domain, w_use_domain
|
||||
(impl_get_properties): Also pass Domain option if applicable
|
||||
(impl_is_valid): Add validation code for Domain
|
||||
(use_domain_toggled): New function
|
||||
(impl_get_confirmation_details): Also put out info about Domain if
|
||||
applicable
|
||||
(impl_get_object): Get w_domain, w_use_domain widgets and set
|
||||
up event listeners for them
|
||||
|
||||
* properties/nm-vpnc-dialog.glade: Added the Domain optional
|
||||
setting
|
||||
|
||||
2005-06-12 David Zeuthen <davidz@redhat.com>
|
||||
|
||||
* doc/example-vpnc-system-wide-connection.sh: New file
|
||||
|
@@ -0,0 +1,4 @@
|
||||
2005-06-16 David Zeuthen <davidz@redhat.com>
|
||||
|
||||
* da.po: Updated danish translations
|
||||
|
||||
|
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: NetworkManager-vpnc\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2005-06-12 09:24-0400\n"
|
||||
"POT-Creation-Date: 2005-06-16 14:01-0400\n"
|
||||
"PO-Revision-Date: 2005-06-11 23:21-0400\n"
|
||||
"Last-Translator: David Zeuthen <davidz@redhat.com>\n"
|
||||
"Language-Team: Danish <dansk@klid.dk>\n"
|
||||
@@ -61,21 +61,26 @@ msgstr "Brugerverifikation til privat netværk"
|
||||
msgid "_Group Password:"
|
||||
msgstr "_Gruppe nøgle:"
|
||||
|
||||
#: properties/nm-vpnc.c:76
|
||||
#: properties/nm-vpnc.c:81
|
||||
msgid "Compatible Cisco VPN client (vpnc)"
|
||||
msgstr "Kompatibel Cisco VPN klient (vpnc)"
|
||||
|
||||
#: properties/nm-vpnc.c:402
|
||||
#, fuzzy, c-format
|
||||
#: properties/nm-vpnc.c:446
|
||||
#, c-format
|
||||
msgid "\tUsername: %s\n"
|
||||
msgstr "\tBrugernavn: %s\n"
|
||||
|
||||
#: properties/nm-vpnc.c:403
|
||||
#: properties/nm-vpnc.c:447
|
||||
#, c-format
|
||||
msgid "\tRoutes: %s\n"
|
||||
msgstr "\tRuter: %s\n"
|
||||
|
||||
#: properties/nm-vpnc.c:406
|
||||
#: properties/nm-vpnc.c:448
|
||||
#, c-format
|
||||
msgid "\tDomain: %s\n"
|
||||
msgstr "\tDomæne: %s\n"
|
||||
|
||||
#: properties/nm-vpnc.c:451
|
||||
#, c-format
|
||||
msgid ""
|
||||
"The following vpnc VPN connection will be created:\n"
|
||||
@@ -84,7 +89,7 @@ msgid ""
|
||||
"\n"
|
||||
"\tGateway: %s\n"
|
||||
"\tGroup Name: %s\n"
|
||||
"%s%s\n"
|
||||
"%s%s%s\n"
|
||||
"The connection details can be changed using the \"Edit\" button.\n"
|
||||
msgstr ""
|
||||
"Flg. private netværks forbindelse via vpnc vil blive oprettet:\n"
|
||||
@@ -96,7 +101,7 @@ msgstr ""
|
||||
"%s%s\n"
|
||||
"Detaljer for forbindelsen kan senere redigeres vha. \"Redigér\" knappen\n"
|
||||
|
||||
#: properties/nm-vpnc.c:431
|
||||
#: properties/nm-vpnc.c:478
|
||||
msgid "Select file to import"
|
||||
msgstr "Vælg fil der skal importeres"
|
||||
|
||||
@@ -141,14 +146,18 @@ msgid "Override user name"
|
||||
msgstr "Overskriv brugernavn"
|
||||
|
||||
#: properties/nm-vpnc-dialog.glade:537
|
||||
msgid "Use domain for authentication"
|
||||
msgstr "Brug domæne til brugerverifikation"
|
||||
|
||||
#: properties/nm-vpnc-dialog.glade:613
|
||||
msgid "Only use VPN connection for these addresses"
|
||||
msgstr "Brug kun det private netværk til flg. adresser"
|
||||
|
||||
#: properties/nm-vpnc-dialog.glade:592
|
||||
#: properties/nm-vpnc-dialog.glade:668
|
||||
msgid "<i>example: 172.16.0.0/16 10.11.12.0/24</i>"
|
||||
msgstr "<i>eksempel: 172.16.0.0/16 10.11.12.0/24</i>"
|
||||
|
||||
#: properties/nm-vpnc-dialog.glade:715
|
||||
#: properties/nm-vpnc-dialog.glade:791
|
||||
msgid "_Import..."
|
||||
msgstr "_Importér..."
|
||||
|
||||
|
@@ -530,6 +530,82 @@
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="vpnc-use-domain">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Use domain for authentication</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox8">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label16">
|
||||
<property name="visible">True</property>
|
||||
<property name="label"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">12</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkEntry" id="vpnc-domain">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="visibility">True</property>
|
||||
<property name="max_length">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="vpnc-use-routes">
|
||||
<property name="visible">True</property>
|
||||
@@ -544,8 +620,8 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
|
@@ -49,6 +49,8 @@ struct _NetworkManagerVpnUIImpl {
|
||||
GtkEntry *w_group_name;
|
||||
GtkCheckButton *w_use_alternate_username;
|
||||
GtkEntry *w_username;
|
||||
GtkCheckButton *w_use_domain;
|
||||
GtkEntry *w_domain;
|
||||
GtkCheckButton *w_use_routes;
|
||||
GtkEntry *w_routes;
|
||||
GtkExpander *w_opt_info_expander;
|
||||
@@ -63,10 +65,13 @@ vpnc_clear_widget (NetworkManagerVpnUIImpl *impl)
|
||||
gtk_entry_set_text (impl->w_group_name, "");
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_alternate_username), FALSE);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_routes), FALSE);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_domain), FALSE);
|
||||
gtk_entry_set_text (impl->w_username, "");
|
||||
gtk_entry_set_text (impl->w_routes, "");
|
||||
gtk_entry_set_text (impl->w_domain, "");
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (impl->w_username), FALSE);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (impl->w_routes), FALSE);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (impl->w_domain), FALSE);
|
||||
gtk_expander_set_expanded (impl->w_opt_info_expander, FALSE);
|
||||
}
|
||||
|
||||
@@ -112,6 +117,11 @@ impl_get_widget (NetworkManagerVpnUI *self, GSList *properties, GSList *routes,
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_alternate_username), TRUE);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (impl->w_username), TRUE);
|
||||
should_expand = TRUE;
|
||||
} else if (strcmp (key, "Domain") == 0) {
|
||||
gtk_entry_set_text (impl->w_domain, value);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (impl->w_use_domain), TRUE);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (impl->w_domain), TRUE);
|
||||
should_expand = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,12 +168,16 @@ impl_get_properties (NetworkManagerVpnUI *self)
|
||||
const char *secret;
|
||||
gboolean use_alternate_username;
|
||||
const char *username;
|
||||
gboolean use_domain;
|
||||
const char *domain;
|
||||
|
||||
connectionname = gtk_entry_get_text (impl->w_connection_name);
|
||||
gateway = gtk_entry_get_text (impl->w_gateway);
|
||||
groupname = gtk_entry_get_text (impl->w_group_name);
|
||||
use_alternate_username = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (impl->w_use_alternate_username));
|
||||
username = gtk_entry_get_text (impl->w_username);
|
||||
use_domain = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (impl->w_use_domain));
|
||||
domain = gtk_entry_get_text (impl->w_domain);
|
||||
|
||||
data = NULL;
|
||||
data = g_slist_append (data, g_strdup ("IPSec gateway"));
|
||||
@@ -174,6 +188,10 @@ impl_get_properties (NetworkManagerVpnUI *self)
|
||||
data = g_slist_append (data, g_strdup ("Xauth username"));
|
||||
data = g_slist_append (data, g_strdup (username));
|
||||
}
|
||||
if (use_domain) {
|
||||
data = g_slist_append (data, g_strdup ("Domain"));
|
||||
data = g_slist_append (data, g_strdup (domain));
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -244,6 +262,8 @@ impl_is_valid (NetworkManagerVpnUI *self)
|
||||
const char *username;
|
||||
gboolean use_routes;
|
||||
const char *routes_entry;
|
||||
gboolean use_domain;
|
||||
const char *domain_entry;
|
||||
|
||||
is_valid = FALSE;
|
||||
|
||||
@@ -254,13 +274,16 @@ impl_is_valid (NetworkManagerVpnUI *self)
|
||||
username = gtk_entry_get_text (impl->w_username);
|
||||
use_routes = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (impl->w_use_routes));
|
||||
routes_entry = gtk_entry_get_text (impl->w_routes);
|
||||
use_domain = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (impl->w_use_domain));
|
||||
domain_entry = gtk_entry_get_text (impl->w_domain);
|
||||
|
||||
/* initial sanity checking */
|
||||
if (strlen (connectionname) > 0 &&
|
||||
strlen (gateway) > 0 &&
|
||||
strlen (groupname) > 0 &&
|
||||
((!use_alternate_username) || (use_alternate_username && strlen (username) > 0)) &&
|
||||
((!use_routes) || (use_routes && strlen (routes_entry) > 0)))
|
||||
((!use_routes) || (use_routes && strlen (routes_entry) > 0)) &&
|
||||
((!use_domain) || (use_domain && strlen (domain_entry) > 0)))
|
||||
is_valid = TRUE;
|
||||
|
||||
/* validate gateway: can be a hostname or an IP; do not allow spaces or tabs */
|
||||
@@ -351,6 +374,22 @@ use_routes_toggled (GtkToggleButton *togglebutton, gpointer user_data)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
use_domain_toggled (GtkToggleButton *togglebutton, gpointer user_data)
|
||||
{
|
||||
NetworkManagerVpnUIImpl *impl = (NetworkManagerVpnUIImpl *) user_data;
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (impl->w_domain),
|
||||
gtk_toggle_button_get_active (togglebutton));
|
||||
|
||||
if (impl->callback != NULL) {
|
||||
gboolean is_valid;
|
||||
|
||||
is_valid = impl_is_valid (&(impl->parent));
|
||||
impl->callback (&(impl->parent), is_valid, impl->callback_user_data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
editable_changed (GtkEditable *editable, gpointer user_data)
|
||||
{
|
||||
@@ -382,6 +421,7 @@ impl_get_confirmation_details (NetworkManagerVpnUI *self)
|
||||
static char buf[512];
|
||||
static char buf2[128];
|
||||
static char buf3[128];
|
||||
static char buf4[128];
|
||||
NetworkManagerVpnUIImpl *impl = (NetworkManagerVpnUIImpl *) self->data;
|
||||
const char *connectionname;
|
||||
const char *gateway;
|
||||
@@ -390,6 +430,8 @@ impl_get_confirmation_details (NetworkManagerVpnUI *self)
|
||||
const char *username;
|
||||
gboolean use_routes;
|
||||
const char *routes;
|
||||
gboolean use_domain;
|
||||
const char *domain;
|
||||
|
||||
connectionname = gtk_entry_get_text (impl->w_connection_name);
|
||||
gateway = gtk_entry_get_text (impl->w_gateway);
|
||||
@@ -398,9 +440,12 @@ impl_get_confirmation_details (NetworkManagerVpnUI *self)
|
||||
username = gtk_entry_get_text (impl->w_username);
|
||||
use_routes = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (impl->w_use_routes));
|
||||
routes = gtk_entry_get_text (impl->w_routes);
|
||||
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);
|
||||
|
||||
g_snprintf (buf, sizeof (buf),
|
||||
_("The following vpnc VPN connection will be created:\n"
|
||||
@@ -411,12 +456,14 @@ impl_get_confirmation_details (NetworkManagerVpnUI *self)
|
||||
"\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 : "");
|
||||
|
||||
return buf;
|
||||
@@ -472,6 +519,8 @@ impl_get_object (void)
|
||||
impl->w_username = GTK_ENTRY (glade_xml_get_widget (impl->xml, "vpnc-username"));
|
||||
impl->w_use_routes = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "vpnc-use-routes"));
|
||||
impl->w_routes = GTK_ENTRY (glade_xml_get_widget (impl->xml, "vpnc-routes"));
|
||||
impl->w_use_domain = GTK_CHECK_BUTTON (glade_xml_get_widget (impl->xml, "vpnc-use-domain"));
|
||||
impl->w_domain = GTK_ENTRY (glade_xml_get_widget (impl->xml, "vpnc-domain"));
|
||||
impl->w_opt_info_expander = GTK_EXPANDER (glade_xml_get_widget (impl->xml,
|
||||
"vpnc-optional-information-expander"));
|
||||
impl->w_import_button = GTK_BUTTON (glade_xml_get_widget (impl->xml,
|
||||
@@ -484,6 +533,9 @@ impl_get_object (void)
|
||||
gtk_signal_connect (GTK_OBJECT (impl->w_use_routes),
|
||||
"toggled", GTK_SIGNAL_FUNC (use_routes_toggled), impl);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (impl->w_use_domain),
|
||||
"toggled", GTK_SIGNAL_FUNC (use_domain_toggled), impl);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (impl->w_connection_name),
|
||||
"changed", GTK_SIGNAL_FUNC (editable_changed), impl);
|
||||
gtk_signal_connect (GTK_OBJECT (impl->w_gateway),
|
||||
@@ -494,6 +546,8 @@ impl_get_object (void)
|
||||
"changed", GTK_SIGNAL_FUNC (editable_changed), impl);
|
||||
gtk_signal_connect (GTK_OBJECT (impl->w_routes),
|
||||
"changed", GTK_SIGNAL_FUNC (editable_changed), impl);
|
||||
gtk_signal_connect (GTK_OBJECT (impl->w_domain),
|
||||
"changed", GTK_SIGNAL_FUNC (editable_changed), impl);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (impl->w_import_button),
|
||||
"clicked", GTK_SIGNAL_FUNC (import_button_clicked), impl);
|
||||
|
Reference in New Issue
Block a user