@@ -46,6 +46,8 @@ public class Installer.AccountView : AbstractInstallerView {
4646 private Gtk . LevelBar pw_levelbar;
4747 private Granite . ValidatedEntry hostname_entry;
4848
49+ private uint announce_timeout_id;
50+
4951 construct {
5052 var avatar = new Adw .Avatar (104 , null , true ) {
5153 margin_top = 12 ,
@@ -102,6 +104,7 @@ public class Installer.AccountView : AbstractInstallerView {
102104 sensitive = false ,
103105 visibility = false
104106 };
107+ confirm_entry. update_property (Gtk . AccessibleProperty . REQUIRED , true , - 1 );
105108
106109 var confirm_label = new Granite .HeaderLabel (_(" Confirm Password" )) {
107110 mnemonic_widget = confirm_entry
@@ -227,13 +230,23 @@ public class Installer.AccountView : AbstractInstallerView {
227230 pw_error_revealer. reveal_child = false ;
228231
229232 pw_levelbar. value = quality;
233+
234+ if (quality <= 50 ) {
235+ queue_announce (pw_entry, _(" Acceptable password" ));
236+ } else if (quality <= 75 ) {
237+ queue_announce (pw_entry, _(" Good password" ));
238+ } else {
239+ queue_announce (pw_entry, _(" Great password" ));
240+ }
230241 } else {
231242 pw_entry. set_icon_from_icon_name (Gtk . EntryIconPosition . SECONDARY , " dialog-warning-symbolic" );
232243
233244 pw_error_revealer. reveal_child = true ;
234245 pw_error_revealer. label = ((PasswordQuality . Error ) quality). to_string (error);
235246
236247 pw_levelbar. value = 0 ;
248+
249+ queue_announce (pw_entry, pw_error_revealer. label);
237250 }
238251 return true ;
239252 }
@@ -246,8 +259,11 @@ public class Installer.AccountView : AbstractInstallerView {
246259 if (pw_entry. text != confirm_entry. text) {
247260 confirm_entry_revealer. label = _(" Passwords do not match" );
248261 confirm_entry_revealer. reveal_child = true ;
262+
263+ queue_announce (confirm_entry, confirm_entry_revealer. label);
249264 } else {
250265 confirm_entry_revealer. reveal_child = false ;
266+ queue_announce (confirm_entry, _(" Passwords match" ));
251267 return true ;
252268 }
253269 } else {
@@ -257,6 +273,19 @@ public class Installer.AccountView : AbstractInstallerView {
257273 return false ;
258274 }
259275
276+ private void queue_announce (Gtk . Entry entry, string announcement) {
277+ if (announce_timeout_id != 0 ) {
278+ Source . remove (announce_timeout_id);
279+ announce_timeout_id = 0 ;
280+ }
281+
282+ announce_timeout_id = Timeout . add (500 , () = > {
283+ entry. announce (announcement, MEDIUM );
284+ announce_timeout_id = 0 ;
285+ return GLib . Source . REMOVE ;
286+ });
287+ }
288+
260289 private bool check_username () {
261290 string username_entry_text = username_entry. text;
262291 bool username_is_valid = is_valid_username (username_entry_text);
@@ -275,6 +304,7 @@ public class Installer.AccountView : AbstractInstallerView {
275304 }
276305
277306 username_error_revealer. reveal_child = true ;
307+ queue_announce (username_entry, username_error_revealer. label);
278308 }
279309
280310 return false ;
0 commit comments