Skip to content

Commit

Permalink
Fixes: NB#296376 - Feature Request: Icon for "Beep"-profile in lock s…
Browse files Browse the repository at this point in the history
…creen

Bug: NB#296376 - Feature Request: Icon for "Beep"-profile in lock screen
RevBy: Eetu Lehmusvuo
  • Loading branch information
Vesa Halttunen committed Feb 3, 2012
1 parent 76c0d42 commit e544318
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> Fri, 27 Jan 2012 13:38:22 +0200

Expand Down
2 changes: 2 additions & 0 deletions src/systemui/statusarea/statusindicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
20 changes: 15 additions & 5 deletions tests/ut_statusindicator/ut_statusindicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,15 +765,25 @@ void Ut_StatusIndicator::testTethering()
QVERIFY(m_subject->styleName().indexOf("Set") >= 0);
}

void Ut_StatusIndicator::testProfile_data()
{
QTest::addColumn<QString>("profileName");
QTest::addColumn<QString>("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()
Expand Down
1 change: 1 addition & 0 deletions tests/ut_statusindicator/ut_statusindicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ private slots:
void testCall_data();
void testCall();
void testTethering();
void testProfile_data();
void testProfile();
void testGPS();
void testTransferStatusIndicatorDBusConnectionCreationInConstructor();
Expand Down
8 changes: 8 additions & 0 deletions themes/style/statusarea.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit e544318

Please sign in to comment.