Merge ubiquity:gtk-show-passwords into ubiquity:master

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 6b6cb1924317548ec4adfbcba881cbcd2a4b5763
Proposed branch: ubiquity:gtk-show-passwords
Merge into: ubiquity:master
Diff against target: 85 lines (+26/-1)
5 files modified
debian/changelog (+6/-1)
gui/gtk/stepPartCrypto.ui (+2/-0)
gui/gtk/stepUserInfo.ui (+2/-0)
ubiquity/plugins/ubi-partman.py (+8/-0)
ubiquity/plugins/ubi-usersetup.py (+8/-0)
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+414410@code.launchpad.net

Commit message

Add the ability to show passwords that are being typed-in on various stages (GTK only for now).

Description of the change

Add the ability to show passwords that are being typed-in on various stages (GTK only for now).

The rationale for this change is the following: currently users are suffering from bugs like LP: #1875062 which are really hard to pin-point and reproduce. A semi-workaround for that is this change, meaning that users can double-check if the password they think they write was actually written correctly (in case the keyboard layout is wrong).
This is by no means a real fix for that issue, but I think such an ability is good anyway.

I'll look into doing the same for KDE, although I see KDE has a very much less intuitive UI for disk encryption. This will be a separate MP.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

We could backport that to focal as well and have it part of 20.04.4.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for working on those change, it's an useful addition. I've one question, see inline review

review: Needs Fixing
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for a creative step. A thought: Even if you add a toggle to make the password visible, how does the user know that they should use it? Maybe make it visible by default? Or that would possibly be too aggressive..

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Thank you for the review seb, let me address that point (as mentioned inline)!

Gunnar: I think that would be too invasive. This is why I only said that this is a semi-workaround, as some users will still be broken. I think it's anyway important to have this feature regardless of the bug with keyboard layout - but that one I think we simply need to find the root cause and eliminate it properly.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for pointing that you copied it, I asked jibel and it was done on purpose, probably just glade doing something weird. If it works without it we should also fix the stepPartCrypto.ui one

review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I'll merge this and then look into fixing the previous one! Thanks for the review!

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 4d6d9e1..bb4e2b9 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,9 +1,14 @@
6 ubiquity (22.04.4) UNRELEASED; urgency=medium
7
8+ [ Brian Murray ]
9 * debian/ubiquity.templates: capitalize Wi-Fi in multiple places so that is
10 consistent throughout the installer.
11
12- -- Brian Murray <brian@ubuntu.com> Fri, 07 Jan 2022 11:28:10 -0800
13+ [ Łukasz 'sil2100' Zemczak ]
14+ * Add the ability to unhide passwords that are being typed-in during various
15+ stages (GTK for now).
16+
17+ -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Thu, 20 Jan 2022 16:07:46 +0100
18
19 ubiquity (22.04.3) jammy; urgency=medium
20
21diff --git a/gui/gtk/stepPartCrypto.ui b/gui/gtk/stepPartCrypto.ui
22index 6095b82..eacd931 100644
23--- a/gui/gtk/stepPartCrypto.ui
24+++ b/gui/gtk/stepPartCrypto.ui
25@@ -120,7 +120,9 @@
26 <property name="invisible-char">●</property>
27 <property name="activates-default">True</property>
28 <property name="width-chars">36</property>
29+ <property name="secondary-icon-name">view-reveal-symbolic</property>
30 <signal name="changed" handler="info_loop" swapped="no"/>
31+ <signal name="icon-press" handler="on_password_toggle_visibility" swapped="no"/>
32 </object>
33 <packing>
34 <property name="left-attach">0</property>
35diff --git a/gui/gtk/stepUserInfo.ui b/gui/gtk/stepUserInfo.ui
36index f39d818..33bf94c 100644
37--- a/gui/gtk/stepUserInfo.ui
38+++ b/gui/gtk/stepUserInfo.ui
39@@ -138,7 +138,9 @@
40 <property name="invisible_char">●</property>
41 <property name="activates_default">True</property>
42 <property name="width_chars">20</property>
43+ <property name="secondary-icon-name">view-reveal-symbolic</property>
44 <signal name="changed" handler="info_loop" swapped="no"/>
45+ <signal name="icon-press" handler="on_password_toggle_visibility" swapped="no"/>
46 <accessibility>
47 <relation type="labelled-by" target="password_label"/>
48 </accessibility>
49diff --git a/ubiquity/plugins/ubi-partman.py b/ubiquity/plugins/ubi-partman.py
50index 9bb1ae6..b9f3d9e 100644
51--- a/ubiquity/plugins/ubi-partman.py
52+++ b/ubiquity/plugins/ubi-partman.py
53@@ -308,6 +308,14 @@ class PageGtk(PageBase):
54 width, height)
55 widget.show()
56
57+ def on_password_toggle_visibility(self, widget, icon_pos, event):
58+ from gi.repository import Gtk
59+ visibility = self.password.get_visibility()
60+ self.password.set_visibility(not visibility)
61+ self.verified_password.set_visibility(not visibility)
62+ self.password.set_icon_from_icon_name(
63+ Gtk.EntryIconPosition.SECONDARY, ('view-conceal-symbolic', 'view-reveal-symbolic')[visibility])
64+
65 def generate_recovery_key(self):
66 if not self.recovery_key_enable.get_active():
67 return
68diff --git a/ubiquity/plugins/ubi-usersetup.py b/ubiquity/plugins/ubi-usersetup.py
69index ee3cc98..ceb067f 100644
70--- a/ubiquity/plugins/ubi-usersetup.py
71+++ b/ubiquity/plugins/ubi-usersetup.py
72@@ -411,6 +411,14 @@ class PageGtk(PageBase):
73
74 self.controller.allow_go_forward(complete)
75
76+ def on_password_toggle_visibility(self, widget, icon_pos, event):
77+ from gi.repository import Gtk
78+ visibility = self.password.get_visibility()
79+ self.password.set_visibility(not visibility)
80+ self.verified_password.set_visibility(not visibility)
81+ self.password.set_icon_from_icon_name(
82+ Gtk.EntryIconPosition.SECONDARY, ('view-conceal-symbolic', 'view-reveal-symbolic')[visibility])
83+
84 def on_username_changed(self, widget):
85 self.username_edited = (widget.get_text() != '')
86

Subscribers

People subscribed via source and target branches