|
|
@ -271,7 +271,8 @@ void TopLevel::resizeEvent (TQResizeEvent *)
|
|
|
|
noTicketsPixmap = loadSizedIcon("kerberos_notickets", width());
|
|
|
|
noTicketsPixmap = loadSizedIcon("kerberos_notickets", width());
|
|
|
|
expiredTicketsPixmap = loadSizedIcon("kerberos_expiredtickets", width());
|
|
|
|
expiredTicketsPixmap = loadSizedIcon("kerberos_expiredtickets", width());
|
|
|
|
partiallyExpiredTicketsPixmap = loadSizedIcon("kerberos_someexpiredtickets", width());
|
|
|
|
partiallyExpiredTicketsPixmap = loadSizedIcon("kerberos_someexpiredtickets", width());
|
|
|
|
expiringTicketsPixmap = loadSizedIcon("kerberos_ticketexpiring", width());
|
|
|
|
timerOverlayPixmap = loadSizedIcon("kerberos_timeroverlay", width());
|
|
|
|
|
|
|
|
warningOverlayPixmap = loadSizedIcon("kerberos_warningoverlay", width());
|
|
|
|
repaint();
|
|
|
|
repaint();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -293,8 +294,6 @@ void TopLevel::mousePressEvent(TQMouseEvent *event) {
|
|
|
|
void TopLevel::paintEvent(TQPaintEvent *) {
|
|
|
|
void TopLevel::paintEvent(TQPaintEvent *) {
|
|
|
|
TQString baseToolTip = i18n("%1 Kerberos ticket(s) listed for principal %2").arg(m_ticketList.count()).arg(m_ticketList[0].cachePrincipal);
|
|
|
|
TQString baseToolTip = i18n("%1 Kerberos ticket(s) listed for principal %2").arg(m_ticketList.count()).arg(m_ticketList[0].cachePrincipal);
|
|
|
|
|
|
|
|
|
|
|
|
TQPixmap *pm = &noTicketsPixmap;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool has_tickets = false;
|
|
|
|
bool has_tickets = false;
|
|
|
|
bool tickets_expiring_soon = false;
|
|
|
|
bool tickets_expiring_soon = false;
|
|
|
|
bool some_tickets_expired = false;
|
|
|
|
bool some_tickets_expired = false;
|
|
|
@ -318,31 +317,33 @@ void TopLevel::paintEvent(TQPaintEvent *) {
|
|
|
|
|
|
|
|
|
|
|
|
if (!notifyExpiry) tickets_expiring_soon = false;
|
|
|
|
if (!notifyExpiry) tickets_expiring_soon = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQPainter p(this);
|
|
|
|
if (has_tickets) {
|
|
|
|
if (has_tickets) {
|
|
|
|
if (all_tickets_expired) {
|
|
|
|
if (all_tickets_expired) {
|
|
|
|
pm = &expiredTicketsPixmap;
|
|
|
|
p.drawPixmap(0, 0, expiredTicketsPixmap);
|
|
|
|
|
|
|
|
p.drawPixmap(0, 0, warningOverlayPixmap);
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) have expired");
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) have expired");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (tickets_expiring_soon) {
|
|
|
|
|
|
|
|
pm = &expiringTicketsPixmap;
|
|
|
|
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("Ticket(s) will expire soon");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (some_tickets_expired) {
|
|
|
|
else if (some_tickets_expired) {
|
|
|
|
pm = &partiallyExpiredTicketsPixmap;
|
|
|
|
p.drawPixmap(0, 0, partiallyExpiredTicketsPixmap);
|
|
|
|
|
|
|
|
p.drawPixmap(0, 0, warningOverlayPixmap);
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("Some ticket(s) have expired");
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("Some ticket(s) have expired");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
pm = &activeTicketsPixmap;
|
|
|
|
p.drawPixmap(0, 0, activeTicketsPixmap);
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active");
|
|
|
|
if (tickets_expiring_soon) {
|
|
|
|
|
|
|
|
p.drawPixmap(0, 0, timerOverlayPixmap);
|
|
|
|
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active\nSome ticket(s) will expire shortly");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
p.drawPixmap(0, 0, noTicketsPixmap);
|
|
|
|
baseToolTip = i18n("No Kerberos tickets are available");
|
|
|
|
baseToolTip = i18n("No Kerberos tickets are available");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQPixmap base(*pm); // make copy of base pixmap
|
|
|
|
|
|
|
|
TQPainter p(this);
|
|
|
|
|
|
|
|
p.drawPixmap(0, 0, base);
|
|
|
|
|
|
|
|
p.end();
|
|
|
|
p.end();
|
|
|
|
|
|
|
|
|
|
|
|
setToolTip(baseToolTip);
|
|
|
|
setToolTip(baseToolTip);
|
|
|
|