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/7227 Thank You, Islam Amer [This message was auto-generated] --- Request # 7227: Messages from BOSS: State: review at 2012-11-01T09:24:50 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: Project:MTF:UX / lipstick -> CE:UX:MTF / lipstick changes files: -------------- --- lipstick.changes +++ lipstick.changes @@ -0,0 +1,3 @@ +* Thu Nov 01 2012 Vesa Halttunen <[email protected]> - 0.4.6 +- Request the screen to be locked so that MCE handles timeouts and blanking (from Vesa) + old: ---- lipstick-0.4.5.tar.bz2 new: ---- lipstick-0.4.6.tar.bz2 spec files: ----------- --- lipstick.spec +++ lipstick.spec @@ -9,7 +9,7 @@ # << macros Summary: QML toolkit for homescreen creation -Version: 0.4.5 +Version: 0.4.6 Release: 1 Group: System/Libraries License: LGPLv2.1 @@ -27,6 +27,7 @@ BuildRequires: pkgconfig(xdamage) BuildRequires: pkgconfig(xfixes) BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(mce) >= 1.12.2 %description A QML toolkit for homescreen creation other changes: -------------- ++++++ lipstick-0.4.5.tar.bz2 -> lipstick-0.4.6.tar.bz2 --- src/lipsticksettings.cpp +++ src/lipsticksettings.cpp @@ -25,6 +25,7 @@ #include <QDebug> #include <QtSensors/QOrientationSensor> #include <QtSensors/QOrientationReading> +#include <mce/mode-names.h> #include "lipsticksettings.h" #include "homeapplication.h" @@ -32,16 +33,12 @@ #include <X11/Xatom.h> #include <X11/Xlib.h> -static int LOCK_SCREEN_TIMEOUT = 5000; - Q_GLOBAL_STATIC(LipstickSettings, settingsInstance) LipstickSettings::LipstickSettings() : QObject() , _lockscreenVisible(false) { - requestScreenToBeLockedTimer.setSingleShot(true); - connect(&requestScreenToBeLockedTimer, SIGNAL(timeout()), this, SLOT(requestScreenToBeLocked())); } LipstickSettings *LipstickSettings::instance() @@ -69,17 +66,14 @@ view->setWindowTitle("Screen Lock"); layer = 2; - if (!externallyChanged && !requestScreenToBeLockedTimer.isActive()) { - // Lock screen entered from inside the home screen: request screen to be locked in 5 seconds - requestScreenToBeLockedTimer.start(LOCK_SCREEN_TIMEOUT); + if (!externallyChanged) { + // Lock screen entered from inside the home screen: request screen to be locked + QDBusMessage message = QDBusMessage::createMethodCall("com.nokia.mce", "/com/nokia/mce/request", "com.nokia.mce.request", "req_tklock_mode_change"); + message.setArguments(QVariantList() << MCE_TK_LOCKED_DELAY); + QDBusConnection::systemBus().asyncCall(message); } } else { view->setWindowTitle("Lipstick"); - - if (requestScreenToBeLockedTimer.isActive()) { - // Cancel any pending screen locking requests - requestScreenToBeLockedTimer.stop(); - } } // Set the stacking layer @@ -105,10 +99,3 @@ sensor.stop(); return orientation == QtMobility::QOrientationReading::TopUp; } - -void LipstickSettings::requestScreenToBeLocked() -{ - QDBusMessage message = QDBusMessage::createMethodCall("com.nokia.mce", "/com/nokia/mce/request", "com.nokia.mce.request", "req_tklock_mode_change"); - message.setArguments(QVariantList() << "locked"); - QDBusConnection::systemBus().asyncCall(message); -} --- src/lipsticksettings.h +++ src/lipsticksettings.h @@ -20,7 +20,6 @@ #include <QObject> #include <QMetaType> #include <QSize> -#include <QTimer> class LipstickSettings : public QObject { @@ -29,7 +28,6 @@ Q_PROPERTY(QSize screenSize READ screenSize NOTIFY screenSizeChanged) bool _lockscreenVisible; - QTimer requestScreenToBeLockedTimer; public: explicit LipstickSettings(); @@ -44,9 +42,6 @@ signals: void lockscreenVisibleChanged(); void screenSizeChanged(); - -private slots: - void requestScreenToBeLocked(); }; Q_DECLARE_METATYPE(LipstickSettings *) --- src/src.pro +++ src/src.pro @@ -2,7 +2,7 @@ TEMPLATE = lib TARGET = lipstick -VERSION = 0.4.5 +VERSION = 0.4.6 DEFINES += LIPSTICK_BUILD_LIBRARY DEBUG_NOTIFICATIONS @@ -76,7 +76,7 @@ CONFIG += link_pkgconfig mobility qt warn_on depend_includepath qmake_cache target_qt MOBILITY += sensors -PKGCONFIG += xcomposite mlite xdamage x11 xfixes xext +PKGCONFIG += xcomposite mlite xdamage x11 xfixes xext mce packagesExist(contentaction-0.1) { message("Using contentaction to launch applications") --- tests/ut_lipsticksettings/ut_lipsticksettings.cpp +++ tests/ut_lipsticksettings/ut_lipsticksettings.cpp @@ -14,26 +14,13 @@ ****************************************************************************/ #include <QtTest/QtTest> -#include <QTimer> #include <QDBusInterface> #include <QDBusPendingCall> +#include <mce/mode-names.h> #include "ut_lipsticksettings.h" #include "lipsticksettings.h" #include "homeapplication.h" -int qTimerStartMsec = -1; -void QTimer::start(int msec) -{ - qTimerStartMsec = msec; - id = 1; -} - -void QTimer::stop() -{ - qTimerStartMsec = -1; - id = -1; -} - HomeApplication *HomeApplication::instance() { return 0; @@ -74,44 +61,34 @@ { LipstickSettings settings; - // Externally making lock screen visible should not start the timer + // Externally making lock screen visible should not lock the screen settings.setLockscreenVisible(true, true); - QCOMPARE(qTimerStartMsec, -1); + QCOMPARE(qDBusConnectionAsyncCallService.isEmpty(), true); settings.setLockscreenVisible(false, true); // Internally making lock screen visible should start the timer settings.setLockscreenVisible(true, false); - QCOMPARE(qTimerStartMsec, 5000); - - // Externally making lock screen invisible should stop the timer - settings.setLockscreenVisible(false, true); - QCOMPARE(qTimerStartMsec, -1); - - // Internally making lock screen invisible should stop the timer - settings.setLockscreenVisible(true, false); - settings.setLockscreenVisible(false, false); - QCOMPARE(qTimerStartMsec, -1); - - // Making the lock screen visible twice should not start the timer twice - settings.setLockscreenVisible(true, false); - qTimerStartMsec = -1; - settings.setLockscreenVisible(true, false); - QCOMPARE(qTimerStartMsec, -1); -} - -void Ut_LipstickSettings::testRequestScreenToBeLocked() -{ - LipstickSettings settings; - connect(this, SIGNAL(timeout()), &settings, SLOT(requestScreenToBeLocked())); - - emit timeout(); - QCOMPARE(qDBusConnectionAsyncCallService, QString("com.nokia.mce")); QCOMPARE(qDBusConnectionAsyncCallPath, QString("/com/nokia/mce/request")); QCOMPARE(qDBusConnectionAsyncCallInterface, QString("com.nokia.mce.request")); QCOMPARE(qDBusConnectionAsyncCallMember, QString("req_tklock_mode_change")); QCOMPARE(qDBusConnectionAsyncCallArguments.count(), 1); - QCOMPARE(qDBusConnectionAsyncCallArguments.last(), QVariant("locked")); + QCOMPARE(qDBusConnectionAsyncCallArguments.last(), QVariant(MCE_TK_LOCKED_DELAY)); + + // Reset the state + qDBusConnectionAsyncCallService.clear(); + + // Externally making lock screen invisible should not lock the screen + settings.setLockscreenVisible(false, true); + QCOMPARE(qDBusConnectionAsyncCallService.isEmpty(), true); + + // Reset the state + settings.setLockscreenVisible(true, false); + qDBusConnectionAsyncCallService.clear(); + + // Internally making lock screen invisible should not lock the screen + settings.setLockscreenVisible(false, false); + QCOMPARE(qDBusConnectionAsyncCallService.isEmpty(), true); } QTEST_MAIN(Ut_LipstickSettings) --- tests/ut_lipsticksettings/ut_lipsticksettings.h +++ tests/ut_lipsticksettings/ut_lipsticksettings.h @@ -28,7 +28,6 @@ void initTestCase(); void cleanupTestCase(); void testSetLockScreenVisible(); - void testRequestScreenToBeLocked(); }; #endif --- tests/ut_lipsticksettings/ut_lipsticksettings.pro +++ tests/ut_lipsticksettings/ut_lipsticksettings.pro @@ -2,7 +2,7 @@ TARGET = ut_lipsticksettings QT += dbus declarative CONFIG += link_pkgconfig mobility -PKGCONFIG += x11 +PKGCONFIG += x11 mce MOBILITY += sensors # unit test and unit ++++++ lipstick.yaml --- lipstick.yaml +++ lipstick.yaml @@ -1,6 +1,6 @@ Name: lipstick Summary: QML toolkit for homescreen creation -Version: 0.4.5 +Version: 0.4.6 Release: 1 Group: System/Libraries License: LGPLv2.1 @@ -19,6 +19,7 @@ - xdamage - xfixes - xext + - mce >= 1.12.2 Files: - "%{_libdir}/liblipstick.so.*" - "%{_libdir}/qt4/imports/org/nemomobile/lipstick/liblipstickplugin.so"
