Merge lp:~aacid/unity8/dash-app-fixes into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 1119
Merged at revision: 1129
Proposed branch: lp:~aacid/unity8/dash-app-fixes
Merge into: lp:unity8
Diff against target: 268 lines (+61/-43)
7 files modified
qml/Components/EdgeDemo.qml (+15/-15)
qml/Dash/Dash.qml (+8/-0)
qml/Dash/DashApplication.qml (+6/-0)
qml/Greeter/Greeter.qml (+1/-1)
qml/Shell.qml (+3/-22)
src/Dash/CMakeLists.txt (+1/-0)
src/Dash/main.cpp (+27/-5)
To merge this branch: bzr merge lp:~aacid/unity8/dash-app-fixes
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+229745@code.launchpad.net

Commit message

Fixes for dash as app

Load i18n catalog
Process command line options
Add the posibility to have a mouse touch adaptor

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
lp:~aacid/unity8/dash-app-fixes updated
1115. By Albert Astals Cid

Build

Revision history for this message
Michał Sawicz (saviq) wrote :

Let's drop the --testability option, we only want to support QT_LOAD_TESTABILITY anyway.

review: Needs Fixing
lp:~aacid/unity8/dash-app-fixes updated
1116. By Albert Astals Cid

Fixme as requested by Saviq

1117. By Albert Astals Cid

drop -testability support

Revision history for this message
Albert Astals Cid (aacid) wrote :

> Let's drop the --testability option, we only want to support
> QT_LOAD_TESTABILITY anyway.

Done.

lp:~aacid/unity8/dash-app-fixes updated
1118. By Albert Astals Cid

Bring the dash background from the shell to the dash

1119. By Albert Astals Cid

Merge lp:~mterry/unity8/dash-app-demo-fixes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes.

 * Did CI run pass? If not, please explain why.
