I have made the following changes intended for : CE:UX:MTF / lipstick Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below.
https://build.pub.meego.com//request/show/7365 Thank You, vesuri [This message was auto-generated] --- Request # 7365: Messages from BOSS: State: review at 2012-11-12T10:29:44 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:vesuri:branches:CE:UX:MTF / lipstick -> CE:UX:MTF / lipstick changes files: -------------- --- lipstick.changes +++ lipstick.changes @@ -0,0 +1,3 @@ +* Fri Nov 09 2012 Vesa Halttunen <[email protected]> - 0.4.10 +- Notification system improvements (from Vesa) + old: ---- lipstick-0.4.9.tar.bz2 new: ---- lipstick-0.4.10.tar.bz2 spec files: ----------- --- lipstick.spec +++ lipstick.spec @@ -9,7 +9,7 @@ # << macros Summary: QML toolkit for homescreen creation -Version: 0.4.9 +Version: 0.4.10 Release: 1 Group: System/Libraries License: LGPLv2.1 @@ -28,6 +28,7 @@ BuildRequires: pkgconfig(xfixes) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(mce) >= 1.12.2 +Obsoletes: libnotificationsystem0 %description A QML toolkit for homescreen creation other changes: -------------- ++++++ lipstick-0.4.9.tar.bz2 -> lipstick-0.4.10.tar.bz2 --- src/notifications/notificationmanager.cpp +++ src/notifications/notificationmanager.cpp @@ -61,6 +61,7 @@ const char *NotificationManager::HINT_PREVIEW_SUMMARY = "x-nemo-preview-summary"; const char *NotificationManager::HINT_REMOTE_ACTION_PREFIX = "x-nemo-remote-action-"; const char *NotificationManager::HINT_USER_REMOVABLE = "x-nemo-user-removable"; +const char *NotificationManager::HINT_LEGACY_TYPE = "x-nemo-legacy-type"; NotificationManager *NotificationManager::instance_ = 0; @@ -488,6 +489,8 @@ if (id > 0) { QString remoteAction = notification->hints().value(QString(HINT_REMOTE_ACTION_PREFIX) + action).toString(); if (!remoteAction.isEmpty()) { + NOTIFICATIONS_DEBUG("INVOKE REMOTE ACTION:" << action << id); + // If a remote action has been defined for the given action, trigger it MRemoteAction(remoteAction).trigger(); } @@ -495,7 +498,7 @@ for (int actionIndex = 0; actionIndex < notification->actions().count() / 2; actionIndex++) { // Actions are sent over as a list of pairs. Each even element in the list (starting at index 0) represents the identifier for the action. Each odd element in the list is the localized string that will be displayed to the user. if (notification->actions().at(actionIndex * 2) == action) { - NOTIFICATIONS_DEBUG("INVOKE:" << action << id); + NOTIFICATIONS_DEBUG("INVOKE ACTION:" << action << id); emit ActionInvoked(id, action); } @@ -504,7 +507,13 @@ QVariant userRemovable = notification->hints().value(HINT_USER_REMOVABLE); if (!userRemovable.isValid() || userRemovable.toBool()) { // The notification should be closed if user removability is not defined (defaults to true) or is set to true - CloseNotification(id, NotificationDismissedByUser); + if (notification->hints().value(HINT_LEGACY_TYPE).toString() == "MNotificationGroup") { + // libmeegotouch notification groups should only be removed from display when tapped + emit notificationRemoved(id); + } else { + // Normal notifications should be removed when tapped + CloseNotification(id, NotificationDismissedByUser); + } } } } --- src/notifications/notificationmanager.h +++ src/notifications/notificationmanager.h @@ -109,6 +109,9 @@ //! Nemo hint: User removability of the notification. static const char *HINT_USER_REMOVABLE; + //! Nemo hint: Legacy type of the notification. + static const char *HINT_LEGACY_TYPE; + //! Notifation closing reasons used in the NotificationClosed signal enum NotificationClosedReason { //! The notification expired. --- src/src.pro +++ src/src.pro @@ -2,7 +2,7 @@ TEMPLATE = lib TARGET = lipstick -VERSION = 0.4.9 +VERSION = 0.4.10 DEFINES += LIPSTICK_BUILD_LIBRARY DEBUG_NOTIFICATIONS VERSION=\\\"$$VERSION\\\" --- tests/ut_notificationmanager/ut_notificationmanager.cpp +++ tests/ut_notificationmanager/ut_notificationmanager.cpp @@ -716,7 +716,7 @@ QCOMPARE(mRemoteActionTrigger.last(), hints.value(QString(NotificationManager::HINT_REMOTE_ACTION_PREFIX) + "action").toString()); } -void Ut_NotificationManager::testInvokingActionRemovesNotificationIfUserRemovable() +void Ut_NotificationManager::testInvokingActionClearsNotificationIfUserRemovable() { // Add three notifications with user removability not set, set to true and set to false NotificationManager *manager = NotificationManager::instance(); @@ -749,6 +749,26 @@ QCOMPARE(closedSpy.at(1).at(1).toInt(), (int)NotificationManager::NotificationDismissedByUser); } +void Ut_NotificationManager::testInvokingActionRemovesNotificationIfUserRemovableAndLegacyGroup() +{ + // Add three notifications with user removability not set, set to true and set to false + NotificationManager *manager = NotificationManager::instance(); + QVariantHash hints; + hints.insert(NotificationManager::HINT_USER_REMOVABLE, true); + hints.insert(NotificationManager::HINT_LEGACY_TYPE, "MNotificationGroup"); + uint id = manager->Notify("app2", 0, QString(), QString(), QString(), QStringList(), hints, 0); + Notification *notification = manager->notification(id); + connect(this, SIGNAL(actionInvoked(QString)), notification, SIGNAL(actionInvoked(QString))); + + // Make all notifications emit the actionInvoked() signal for action "action"; removable notifications should get removed + QSignalSpy removedSpy(manager, SIGNAL(notificationRemoved(uint))); + QSignalSpy closedSpy(manager, SIGNAL(NotificationClosed(uint,uint))); + emit actionInvoked("action"); + QCOMPARE(removedSpy.count(), 1); + QCOMPARE(removedSpy.at(0).at(0).toUInt(), id); + QCOMPARE(closedSpy.count(), 0); +} + void Ut_NotificationManager::testListingNotifications() { NotificationManager *manager = NotificationManager::instance(); --- tests/ut_notificationmanager/ut_notificationmanager.h +++ tests/ut_notificationmanager/ut_notificationmanager.h @@ -43,7 +43,8 @@ void testActionIsInvokedIfDefined(); void testActionIsNotInvokedIfIncomplete(); void testRemoteActionIsInvokedIfDefined(); - void testInvokingActionRemovesNotificationIfUserRemovable(); + void testInvokingActionClearsNotificationIfUserRemovable(); + void testInvokingActionRemovesNotificationIfUserRemovableAndLegacyGroup(); void testListingNotifications(); signals: ++++++ lipstick.yaml --- lipstick.yaml +++ lipstick.yaml @@ -1,6 +1,6 @@ Name: lipstick Summary: QML toolkit for homescreen creation -Version: 0.4.9 +Version: 0.4.10 Release: 1 Group: System/Libraries License: LGPLv2.1 @@ -24,6 +24,8 @@ - "%{_libdir}/liblipstick.so.*" - "%{_libdir}/qt4/imports/org/nemomobile/lipstick/liblipstickplugin.so" - "%{_libdir}/qt4/imports/org/nemomobile/lipstick/qmldir" +Obsoletes: + - libnotificationsystem0 SubPackages: - Name: devel
