[network-manager-libreswan/lr/ui-polish: 3/5] properties: use the new nma-based password widgets
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-libreswan/lr/ui-polish: 3/5] properties: use the new nma-based password widgets
- Date: Mon, 25 Jan 2016 17:04:48 +0000 (UTC)
commit fafdb6c24a437038738be2e2613f28f827881575
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Fri Jan 22 16:36:56 2016 +0100
properties: use the new nma-based password widgets
properties/Makefile.am | 8 +-
properties/nm-libreswan-dialog.ui | 194 ++++++++++++++-----------------------
properties/nm-libreswan.c | 189 ++++++++++++------------------------
3 files changed, 142 insertions(+), 249 deletions(-)
---
diff --git a/properties/Makefile.am b/properties/Makefile.am
index 0e318da..b7f19d0 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -15,12 +15,14 @@ common_CFLAGS = \
libnm_vpn_plugin_libreswan_la_CFLAGS = \
$(common_CFLAGS) \
- $(LIBNM_CFLAGS)
+ $(LIBNM_CFLAGS) \
+ $(LIBNMA_CFLAGS)
libnm_libreswan_properties_la_CFLAGS = \
-DNM_LIBRESWAN_OLD \
$(common_CFLAGS) \
- $(LIBNM_GLIB_CFLAGS)
+ $(LIBNM_GLIB_CFLAGS) \
+ $(LIBNM_GTK_CFLAGS)
libnm_vpn_plugin_libreswan_la_SOURCES = \
nm-libreswan.c \
@@ -32,11 +34,13 @@ libnm_libreswan_properties_la_SOURCES = \
libnm_vpn_plugin_libreswan_la_LIBADD = \
$(GTK_LIBS) \
$(LIBNM_LIBS) \
+ $(LIBNMA_LIBS) \
$(top_builddir)/common/libnm-libreswan-common.la
libnm_libreswan_properties_la_LIBADD = \
$(GTK_LIBS) \
$(LIBNM_GLIB_LIBS) \
+ $(LIBNM_GTK_LIBS) \
$(top_builddir)/common/libnm-vpn-plugin-libreswan-common.la
libnm_vpn_plugin_libreswan_la_LDFLAGS = \
diff --git a/properties/nm-libreswan-dialog.ui b/properties/nm-libreswan-dialog.ui
index f6d01e6..a5e6c74 100644
--- a/properties/nm-libreswan-dialog.ui
+++ b/properties/nm-libreswan-dialog.ui
@@ -2,28 +2,6 @@
<!-- Generated with glade 3.19.0 -->
<interface>
<requires lib="gtk+" version="3.0"/>
- <object class="GtkListStore" id="model1">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes"> </col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="model2">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes"> </col>
- </row>
- </data>
- </object>
<object class="GtkBox" id="libreswan-vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -63,37 +41,27 @@
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
- <object class="GtkComboBox" id="group_pass_type_combo">
+ <object class="GtkLabel" id="label23">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="model">model1</property>
- <child>
- <object class="GtkCellRendererText" id="renderer1"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
+ <property name="label" translatable="yes">_Gateway:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">gateway_entry</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">3</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="GtkComboBox" id="user_pass_type_combo">
+ <object class="GtkEntry" id="gateway_entry">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">model2</property>
- <child>
- <object class="GtkCellRendererText" id="renderer2"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
+ <property name="can_focus">True</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
@@ -108,7 +76,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
@@ -119,59 +87,57 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Gro_up password:</property>
+ <property name="label" translatable="yes">_Secret:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">group_entry</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label23">
+ <object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">_Gateway:</property>
+ <property name="label" translatable="yes">_User password:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">gateway_entry</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label24">
+ <object class="GtkEntry" id="user_password_entry">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">G_roup name:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">group_entry</property>
- <property name="xalign">0</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="gateway_entry">
+ <object class="GtkLabel" id="label24">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">G_roup name:</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
@@ -181,46 +147,35 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label3">
+ <object class="GtkLabel" id="label26">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">_User password:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">group_entry</property>
+ <property name="label" translatable="yes">User name:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="user_password_entry">
+ <object class="GtkEntry" id="user_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="visibility">False</property>
+ <property name="invisible_char">●</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
</child>
</object>
@@ -247,7 +202,7 @@
<object class="GtkLabel" id="label25">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes"><b>Optional</b></property>
+ <property name="label" translatable="yes"><b>Advanced</b></property>
<property name="use_markup">True</property>
<property name="xalign">0</property>
</object>
@@ -273,10 +228,10 @@
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
- <object class="GtkLabel" id="label26">
+ <object class="GtkLabel" id="label27">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">User name:</property>
+ <property name="label" translatable="yes">Phase1 Algorithms:</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -285,21 +240,10 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="user_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label27">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Phase1 Algorithms:</property>
+ <property name="label" translatable="yes">Phase2 Algorithms:</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -308,21 +252,10 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="phase1_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Phase2 Algorithms:</property>
+ <property name="label" translatable="yes">Domain:</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -331,26 +264,25 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="phase2_entry">
+ <object class="GtkEntry" id="phase1_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label2">
+ <object class="GtkEntry" id="phase2_entry">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Domain:</property>
- <property name="xalign">0</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
@@ -361,7 +293,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">2</property>
</packing>
</child>
</object>
@@ -383,4 +315,26 @@
</packing>
</child>
</object>
+ <object class="GtkListStore" id="model1">
+ <columns>
+ <!-- column-name gchararray -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes"> </col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkListStore" id="model2">
+ <columns>
+ <!-- column-name gchararray -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes"> </col>
+ </row>
+ </data>
+ </object>
</interface>
diff --git a/properties/nm-libreswan.c b/properties/nm-libreswan.c
index d3b4cf8..7f4cf26 100644
--- a/properties/nm-libreswan.c
+++ b/properties/nm-libreswan.c
@@ -38,10 +38,12 @@
#ifdef NM_LIBRESWAN_OLD
#define NM_VPN_LIBNM_COMPAT
+
#include <nm-vpn-plugin-ui-interface.h>
#include <nm-setting-vpn.h>
#include <nm-setting-connection.h>
#include <nm-setting-ip4-config.h>
+#include <nm-ui-utils.h>
#define LIBRESWAN_EDITOR_PLUGIN_ERROR NM_SETTING_VPN_ERROR
#define LIBRESWAN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY NM_SETTING_VPN_ERROR_INVALID_PROPERTY
@@ -49,6 +51,7 @@
#else /* !NM_LIBRESWAN_OLD */
#include <NetworkManager.h>
+#include <nma-ui-utils.h>
#define LIBRESWAN_EDITOR_PLUGIN_ERROR NM_CONNECTION_ERROR
#define LIBRESWAN_EDITOR_PLUGIN_ERROR_INVALID_PROPERTY NM_CONNECTION_ERROR_INVALID_PROPERTY
@@ -136,13 +139,9 @@ setup_password_widget (LibreswanEditor *self,
gboolean new_connection)
{
LibreswanEditorPrivate *priv = LIBRESWAN_EDITOR_GET_PRIVATE (self);
- NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
GtkWidget *widget;
const char *value;
- if (new_connection)
- secret_flags = NM_SETTING_SECRET_FLAG_AGENT_OWNED;
-
widget = (GtkWidget *) gtk_builder_get_object (priv->builder, entry_name);
g_assert (widget);
gtk_size_group_add_widget (priv->group, widget);
@@ -150,10 +149,7 @@ setup_password_widget (LibreswanEditor *self,
if (s_vpn) {
value = nm_setting_vpn_get_secret (s_vpn, secret_name);
gtk_entry_set_text (GTK_ENTRY (widget), value ? value : "");
- nm_setting_get_secret_flags (NM_SETTING (s_vpn), secret_name, &secret_flags, NULL);
}
- secret_flags &= ~(NM_SETTING_SECRET_FLAG_NOT_SAVED | NM_SETTING_SECRET_FLAG_NOT_REQUIRED);
- g_object_set_data (G_OBJECT (widget), "flags", GUINT_TO_POINTER (secret_flags));
g_signal_connect (widget, "changed", G_CALLBACK (stuff_changed_cb), self);
}
@@ -177,48 +173,13 @@ show_toggled_cb (GtkCheckButton *button, LibreswanEditor *self)
}
static void
-pw_type_changed_helper (LibreswanEditor *self, GtkWidget *combo)
-{
- LibreswanEditorPrivate *priv = LIBRESWAN_EDITOR_GET_PRIVATE (self);
- const char *entry = NULL;
- GtkWidget *widget;
-
- /* If the user chose "Not required", desensitize and clear the correct
- * password entry.
- */
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user_pass_type_combo"));
- if (combo == widget)
- entry = "user_password_entry";
- else {
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "group_pass_type_combo"));
- if (combo == widget)
- entry = "group_password_entry";
- }
- if (!entry)
- return;
-
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, entry));
- g_assert (widget);
-
- switch (gtk_combo_box_get_active (GTK_COMBO_BOX (combo))) {
- case PW_TYPE_ASK:
- case PW_TYPE_UNUSED:
- gtk_entry_set_text (GTK_ENTRY (widget), "");
- gtk_widget_set_sensitive (widget, FALSE);
- break;
- default:
- gtk_widget_set_sensitive (widget, TRUE);
- break;
- }
-}
-
-static void
-pw_type_combo_changed_cb (GtkWidget *combo, gpointer user_data)
+password_storage_changed_cb (GObject *entry,
+ GParamSpec *pspec,
+ gpointer user_data)
{
LibreswanEditor *self = LIBRESWAN_EDITOR (user_data);
- pw_type_changed_helper (self, combo);
- stuff_changed_cb (combo, self);
+ stuff_changed_cb (NULL, self);
}
static const char *
@@ -237,72 +198,40 @@ secret_flags_to_pw_type (NMSettingVpn *s_vpn, const char *key)
}
static void
-init_one_pw_combo (LibreswanEditor *self,
- NMSettingVpn *s_vpn,
- const char *combo_name,
- const char *secret_key,
- const char *type_key,
- const char *entry_name)
+init_password_icon (LibreswanEditor *self,
+ NMSettingVpn *s_vpn,
+ const char *secret_key,
+ const char *type_key,
+ const char *entry_name)
{
LibreswanEditorPrivate *priv = LIBRESWAN_EDITOR_GET_PRIVATE (self);
- int active = -1;
- GtkWidget *widget;
- GtkListStore *store;
- GtkTreeIter iter;
- const char *value = NULL;
- guint32 default_idx = 1;
+ GtkWidget *entry;
+ const char *value;
+ const char *flags = NULL;
- /* If there's already a password and the password type can't be found in
- * the VPN settings, default to saving it. Otherwise, always ask for it.
- */
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, entry_name));
- if (widget) {
- const char *tmp;
+ entry = GTK_WIDGET (gtk_builder_get_object (priv->builder, entry_name));
+ g_assert (entry);
- tmp = gtk_entry_get_text (GTK_ENTRY (widget));
- if (tmp && strlen (tmp))
- default_idx = 0;
- }
+ nma_utils_setup_password_storage (entry, 0, (NMSetting *) s_vpn, secret_key,
+ TRUE, FALSE);
- store = gtk_list_store_new (1, G_TYPE_STRING);
+ /* If there's no password and no flags in the setting,
+ * initialize flags as "always-ask".
+ */
if (s_vpn) {
- value = secret_flags_to_pw_type (s_vpn, secret_key);
- if (!value)
- value = nm_setting_vpn_get_data_item (s_vpn, type_key);
- }
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, _("Saved"), -1);
- if ((active < 0) && value) {
- if (!strcmp (value, NM_LIBRESWAN_PW_TYPE_SAVE))
- active = 0;
+ flags = secret_flags_to_pw_type (s_vpn, secret_key);
+ if (!flags || !strcmp (flags, NM_LIBRESWAN_PW_TYPE_SAVE))
+ flags = nm_setting_vpn_get_data_item (s_vpn, type_key);
}
+ value = gtk_entry_get_text (GTK_ENTRY (entry));
+ if ((!value || !*value) && !flags)
+ nma_utils_update_password_storage (entry, NM_SETTING_SECRET_FLAG_NOT_SAVED,
+ (NMSetting *) s_vpn, secret_key);
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, _("Always Ask"), -1);
- if ((active < 0) && value) {
- if (!strcmp (value, NM_LIBRESWAN_PW_TYPE_ASK))
- active = 1;
- }
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, _("Not Required"), -1);
- if ((active < 0) && value) {
- if (!strcmp (value, NM_LIBRESWAN_PW_TYPE_UNUSED))
- active = 2;
- }
-
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, combo_name));
- g_assert (widget);
- gtk_combo_box_set_model (GTK_COMBO_BOX (widget), GTK_TREE_MODEL (store));
- g_object_unref (store);
- gtk_combo_box_set_active (GTK_COMBO_BOX (widget), active < 0 ? default_idx : active);
- pw_type_changed_helper (self, widget);
-
- g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (pw_type_combo_changed_cb), self);
+ g_signal_connect (entry, "notify::secondary-icon-name",
+ G_CALLBACK (password_storage_changed_cb), self);
}
-
static gboolean
init_editor_plugin (LibreswanEditor *self,
NMConnection *connection,
@@ -352,18 +281,16 @@ init_editor_plugin (LibreswanEditor *self,
NM_LIBRESWAN_PSK_VALUE,
new_connection);
- init_one_pw_combo (self,
- s_vpn,
- "user_pass_type_combo",
- NM_LIBRESWAN_XAUTH_PASSWORD,
- NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES,
- "user_password_entry");
- init_one_pw_combo (self,
- s_vpn,
- "group_pass_type_combo",
- NM_LIBRESWAN_PSK_VALUE,
- NM_LIBRESWAN_PSK_INPUT_MODES,
- "group_password_entry");
+ init_password_icon (self,
+ s_vpn,
+ NM_LIBRESWAN_XAUTH_PASSWORD,
+ NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES,
+ "user_password_entry");
+ init_password_icon (self,
+ s_vpn,
+ NM_LIBRESWAN_PSK_VALUE,
+ NM_LIBRESWAN_PSK_INPUT_MODES,
+ "group_password_entry");
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user_entry"));
g_return_val_if_fail (widget != NULL, FALSE);
@@ -434,33 +361,32 @@ static void
save_one_password (NMSettingVpn *s_vpn,
GtkBuilder *builder,
const char *entry_name,
- const char *combo_name,
const char *secret_key,
const char *type_key)
{
- NMSettingSecretFlags flags = NM_SETTING_SECRET_FLAG_NONE;
+ NMSettingSecretFlags flags;
const char *data_val = NULL, *password;
- GtkWidget *entry, *combo;
+ GtkWidget *entry;
+ /* Get secret flags */
entry = GTK_WIDGET (gtk_builder_get_object (builder, entry_name));
- flags = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (entry), "flags"));
+ flags = nma_utils_menu_to_secret_flags (entry);
- combo = GTK_WIDGET (gtk_builder_get_object (builder, combo_name));
- switch (gtk_combo_box_get_active (GTK_COMBO_BOX (combo))) {
- case PW_TYPE_SAVE:
+ /* Save password and convert flags to legacy data items */
+ switch (flags) {
+ case NM_SETTING_SECRET_FLAG_NONE:
+ case NM_SETTING_SECRET_FLAG_AGENT_OWNED:
password = gtk_entry_get_text (GTK_ENTRY (entry));
if (password && strlen (password))
nm_setting_vpn_add_secret (s_vpn, secret_key, password);
data_val = NM_LIBRESWAN_PW_TYPE_SAVE;
break;
- case PW_TYPE_UNUSED:
+ case NM_SETTING_SECRET_FLAG_NOT_REQUIRED:
data_val = NM_LIBRESWAN_PW_TYPE_UNUSED;
- flags |= NM_SETTING_SECRET_FLAG_NOT_REQUIRED;
break;
- case PW_TYPE_ASK:
+ case NM_SETTING_SECRET_FLAG_NOT_SAVED:
default:
data_val = NM_LIBRESWAN_PW_TYPE_ASK;
- flags |= NM_SETTING_SECRET_FLAG_NOT_SAVED;
break;
}
@@ -525,13 +451,11 @@ update_connection (NMVpnEditor *iface,
save_one_password (s_vpn,
priv->builder,
"user_password_entry",
- "user_pass_type_combo",
NM_LIBRESWAN_XAUTH_PASSWORD,
NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES);
save_one_password (s_vpn,
priv->builder,
"group_password_entry",
- "group_pass_type_combo",
NM_LIBRESWAN_PSK_VALUE,
NM_LIBRESWAN_PSK_INPUT_MODES);
@@ -612,6 +536,17 @@ dispose (GObject *object)
LibreswanEditor *plugin = LIBRESWAN_EDITOR (object);
LibreswanEditorPrivate *priv = LIBRESWAN_EDITOR_GET_PRIVATE (plugin);
+ GtkWidget *widget;
+
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user_password_entry"));
+ g_signal_handlers_disconnect_by_func (G_OBJECT (widget),
+ (GCallback) password_storage_changed_cb,
+ plugin);
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "group_password_entry"));
+ g_signal_handlers_disconnect_by_func (G_OBJECT (widget),
+ (GCallback) password_storage_changed_cb,
+ plugin);
+
if (priv->group)
g_object_unref (priv->group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]