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/7427

Thank You,
vesuri

[This message was auto-generated]

---

Request # 7427:

Messages from BOSS:

State: review at 2012-11-20T16:11:04 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 @@
+* Tue Nov 20 2012 Vesa Halttunen <[email protected]> - 0.5.1
+- Notification system improvements (from Vesa)
+

old:
----
  lipstick-0.5.0.tar.bz2

new:
----
  lipstick-0.5.1.tar.bz2

spec files:
-----------
--- lipstick.spec
+++ lipstick.spec
@@ -9,7 +9,7 @@
 # << macros
 
 Summary:    QML toolkit for homescreen creation
-Version:    0.5.0
+Version:    0.5.1
 Release:    1
 Group:      System/Libraries
 License:    LGPLv2.1

other changes:
--------------

++++++ lipstick-0.5.0.tar.bz2 -> lipstick-0.5.1.tar.bz2
--- .gitignore
+++ .gitignore
@@ -1,18 +0,0 @@
-Makefile
-*.o
-*gen_*.h
-*gen_*.cpp
-*gen_*.o
-*moc_*.h
-*moc_*.cpp
-*moc_*.o
-*~
-*.log
-*.log.xml
-*.gcno
-*.gcda
-*.pro.user
-configure-stamp
-build-stamp
-.project
-.cproject
--- plugin/.gitignore
+++ plugin/.gitignore
@@ -1 +0,0 @@
-liblipstickplugin.so
--- src/.gitignore
+++ src/.gitignore
@@ -1,2 +0,0 @@
-liblipstick.*
-pkgconfig
--- src/notifications/.gitignore
+++ src/notifications/.gitignore
@@ -1 +0,0 @@
-notificationmanageradaptor.*
--- src/notifications/notificationmanager.cpp
+++ src/notifications/notificationmanager.cpp
@@ -61,7 +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";
+const char *NotificationManager::HINT_USER_CLOSEABLE = "x-nemo-user-closeable";
 
 NotificationManager *NotificationManager::instance_ = 0;
 
@@ -506,13 +506,14 @@
 
             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
-                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
+                // The notification should be removed if user removability is 
not defined (defaults to true) or is set to true
+                QVariant userCloseable = 
notification->hints().value(HINT_USER_CLOSEABLE);
+                if (!userCloseable.isValid() || userCloseable.toBool()) {
+                    // The notification should be closed if user closeability 
is not defined (defaults to true) or is set to true
                     CloseNotification(id, NotificationDismissedByUser);
+                } else {
+                    // Uncloseable notifications should be only removed
+                    emit notificationRemoved(id);
                 }
             }
         }
--- src/notifications/notificationmanager.h
+++ src/notifications/notificationmanager.h
@@ -109,8 +109,8 @@
     //! 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;
+    //! Nemo hint: User closeability of the notification.
+    static const char *HINT_USER_CLOSEABLE;
 
     //! Notifation closing reasons used in the NotificationClosed signal
     enum NotificationClosedReason {
--- src/notifications/notificationpreviewpresenter.cpp
+++ src/notifications/notificationpreviewpresenter.cpp
@@ -73,11 +73,12 @@
             }
         }
     } else {
-        removeNotification(id);
+        // Remove updated notification only from the queue so that a currently 
visible notification won't suddenly disappear
+        removeNotification(id, true);
     }
 }
 
