on xenial help sign in
Make sure the alerting-wiggle gets correctly triggered by changes to count and countVisible at runtime.
ccb786eMirco Müller
plugins/Unity/Launcher/dbusinterface.cpp+9
@@ -66,6 +66,7 @@ QString DBusInterface::introspect(const QString &path) const
66 "<interface name=\"com.canonical.Unity.Launcher.Item\">"
66 "<interface name=\"com.canonical.Unity.Launcher.Item\">"
67 "<property name=\"count\" type=\"i\" access=\"readwrite\" />"
67 "<property name=\"count\" type=\"i\" access=\"readwrite\" />"
68 "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />"
68 "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />"
69+ "<property name=\"alerting\" type=\"b\" access=\"readwrite\" />"
69 "</interface>";
70 "</interface>";
70 return nodeiface;
71 return nodeiface;
71}
72}
@@ -168,6 +169,8 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
168 retval.append(QVariant::fromValue(QDBusVariant(item->count())));
169 retval.append(QVariant::fromValue(QDBusVariant(item->count())));
169 } else if (message.arguments()[1].toString() == "countVisible") {
170 } else if (message.arguments()[1].toString() == "countVisible") {
170 retval.append(QVariant::fromValue(QDBusVariant(item->countVisible())));
171 retval.append(QVariant::fromValue(QDBusVariant(item->countVisible())));
172+ } else if (message.arguments()[1].toString() == "alerting") {
173+ retval.append(QVariant::fromValue(QDBusVariant(item->alerting())));
171 }
174 }
172 } else if (message.member() == "Set") {
175 } else if (message.member() == "Set") {
173 if (message.arguments()[1].toString() == "count") {
176 if (message.arguments()[1].toString() == "count") {
@@ -182,6 +185,12 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
182 Q_EMIT countVisibleChanged(appid, newVisible);
185 Q_EMIT countVisibleChanged(appid, newVisible);
183 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible);
186 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible);
184 }
187 }
188+ } else if (message.arguments()[1].toString() == "alerting") {
189+ bool newAlerting = message.arguments()[2].value<QDBusVariant>().variant().toBool();
190+ if (!item || newAlerting != item->alerting()) {
191+ Q_EMIT alertingChanged(appid, newAlerting);
192+ notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "alerting", newAlerting);
193+ }
185 }
194 }
186 } else if (message.member() == "GetAll") {
195 } else if (message.member() == "GetAll") {
187 if (item) {
196 if (item) {
plugins/Unity/Launcher/dbusinterface.h+1
@@ -36,6 +36,7 @@ public:
36Q_SIGNALS:
36Q_SIGNALS:
37 void countChanged(const QString &appId, int count);
37 void countChanged(const QString &appId, int count);
38 void countVisibleChanged(const QString &appId, bool countVisible);
38 void countVisibleChanged(const QString &appId, bool countVisible);
39+ void alertingChanged(const QString &appId, bool alerting);
39 void refreshCalled();
40 void refreshCalled();
40
41
41private:
42private:
qml/Launcher/LauncherDelegate.qml+6
@@ -181,6 +181,12 @@ Item {
181 duration: privWiggleAnim.duration
181 duration: privWiggleAnim.duration
182 easing.type: Easing.OutQuad
182 easing.type: Easing.OutQuad
183 }
183 }
184+
185+ UbuntuNumberAnimation {
186+ target: privWiggleAnim.target
187+ property: "alerting"
188+ to: 0
189+ }
184 }
190 }
185
191
186 Item {
192 Item {