aboutsummaryrefslogtreecommitdiff
path: root/src/user-list.vala
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-12-04 08:00:16 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-12-04 08:00:16 +0100
commit1882ca719cdc0d9b0157b364501ba90cb0b0bf10 (patch)
treefe8e80bc35a137cb79c3be9aaa17e80c1dee52ee /src/user-list.vala
parentb1a1a099df2207a4bf4391db68f2836fd2343f2a (diff)
parenteae841554affbe9f5bcb2c4ddb930cf3ba2e3846 (diff)
downloadarctica-greeter-1882ca719cdc0d9b0157b364501ba90cb0b0bf10.tar.gz
arctica-greeter-1882ca719cdc0d9b0157b364501ba90cb0b0bf10.tar.bz2
arctica-greeter-1882ca719cdc0d9b0157b364501ba90cb0b0bf10.zip
Merge branch 'tari01-pr/manual-user-change'
Attributes GH PR #98: https://github.com/ArcticaProject/arctica-greeter/pull/98
Diffstat (limited to 'src/user-list.vala')
-rw-r--r--src/user-list.vala21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/user-list.vala b/src/user-list.vala
index 2c2fe3b..dee3850 100644
--- a/src/user-list.vala
+++ b/src/user-list.vala
@@ -39,6 +39,7 @@ int remote_server_field_sort_function (RemoteServerField? item1, RemoteServerFie
public class UserList : GreeterList
{
private bool _offer_guest = false;
+ private string sLastAddedUser = null;
public bool offer_guest
{
get { return _offer_guest; }
@@ -936,6 +937,11 @@ public class UserList : GreeterList
e.set_is_active (is_active);
debug ("Adding user to list. User: %s, background: %s, is_active: %s, has_messages: %s, session: %s", e.label, e.background, is_active.to_string(), has_messages.to_string(), session);
+ if (have_entries () && always_show_manual)
+ {
+ this.sLastAddedUser = label;
+ }
+
/* Remove manual option when have users */
if (have_entries () && !always_show_manual)
remove_entry ("*other");
@@ -1207,7 +1213,22 @@ public class UserList : GreeterList
}
}
else
+ {
base.show_prompt_cb (text, type);
+
+ if (type == LightDM.PromptType.SECRET && this.sLastAddedUser != null)
+ {
+ try
+ {
+ DBusServer pServer = this.greeter.getDBusServer ();
+ pServer.sendUserChange (this.sLastAddedUser);
+ }
+ catch (Error pError)
+ {
+ error ("Panic: %s", pError.message);
+ }
+ }
+ }
}
/* A lot of test code below here */