[network-manager-fortisslvpn/nm-1-0: 4/13] properties: add support for user certificates
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-fortisslvpn/nm-1-0: 4/13] properties: add support for user certificates
- Date: Sat, 3 Oct 2015 15:51:07 +0000 (UTC)
commit 73cabbf7898887464c38865a6b03ee4401eca19d
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Sat Sep 26 09:26:08 2015 +0200
properties: add support for user certificates
(cherry picked from commit 308aab75e9f4bed33977d14d6b669d303d07dab0)
properties/nm-fortisslvpn-dialog.ui | 46 +++++++++++++++++++++++++++++++++++
properties/nm-fortisslvpn.c | 33 +++++++++++++++++++++++++
2 files changed, 79 insertions(+), 0 deletions(-)
---
diff --git a/properties/nm-fortisslvpn-dialog.ui b/properties/nm-fortisslvpn-dialog.ui
index 313b956..59101b2 100644
--- a/properties/nm-fortisslvpn-dialog.ui
+++ b/properties/nm-fortisslvpn-dialog.ui
@@ -340,6 +340,52 @@ config: user <name></property>
</packing>
</child>
<child>
+ <object class="GtkFileChooserButton" id="cert_chooser">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFileChooserButton" id="key_chooser">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">User Key:</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">User Certificate:</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
<placeholder/>
</child>
</object>
diff --git a/properties/nm-fortisslvpn.c b/properties/nm-fortisslvpn.c
index 4421be6..b5f40ff 100644
--- a/properties/nm-fortisslvpn.c
+++ b/properties/nm-fortisslvpn.c
@@ -343,6 +343,27 @@ init_plugin_ui (FortisslvpnPluginUiWidget *self, NMConnection *connection, GErro
}
g_signal_connect (G_OBJECT (widget), "update-preview", G_CALLBACK (stuff_changed_cb), self);
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "cert_chooser"));
+ if (!widget)
+ return FALSE;
+ gtk_size_group_add_widget (priv->group, widget);
+ if (s_vpn) {
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_FORTISSLVPN_KEY_CERT);
+ if (value && strlen (value))
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), value);
+ }
+ g_signal_connect (G_OBJECT (widget), "update-preview", G_CALLBACK (stuff_changed_cb), self);
+
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "key_chooser"));
+ if (!widget)
+ return FALSE;
+ gtk_size_group_add_widget (priv->group, widget);
+ if (s_vpn) {
+ value = nm_setting_vpn_get_data_item (s_vpn, NM_FORTISSLVPN_KEY_KEY);
+ if (value && strlen (value))
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), value);
+ }
+ g_signal_connect (G_OBJECT (widget), "update-preview", G_CALLBACK (stuff_changed_cb), self);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "advanced_dialog"));
if (!widget)
@@ -439,6 +460,18 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
if (str && strlen (str))
nm_setting_vpn_add_data_item (s_vpn, NM_FORTISSLVPN_KEY_CA, str);
+ /* User certificate */
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "cert_chooser"));
+ str = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
+ if (str && strlen (str))
+ nm_setting_vpn_add_data_item (s_vpn, NM_FORTISSLVPN_KEY_CERT, str);
+
+ /* User key */
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "key_chooser"));
+ str = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
+ if (str && strlen (str))
+ nm_setting_vpn_add_data_item (s_vpn, NM_FORTISSLVPN_KEY_KEY, str);
+
/* Trusted certificate */
if (priv->trusted_cert && strlen (priv->trusted_cert))
nm_setting_vpn_add_data_item (s_vpn,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]