[gnome-initial-setup/shell/4765: 356/362] Add password reminder
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup/shell/4765: 356/362] Add password reminder
- Date: Thu, 19 Mar 2015 01:51:01 +0000 (UTC)
commit d97083741f2995e20f13b9b1bb72208ec513e665
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Mon Mar 16 12:56:41 2015 +0100
Add password reminder
When creating the user account, offers the user a way to hint what is the
password, in case they don't remind it later.
[endlessm/eos-shell#1623]
.../pages/account/gis-account-page.c | 26 ++-
.../pages/account/gis-account-page.ui | 224 +++++++++-----------
2 files changed, 124 insertions(+), 126 deletions(-)
---
diff --git a/gnome-initial-setup/pages/account/gis-account-page.c
b/gnome-initial-setup/pages/account/gis-account-page.c
index 4710229..8d9de34 100644
--- a/gnome-initial-setup/pages/account/gis-account-page.c
+++ b/gnome-initial-setup/pages/account/gis-account-page.c
@@ -128,11 +128,13 @@ clear_account_page (GisAccountPage *page)
GtkWidget *username_combo;
GtkWidget *password_entry;
GtkWidget *confirm_entry;
+ GtkWidget *reminder_entry;
fullname_entry = WID("account-fullname-entry");
username_combo = WID("account-username-combo");
password_entry = WID("account-password-entry");
confirm_entry = WID("account-confirm-entry");
+ reminder_entry = WID("account-reminder-entry");
priv->valid_name = FALSE;
priv->valid_username = FALSE;
@@ -146,16 +148,19 @@ clear_account_page (GisAccountPage *page)
gtk_combo_box_set_active (GTK_COMBO_BOX (username_combo), 0);
gtk_entry_set_text (GTK_ENTRY (password_entry), "");
gtk_entry_set_text (GTK_ENTRY (confirm_entry), "");
+ gtk_entry_set_text (GTK_ENTRY (reminder_entry), "");
}
static gboolean
local_validate (GisAccountPage *page)
{
GisAccountPagePrivate *priv = gis_account_page_get_instance_private (page);
+ gboolean has_reminder = (gtk_entry_get_text_length (OBJ (GtkEntry*, "account-reminder-entry")) > 0);
return priv->valid_name &&
priv->valid_username &&
- priv->valid_confirm;
+ priv->valid_confirm &&
+ has_reminder;
}
static gboolean
@@ -450,6 +455,14 @@ confirm_entry_focus_out (GtkWidget *widget,
}
static void
+reminder_changed (GtkWidget *w,
+ GParamSpec *pspec,
+ GisAccountPage *page)
+{
+ update_account_page_status (page);
+}
+
+static void
create_shared_user (GisAccountPage *page)
{
GisAccountPagePrivate *priv = gis_account_page_get_instance_private (page);
@@ -482,10 +495,12 @@ local_create_user (GisAccountPage *page)
{
GisAccountPagePrivate *priv = gis_account_page_get_instance_private (page);
gchar *username;
+ gchar *sanitized_reminder;
const gchar *password;
const gchar *old_password;
const gchar *fullname;
const gchar *language;
+ const gchar *reminder;
ActUser *old_user;
GError *error = NULL;
@@ -494,6 +509,7 @@ local_create_user (GisAccountPage *page)
username = gtk_combo_box_text_get_active_text (OBJ(GtkComboBoxText*, "account-username-combo"));
fullname = gtk_entry_get_text (OBJ (GtkEntry*, "account-fullname-entry"));
password = gtk_entry_get_text (OBJ (GtkEntry*, "account-password-entry"));
+ reminder = gtk_entry_get_text (OBJ (GtkEntry*, "account-reminder-entry"));
priv->act_user = act_user_manager_create_user (priv->act_client, username, fullname, priv->account_type,
&error);
if (error != NULL) {
@@ -513,7 +529,9 @@ local_create_user (GisAccountPage *page)
if (strlen (password) == 0) {
act_user_set_password_mode (priv->act_user, ACT_USER_PASSWORD_MODE_NONE);
} else {
- act_user_set_password (priv->act_user, password, "");
+ sanitized_reminder = g_strstrip (g_strdup (reminder));
+ act_user_set_password (priv->act_user, password, sanitized_reminder);
+ g_free (sanitized_reminder);
save_user_password (password);
}
@@ -1199,6 +1217,7 @@ gis_account_page_constructed (GObject *object)
GtkWidget *username_combo;
GtkWidget *password_entry;
GtkWidget *confirm_entry;
+ GtkWidget *reminder_entry;
GtkWidget *password_toggle;
GtkSettings *settings;
@@ -1215,6 +1234,7 @@ gis_account_page_constructed (GObject *object)
username_combo = WID("account-username-combo");
password_entry = WID("account-password-entry");
confirm_entry = WID("account-confirm-entry");
+ reminder_entry = WID("account-reminder-entry");
password_toggle = WID("account-password-visibility-toggle");
g_signal_connect (fullname_entry, "notify::text",
@@ -1225,6 +1245,8 @@ gis_account_page_constructed (GObject *object)
G_CALLBACK (password_changed), page);
g_signal_connect (confirm_entry, "notify::text",
G_CALLBACK (password_changed), page);
+ g_signal_connect (reminder_entry, "notify::text",
+ G_CALLBACK (reminder_changed), page);
g_signal_connect_after (password_entry, "focus-out-event",
G_CALLBACK (password_entry_focus_out), page);
g_signal_connect_after (confirm_entry, "focus-out-event",
diff --git a/gnome-initial-setup/pages/account/gis-account-page.ui
b/gnome-initial-setup/pages/account/gis-account-page.ui
index 6091a16..d078ff3 100644
--- a/gnome-initial-setup/pages/account/gis-account-page.ui
+++ b/gnome-initial-setup/pages/account/gis-account-page.ui
@@ -1,6 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkListStore" id="account-username-model">
+ <columns>
+ <!-- column-name gchararray -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+ <object class="GtkListStore" id="enterprise-realms-model">
+ <columns>
+ <!-- column-name gchararray -->
+ <column type="gchararray"/>
+ <!-- column-name gobject -->
+ <column type="GObject"/>
+ </columns>
+ </object>
<object class="GtkBox" id="account-page">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -28,7 +43,6 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
- <property name="margin_bottom">0</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Create a Personal Account</property>
<attributes>
@@ -40,7 +54,6 @@
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -49,21 +62,19 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
+ <property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- <property name="margin_bottom">0</property>
- <property name="hexpand">True</property>
<property name="label" translatable="yes">Type in your full name and a password that you'll
remember.</property>
<property name="wrap">True</property>
<attributes>
- <attribute name="scale" value="0.8"/>
+ <attribute name="scale" value="0.80000000000000004"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">3</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -72,21 +83,20 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
<property name="margin_bottom">12</property>
<property name="hexpand">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="label" translatable="yes">You may want to write down your password. Make
sure you pay attention to upper case letters. If the caps lock key is pressed, the symbol ⚠ will appear at
the right side of the space in which you're writing. You'll need to type in this password identically each
time you access your account.</property>
<property name="wrap">True</property>
<attributes>
- <attribute name="scale" value="0.8"/>
+ <attribute name="scale" value="0.80000000000000004"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">3</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -102,28 +112,22 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="account-fullname-entry">
- <property name="max_length">80</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="max_length">80</property>
<property name="invisible_char">●</property>
- <property name="invisible_char_set">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="account-username-label">
- <property name="visible">False</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="xalign">1</property>
@@ -134,17 +138,12 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="account-username-combo">
- <property name="visible">False</property>
<property name="can_focus">False</property>
<property name="has_entry">True</property>
- <property name="entry_text_column">0</property>
- <property name="id_column">1</property>
<child internal-child="entry">
<object class="GtkEntry" id="comboboxtext-entry">
<property name="can_focus">True</property>
@@ -154,27 +153,22 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="account-username-explanation">
- <property name="visible">False</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_bottom">12</property>
<property name="label" translatable="yes">The username will be used to name your personal
folder, and it cannot be changed.</property>
<property name="wrap">True</property>
<attributes>
- <attribute name="scale" value="0.8"/>
+ <attribute name="scale" value="0.80000000000000004"/>
</attributes>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -190,8 +184,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -200,13 +192,10 @@
<property name="can_focus">True</property>
<property name="visibility">False</property>
<property name="invisible_char">●</property>
- <property name="invisible_char_set">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -222,24 +211,19 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="account-confirm-entry">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
- <property name="sensitive">False</property>
<property name="invisible_char">●</property>
- <property name="invisible_char_set">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -252,14 +236,13 @@
<property name="label" translatable="yes">To make your password more secure, you can use
letters and numbers together. This is optional.</property>
<property name="wrap">True</property>
<attributes>
- <attribute name="scale" value="0.8"/>
+ <attribute name="scale" value="0.80000000000000004"/>
</attributes>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">8</property>
<property name="width">2</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -274,9 +257,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label"></property>
<attributes>
- <attribute name="scale" value="0.8"/>
+ <attribute name="scale" value="0.80000000000000004"/>
</attributes>
</object>
<packing>
@@ -291,7 +273,7 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">center</property>
- <property name="max-value">4</property>
+ <property name="max_value">4</property>
<property name="mode">discrete</property>
</object>
<packing>
@@ -304,8 +286,6 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">6</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -314,21 +294,19 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
+ <property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- <property name="margin_bottom">0</property>
- <property name="hexpand">True</property>
<property name="label" translatable="yes">To continue, please make sure you fill in all the
blanks.</property>
<property name="wrap">True</property>
<attributes>
- <attribute name="scale" value="0.8"/>
+ <attribute name="scale" value="0.80000000000000004"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">9</property>
+ <property name="top_attach">11</property>
<property name="width">2</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -337,13 +315,60 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
+ <property name="draw_indicator">False</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">7</property>
- </packing>
- </child>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="account-reminder-entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="account-reminder-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Password _reminder</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">account-reminder-entry</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="account-reminder-explanation">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Password reminder will be shown when you don't
remember your password. Just enter an empty space if you don't want one.</property>
+ <property name="wrap">True</property>
+ <attributes>
+ <attribute name="scale" value="0.80000000000000004"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">9</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
<child>
<placeholder/>
</child>
@@ -397,8 +422,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -419,7 +442,6 @@
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -435,8 +457,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -452,8 +472,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -469,8 +487,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -479,13 +495,10 @@
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char">●</property>
- <property name="invisible_char_set">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -496,13 +509,10 @@
<property name="visibility">False</property>
<property name="invisible_char">●</property>
<property name="activates_default">True</property>
- <property name="invisible_char_set">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -522,8 +532,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -534,14 +542,12 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">Enterprise domain or realm name</property>
<attributes>
- <attribute name="scale" value="0.8"/>
+ <attribute name="scale" value="0.80000000000000004"/>
</attributes>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -552,8 +558,6 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -585,14 +589,31 @@
</child>
<child>
<object class="GtkToggleButton" id="page-toggle">
- <property name="visible">False</property>
- <property name="use_underline">True</property>
- <property name="label" translatable="true">_Use Enterprise Login</property>
+ <property name="label">_Use Enterprise Login</property>
+ <property name="can_focus">False</property>
+ <property name="receives_default">False</property>
<property name="halign">start</property>
<property name="valign">end</property>
+ <property name="use_underline">True</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
+ <object class="GtkSizeGroup" id="sizegroup1">
+ <widgets>
+ <widget name="account-fullname-label"/>
+ <widget name="account-username-label"/>
+ <widget name="account-password-label"/>
+ <widget name="account-confirm-label"/>
+ <widget name="label4"/>
+ <widget name="label8"/>
+ <widget name="label9"/>
+ </widgets>
+ </object>
<object class="GtkDialog" id="join-dialog">
<property name="can_focus">False</property>
<property name="border_width">10</property>
@@ -617,7 +638,6 @@
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -635,7 +655,6 @@
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
</object>
<packing>
@@ -715,8 +734,6 @@ name for your computer.</property>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -730,8 +747,6 @@ name for your computer.</property>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -749,8 +764,6 @@ name for your computer.</property>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -762,8 +775,6 @@ name for your computer.</property>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -781,8 +792,6 @@ name for your computer.</property>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -791,13 +800,10 @@ name for your computer.</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char">●</property>
- <property name="invisible_char_set">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -815,8 +821,6 @@ name for your computer.</property>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -827,13 +831,10 @@ name for your computer.</property>
<property name="visibility">False</property>
<property name="invisible_char">●</property>
<property name="activates_default">True</property>
- <property name="invisible_char_set">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -857,30 +858,5 @@ name for your computer.</property>
<action-widget response="-5">button2</action-widget>
</action-widgets>
</object>
- <object class="GtkListStore" id="account-username-model">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- </object>
- <object class="GtkListStore" id="enterprise-realms-model">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- <!-- column-name gobject -->
- <column type="GObject"/>
- </columns>
- </object>
<object class="GtkSizeGroup" id="sizegroup"/>
- <object class="GtkSizeGroup" id="sizegroup1">
- <widgets>
- <widget name="account-fullname-label"/>
- <widget name="account-username-label"/>
- <widget name="account-password-label"/>
- <widget name="account-confirm-label"/>
- <widget name="label4"/>
- <widget name="label8"/>
- <widget name="label9"/>
- </widgets>
- </object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]