on xenial help sign in
Back out greeter changing profile -- we don't have proper settings support for that yet
d560179Michael Terry
qml/Shell.qml+1−1
@@ -751,7 +751,7 @@ Item {
751
751
752 indicatorsModel: Indicators.IndicatorsModel {
752 indicatorsModel: Indicators.IndicatorsModel {
753 // TODO: This should be sourced by device type (e.g. "desktop", "tablet", "phone"...)
753 // TODO: This should be sourced by device type (e.g. "desktop", "tablet", "phone"...)
754− profile: shell.locked ? (indicatorProfile + "_greeter") : indicatorProfile
754+ profile: indicatorProfile
755 Component.onCompleted: load()
755 Component.onCompleted: load()
756 }
756 }
757 }
757 }
tests/qmltests/tst_Shell.qml+24−7
@@ -25,6 +25,7 @@ import Ubuntu.Components 1.1
25import Ubuntu.Telephony 0.1 as Telephony
25import Ubuntu.Telephony 0.1 as Telephony
26import Unity.Application 0.1
26import Unity.Application 0.1
27import Unity.Connectivity 0.1
27import Unity.Connectivity 0.1
28+import Unity.Indicators 0.1
28import Unity.Notifications 1.0
29import Unity.Notifications 1.0
29import Unity.Test 0.1 as UT
30import Unity.Test 0.1 as UT
30import Powerd 0.1
31import Powerd 0.1
@@ -169,6 +170,7 @@ Item {
169
170
170 function init() {
171 function init() {
171 tryCompare(shell, "enabled", true); // enabled by greeter when ready
172 tryCompare(shell, "enabled", true); // enabled by greeter when ready
173+ shell.indicatorProfile = "phone";
172
174
173 swipeAwayGreeter();
175 swipeAwayGreeter();
174
176
@@ -547,15 +549,30 @@ Item {
547 }
549 }
548
550
549 function test_greeterDoesNotChangeIndicatorProfile() {
551 function test_greeterDoesNotChangeIndicatorProfile() {
550− var visibleIndicators = findChild(shell, "visibleIndicators");
552+ var panel = findChild(shell, "panel");
551− tryCompare(visibleIndicators, "profile", shell.indicatorProfile);
553+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
552
554
553− var greeter = findChild(shell, "greeter");
555+ LightDM.Greeter.showGreeter();
554− greeter.show();
556+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
557+
558+ LightDM.Greeter.hideGreeter();
555− tryCompare(visibleIndicators, "profile", shell.indicatorProfile);
559+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
560+ }
556
561
557− greeter.hide();
562+ function test_shellProfileChangesReachIndicators() {
563+ var panel = findChild(shell, "panel");
564+
565+ shell.indicatorProfile = "test1";
566+ for (var i = 0; i < panel.indicators.indicatorsModel.count; ++i) {
567+ var properties = panel.indicators.indicatorsModel.data(i, IndicatorsModelRole.IndicatorProperties);
568+ verify(properties["menuObjectPath"].substr(-5), "test1");
569+ }
570+
558− tryCompare(visibleIndicators, "profile", shell.indicatorProfile);
571+ shell.indicatorProfile = "test2";
572+ for (var i = 0; i < panel.indicators.indicatorsModel.count; ++i) {
573+ var properties = panel.indicators.indicatorsModel.data(i, IndicatorsModelRole.IndicatorProperties);
574+ verify(properties["menuObjectPath"].substr(-5), "test2");
575+ }
559 }
576 }
560
577
561 function test_focusRequestedHidesGreeter() {
578 function test_focusRequestedHidesGreeter() {
tests/qmltests/tst_ShellWithPin.qml+7−5
@@ -233,17 +233,19 @@ Item {
233 }
233 }
234
234
235 function test_greeterChangesIndicatorProfile() {
235 function test_greeterChangesIndicatorProfile() {
236+ skip("Not supported yet, waiting on design for new settings panel");
237+
236− var visibleIndicators = findChild(shell, "visibleIndicators");
238+ var panel = findChild(shell, "panel");
237− tryCompare(visibleIndicators, "profile", shell.indicatorProfile + "_greeter");
239+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile + "_greeter");
238
240
239 LightDM.Greeter.hideGreeter();
241 LightDM.Greeter.hideGreeter();
240− tryCompare(visibleIndicators, "profile", shell.indicatorProfile);
242+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
241
243
242 LightDM.Greeter.showGreeter();
244 LightDM.Greeter.showGreeter();
243− tryCompare(visibleIndicators, "profile", shell.indicatorProfile + "_greeter");
245+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile + "_greeter");
244
246
245 LightDM.Greeter.hideGreeter();
247 LightDM.Greeter.hideGreeter();
246− tryCompare(visibleIndicators, "profile", shell.indicatorProfile);
248+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
247 }
249 }
248
250
249 function test_login() {
251 function test_login() {