diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-12-04 08:00:16 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-12-04 08:00:16 +0100 |
commit | 1882ca719cdc0d9b0157b364501ba90cb0b0bf10 (patch) | |
tree | fe8e80bc35a137cb79c3be9aaa17e80c1dee52ee | |
parent | b1a1a099df2207a4bf4391db68f2836fd2343f2a (diff) | |
parent | eae841554affbe9f5bcb2c4ddb930cf3ba2e3846 (diff) | |
download | arctica-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
-rw-r--r-- | src/arctica-greeter.vala | 5 | ||||
-rw-r--r-- | src/user-list.vala | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 7f1ddb2..1f9bbfa 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -133,6 +133,11 @@ public class ArcticaGreeter : Object ); } + public DBusServer getDBusServer () + { + return this.pServer; + } + private void onBusAcquired (DBusConnection pConnection) { try 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 */ |