on xenial help sign in
review comments
6d13c4dNick Dedekind
tests/mocks/Utils/plugin.cpp+12−11
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2012 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -20,21 +20,22 @@
20#include <QQmlContext>
20#include <QQmlContext>
21#include <QtQuick/QQuickWindow>
21#include <QtQuick/QQuickWindow>
22#include <QDebug>
22#include <QDebug>
23−// self
24−#include "plugin.h"
25
23
26// local
24// local
27−#include "inputwatcher.h"
25+#include "plugin.h"
28−#include "qlimitproxymodelqml.h"
29−#include "unitysortfilterproxymodelqml.h"
30−#include "relativetimeformatter.h"
31−#include "timeformatter.h"
32−#include "unitymenumodelpaths.h"
33−#include "windowkeysfilter.h"
34−#include "easingcurve.h"
35#include "windowstatestorage.h"
26#include "windowstatestorage.h"
36#include "constants.h"
27#include "constants.h"
37
28
29+// plugin
30+#include <inputwatcher.h>
31+#include <qlimitproxymodelqml.h>
32+#include <unitysortfilterproxymodelqml.h>
33+#include <relativetimeformatter.h>
34+#include <timeformatter.h>
35+#include <unitymenumodelpaths.h>
36+#include <windowkeysfilter.h>
37+#include <easingcurve.h>
38+
38static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
39static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
39{
40{
40 Q_UNUSED(engine)
41 Q_UNUSED(engine)
tests/mocks/Utils/plugin.h+1−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2012 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
tests/qmltests/Stages/tst_DesktopStage.qml+1−4
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013,2014 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -95,9 +95,6 @@ Rectangle {
95
95
96 property Item desktopStage: desktopStageLoader.status === Loader.Ready ? desktopStageLoader.item : null
96 property Item desktopStage: desktopStageLoader.status === Loader.Ready ? desktopStageLoader.item : null
97
97
98− function init() {
99− }
100−
101 function cleanup() {
98 function cleanup() {
102 desktopStageLoader.itemDestroyed = false;
99 desktopStageLoader.itemDestroyed = false;
103 desktopStageLoader.active = false;
100 desktopStageLoader.active = false;
tests/qmltests/tst_Shell.qml+51−48
@@ -137,62 +137,66 @@ Rectangle {
137 }
137 }
138 }
138 }
139
139
140− Rectangle {
140+ Flickable {
141 id: controls
141 id: controls
142− color: "darkgrey"
142+ contentHeight: controlRect.height
143− width: units.gu(30)
143+
144 anchors.top: root.top
144 anchors.top: root.top
145 anchors.bottom: root.bottom
145 anchors.bottom: root.bottom
146 anchors.right: root.right
146 anchors.right: root.right
147+ width: units.gu(30)
148+
149+ Rectangle {
150+ id: controlRect
151+ anchors { left: parent.left; right: parent.right }
152+ color: "darkgrey"
153+ height: childrenRect.height + units.gu(2)
154+
155+ Column {
156+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
157+ spacing: units.gu(1)
158+
159+ Button {
160+ text: "Show Greeter"
161+ activeFocusOnPress: false
162+ onClicked: {
163+ if (shellLoader.status !== Loader.Ready)
164+ return;
147
165
148− Column {
149− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
150− spacing: units.gu(1)
151− Button {
152− text: "Show Greeter"
153− activeFocusOnPress: false
154− onClicked: {
155− if (shellLoader.status !== Loader.Ready)
156− return;
157−
158− var greeter = testCase.findChild(shellLoader.item, "greeter");
166+ var greeter = testCase.findChild(shellLoader.item, "greeter");
159− if (!greeter.shown) {
167+ if (!greeter.shown) {
160− LightDM.Greeter.showGreeter();
168+ LightDM.Greeter.showGreeter();
169+ }
161 }
170 }
162 }
171 }
163− }
164− ListItem.ItemSelector {
172+ ListItem.ItemSelector {
165− anchors { left: parent.left; right: parent.right }
173+ anchors { left: parent.left; right: parent.right }
166− activeFocusOnPress: false
174+ activeFocusOnPress: false
167− text: "LightDM mock mode"
175+ text: "LightDM mock mode"
168− model: ["single", "single-passphrase", "single-pin", "full"]
176+ model: ["single", "single-passphrase", "single-pin", "full"]
169− onSelectedIndexChanged: {
177+ onSelectedIndexChanged: {
170− shellLoader.active = false;
178+ shellLoader.active = false;
171− LightDM.Greeter.mockMode = model[selectedIndex];
179+ LightDM.Greeter.mockMode = model[selectedIndex];
172− LightDM.Users.mockMode = model[selectedIndex];
180+ LightDM.Users.mockMode = model[selectedIndex];
173− shellLoader.active = true;
181+ shellLoader.active = true;
182+ }
174 }
183 }
175− }
176− ListItem.ItemSelector {
184+ ListItem.ItemSelector {
177− anchors { left: parent.left; right: parent.right }
185+ anchors { left: parent.left; right: parent.right }
178− activeFocusOnPress: false
186+ activeFocusOnPress: false
179− text: "Size"
187+ text: "Size"
180− model: ["phone", "tablet", "desktop"]
188+ model: ["phone", "tablet", "desktop"]
181− onSelectedIndexChanged: {
189+ onSelectedIndexChanged: {
182− shellLoader.active = false;
190+ shellLoader.active = false;
183− shellLoader.state = model[selectedIndex];
191+ shellLoader.state = model[selectedIndex];
184− shellLoader.active = true;
192+ shellLoader.active = true;
193+ }
194+ }
195+ MouseTouchEmulationCheckbox {
196+ id: mouseEmulation
197+ checked: true
198+ color: "white"
185 }
199 }
186− }
187− MouseTouchEmulationCheckbox {
188− id: mouseEmulation
189− checked: true
190− color: "white"
191− }
192−
193− Column {
194− anchors { left: parent.left; right: parent.right }
195− spacing: units.gu(1)
196
200
197 Label { text: "Applications"; font.bold: true }
201 Label { text: "Applications"; font.bold: true }
198
202
@@ -281,7 +285,6 @@ Rectangle {
281 }
285 }
282
286
283 function cleanup() {
287 function cleanup() {
284− mouseEmulation.checked = true;
285 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
288 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
286 tearDown();
289 tearDown();
287 }
290 }