X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=blobdiff_plain;f=src%2Fcharon%2Fplugins%2Fdbus%2Fnm_applet_gui.c;h=70abfaddbc82ae08a7a6ec04d550429ce026b007;hp=7a35ab6961196a4d3a83f3bc5847d226f26dba8f;hb=2d87903db9cb9cfef4c17bae89cdc3e8076c4ab6;hpb=2d94fdfab7bdca2f98ea462f0066a7867dc8020b;ds=sidebyside diff --git a/src/charon/plugins/dbus/nm_applet_gui.c b/src/charon/plugins/dbus/nm_applet_gui.c index 7a35ab6..70abfad 100644 --- a/src/charon/plugins/dbus/nm_applet_gui.c +++ b/src/charon/plugins/dbus/nm_applet_gui.c @@ -52,6 +52,16 @@ struct private_nm_applet_gui_t { * name of the connection */ GtkEntry *name; + + /** + * gateway address + */ + GtkEntry *gateway; + + /** + * username + */ + GtkEntry *user; }; static const char *get_display_name(private_nm_applet_gui_t *this) @@ -70,7 +80,8 @@ static GtkWidget *get_widget(private_nm_applet_gui_t *this, GSList *properties, GSList *i; gtk_entry_set_text(this->name, ""); - /*gtk_entry_set_text(this->gateway, "");*/ + gtk_entry_set_text(this->gateway, ""); + gtk_entry_set_text(this->user, ""); if (connection_name) { @@ -87,15 +98,17 @@ static GtkWidget *get_widget(private_nm_applet_gui_t *this, GSList *properties, if (properties) { value = properties->data; - /* if (strcmp(key, "gateway") == 0) { gtk_entry_set_text(this->gateway, value); - }*/ + } + if (strcmp(key, "user") == 0) + { + gtk_entry_set_text(this->user, value); + } properties = g_slist_next(properties); } } - return this->widget; } @@ -103,8 +116,10 @@ static GSList *get_properties(private_nm_applet_gui_t *this) { GSList *props = NULL; - /*props = g_slist_append(props, g_strdup("gateway")); - props = g_slist_append(props, g_strdup(gtk_entry_get_text(this->gateway)));*/ + props = g_slist_append(props, g_strdup("gateway")); + props = g_slist_append(props, g_strdup(gtk_entry_get_text(this->gateway))); + props = g_slist_append(props, g_strdup("user")); + props = g_slist_append(props, g_strdup(gtk_entry_get_text(this->user))); return props; } @@ -178,14 +193,16 @@ NetworkManagerVpnUI* nm_vpn_properties_factory(void) this->public.data = NULL; this->callback = NULL; - this->xml = glade_xml_new("/home/martin/strongswan/trunk/src/networkmanager/nm_applet_gui.xml", NULL, NULL); + this->xml = glade_xml_new("/home/martin/strongswan/trunk/src/charon/plugins/dbus/nm_applet_gui.xml", NULL, NULL); if (this->xml != NULL) { this->widget = glade_xml_get_widget(this->xml, "main"); this->name = GTK_ENTRY(glade_xml_get_widget(this->xml, "name")); + this->gateway = GTK_ENTRY(glade_xml_get_widget(this->xml, "gateway")); + this->user = GTK_ENTRY(glade_xml_get_widget(this->xml, "user")); - if (this->widget && this->name) + if (this->widget && this->name && this->gateway && this->user) { return &this->public; }