-void NotificationPreviewPresenter::removeNotification(uint id)
+void NotificationPreviewPresenter::removeNotification(uint id, bool 
onlyFromQueue)
 {
     // Remove the notification from the queue
     Notification *notification = 
NotificationManager::instance()->notification(id);
@@ -86,7 +87,7 @@
         notificationQueue.removeAll(notification);
 
         // If the notification is currently being shown hide it - the next 
notification will be shown after the current one has been hidden
-        if (currentNotification == notification) {
+        if (!onlyFromQueue && currentNotification == notification) {
             currentNotification = 0;
             emit notificationChanged();
         }
--- src/notifications/notificationpreviewpresenter.h
+++ src/notifications/notificationpreviewpresenter.h
@@ -90,7 +90,7 @@
      *
      * \param id the ID of the notification to be removed
      */
-    void removeNotification(uint id);
+    void removeNotification(uint id, bool onlyFromQueue = false);
 
 private:
     //! Creates the notification window if it has not been created yet.
--- src/src.pro
+++ src/src.pro
@@ -2,7 +2,7 @@
 
 TEMPLATE = lib
 TARGET = lipstick
-VERSION = 0.5.0
+VERSION = 0.5.1
 
 DEFINES += LIPSTICK_BUILD_LIBRARY VERSION=\\\"$$VERSION\\\"
 
--- tests/ut_categorydefinitionstore/.gitignore
+++ tests/ut_categorydefinitionstore/.gitignore
@@ -1 +0,0 @@
-ut_categorydefinitionstore
--- tests/ut_lipstickdbusinterface/.gitignore
+++ tests/ut_lipstickdbusinterface/.gitignore
@@ -1 +0,0 @@
-ut_lipstickdbusinterface
--- tests/ut_lipsticksettings/.gitignore
+++ tests/ut_lipsticksettings/.gitignore
@@ -1 +0,0 @@
-ut_lipsticksettings
--- tests/ut_notification/.gitignore
+++ tests/ut_notification/.gitignore
@@ -1 +0,0 @@
-ut_notification
--- tests/ut_notificationlistmodel/.gitignore
+++ tests/ut_notificationlistmodel/.gitignore
@@ -1 +0,0 @@
-ut_notificationlistmodel
--- tests/ut_notificationmanager/.gitignore
+++ tests/ut_notificationmanager/.gitignore
@@ -1 +0,0 @@
-ut_notificationmanager
--- 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::testInvokingActionClearsNotificationIfUserRemovable()
+void 
Ut_NotificationManager::testInvokingActionClosesNotificationIfUserRemovable()
 {
     // Add three notifications with user removability not set, set to true and 
set to false
     NotificationManager *manager = NotificationManager::instance();
@@ -749,18 +749,18 @@
     QCOMPARE(closedSpy.at(1).at(1).toInt(), 
(int)NotificationManager::NotificationDismissedByUser);
 }
 
-void 
Ut_NotificationManager::testInvokingActionRemovesNotificationIfUserRemovableAndLegacyGroup()
+void 
Ut_NotificationManager::testInvokingActionRemovesNotificationIfUserRemovableAndNotCloseable()
 {
-    // Add three notifications with user removability not set, set to true and 
set to false
+    // Add notification which is removable but not closeable
     NotificationManager *manager = NotificationManager::instance();
     QVariantHash hints;
     hints.insert(NotificationManager::HINT_USER_REMOVABLE, true);
-    hints.insert(NotificationManager::HINT_LEGACY_TYPE, "MNotificationGroup");
+    hints.insert(NotificationManager::HINT_USER_CLOSEABLE, false);
     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
+    // Make the notifications emit the actionInvoked() signal for action 
"action"; removable notifications should get removed but non-closeable should 
not be closed
     QSignalSpy removedSpy(manager, SIGNAL(notificationRemoved(uint)));
     QSignalSpy closedSpy(manager, SIGNAL(NotificationClosed(uint,uint)));
     emit actionInvoked("action");
--- tests/ut_notificationmanager/ut_notificationmanager.h
+++ tests/ut_notificationmanager/ut_notificationmanager.h
@@ -43,8 +43,8 @@
     void testActionIsInvokedIfDefined();
     void testActionIsNotInvokedIfIncomplete();
     void testRemoteActionIsInvokedIfDefined();
-    void testInvokingActionClearsNotificationIfUserRemovable();
-    void testInvokingActionRemovesNotificationIfUserRemovableAndLegacyGroup();
+    void testInvokingActionClosesNotificationIfUserRemovable();
+    void testInvokingActionRemovesNotificationIfUserRemovableAndNotCloseable();
     void testListingNotifications();
 
 signals:
--- tests/ut_notificationpreviewpresenter/.gitignore
+++ tests/ut_notificationpreviewpresenter/.gitignore
@@ -1 +0,0 @@
-ut_notificationpreviewpresenter
--- tests/ut_notificationpreviewpresenter/ut_notificationpreviewpresenter.cpp
+++ tests/ut_notificationpreviewpresenter/ut_notificationpreviewpresenter.cpp
@@ -354,20 +354,28 @@
     QCOMPARE(qWidgetVisible[static_cast<QWidget 
*>(qDeclarativeViews.first())], windowVisible);
 }
 
-void 
Ut_NotificationPreviewPresenter::testUpdateNotificationRemovesNotificationIfNoSummaryOrBody()
+void 
Ut_NotificationPreviewPresenter::testUpdateNotificationRemovesNotificationFromQueueIfNoSummaryOrBody()
 {
     NotificationPreviewPresenter presenter;
 
-    // Create a notification
-    Notification *notification = createNotification(1);
+    // Create two notifications
+    Notification *notification1 = createNotification(1);
+    Notification *notification2 = createNotification(2);
     presenter.updateNotification(1);
+    presenter.updateNotification(2);
 
-    // Update the notification to have no summary or body
+    // Update the notifications to have no summary or body
     QSignalSpy spy(&presenter, SIGNAL(notificationChanged()));
-    notification->setHints(QVariantHash());
+    notification1->setHints(QVariantHash());
+    notification2->setHints(QVariantHash());
     presenter.updateNotification(1);
+    presenter.updateNotification(2);
 
-    // Check that an empty notification is signaled onwards
+    // Check that the current notification is not removed
+    QCOMPARE(spy.count(), 0);
+
+    // Check that the other notification is removed from the queue
+    presenter.showNextNotification();
     QCOMPARE(spy.count(), 1);
     QCOMPARE(presenter.notification(), (Notification *)0);
 }
--- tests/ut_notificationpreviewpresenter/ut_notificationpreviewpresenter.h
+++ tests/ut_notificationpreviewpresenter/ut_notificationpreviewpresenter.h
@@ -34,7 +34,7 @@
     void testWindowMasking();
     void testNotificationNotShownIfNoSummaryOrBody_data();
     void testNotificationNotShownIfNoSummaryOrBody();
-    void testUpdateNotificationRemovesNotificationIfNoSummaryOrBody();
+    void testUpdateNotificationRemovesNotificationFromQueueIfNoSummaryOrBody();
 };
 
 #endif
--- tools/notificationtool/.gitignore
+++ tools/notificationtool/.gitignore
@@ -1,2 +0,0 @@
-notificationmanagerproxy.*
-notificationtool

++++++ lipstick.yaml
--- lipstick.yaml
+++ lipstick.yaml
@@ -1,6 +1,6 @@
 Name: lipstick
 Summary: QML toolkit for homescreen creation
-Version: 0.5.0
+Version: 0.5.1
 Release: 1
 Group: System/Libraries
 License: LGPLv2.1



Reply via email to