Passed locally.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Components/EdgeDemo.qml'
--- qml/Components/EdgeDemo.qml 2014-07-23 10:16:29 +0000
+++ qml/Components/EdgeDemo.qml 2014-08-06 14:41:59 +0000
@@ -24,13 +24,13 @@
24 property Item greeter24 property Item greeter
25 property Item launcher25 property Item launcher
26 property Item indicators26 property Item indicators
27 property Item underlay27 property Item stages
2828
29 property bool launcherEnabled: true29 property bool launcherEnabled: true
30 property bool dashEnabled: true30 property bool stagesEnabled: true
31 property bool panelEnabled: true31 property bool panelEnabled: true
32 property bool panelContentEnabled: true32 property bool panelContentEnabled: true
33 property bool running: !launcherEnabled || !dashEnabled || !panelEnabled || !panelContentEnabled33 property bool running: !launcherEnabled || !stagesEnabled || !panelEnabled || !panelContentEnabled
3434
35 property bool paused: false35 property bool paused: false
3636
@@ -58,7 +58,7 @@
5858
59 function stopDemo() {59 function stopDemo() {
60 launcherEnabled = true60 launcherEnabled = true
61 dashEnabled = true61 stagesEnabled = true
62 panelEnabled = true62 panelEnabled = true
63 panelContentEnabled = true63 panelContentEnabled = true
64 if (d.rightEdgeDemo) d.rightEdgeDemo.destroy()64 if (d.rightEdgeDemo) d.rightEdgeDemo.destroy()
@@ -74,11 +74,11 @@
74 }74 }
7575
76 launcherEnabled = false;76 launcherEnabled = false;
77 dashEnabled = false;77 stagesEnabled = false;
78 panelEnabled = false;78 panelEnabled = false;
79 panelContentEnabled = false;79 panelContentEnabled = false;
8080
81 // Begin with either greeter or dash, depending on which is visible81 // Begin with either greeter or top, depending on which is visible
82 if (greeter && greeter.shown) {82 if (greeter && greeter.shown) {
83 startRightEdgeDemo()83 startRightEdgeDemo()
84 } else {84 } else {
@@ -138,12 +138,12 @@
138138
139 function startTopEdgeDemo() {139 function startTopEdgeDemo() {
140 demo.panelEnabled = true;140 demo.panelEnabled = true;
141 if (demo.dash && demo.underlay) {141 if (demo.stages) {
142 d.topEdgeDemo = d.overlay.createObject(demo.underlay, {142 d.topEdgeDemo = d.overlay.createObject(demo.stages, {
143 "edge": "top",143 "edge": "top",
144 "title": i18n.tr("Top edge"),144 "title": i18n.tr("Top edge"),
145 "text": i18n.tr("Try swiping from the top edge to access the indicators"),145 "text": i18n.tr("Try swiping from the top edge to access the indicators"),
146 "anchors.fill": demo.underlay,146 "anchors.fill": demo.stages,
147 });147 });
148 }148 }
149 if (d.topEdgeDemo) {149 if (d.topEdgeDemo) {
@@ -192,12 +192,12 @@
192 function startLeftEdgeDemo() {192 function startLeftEdgeDemo() {
193 demo.panelEnabled = false;193 demo.panelEnabled = false;
194 demo.launcherEnabled = true;194 demo.launcherEnabled = true;
195 if (demo.underlay) {195 if (demo.stages) {
196 d.leftEdgeDemo = d.overlay.createObject(demo.underlay, {196 d.leftEdgeDemo = d.overlay.createObject(demo.stages, {
197 "edge": "left",197 "edge": "left",
198 "title": i18n.tr("Left edge"),198 "title": i18n.tr("Left edge"),
199 "text": i18n.tr("Swipe from the left to reveal the launcher for quick access to apps"),199 "text": i18n.tr("Swipe from the left to reveal the launcher for quick access to apps"),
200 "anchors.fill": demo.underlay,200 "anchors.fill": demo.stages,
201 });201 });
202 }202 }
203 if (d.leftEdgeDemo) {203 if (d.leftEdgeDemo) {
@@ -220,12 +220,12 @@
220220
221 function startFinalEdgeDemo() {221 function startFinalEdgeDemo() {
222 demo.launcherEnabled = false;222 demo.launcherEnabled = false;
223 if (demo.underlay) {223 if (demo.stages) {
224 d.finalEdgeDemo = d.overlay.createObject(demo.underlay, {224 d.finalEdgeDemo = d.overlay.createObject(demo.stages, {
225 "edge": "none",225 "edge": "none",
226 "title": i18n.tr("Well done"),226 "title": i18n.tr("Well done"),
227 "text": i18n.tr("You have now mastered the edge gestures and can start using the phone<br><br>Tap on the screen to start"),227 "text": i18n.tr("You have now mastered the edge gestures and can start using the phone<br><br>Tap on the screen to start"),
228 "anchors.fill": demo.underlay,228 "anchors.fill": demo.stages,
229 "showSkip": false,229 "showSkip": false,
230 });230 });
231 }231 }
232232
=== modified file 'qml/Dash/Dash.qml'
--- qml/Dash/Dash.qml 2014-07-29 11:35:10 +0000
+++ qml/Dash/Dash.qml 2014-08-06 14:41:59 +0000
@@ -74,6 +74,14 @@
74 filterRegExp: RegExp("^true$")74 filterRegExp: RegExp("^true$")
75 }75 }
7676
77 Image {
78 anchors.fill: parent
79 source: parent.width > parent.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
80 fillMode: Image.PreserveAspectCrop
81 horizontalAlignment: Image.AlignRight
82 verticalAlignment: Image.AlignTop
83 }
84
77 DashContent {85 DashContent {
78 id: dashContent86 id: dashContent
79 objectName: "dashContent"87 objectName: "dashContent"
8088
=== modified file 'qml/Dash/DashApplication.qml'
--- qml/Dash/DashApplication.qml 2014-07-29 14:28:16 +0000
+++ qml/Dash/DashApplication.qml 2014-08-06 14:41:59 +0000
@@ -23,6 +23,12 @@
2323
24 useDeprecatedToolbar: false24 useDeprecatedToolbar: false
2525
26 Binding {
27 target: i18n
28 property: "domain"
29 value: "unity8"
30 }
31
26 Dash {32 Dash {
27 anchors.fill: parent33 anchors.fill: parent
28 }34 }
2935
=== modified file 'qml/Greeter/Greeter.qml'
--- qml/Greeter/Greeter.qml 2014-07-22 14:46:01 +0000
+++ qml/Greeter/Greeter.qml 2014-08-06 14:41:59 +0000
@@ -70,7 +70,7 @@
70 DraggingArea {70 DraggingArea {
71 id: dragHandle71 id: dragHandle
72 anchors.fill: parent72 anchors.fill: parent
73 enabled: (greeter.narrowMode || !greeter.locked) && greeter.enabled73 enabled: (greeter.narrowMode || !greeter.locked) && greeter.enabled && greeter.shown
74 orientation: Qt.Horizontal74 orientation: Qt.Horizontal
75 propagateComposedEvents: true75 propagateComposedEvents: true
7676
7777
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2014-08-05 12:06:16 +0000
+++ qml/Shell.qml 2014-08-06 14:41:59 +0000
@@ -113,25 +113,6 @@
113 }113 }
114114
115 Item {115 Item {
116 id: underlay
117 objectName: "underlay"
118 anchors.fill: parent
119
120 // Whether the underlay is fully covered by opaque UI elements.
121 property bool fullyCovered: (panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth)
122 || stages.fullyShown || greeterWrapper.fullyShown
123 visible: !fullyCovered
124
125 Image {
126 anchors.fill: underlay
127 source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
128 fillMode: Image.PreserveAspectCrop
129 horizontalAlignment: Image.AlignRight
130 verticalAlignment: Image.AlignTop
131 }
132 }
133
134 Item {
135 id: stages116 id: stages
136 objectName: "stages"117 objectName: "stages"
137 width: parent.width118 width: parent.width
@@ -186,12 +167,12 @@
186 Binding {167 Binding {
187 target: applicationsDisplayLoader.item168 target: applicationsDisplayLoader.item
188 property: "interactive"169 property: "interactive"
189 value: !greeter.shown && !lockscreen.shown && panel.indicators.fullyClosed && launcher.progress == 0170 value: edgeDemo.stagesEnabled && !greeter.shown && !lockscreen.shown && panel.indicators.fullyClosed && launcher.progress == 0
190 }171 }
191 Binding {172 Binding {
192 target: applicationsDisplayLoader.item173 target: applicationsDisplayLoader.item
193 property: "spreadEnabled"174 property: "spreadEnabled"
194 value: greeter.fakeActiveForApp === "" // to support emergency dialer hack175 value: edgeDemo.stagesEnabled && greeter.fakeActiveForApp === "" // to support emergency dialer hack
195 }176 }
196 Binding {177 Binding {
197 target: applicationsDisplayLoader.item178 target: applicationsDisplayLoader.item
@@ -580,7 +561,7 @@
580 greeter: greeter561 greeter: greeter
581 launcher: launcher562 launcher: launcher
582 indicators: panel.indicators563 indicators: panel.indicators
583 underlay: underlay564 stages: stages
584 }565 }
585566
586 Connections {567 Connections {
587568
=== modified file 'src/Dash/CMakeLists.txt'
--- src/Dash/CMakeLists.txt 2014-07-23 06:54:10 +0000
+++ src/Dash/CMakeLists.txt 2014-08-06 14:41:59 +0000
@@ -1,5 +1,6 @@
1set(DASH_SRCS1set(DASH_SRCS
2 main.cpp2 main.cpp
3 ../MouseTouchAdaptor.cpp
3)4)
45
5add_executable(unity8-dash ${DASH_SRCS})6add_executable(unity8-dash ${DASH_SRCS})
67
=== modified file 'src/Dash/main.cpp'
--- src/Dash/main.cpp 2014-07-29 11:35:10 +0000
+++ src/Dash/main.cpp 2014-08-06 14:41:59 +0000
@@ -24,8 +24,10 @@
24#include <QDebug>24#include <QDebug>
25#include <QCommandLineParser>25#include <QCommandLineParser>
26#include <QLibrary>26#include <QLibrary>
27#include <libintl.h>
2728
28#include <paths.h>29#include <paths.h>
30#include "../MouseTouchAdaptor.h"
2931
30int main(int argc, const char *argv[])32int main(int argc, const char *argv[])
31{33{
@@ -35,11 +37,21 @@
35 parser.setApplicationDescription("Description: Unity 8 Shell Dash");37 parser.setApplicationDescription("Description: Unity 8 Shell Dash");
36 parser.addHelpOption();38 parser.addHelpOption();
3739
38 QCommandLineOption testabilityOption("testability",40 QCommandLineOption mousetouchOption("mousetouch",
39 "Load the testability driver (Alternatively export QT_LOAD_TESTABILITY");41 "Allow the mouse to provide touch input");
40 parser.addOption(testabilityOption);42 parser.addOption(mousetouchOption);
4143
42 if (parser.isSet(testabilityOption) || getenv("QT_LOAD_TESTABILITY")) {44 // FIXME Remove once we drop the need of the hint
45 QCommandLineOption desktopFileHintOption("desktop_file_hint",
46 "The desktop_file_hint option for QtMir", "hint_file");
47 parser.addOption(desktopFileHintOption);
48
49 // Treat args with single dashes the same as arguments with two dashes
50 // Ex: -fullscreen == --fullscreen
51 parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
52 parser.process(*application);
53
54 if (getenv("QT_LOAD_TESTABILITY")) {
43 QLibrary testLib(QLatin1String("qttestability"));55 QLibrary testLib(QLatin1String("qttestability"));
44 if (testLib.load()) {56 if (testLib.load()) {
45 typedef void (*TasInitialize)(void);57 typedef void (*TasInitialize)(void);
@@ -54,10 +66,20 @@
54 }66 }
55 }67 }
5668
69 bindtextdomain("unity8", translationDirectory().toUtf8().data());
70
57 QQuickView* view = new QQuickView();71 QQuickView* view = new QQuickView();
58 view->setResizeMode(QQuickView::SizeRootObjectToView);72 view->setResizeMode(QQuickView::SizeRootObjectToView);
59 view->setTitle("Unity Dash");73 view->setTitle("Unity Dash");
6074
75 // You will need this if you want to interact with touch-only components using a mouse
76 // Needed only when manually testing on a desktop.
77 MouseTouchAdaptor *mouseTouchAdaptor = 0;
78 if (parser.isSet(mousetouchOption)) {
79 mouseTouchAdaptor = new MouseTouchAdaptor;
80 application->installNativeEventFilter(mouseTouchAdaptor);
81 }
82
61 QUrl source(::qmlDirectory()+"Dash/DashApplication.qml");83 QUrl source(::qmlDirectory()+"Dash/DashApplication.qml");
62 prependImportPaths(view->engine(), ::overrideImportPaths());84 prependImportPaths(view->engine(), ::overrideImportPaths());
63 appendImportPaths(view->engine(), ::fallbackImportPaths());85 appendImportPaths(view->engine(), ::fallbackImportPaths());

Subscribers

People subscribed via source and target branches