Merge lp:~robert-ancell/unity-greeter/post-login-messages into lp:unity-greeter

Proposed by Robert Ancell on 2014-04-30
Status: Merged
Approved by: Robert Ancell on 2014-04-30
Approved revision: 1227
Merged at revision: 1227
Proposed branch: lp:~robert-ancell/unity-greeter/post-login-messages
Merge into: lp:unity-greeter
Diff against target: 79 lines (+14/-2)
2 files modified
src/greeter-list.vala (+5/-2)
src/user-list.vala (+9/-0)
To merge this branch: bzr merge lp:~robert-ancell/unity-greeter/post-login-messages
Reviewer Review Type Date Requested Status
Robert Ancell Approve on 2014-04-30
Review via email: mp+217703@code.launchpad.net

Commit message

Require user to acknowledge messages after last prompt

To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/greeter-list.vala'
2--- src/greeter-list.vala 2014-04-08 01:17:51 +0000
3+++ src/greeter-list.vala 2014-04-30 00:14:07 +0000
4@@ -774,6 +774,7 @@
5
6 protected bool will_clear = false;
7 protected bool prompted = false;
8+ protected bool unacknowledged_messages = false;
9
10 protected void connect_to_lightdm ()
11 {
12@@ -784,6 +785,7 @@
13
14 protected void show_message_cb (string text, LightDM.MessageType type)
15 {
16+ unacknowledged_messages = true;
17 show_message (text, type == LightDM.MessageType.ERROR);
18 }
19
20@@ -828,8 +830,8 @@
21
22 if (is_authenticated)
23 {
24- /* Login immediately if prompted */
25- if (prompted)
26+ /* Login immediately if prompted and user has acknowledged all messages */
27+ if (prompted && !unacknowledged_messages)
28 {
29 login_complete ();
30 if (UnityGreeter.singleton.test_mode)
31@@ -876,6 +878,7 @@
32 protected virtual void start_authentication ()
33 {
34 prompted = false;
35+ unacknowledged_messages = false;
36
37 /* Reset manual username */
38 manual_name = null;
39
40=== modified file 'src/user-list.vala'
41--- src/user-list.vala 2014-03-26 21:25:01 +0000
42+++ src/user-list.vala 2014-04-30 00:14:07 +0000
43@@ -874,6 +874,7 @@
44 {
45 selected_entry.sensitive = false;
46 will_clear = true;
47+ unacknowledged_messages = false;
48
49 foreach (var response in responses)
50 {
51@@ -888,6 +889,7 @@
52 {
53 debug ("Start session for %s", selected_entry.id);
54
55+ unacknowledged_messages = false;
56 var is_authenticated = false;
57 if (UnityGreeter.singleton.test_mode)
58 is_authenticated = test_is_authenticated;
59@@ -1118,6 +1120,7 @@
60 { "unicode", "가나다라마", "*" },
61 { "no-response", "No Response", "*" },
62 { "no-badge", "No Badge", "*" },
63+ { "messages-after-login", "Messages After Login", "*" },
64 { "" }
65 };
66 private List<string> test_backgrounds;
67@@ -1520,6 +1523,12 @@
68 show_message_cb ("Account is locked", LightDM.MessageType.ERROR);
69 authentication_complete_cb ();
70 break;
71+ case "messages-after-login":
72+ test_is_authenticated = text == "password";
73+ if (test_is_authenticated)
74+ show_message_cb ("Congratulations on logging in!", LightDM.MessageType.INFO);
75+ authentication_complete_cb ();
76+ break;
77 default:
78 test_is_authenticated = text == "password";
79 authentication_complete_cb ();

Subscribers

People subscribed via source and target branches