|
|
@ -50,15 +50,9 @@
|
|
|
|
#include <kaction.h>
|
|
|
|
#include <kaction.h>
|
|
|
|
#include <knotifydialog.h>
|
|
|
|
#include <knotifydialog.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "tealist.h"
|
|
|
|
|
|
|
|
#include "timeedit.h"
|
|
|
|
|
|
|
|
#include "toplevel.h"
|
|
|
|
#include "toplevel.h"
|
|
|
|
#include "toplevel.moc"
|
|
|
|
#include "toplevel.moc"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const int TopLevel::DEFAULT_TEA_TIME = 3*60;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TopLevel::TopLevel() : KSystemTray()
|
|
|
|
TopLevel::TopLevel() : KSystemTray()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
setBackgroundMode(X11ParentRelative); // what for?
|
|
|
|
setBackgroundMode(X11ParentRelative); // what for?
|
|
|
@ -66,8 +60,7 @@ TopLevel::TopLevel() : KSystemTray()
|
|
|
|
KConfig *config = kapp->config();
|
|
|
|
KConfig *config = kapp->config();
|
|
|
|
config->setGroup("Kerberos");
|
|
|
|
config->setGroup("Kerberos");
|
|
|
|
|
|
|
|
|
|
|
|
confAct = new KAction(i18n("&Configure..."), "configure", 0,
|
|
|
|
confAct = new KAction(i18n("&Configure..."), "configure", 0, TQT_TQOBJECT(this), TQT_SLOT(config()), actionCollection(), "configure");
|
|
|
|
TQT_TQOBJECT(this), TQT_SLOT(config()), actionCollection(), "configure");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// create app menu (displayed on right-click)
|
|
|
|
// create app menu (displayed on right-click)
|
|
|
|
menu = new TQPopupMenu();
|
|
|
|
menu = new TQPopupMenu();
|
|
|
@ -81,11 +74,6 @@ TopLevel::TopLevel() : KSystemTray()
|
|
|
|
confAct->plug(menu);
|
|
|
|
confAct->plug(menu);
|
|
|
|
menu->insertItem(SmallIcon("help"), i18n("&Help"), helpMnu);
|
|
|
|
menu->insertItem(SmallIcon("help"), i18n("&Help"), helpMnu);
|
|
|
|
menu->insertItem(SmallIcon("exit"), i18n("Quit"), kapp, TQT_SLOT(quit()));
|
|
|
|
menu->insertItem(SmallIcon("exit"), i18n("Quit"), kapp, TQT_SLOT(quit()));
|
|
|
|
|
|
|
|
|
|
|
|
confdlg = 0L;
|
|
|
|
|
|
|
|
anondlg = 0L;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stop(); // reset timer, disable some menu entries, etc.
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* slot: signal shutDown() from KApplication */
|
|
|
|
/* slot: signal shutDown() from KApplication */
|
|
|
@ -130,27 +118,13 @@ void TopLevel::mousePressEvent(TQMouseEvent *event)
|
|
|
|
/** Handle paintEvent (ie. animate icon) */
|
|
|
|
/** Handle paintEvent (ie. animate icon) */
|
|
|
|
void TopLevel::paintEvent(TQPaintEvent *)
|
|
|
|
void TopLevel::paintEvent(TQPaintEvent *)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQPixmap *pm = &mugPixmap;
|
|
|
|
TQPixmap *pm = &noTicketsPixmap;
|
|
|
|
|
|
|
|
|
|
|
|
if (running) {
|
|
|
|
// RAJA FIXME
|
|
|
|
if (useTrayVis)
|
|
|
|
|
|
|
|
pm = &teaAnim1Pixmap; // this is 'mugPixmap' plus brown content
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
pm = &teaNotReadyPixmap; // generic "steeping" icon
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// use simple two-frame "animation"
|
|
|
|
|
|
|
|
// FIXME: how about using a TQMovie instead? (eg. MNG)
|
|
|
|
|
|
|
|
if (ready) {
|
|
|
|
|
|
|
|
if (firstFrame)
|
|
|
|
|
|
|
|
pm = &teaAnim1Pixmap;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
pm = &teaAnim2Pixmap;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQPixmap base(*pm); // make copy of base pixmap
|
|
|
|
TQPixmap base(*pm); // make copy of base pixmap
|
|
|
|
TQPainter p(this);
|
|
|
|
TQPainter p(this);
|
|
|
|
p.drawPixmap(x, y, base);
|
|
|
|
p.drawPixmap(0, 0, base);
|
|
|
|
p.end();
|
|
|
|
p.end();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|