summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-06-13 21:56:45 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-06-13 21:56:45 -0500
commitc57a10113d7abc28a8e05d2cbf9ea9956bb5b58b (patch)
treea972ddbdb855f3466dc35f644220d2ab013e5294 /src
parent02d6ef6446dc03f56abde8d71852f69c91403af8 (diff)
downloadkerberostray-c57a10113d7abc28a8e05d2cbf9ea9956bb5b58b.tar.gz
kerberostray-c57a10113d7abc28a8e05d2cbf9ea9956bb5b58b.zip
Make tray icon easier to see and understand
Diffstat (limited to 'src')
-rw-r--r--src/cr22-action-kerberos_ticketexpiring.pngbin1398 -> 0 bytes
-rw-r--r--src/cr22-action-kerberos_timeroverlay.pngbin0 -> 428 bytes
-rw-r--r--src/cr22-action-kerberos_warningoverlay.pngbin0 -> 436 bytes
-rw-r--r--src/toplevel.cpp31
-rw-r--r--src/toplevel.h3
5 files changed, 18 insertions, 16 deletions
diff --git a/src/cr22-action-kerberos_ticketexpiring.png b/src/cr22-action-kerberos_ticketexpiring.png
deleted file mode 100644
index 2354930..0000000
--- a/src/cr22-action-kerberos_ticketexpiring.png
+++ /dev/null
Binary files differ
diff --git a/src/cr22-action-kerberos_timeroverlay.png b/src/cr22-action-kerberos_timeroverlay.png
new file mode 100644
index 0000000..7b94cee
--- /dev/null
+++ b/src/cr22-action-kerberos_timeroverlay.png
Binary files differ
diff --git a/src/cr22-action-kerberos_warningoverlay.png b/src/cr22-action-kerberos_warningoverlay.png
new file mode 100644
index 0000000..38d2380
--- /dev/null
+++ b/src/cr22-action-kerberos_warningoverlay.png
Binary files differ
diff --git a/src/toplevel.cpp b/src/toplevel.cpp
index 3b80d2d..d998691 100644
--- a/src/toplevel.cpp
+++ b/src/toplevel.cpp
@@ -271,7 +271,8 @@ void TopLevel::resizeEvent (TQResizeEvent *)
noTicketsPixmap = loadSizedIcon("kerberos_notickets", width());
expiredTicketsPixmap = loadSizedIcon("kerberos_expiredtickets", width());
partiallyExpiredTicketsPixmap = loadSizedIcon("kerberos_someexpiredtickets", width());
- expiringTicketsPixmap = loadSizedIcon("kerberos_ticketexpiring", width());
+ timerOverlayPixmap = loadSizedIcon("kerberos_timeroverlay", width());
+ warningOverlayPixmap = loadSizedIcon("kerberos_warningoverlay", width());
repaint();
}
@@ -293,8 +294,6 @@ void TopLevel::mousePressEvent(TQMouseEvent *event) {
void TopLevel::paintEvent(TQPaintEvent *) {
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 tickets_expiring_soon = false;
bool some_tickets_expired = false;
@@ -318,31 +317,33 @@ void TopLevel::paintEvent(TQPaintEvent *) {
if (!notifyExpiry) tickets_expiring_soon = false;
+ TQPainter p(this);
if (has_tickets) {
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");
}
- else if (tickets_expiring_soon) {
- pm = &expiringTicketsPixmap;
- baseToolTip = baseToolTip + "\n" + i18n("Ticket(s) will expire soon");
- }
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");
}
else {
- pm = &activeTicketsPixmap;
- baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active");
+ 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");
+ }
+ else {
+ baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active");
+ }
}
}
else {
+ p.drawPixmap(0, 0, noTicketsPixmap);
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();
setToolTip(baseToolTip);
diff --git a/src/toplevel.h b/src/toplevel.h
index 4082eef..41ed816 100644
--- a/src/toplevel.h
+++ b/src/toplevel.h
@@ -79,7 +79,8 @@ private:
TQPixmap noTicketsPixmap;
TQPixmap expiredTicketsPixmap;
TQPixmap partiallyExpiredTicketsPixmap;
- TQPixmap expiringTicketsPixmap;
+ TQPixmap timerOverlayPixmap;
+ TQPixmap warningOverlayPixmap;
KAction *confAct;
KAction *getNewTGTAct;
KAction *getNewSTAct;