The setting also moved to the Interface settings page.
State oldstate = state();
SystemTray::setState(state_);
if(oldstate != state()) {
- if(state() == NeedsAttention && mode() == Legacy)
+ if(state() == NeedsAttention && mode() == Legacy && animationEnabled())
_blinkTimer.start();
else {
_blinkTimer.stop();
setupHotList();
#ifndef HAVE_KDE
- QtUi::registerNotificationBackend(new TaskbarNotificationBackend(this));
-# ifndef QT_NO_SYSTEMTRAYICON
- QtUi::registerNotificationBackend(new SystrayNotificationBackend(this));
-# endif
# ifdef HAVE_PHONON
QtUi::registerNotificationBackend(new PhononNotificationBackend(this));
# endif
+# ifndef QT_NO_SYSTEMTRAYICON
+ QtUi::registerNotificationBackend(new SystrayNotificationBackend(this));
+# endif
+
+ QtUi::registerNotificationBackend(new TaskbarNotificationBackend(this));
#else /* HAVE_KDE */
QtUi::registerNotificationBackend(new KNotificationBackend(this));
</widget>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</spacer>
</item>
- <item>
+ <item row="0" column="1">
<widget class="QCheckBox" name="minimizeOnClose">
<property name="text">
<string>Hide to tray on close button</string>
</property>
</widget>
</item>
+ <item row="1" column="0">
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="animateSystrayIcon">
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Enable animations</string>
+ </property>
+ <property name="settingsKey" stdset="0">
+ <string notr="true">/Notification/Systray/Animate</string>
+ </property>
+ <property name="defaultValue" stdset="0">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
<item>
_statusNotifierItemDBus = new StatusNotifierItemDBus(this);
connect(this, SIGNAL(toolTipChanged(QString,QString)), _statusNotifierItemDBus, SIGNAL(NewToolTip()));
+ connect(this, SIGNAL(animationEnabledChanged(bool)), _statusNotifierItemDBus, SIGNAL(NewAttentionIcon()));
connect(QDBusConnection::sessionBus().interface(), SIGNAL(serviceOwnerChanged(QString,QString,QString)),
SLOT(serviceChange(QString,QString,QString)));
}
QString StatusNotifierItem::attentionIconName() const {
- return QString("quassel_message");
+ if(animationEnabled())
+ return QString("quassel_message");
+ else
+ return QString("quassel");
}
QString StatusNotifierItem::toolTipIconName() const {
_trayMenu->addAction(coll->action("Quit"));
connect(_trayMenu, SIGNAL(aboutToShow()), SLOT(trayMenuAboutToShow()));
+
+ NotificationSettings notificationSettings;
+ notificationSettings.initAndNotify("Systray/Animate", this, SLOT(enableAnimationChanged(QVariant)), true);
}
void SystemTray::trayMenuAboutToShow() {
void SystemTray::minimizeRestore() {
GraphicalUi::toggleMainWidget();
}
+
+void SystemTray::enableAnimationChanged(const QVariant &v) {
+ _animationEnabled = v.toBool();
+ emit animationEnabledChanged(v.toBool());
+}
signals:
void activated(SystemTray::ActivationReason);
void iconChanged(const Icon &);
+ void animationEnabledChanged(bool);
void toolTipChanged(const QString &title, const QString &subtitle);
void messageClicked(uint notificationId);
void messageClosed(uint notificationId);
inline QString toolTipSubTitle() const;
inline QMenu *trayMenu() const;
+ inline bool animationEnabled() const;
private slots:
void minimizeRestore();
void trayMenuAboutToShow();
+ void enableAnimationChanged(const QVariant &);
private:
Mode _mode;
QString _toolTipTitle, _toolTipSubTitle;
Icon _passiveIcon, _activeIcon, _needsAttentionIcon;
+ bool _animationEnabled;
QMenu *_trayMenu;
QWidget *_associatedWidget;
QMenu *SystemTray::trayMenu() const { return _trayMenu; }
QString SystemTray::toolTipTitle() const { return _toolTipTitle; }
QString SystemTray::toolTipSubTitle() const { return _toolTipSubTitle; }
-
+bool SystemTray::animationEnabled() const { return _animationEnabled; }
#endif
_blockActivation(false)
{
NotificationSettings notificationSettings;
- _showBubble = notificationSettings.value("Systray/ShowBubble", true).toBool();
- _animate = notificationSettings.value("Systray/Animate", true).toBool();
-
- notificationSettings.notify("Systray/ShowBubble", this, SLOT(showBubbleChanged(const QVariant &)));
- notificationSettings.notify("Systray/Animate", this, SLOT(animateChanged(const QVariant &)));
+ notificationSettings.initAndNotify("Systray/ShowBubble", this, SLOT(showBubbleChanged(QVariant)), true);
+ notificationSettings.initAndNotify("Systray/Animate", this, SLOT(animateChanged(QVariant)), true);
connect(QtUi::mainWindow()->systemTray(), SIGNAL(messageClicked(uint)), SLOT(notificationActivated(uint)));
connect(QtUi::mainWindow()->systemTray(), SIGNAL(activated(SystemTray::ActivationReason)),