- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) version 3. *
+ * This file is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License (LGPL) *
+ * as published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
-: QObject(parent),
- _mode(Invalid),
- _state(Passive),
- _shouldBeVisible(true),
- _passiveIcon(DesktopIcon("quassel_inactive")),
- _activeIcon(DesktopIcon("quassel")),
- _needsAttentionIcon(DesktopIcon("quassel_message")),
- _trayMenu(0),
- _associatedWidget(parent)
+ : QObject(parent),
+ _mode(Invalid),
+ _state(Passive),
+ _shouldBeVisible(true),
+ _passiveIcon(DesktopIcon("quassel-inactive")),
+ _activeIcon(DesktopIcon("quassel")),
+ _needsAttentionIcon(DesktopIcon("quassel-message")),
+ _trayMenu(0),
+ _associatedWidget(parent)
-void SystemTray::init() {
- ActionCollection *coll = QtUi::actionCollection("General");
- _minimizeRestoreAction = new Action(tr("&Minimize"), this, this, SLOT(minimizeRestore()));
+
+void SystemTray::init()
+{
+ ActionCollection *coll = QtUi::actionCollection("General");
+ _minimizeRestoreAction = new Action(tr("&Minimize"), this, this, SLOT(minimizeRestore()));
- KMenu *kmenu;
- _trayMenu = kmenu = new KMenu();
- kmenu->addTitle(qApp->windowIcon(), "Quassel IRC");
+ KMenu *kmenu;
+ _trayMenu = kmenu = new KMenu();
+ kmenu->addTitle(_activeIcon, "Quassel IRC");
- _trayMenu->addAction(coll->action("ConnectCore"));
- _trayMenu->addAction(coll->action("DisconnectCore"));
- _trayMenu->addAction(coll->action("CoreInfo"));
- _trayMenu->addSeparator();
- _trayMenu->addAction(_minimizeRestoreAction);
- _trayMenu->addAction(coll->action("Quit"));
+ _trayMenu->addAction(coll->action("ConnectCore"));
+ _trayMenu->addAction(coll->action("DisconnectCore"));
+ _trayMenu->addAction(coll->action("CoreInfo"));
+ _trayMenu->addSeparator();
+ _trayMenu->addAction(_minimizeRestoreAction);
+ _trayMenu->addAction(coll->action("Quit"));
- NotificationSettings notificationSettings;
- notificationSettings.initAndNotify("Systray/Animate", this, SLOT(enableAnimationChanged(QVariant)), true);
+ NotificationSettings notificationSettings;
+ notificationSettings.initAndNotify("Systray/Animate", this, SLOT(enableAnimationChanged(QVariant)), true);
-void SystemTray::trayMenuAboutToShow() {
- if(GraphicalUi::isMainWidgetVisible())
- _minimizeRestoreAction->setText(tr("&Minimize"));
- else
- _minimizeRestoreAction->setText(tr("&Restore"));
+
+void SystemTray::trayMenuAboutToShow()
+{
+ if (GraphicalUi::isMainWidgetVisible())
+ _minimizeRestoreAction->setText(tr("&Minimize"));
+ else
+ _minimizeRestoreAction->setText(tr("&Restore"));
-void SystemTray::setAlert(bool alerted) {
- if(alerted)
- setState(NeedsAttention);
- else
- setState(Client::isConnected() ? Active : Passive);
+
+void SystemTray::setAlert(bool alerted)
+{
+ if (alerted)
+ setState(NeedsAttention);
+ else
+ setState(Client::isConnected() ? Active : Passive);
-void SystemTray::setToolTip(const QString &title, const QString &subtitle) {
- _toolTipTitle = title;
- _toolTipSubTitle = subtitle;
- emit toolTipChanged(title, subtitle);
+
+void SystemTray::setToolTip(const QString &title, const QString &subtitle)
+{
+ _toolTipTitle = title;
+ _toolTipSubTitle = subtitle;
+ emit toolTipChanged(title, subtitle);
-void SystemTray::showMessage(const QString &title, const QString &message, MessageIcon icon, int millisecondsTimeoutHint, uint id) {
- Q_UNUSED(title)
- Q_UNUSED(message)
- Q_UNUSED(icon)
- Q_UNUSED(millisecondsTimeoutHint)
- Q_UNUSED(id)
+
+void SystemTray::showMessage(const QString &title, const QString &message, MessageIcon icon, int millisecondsTimeoutHint, uint id)
+{
+ Q_UNUSED(title)
+ Q_UNUSED(message)
+ Q_UNUSED(icon)
+ Q_UNUSED(millisecondsTimeoutHint)
+ Q_UNUSED(id)
-void SystemTray::enableAnimationChanged(const QVariant &v) {
- _animationEnabled = v.toBool();
- emit animationEnabledChanged(v.toBool());
+
+void SystemTray::enableAnimationChanged(const QVariant &v)
+{
+ _animationEnabled = v.toBool();
+ emit animationEnabledChanged(v.toBool());