Tell indicators whether we're in greeter or phone mode according to a compile-time define
commit55298669e4372d20a165c71ffe83171bb345164f
authorMichael Terry <michael.terry@canonical.com>
dateWed 20 Nov 2013, 16:44 (13 years ago)
parent3934179
CMakeLists.txt+2−2
@@ -118,10 +118,10 @@ add_executable(${GREETER_APP}
118118 )
119119
120120set_target_properties(${SHELL_APP} PROPERTIES
121− COMPILE_DEFINITIONS "APP_NAME=\"Unity 8\";QML_FILE=\"Shell.qml\""
121+ COMPILE_DEFINITIONS "APP_NAME=\"Unity 8\";QML_FILE=\"Shell.qml\";INDICATOR_MODE=\"phone\""
122122 )
123123set_target_properties(${GREETER_APP} PROPERTIES
124− COMPILE_DEFINITIONS "APP_NAME=\"Unity 8 Greeter\";QML_FILE=\"GreeterShell.qml\""
124+ COMPILE_DEFINITIONS "APP_NAME=\"Unity 8 Greeter\";QML_FILE=\"GreeterShell.qml\";INDICATOR_MODE=\"phone_greeter\""
125125 )
126126
127127qt5_use_modules(${SHELL_APP} Qml Quick Test)
Greeter/Clock.qml+1−1
@@ -42,7 +42,7 @@ Item {
4242
4343 busName: "com.canonical.indicator.datetime"
4444 actionsObjectPath: "/com/canonical/indicator/datetime"
45− menuObjectPath: clock.active ? "/com/canonical/indicator/datetime/phone" : ""
45+ menuObjectPath: clock.active ? "/com/canonical/indicator/datetime/phone_greeter" : ""
4646
4747 Indicators.RootActionState {
4848 menu: timeModel.model
Panel/Indicators/client/IndicatorsTree.qml+1−1
@@ -30,7 +30,7 @@ Page {
3030 property string busName: unityModel.busName
3131 property string actionsObjectPath
3232 property var menuObjectPaths: undefined
33− readonly property string device: "phone"
33+ readonly property string device: unity8IndicatorMode
3434
3535 property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : ""
3636
main.cpp+1
@@ -128,6 +128,7 @@ int startShell(int argc, const char** argv, void* server)
128128 view->setTitle("Qml Phone Shell");
129129 view->engine()->setBaseUrl(QUrl::fromLocalFile(::shellAppDirectory()));
130130 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
131+ view->rootContext()->setContextProperty("unity8IndicatorMode", INDICATOR_MODE);
131132 if (args.contains(QLatin1String("-frameless"))) {
132133 view->setFlags(Qt::FramelessWindowHint);
133134 }
plugins/Unity/Indicators/qml/IndicatorBase.qml+1−1
@@ -30,7 +30,7 @@ Item {
3030 property string busName
3131 property string actionsObjectPath
3232 property var menuObjectPaths: undefined
33− readonly property string device: "phone"
33+ readonly property string device: unity8IndicatorMode
3434 property string rootMenuType: "com.canonical.indicator.root"
3535
3636 property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : ""