From: Tom Yu Date: Mon, 1 Oct 2007 23:54:23 +0000 (+0000) Subject: pull up r20031 from trunk X-Git-Tag: krb5-1.6.3-beta2~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=77193a75daa9fdc46f434121a741385b4a4c3f7d;p=krb5.git pull up r20031 from trunk r20031@cathode-dark-space: jaltman | 2007-10-01 01:27:29 -0400 ticket: new subject: NIM: BUG: APP: notification icon state Currently, the notification icon that is created by Network Identity Manager indicates the status of all the known credentials. If any credential belonging to any identity is expired or in a critical state, the icon will change color to indicate this. This patch changes the behavior to only indicate the status of credentials belonging to the default identity. The expiration state of credentials that do not belong to the default identity no longer affect the appearance of the notification icon. ticket: 5796 version_fixed: 1.6.3 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@20072 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/windows/identity/ui/credwnd.c b/src/windows/identity/ui/credwnd.c index e58786363..913503f04 100644 --- a/src/windows/identity/ui/credwnd.c +++ b/src/windows/identity/ui/credwnd.c @@ -1445,7 +1445,6 @@ cw_update_outline(khui_credwnd_tbl * tbl) khm_size cbbuf; khm_int32 flags; int selected; - khm_int32 expstate = 0; /* this is called after calling cw_update_creds, so we assume that the credentials are all loaded and sorted according to @@ -1715,7 +1714,6 @@ cw_update_outline(khui_credwnd_tbl * tbl) if (flags) { ol->flags |= flags; ol->flags |= KHUI_CW_O_SHOWFLAG; - expstate |= flags; } else if (grouping[j] == tbl->n_cols - 1) { /* if we aren't showing any creds under this outline level, we should also show any @@ -1994,17 +1992,34 @@ cw_update_outline(khui_credwnd_tbl * tbl) tbl->cursor_row = 0; _exit: - /* note that the expstate is derived from whether or not - * we have expiration states set for any active identities */ - if (n_creds == 0) - khm_notify_icon_expstate(KHM_NOTIF_EMPTY); - else if ((expstate & CW_EXPSTATE_EXPIRED) == CW_EXPSTATE_EXPIRED) - khm_notify_icon_expstate(KHM_NOTIF_EXP); - else if ((expstate & CW_EXPSTATE_WARN) == CW_EXPSTATE_WARN || - (expstate & CW_EXPSTATE_CRITICAL) == CW_EXPSTATE_CRITICAL) - khm_notify_icon_expstate(KHM_NOTIF_WARN); - else - khm_notify_icon_expstate(KHM_NOTIF_OK); + + { + khm_handle def_ident = NULL; + khm_int32 def_expstate = 0; + khm_boolean def_empty = TRUE; + + kcdb_identity_get_default(&def_ident); + if (def_ident) { + khui_credwnd_ident * cwi; + + cwi = cw_find_ident(tbl, def_ident); + if (cwi) { + def_empty = (cwi->id_credcount == 0); + } + + def_expstate = cw_get_buf_exp_flags(tbl, def_ident); + } + + if (def_empty) + khm_notify_icon_expstate(KHM_NOTIF_EMPTY); + else if ((def_expstate & CW_EXPSTATE_EXPIRED) == CW_EXPSTATE_EXPIRED) + khm_notify_icon_expstate(KHM_NOTIF_EXP); + else if ((def_expstate & CW_EXPSTATE_WARN) == CW_EXPSTATE_WARN || + (def_expstate & CW_EXPSTATE_CRITICAL) == CW_EXPSTATE_CRITICAL) + khm_notify_icon_expstate(KHM_NOTIF_WARN); + else + khm_notify_icon_expstate(KHM_NOTIF_OK); + } } void