2
This program is free software; you can redistribute it and/or modify
3
it under the terms of the GNU General Public License as published by
4
the Free Software Foundation; either version 2 of the License, or
5
(at your option) any later version.
9
This class handles the system tray icon
11
copyright: (C) 2003 by Peter Simonsson
16
#include "application.h"
19
#include "chatwindow.h"
20
#include "config/preferences.h"
26
namespace Konversation
29
TrayIcon::TrayIcon(QWidget* parent) : KSystemTrayIcon(parent)
31
m_notificationEnabled = false;
32
m_blinkTimer = new QTimer(this);
33
connect(m_blinkTimer, SIGNAL(timeout()), SLOT(blinkTimeout()));
37
setToolTip(i18n("Konversation - IRC Client"));
44
void TrayIcon::startNotification()
46
if(!m_notificationEnabled)
51
if(Preferences::self()->trayNotifyBlink())
53
if(!m_blinkTimer->isActive())
55
setIcon(m_messagePix);
57
m_blinkTimer->start(500);
62
setIcon(m_messagePix);
67
void TrayIcon::endNotification()
70
setIcon(m_nomessagePix);
73
void TrayIcon::blinkTimeout()
75
m_blinkOn = !m_blinkOn;
79
setIcon(m_messagePix);
83
setIcon(m_nomessagePix);
87
void TrayIcon::updateAppearance()
89
m_nomessagePix = loadIcon("konversation");
90
m_messagePix = loadIcon("konv_message");
91
setIcon(m_nomessagePix);
95
#include "trayicon.moc"