|
|
|
@ -299,6 +299,9 @@ void TopLevel::paintEvent(TQPaintEvent *) {
|
|
|
|
|
bool some_tickets_expired = false;
|
|
|
|
|
bool all_tickets_expired = true;
|
|
|
|
|
|
|
|
|
|
int expired_tickets = 0;
|
|
|
|
|
int expiring_tickets = 0;
|
|
|
|
|
|
|
|
|
|
KerberosTicketInfoList::Iterator it;
|
|
|
|
|
for (it = m_ticketList.begin(); it != m_ticketList.end(); ++it) {
|
|
|
|
|
KerberosTicketInfo ticket = *it;
|
|
|
|
@ -308,9 +311,11 @@ void TopLevel::paintEvent(TQPaintEvent *) {
|
|
|
|
|
all_tickets_expired = false;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
expired_tickets++;
|
|
|
|
|
some_tickets_expired = true;
|
|
|
|
|
}
|
|
|
|
|
if ((ticket.validEndTime > now) && (ticket.validEndTime < now.addSecs(notifyExpiryMinutes*60))) {
|
|
|
|
|
expiring_tickets++;
|
|
|
|
|
tickets_expiring_soon = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -327,13 +332,13 @@ void TopLevel::paintEvent(TQPaintEvent *) {
|
|
|
|
|
else if (some_tickets_expired) {
|
|
|
|
|
p.drawPixmap(0, 0, partiallyExpiredTicketsPixmap);
|
|
|
|
|
p.drawPixmap(0, 0, warningOverlayPixmap);
|
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("Some ticket(s) have expired");
|
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("%1 ticket(s) have expired").arg(expired_tickets);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
p.drawPixmap(0, 0, activeTicketsPixmap);
|
|
|
|
|
if (tickets_expiring_soon) {
|
|
|
|
|
p.drawPixmap(0, 0, timerOverlayPixmap);
|
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active\nSome ticket(s) will expire shortly");
|
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active\n%1 ticket(s) will expire shortly").arg(expiring_tickets);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active");
|
|
|
|
|