Merge lp:~robert-ancell/unity-greeter/retry-button-on-failed-authentication into lp:unity-greeter

Proposed by Robert Ancell
Status: Merged
Merged at revision: 346
Proposed branch: lp:~robert-ancell/unity-greeter/retry-button-on-failed-authentication
Merge into: lp:unity-greeter
Diff against target: 107 lines (+33/-16)
3 files modified
src/dash-button.vala (+18/-11)
src/unity-greeter.vala (+1/-1)
src/user-list.vala (+14/-4)
To merge this branch: bzr merge lp:~robert-ancell/unity-greeter/retry-button-on-failed-authentication
Reviewer Review Type Date Requested Status
Michael Terry (community) Approve
Review via email: mp+96707@code.launchpad.net

Description of the change

Show retry button if authentication completes without a prompt but is not successful. Test with the "No Password" and "Locked Account" users.

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

I guess it's fine? The No Password user just stays at "Logging in..." and the button never re-appears to display "Retry". But trunk does that too...

It works on the Locked user though.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/dash-button.vala'
--- src/dash-button.vala 2012-02-21 17:31:59 +0000
+++ src/dash-button.vala 2012-03-09 05:18:17 +0000
@@ -19,16 +19,22 @@
1919
20public class DashButton : Gtk.Button, Fadable20public class DashButton : Gtk.Button, Fadable
21{21{
22 public string text {get; construct; default = "";}
23 protected FadeTracker fade_tracker {get; protected set;}22 protected FadeTracker fade_tracker {get; protected set;}
23 private Gtk.Label text_label;
24
25 private string _text = "";
26 public string text
27 {
28 get { return _text; }
29 set
30 {
31 _text = value;
32 text_label.set_markup ("<span font_size=\"large\">%s</span>".printf (value));
33 }
34 }
2435
25 public DashButton (string text)36 public DashButton (string text)
26 {37 {
27 Object (text: text);
28 }
29
30 construct
31 {
32 fade_tracker = new FadeTracker (this);38 fade_tracker = new FadeTracker (this);
3339
34 var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);40 var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
@@ -40,11 +46,12 @@
40 hbox.add (label);46 hbox.add (label);
4147
42 // add text48 // add text
43 label = new Gtk.Label ("<span font_size=\"large\">%s</span>".printf (text));49 text_label = new Gtk.Label ("");
44 label.use_markup = true;50 text_label.use_markup = true;
45 label.hexpand = true;51 text_label.hexpand = true;
46 label.halign = Gtk.Align.CENTER;52 text_label.halign = Gtk.Align.CENTER;
47 hbox.add (label);53 hbox.add (text_label);
54 this.text = text;
4855
49 // add chevron56 // add chevron
50 var image = new Gtk.Image.from_file (Path.build_filename (Config.PKGDATADIR, "arrow_right.png", null));57 var image = new Gtk.Image.from_file (Path.build_filename (Config.PKGDATADIR, "arrow_right.png", null));
5158
=== modified file 'src/unity-greeter.vala'
--- src/unity-greeter.vala 2012-03-08 03:15:53 +0000
+++ src/unity-greeter.vala 2012-03-09 05:18:17 +0000
@@ -425,7 +425,7 @@
425 else425 else
426 {426 {
427 user_list.set_error (_("Failed to authenticate"));427 user_list.set_error (_("Failed to authenticate"));
428 user_list.show_authenticated ();428 user_list.show_authenticated (false);
429 }429 }
430 }430 }
431 }431 }
432432
=== modified file 'src/user-list.vala'
--- src/user-list.vala 2012-03-09 04:51:01 +0000
+++ src/user-list.vala 2012-03-09 05:18:17 +0000
@@ -179,7 +179,7 @@
179 prompt_entry.activate.connect (prompt_entry_activate_cb);179 prompt_entry.activate.connect (prompt_entry_activate_cb);
180 add_with_class (prompt_entry);180 add_with_class (prompt_entry);
181181
182 login_button = new DashButton (_("Log In")); /* 'Log In' here is the button for logging in. */182 login_button = new DashButton ("");
183 login_button.clicked.connect (login_button_clicked_cb);183 login_button.clicked.connect (login_button_clicked_cb);
184 add_with_class (login_button);184 add_with_class (login_button);
185185
@@ -313,17 +313,27 @@
313 redraw_login_box ();313 redraw_login_box ();
314 }314 }
315315
316 public void show_authenticated ()316 public void show_authenticated (bool successful = true)
317 {317 {
318 prompt_entry.hide ();318 prompt_entry.hide ();
319 login_button.hide ();319 login_button.hide ();
320 message = "";320 message = "";
321 var accessible = login_button.get_accessible ();
322 if (successful)
323 {
324 accessible.set_name (_("Login as %s").printf (selected_entry.layout.get_text ()));
325 /* 'Log In' here is the button for logging in. */
326 login_button.text = _("Log In");
327 }
328 else
329 {
330 accessible.set_name (_("Retry").printf (selected_entry.layout.get_text ()));
331 login_button.text = _("Retry");
332 }
321 if (mode == Mode.SCROLLING)333 if (mode == Mode.SCROLLING)
322 prompt_widget_to_show = login_button;334 prompt_widget_to_show = login_button;
323 else335 else
324 login_button.show ();336 login_button.show ();
325 var accessible = login_button.get_accessible ();
326 accessible.set_name (_("Login as %s").printf (selected_entry.layout.get_text ()));
327 login_button.grab_focus ();337 login_button.grab_focus ();
328 redraw_login_box ();338 redraw_login_box ();
329 }339 }

Subscribers

People subscribed via source and target branches