[accounts-dialog] Fix up the handling of 'locked'
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [accounts-dialog] Fix up the handling of 'locked'
- Date: Fri, 26 Mar 2010 05:52:01 +0000 (UTC)
commit 115ea1d37029a715341d55e76555650fc8ef3c9e
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Mar 25 00:20:46 2010 -0400
Fix up the handling of 'locked'
src/main.c | 26 +++++++++++++-------------
src/um-user.c | 8 ++++++++
src/um-user.h | 1 +
3 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index ab1eaa3..58ebf9a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -500,20 +500,20 @@ show_user (UmUser *user, UserAccountDialog *d)
}
} while (gtk_tree_model_iter_next (model, &iter));
- switch (um_user_get_password_mode (user)) {
- case UM_PASSWORD_MODE_REGULAR:
- text = "\xe2\x80\xa2\xe2\x80\xa2\xe2\x80\xa2\xe2\x80\xa2\xe2\x80\xa2";
- break;
- case UM_PASSWORD_MODE_SET_AT_LOGIN:
- text = C_("Password mode", "To be set at next login");
- break;
- case UM_PASSWORD_MODE_NONE:
- text = C_("Password mode", "None");
- break;
- case UM_PASSWORD_MODE_DISABLED:
+ if (um_user_get_locked (user))
text = C_("Password mode", "Account disabled");
- break;
- default:
+ else {
+ switch (um_user_get_password_mode (user)) {
+ case UM_PASSWORD_MODE_REGULAR:
+ text = "\xe2\x80\xa2\xe2\x80\xa2\xe2\x80\xa2\xe2\x80\xa2\xe2\x80\xa2";
+ break;
+ case UM_PASSWORD_MODE_SET_AT_LOGIN:
+ text = C_("Password mode", "To be set at next login");
+ break;
+ case UM_PASSWORD_MODE_NONE:
+ text = C_("Password mode", "None");
+ break;
+ default:
g_assert_not_reached ();
}
label = get_widget (d, "account-password-value-label");
diff --git a/src/um-user.c b/src/um-user.c
index eb7062a..99195c7 100644
--- a/src/um-user.c
+++ b/src/um-user.c
@@ -657,6 +657,14 @@ um_user_get_icon_file (UmUser *user)
}
gboolean
+um_user_get_locked (UmUser *user)
+{
+ g_return_val_if_fail (UM_IS_USER (user), FALSE);
+
+ return user->props->locked;
+}
+
+gboolean
um_user_get_automatic_login (UmUser *user)
{
g_return_val_if_fail (UM_IS_USER (user), FALSE);
diff --git a/src/um-user.h b/src/um-user.h
index 6c487b6..c149c41 100644
--- a/src/um-user.h
+++ b/src/um-user.h
@@ -65,6 +65,7 @@ gulong um_user_get_login_frequency (UmUser *user);
gint um_user_get_password_mode (UmUser *user);
const gchar *um_user_get_password_hint (UmUser *user);
const gchar *um_user_get_icon_file (UmUser *user);
+gboolean um_user_get_locked (UmUser *user);
gboolean um_user_get_automatic_login (UmUser *user);
void um_user_set_user_name (UmUser *user,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]