mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 06:28:05 +02:00
2008-09-24 Tambet Ingo <tambet@gmail.com>
* properties/nm-openvpn-dialog.glade: Add "show passwords" checkbox. * properties/nm-openvpn.c (auth_combo_changed_cb): Change the sensitivity of "show passwords" checkbox depending on whether the active page has any password entries. * properties/auth-helpers.c (fill_password): Add a signal handler for "show passwords" checkbox to change the password entry's visibility. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4092 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
e582204090
commit
66767578e1
4 changed files with 51 additions and 1 deletions
|
|
@ -1,3 +1,14 @@
|
|||
2008-09-24 Tambet Ingo <tambet@gmail.com>
|
||||
|
||||
* properties/nm-openvpn-dialog.glade: Add "show passwords" checkbox.
|
||||
|
||||
* properties/nm-openvpn.c (auth_combo_changed_cb): Change the
|
||||
sensitivity of "show passwords" checkbox depending on whether the
|
||||
active page has any password entries.
|
||||
|
||||
* properties/auth-helpers.c (fill_password): Add a signal handler for
|
||||
"show passwords" checkbox to change the password entry's visibility.
|
||||
|
||||
2008-09-24 Tambet Ingo <tambet@gmail.com>
|
||||
|
||||
* Implement required "save_secrets" and "delete_connection" methods of the
|
||||
|
|
|
|||
|
|
@ -41,6 +41,12 @@
|
|||
#include "src/nm-openvpn-service.h"
|
||||
#include "common-gnome/keyring-helpers.h"
|
||||
|
||||
static void
|
||||
show_password (GtkToggleButton *togglebutton, GtkEntry *password_entry)
|
||||
{
|
||||
gtk_entry_set_visibility (password_entry, gtk_toggle_button_get_active (togglebutton));
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
fill_password (GladeXML *xml,
|
||||
const char *widget_name,
|
||||
|
|
@ -48,11 +54,15 @@ fill_password (GladeXML *xml,
|
|||
gboolean cert_password)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkWidget *show_passwords;
|
||||
char *password;
|
||||
|
||||
widget = glade_xml_get_widget (xml, widget_name);
|
||||
g_assert (widget);
|
||||
|
||||
show_passwords = glade_xml_get_widget (xml, "show_passwords");
|
||||
g_signal_connect (show_passwords, "toggled", G_CALLBACK (show_password), widget);
|
||||
|
||||
if (!connection)
|
||||
return widget;
|
||||
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@
|
|||
<child>
|
||||
<widget class="GtkTable" id="table3">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="row_spacing">6</property>
|
||||
|
|
@ -1439,6 +1439,28 @@
|
|||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="show_passwords">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Show passwords</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="left_attach">0</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
|
|||
|
|
@ -171,18 +171,25 @@ auth_combo_changed_cb (GtkWidget *combo, gpointer user_data)
|
|||
OpenvpnPluginUiWidget *self = OPENVPN_PLUGIN_UI_WIDGET (user_data);
|
||||
OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
|
||||
GtkWidget *auth_notebook;
|
||||
GtkWidget *show_passwords;
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter iter;
|
||||
gint new_page = 0;
|
||||
|
||||
auth_notebook = glade_xml_get_widget (priv->xml, "auth_notebook");
|
||||
g_assert (auth_notebook);
|
||||
show_passwords = glade_xml_get_widget (priv->xml, "show_passwords");
|
||||
g_assert (auth_notebook);
|
||||
|
||||
model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
|
||||
g_assert (model);
|
||||
g_assert (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter));
|
||||
|
||||
gtk_tree_model_get (model, &iter, COL_AUTH_PAGE, &new_page, -1);
|
||||
|
||||
/* Static key page doesn't have any passwords */
|
||||
gtk_widget_set_sensitive (show_passwords, new_page != 3);
|
||||
|
||||
gtk_notebook_set_current_page (GTK_NOTEBOOK (auth_notebook), new_page);
|
||||
|
||||
stuff_changed_cb (combo, self);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue