Merge lp:~mterry/unity-greeter/two-prompts into lp:unity-greeter

Proposed by Michael Terry
Status: Merged
Merged at revision: 515
Proposed branch: lp:~mterry/unity-greeter/two-prompts
Merge into: lp:unity-greeter
Diff against target: 75 lines (+26/-8)
1 file modified
src/user-list.vala (+26/-8)
To merge this branch: bzr merge lp:~mterry/unity-greeter/two-prompts
Reviewer Review Type Date Requested Status
Unity Greeter Development Team Pending
Review via email: mp+120391@code.launchpad.net

Description of the change

Now that lightdm itself supports multi-prompts, this branch will add support to unity-greeter.

It also fleshes out the two-prompts test user, which before didn't have a way to successfully log in.

Note that if you try and fail to log in as the two-prompts user, you will see that the error label causes the prompts to move outside the box. This is a separate bug that will be fixed by the remote-login branch. So don't worry about that. It's not caused by this branch.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/user-list.vala'
2--- src/user-list.vala 2012-08-16 14:58:17 +0000
3+++ src/user-list.vala 2012-08-20 13:55:21 +0000
4@@ -200,16 +200,16 @@
5
6 protected void prompt_box_respond_cb (string[] responses)
7 {
8- if (responses.length != 1)
9- return; // FIXME: handle more than 1!
10-
11 selected_entry.sensitive = false;
12 will_clear = true;
13
14- if (UnityGreeter.test_mode)
15- test_respond (responses[0]);
16- else
17- UnityGreeter.greeter.respond (responses[0]);
18+ foreach (var response in responses)
19+ {
20+ if (UnityGreeter.test_mode)
21+ test_respond (response);
22+ else
23+ UnityGreeter.greeter.respond (response);
24+ }
25 }
26
27 private void prompt_box_login_cb ()
28@@ -363,6 +363,7 @@
29 private List<string> test_backgrounds;
30 private int n_test_entries = 0;
31 private bool test_prompted_sso = false;
32+ private bool test_two_prompts_first = false;
33 private bool test_request_new_password = false;
34 private string? test_new_password = null;
35
36@@ -522,6 +523,22 @@
37 authentication_complete_cb ();
38 }
39 break;
40+ case "two-prompts":
41+ if (!test_two_prompts_first)
42+ {
43+ test_two_prompts_first = true;
44+ if (text != "blue")
45+ {
46+ test_is_authenticated = false;
47+ authentication_complete_cb ();
48+ }
49+ }
50+ else
51+ {
52+ test_is_authenticated = text == "password";
53+ authentication_complete_cb ();
54+ }
55+ break;
56 case "change-password":
57 if (test_new_password != null)
58 {
59@@ -567,6 +584,7 @@
60 test_username = null;
61 test_is_authenticated = false;
62 test_prompted_sso = false;
63+ test_two_prompts_first = false;
64 test_request_new_password = false;
65 test_new_password = null;
66
67@@ -617,7 +635,7 @@
68 show_prompt_cb (_("Password:"), LightDM.PromptType.SECRET);
69 break;
70 case "two-prompts":
71- show_prompt_cb (_("Favorite Color:"), LightDM.PromptType.QUESTION);
72+ show_prompt_cb (_("Favorite Color (blue):"), LightDM.PromptType.QUESTION);
73 show_prompt_cb (_("Password:"), LightDM.PromptType.SECRET);
74 break;
75 default:

Subscribers

People subscribed via source and target branches