diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2012-03-08 15:57:58 +1100 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2012-03-08 15:57:58 +1100 |
commit | 7d9dc8a22ea8713ce48a6b3b571b18d335d6d107 (patch) | |
tree | bd7b0c02061964af85a5ca29e60039384321409e | |
parent | c0ce01798f047caf7a6fc5d02c0512c024dcc328 (diff) | |
download | lightdm-7d9dc8a22ea8713ce48a6b3b571b18d335d6d107.tar.gz |
Add a seat option greeter-show-manual-login which hints to a greeter if it should show a manual username entry if a user list is already present
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | data/lightdm.conf | 2 | ||||
-rw-r--r-- | liblightdm-gobject/greeter.c | 34 | ||||
-rw-r--r-- | liblightdm-gobject/liblightdm-gobject-1.vapi | 1 | ||||
-rw-r--r-- | liblightdm-gobject/lightdm/greeter.h | 2 | ||||
-rw-r--r-- | src/display.c | 11 | ||||
-rw-r--r-- | src/display.h | 2 | ||||
-rw-r--r-- | src/seat.c | 1 |
8 files changed, 57 insertions, 2 deletions
@@ -1,7 +1,9 @@ Overview of changes in lightdm 1.1.7 - * Add a seat option greeter-allow-guest which controls if the - greeter should show a guest option + * Add a seat option greeter-allow-guest which controls if the greeter should + provide an option to access the guest account. + * Add a seat option greeter-show-manual-login which hints to a greeter if it + should show a manual username entry if a user list is already present. Overview of changes in lightdm 1.1.6 diff --git a/data/lightdm.conf b/data/lightdm.conf index f37dcdb0..f6707289 100644 --- a/data/lightdm.conf +++ b/data/lightdm.conf @@ -39,6 +39,7 @@ # greeter-session = Session to load for greeter # greeter-hide-users = True to hide the user list # greeter-show-guest = True if the greeter should show a guest login option +# greeter-show-manual-login = True if the greeter should offer a manual login option # user-session = Session to load for users # allow-guest = True if guest login is allowed # guest-session = Session to load for guests (overrides user-session) @@ -64,6 +65,7 @@ #greeter-session=example-gtk-gnome #greeter-hide-users=false #greeter-show-guest=true +#greeter-show-manual-login=false #user-session=default #allow-guest=true #guest-session=UNIMPLEMENTED diff --git a/liblightdm-gobject/greeter.c b/liblightdm-gobject/greeter.c index ee3960f8..2806dd58 100644 --- a/liblightdm-gobject/greeter.c +++ b/liblightdm-gobject/greeter.c @@ -21,6 +21,7 @@ enum { PROP_0, PROP_DEFAULT_SESSION_HINT, PROP_HIDE_USERS_HINT, + PROP_SHOW_MANUAL_LOGIN_HINT, PROP_LOCK_HINT, PROP_HAS_GUEST_ACCOUNT_HINT, PROP_SELECT_USER_HINT, @@ -562,6 +563,28 @@ lightdm_greeter_get_hide_users_hint (LightDMGreeter *greeter) } /** + * lightdm_greeter_get_show_manual_login_hint: + * @greeter: A #LightDMGreeter + * + * Check if a manual login option should be shown. If set the GUI + * should provide a way for a username to be entered manually. + * Without this hint a greeter which is showing a user list can + * limit logins to only those users. + * + * Return value: #TRUE if a manual login option should be shown. + */ +gboolean +lightdm_greeter_get_show_manual_login_hint (LightDMGreeter *greeter) +{ + const gchar *value; + + g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), FALSE); + value = lightdm_greeter_get_hint (greeter, "show-manual-login"); + + return g_strcmp0 (value, "true") == 0; +} + +/** * lightdm_greeter_get_lock_hint: * @greeter: A #LightDMGreeter * @@ -990,6 +1013,9 @@ lightdm_greeter_get_property (GObject *object, case PROP_HIDE_USERS_HINT: g_value_set_boolean (value, lightdm_greeter_get_hide_users_hint (self)); break; + case PROP_SHOW_MANUAL_LOGIN_HINT: + g_value_set_boolean (value, lightdm_greeter_get_show_manual_login_hint (self)); + break; case PROP_LOCK_HINT: g_value_set_boolean (value, lightdm_greeter_get_lock_hint (self)); break; @@ -1106,6 +1132,14 @@ lightdm_greeter_class_init (LightDMGreeterClass *klass) G_PARAM_READABLE)); g_object_class_install_property (object_class, + PROP_SHOW_MANUAL_LOGIN_HINT, + g_param_spec_boolean ("show-manual-login-hint", + "show-manual-login-hint", + "Show manual login hint", + FALSE, + G_PARAM_READABLE)); + + g_object_class_install_property (object_class, PROP_LOCK_HINT, g_param_spec_boolean ("lock-hint", "lock-hint", diff --git a/liblightdm-gobject/liblightdm-gobject-1.vapi b/liblightdm-gobject/liblightdm-gobject-1.vapi index 88d67850..56aa327e 100644 --- a/liblightdm-gobject/liblightdm-gobject-1.vapi +++ b/liblightdm-gobject/liblightdm-gobject-1.vapi @@ -27,6 +27,7 @@ namespace LightDM { public unowned string get_hint (string name); public unowned string default_session_hint { get; } public bool hide_users_hint { get; } + public bool show_manual_login_hint { get; } public bool lock_hint { get; } public bool has_guest_account_hint { get; } public unowned string select_user_hint { get; } diff --git a/liblightdm-gobject/lightdm/greeter.h b/liblightdm-gobject/lightdm/greeter.h index 1b76be98..dc051b3e 100644 --- a/liblightdm-gobject/lightdm/greeter.h +++ b/liblightdm-gobject/lightdm/greeter.h @@ -80,6 +80,8 @@ const gchar *lightdm_greeter_get_default_session_hint (LightDMGreeter *greeter); gboolean lightdm_greeter_get_hide_users_hint (LightDMGreeter *greeter); +gboolean lightdm_greeter_get_show_manual_login_hint (LightDMGreeter *greeter); + gboolean lightdm_greeter_get_lock_hint (LightDMGreeter *greeter); gboolean lightdm_greeter_get_has_guest_account_hint (LightDMGreeter *greeter); diff --git a/src/display.c b/src/display.c index 3f26395a..be83134e 100644 --- a/src/display.c +++ b/src/display.c @@ -55,6 +55,9 @@ struct DisplayPrivate /* TRUE if the user list should be shown */ gboolean greeter_hide_users; + /* TRUE if a manual login option should be shown */ + gboolean greeter_show_manual_login; + /* TRUE if the greeter is a lock screen */ gboolean greeter_is_lock; @@ -204,6 +207,13 @@ display_set_hide_users_hint (Display *display, gboolean hide_users) } void +display_set_show_manual_login_hint (Display *display, gboolean show_manual_login) +{ + g_return_if_fail (display != NULL); + display->priv->greeter_show_manual_login = show_manual_login; +} + +void display_set_lock_hint (Display *display, gboolean is_lock) { g_return_if_fail (display != NULL); @@ -417,6 +427,7 @@ start_greeter (Display *display) greeter_set_allow_guest (display->priv->greeter, display->priv->allow_guest); greeter_set_hint (display->priv->greeter, "has-guest-account", (display->priv->allow_guest && display->priv->greeter_allow_guest) ? "true" : "false"); greeter_set_hint (display->priv->greeter, "hide-users", display->priv->greeter_hide_users ? "true" : "false"); + greeter_set_hint (display->priv->greeter, "show-manual-login", display->priv->greeter_show_manual_login ? "true" : "false"); if (display->priv->greeter_is_lock) greeter_set_hint (display->priv->greeter, "lock-screen", "true"); diff --git a/src/display.h b/src/display.h index c7e0850b..e6a970b1 100644 --- a/src/display.h +++ b/src/display.h @@ -72,6 +72,8 @@ void display_set_select_user_hint (Display *display, const gchar *username, gboo void display_set_hide_users_hint (Display *display, gboolean hide_users); +void display_set_show_manual_login_hint (Display *display, gboolean show_manual); + void display_set_lock_hint (Display *display, gboolean is_lock); void display_set_user_session (Display *display, const gchar *session_name); @@ -487,6 +487,7 @@ switch_to_user_or_start_greeter (Seat *seat, const gchar *username, gboolean use display_set_greeter_session (display, seat_get_string_property (seat, "greeter-session")); display_set_session_wrapper (display, seat_get_string_property (seat, "session-wrapper")); display_set_hide_users_hint (display, seat_get_boolean_property (seat, "greeter-hide-users")); + display_set_show_manual_login_hint (display, seat_get_boolean_property (seat, "greeter-show-manual-login")); if (is_lock) display_set_lock_hint (display, TRUE); display_set_allow_guest (display, seat_get_allow_guest (seat)); |