on xenial help sign in
Tell indicators whether we're in greeter or phone mode according to a compile-time define
5529866Michael Terry
CMakeLists.txt+2−2
@@ -118,10 +118,10 @@ add_executable(${GREETER_APP}
118 )
118 )
119
119
120set_target_properties(${SHELL_APP} PROPERTIES
120set_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\""
122 )
122 )
123set_target_properties(${GREETER_APP} PROPERTIES
123set_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\""
125 )
125 )
126
126
127qt5_use_modules(${SHELL_APP} Qml Quick Test)
127qt5_use_modules(${SHELL_APP} Qml Quick Test)
Greeter/Clock.qml+1−1
@@ -42,7 +42,7 @@ Item {
42
42
43 busName: "com.canonical.indicator.datetime"
43 busName: "com.canonical.indicator.datetime"
44 actionsObjectPath: "/com/canonical/indicator/datetime"
44 actionsObjectPath: "/com/canonical/indicator/datetime"
45− menuObjectPath: clock.active ? "/com/canonical/indicator/datetime/phone" : ""
45+ menuObjectPath: clock.active ? "/com/canonical/indicator/datetime/phone_greeter" : ""
46
46
47 Indicators.RootActionState {
47 Indicators.RootActionState {
48 menu: timeModel.model
48 menu: timeModel.model
Panel/Indicators/client/IndicatorsTree.qml+1−1
@@ -30,7 +30,7 @@ Page {
30 property string busName: unityModel.busName
30 property string busName: unityModel.busName
31 property string actionsObjectPath
31 property string actionsObjectPath
32 property var menuObjectPaths: undefined
32 property var menuObjectPaths: undefined
33− readonly property string device: "phone"
33+ readonly property string device: unity8IndicatorMode
34
34
35 property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : ""
35 property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : ""
36
36
main.cpp+1
@@ -128,6 +128,7 @@ int startShell(int argc, const char** argv, void* server)
128 view->setTitle("Qml Phone Shell");
128 view->setTitle("Qml Phone Shell");
129 view->engine()->setBaseUrl(QUrl::fromLocalFile(::shellAppDirectory()));
129 view->engine()->setBaseUrl(QUrl::fromLocalFile(::shellAppDirectory()));
130 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
130 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
131+ view->rootContext()->setContextProperty("unity8IndicatorMode", INDICATOR_MODE);
131 if (args.contains(QLatin1String("-frameless"))) {
132 if (args.contains(QLatin1String("-frameless"))) {
132 view->setFlags(Qt::FramelessWindowHint);
133 view->setFlags(Qt::FramelessWindowHint);
133 }
134 }
plugins/Unity/Indicators/qml/IndicatorBase.qml+1−1
@@ -30,7 +30,7 @@ Item {
30 property string busName
30 property string busName
31 property string actionsObjectPath
31 property string actionsObjectPath
32 property var menuObjectPaths: undefined
32 property var menuObjectPaths: undefined
33− readonly property string device: "phone"
33+ readonly property string device: unity8IndicatorMode
34 property string rootMenuType: "com.canonical.indicator.root"
34 property string rootMenuType: "com.canonical.indicator.root"
35
35
36 property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : ""
36 property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : ""