diff --git a/debian/changelog b/debian/changelog index 975d0f66..194aff6c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ system-ui (1.3.2~1) unstable; urgency=low * [UNRELEASED] + * Fixes: NB#296376 - Feature Request: Icon for "Beep"-profile in lock screen -- Vesa Halttunen Fri, 27 Jan 2012 13:38:22 +0200 diff --git a/src/systemui/statusarea/statusindicator.cpp b/src/systemui/statusarea/statusindicator.cpp index 97f8d7d8..9a851249 100644 --- a/src/systemui/statusarea/statusindicator.cpp +++ b/src/systemui/statusarea/statusindicator.cpp @@ -680,6 +680,8 @@ void ProfileStatusIndicator::profileChanged() { if (profile->value().toString() == "silent") { setStyleNameAndUpdate(QString(metaObject()->className()) + "Silent"); + } else if (profile->value().toString() == "meeting") { + setStyleNameAndUpdate(QString(metaObject()->className()) + "Beep"); } else { setStyleNameAndUpdate(metaObject()->className()); } diff --git a/tests/ut_statusindicator/ut_statusindicator.cpp b/tests/ut_statusindicator/ut_statusindicator.cpp index 79ee0bdf..6225a276 100644 --- a/tests/ut_statusindicator/ut_statusindicator.cpp +++ b/tests/ut_statusindicator/ut_statusindicator.cpp @@ -765,15 +765,25 @@ void Ut_StatusIndicator::testTethering() QVERIFY(m_subject->styleName().indexOf("Set") >= 0); } +void Ut_StatusIndicator::testProfile_data() +{ + QTest::addColumn("profileName"); + QTest::addColumn("styleName"); + + QTest::newRow("Default") << QString("default") << QString("ProfileStatusIndicator"); + QTest::newRow("Silent") << QString("silent") << QString("ProfileStatusIndicatorSilent"); + QTest::newRow("Meeting (Beep)") << QString("meeting") << QString("ProfileStatusIndicatorBeep"); +} + void Ut_StatusIndicator::testProfile() { - m_subject = new ProfileStatusIndicator(*testContext); + QFETCH(QString, profileName); + QFETCH(QString, styleName); - testContextItems["Profile.Name"]->setValue(QVariant("silent")); - QVERIFY(m_subject->styleName().indexOf("Silent") >= 0); + m_subject = new ProfileStatusIndicator(*testContext); - testContextItems["Profile.Name"]->setValue(QVariant("default")); - QVERIFY(m_subject->styleName().indexOf("Silent") < 0); + testContextItems["Profile.Name"]->setValue(profileName); + QCOMPARE(m_subject->styleName(), styleName); } void Ut_StatusIndicator::testGPS() diff --git a/tests/ut_statusindicator/ut_statusindicator.h b/tests/ut_statusindicator/ut_statusindicator.h index 1cb1b01c..c79bebe2 100644 --- a/tests/ut_statusindicator/ut_statusindicator.h +++ b/tests/ut_statusindicator/ut_statusindicator.h @@ -72,6 +72,7 @@ private slots: void testCall_data(); void testCall(); void testTethering(); + void testProfile_data(); void testProfile(); void testGPS(); void testTransferStatusIndicatorDBusConnectionCreationInConstructor(); diff --git a/themes/style/statusarea.css b/themes/style/statusarea.css index 791d864c..6ebd077a 100644 --- a/themes/style/statusarea.css +++ b/themes/style/statusarea.css @@ -611,6 +611,14 @@ StatusIndicatorIconStyle#ProfileStatusIndicatorSilent { maximum-size: -1 -1; } +StatusIndicatorIconStyle#ProfileStatusIndicatorBeep { + /* The list of IDs of the images to be shown in the status indicator separated by spaces */ + image-list: "icon-s-status-beep"; + preferred-size: -1 -1; + minimum-size: -1 -1; + maximum-size: -1 -1; +} + /* "Offline" presence, no indicator */ StatusIndicatorIconStyle#PresenceStatusIndicator { /* The list of IDs of the images to be shown in the status indicator separated by spaces */