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
1=== modified file 'src/dash-button.vala'
2--- src/dash-button.vala 2012-02-21 17:31:59 +0000
3+++ src/dash-button.vala 2012-03-09 05:18:17 +0000
4@@ -19,16 +19,22 @@
5
6 public class DashButton : Gtk.Button, Fadable
7 {
8- public string text {get; construct; default = "";}
9 protected FadeTracker fade_tracker {get; protected set;}
10+ private Gtk.Label text_label;
11+
12+ private string _text = "";
13+ public string text
14+ {
15+ get { return _text; }
16+ set
17+ {
18+ _text = value;
19+ text_label.set_markup ("<span font_size=\"large\">%s</span>".printf (value));
20+ }
21+ }
22
23 public DashButton (string text)
24 {
25- Object (text: text);
26- }
27-
28- construct
29- {
30 fade_tracker = new FadeTracker (this);
31
32 var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
33@@ -40,11 +46,12 @@
34 hbox.add (label);
35
36 // add text
37- label = new Gtk.Label ("<span font_size=\"large\">%s</span>".printf (text));
38- label.use_markup = true;
39- label.hexpand = true;
40- label.halign = Gtk.Align.CENTER;
41- hbox.add (label);
42+ text_label = new Gtk.Label ("");
43+ text_label.use_markup = true;
44+ text_label.hexpand = true;
45+ text_label.halign = Gtk.Align.CENTER;
46+ hbox.add (text_label);
47+ this.text = text;
48
49 // add chevron
50 var image = new Gtk.Image.from_file (Path.build_filename (Config.PKGDATADIR, "arrow_right.png", null));
51
52=== modified file 'src/unity-greeter.vala'
53--- src/unity-greeter.vala 2012-03-08 03:15:53 +0000
54+++ src/unity-greeter.vala 2012-03-09 05:18:17 +0000
55@@ -425,7 +425,7 @@
56 else
57 {
58 user_list.set_error (_("Failed to authenticate"));
59- user_list.show_authenticated ();
60+ user_list.show_authenticated (false);
61 }
62 }
63 }
64
65=== modified file 'src/user-list.vala'
66--- src/user-list.vala 2012-03-09 04:51:01 +0000
67+++ src/user-list.vala 2012-03-09 05:18:17 +0000
68@@ -179,7 +179,7 @@
69 prompt_entry.activate.connect (prompt_entry_activate_cb);
70 add_with_class (prompt_entry);
71
72- login_button = new DashButton (_("Log In")); /* 'Log In' here is the button for logging in. */
73+ login_button = new DashButton ("");
74 login_button.clicked.connect (login_button_clicked_cb);
75 add_with_class (login_button);
76
77@@ -313,17 +313,27 @@
78 redraw_login_box ();
79 }
80
81- public void show_authenticated ()
82+ public void show_authenticated (bool successful = true)
83 {
84 prompt_entry.hide ();
85 login_button.hide ();
86 message = "";
87+ var accessible = login_button.get_accessible ();
88+ if (successful)
89+ {
90+ accessible.set_name (_("Login as %s").printf (selected_entry.layout.get_text ()));
91+ /* 'Log In' here is the button for logging in. */
92+ login_button.text = _("Log In");
93+ }
94+ else
95+ {
96+ accessible.set_name (_("Retry").printf (selected_entry.layout.get_text ()));
97+ login_button.text = _("Retry");
98+ }
99 if (mode == Mode.SCROLLING)
100 prompt_widget_to_show = login_button;
101 else
102 login_button.show ();
103- var accessible = login_button.get_accessible ();
104- accessible.set_name (_("Login as %s").printf (selected_entry.layout.get_text ()));
105 login_button.grab_focus ();
106 redraw_login_box ();
107 }

Subscribers

People subscribed via source and target branches