diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-09-25 22:03:16 +0200 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2023-10-06 11:45:06 +0200 |
commit | 622780a18b551efb05ea45719862c841c01ffe5d (patch) | |
tree | c3999fbfa0d1089c2774083aeb82436649f98cbf | |
parent | df7825b0044a7c6be526e93a263f2f4f2c1143fa (diff) | |
download | arctica-greeter-622780a18b551efb05ea45719862c841c01ffe5d.tar.gz arctica-greeter-622780a18b551efb05ea45719862c841c01ffe5d.tar.bz2 arctica-greeter-622780a18b551efb05ea45719862c841c01ffe5d.zip |
Show labels for 'Username:' and 'Password:' if configured via gsettings.
Fixes: https://github.com/ArcticaProject/arctica-greeter/issues/62
-rw-r--r-- | data/org.ArcticaProject.arctica-greeter.gschema.xml | 4 | ||||
-rw-r--r-- | src/greeter-list.vala | 14 | ||||
-rw-r--r-- | src/settings.vala | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/data/org.ArcticaProject.arctica-greeter.gschema.xml b/data/org.ArcticaProject.arctica-greeter.gschema.xml index 7399af4..3fcd956 100644 --- a/data/org.ArcticaProject.arctica-greeter.gschema.xml +++ b/data/org.ArcticaProject.arctica-greeter.gschema.xml @@ -77,6 +77,10 @@ <default>true</default> <summary>Whether to show the hostname in the menubar</summary> </key> + <key name="show-login-labels" type="b"> + <default>false</default> + <summary>Whether to show 'Username:' and 'Password:' labels in login box</summary> + </key> <key name="logo" type="s"> <default>'/usr/share/arctica-greeter/logo.png'</default> <summary>Logo file to use</summary> diff --git a/src/greeter-list.vala b/src/greeter-list.vala index 102c153..e39ac19 100644 --- a/src/greeter-list.vala +++ b/src/greeter-list.vala @@ -819,6 +819,8 @@ public abstract class GreeterList : FadableBox protected virtual void show_prompt_cb (string text, LightDM.PromptType type) { + var show_label_if_configured = false; + /* Notify the greeter on what user has been logged */ if (get_selected_id () == "*other" && manual_name == null) { @@ -831,9 +833,21 @@ public abstract class GreeterList : FadableBox prompted = true; if (text == "Password: ") + { text = _("Password:"); + show_label_if_configured = true; + } if (text == "login:") + { text = _("Username:"); + show_label_if_configured = true; + } + + if ((AGSettings.get_boolean(AGSettings.KEY_SHOW_LOGIN_LABELS)) && (show_label_if_configured)) + { + show_message(text); + } + var entry = add_prompt (text, type == LightDM.PromptType.SECRET); /* Limit the number of characters in case a cat is sitting on the keyboard... */ diff --git a/src/settings.vala b/src/settings.vala index b870bd2..efc72f2 100644 --- a/src/settings.vala +++ b/src/settings.vala @@ -33,6 +33,7 @@ public class AGSettings : Object public const string KEY_DRAW_USER_BACKGROUNDS = "draw-user-backgrounds"; public const string KEY_DRAW_GRID = "draw-grid"; public const string KEY_SHOW_HOSTNAME = "show-hostname"; + public const string KEY_SHOW_LOGIN_LABELS = "show-login-labels"; public const string KEY_LOGO = "logo"; public const string KEY_LOGO_ALPHA = "logo-alpha"; public const string KEY_THEME_NAME = "theme-name"; |