on xenial help sign in
Merge trunk
79c9074Daniel d'Andrada
debian/changelog+41
@@ -4,6 +4,47 @@ unity8 (8.10-0ubuntu1) UNRELEASED; urgency=medium
4
4
5 -- Michał Sawicz <michal.sawicz@canonical.com> Wed, 15 Apr 2015 14:47:17 +0200
5 -- Michał Sawicz <michal.sawicz@canonical.com> Wed, 15 Apr 2015 14:47:17 +0200
6
6
7+unity8 (8.02+15.10.20150518.1-0ubuntu1) wily; urgency=medium
8+
9+ [ Albert Astals Cid ]
10+ * Add overrides to override functions
11+ * Implement "rating-edit" preview widget (LP: #1318144)
12+ * Make the DashContent::test_mainNavigation test more stable (LP:
13+ #1450809)
14+ * Use art height as implicitHeight when the header is overlayed and
15+ there's no summary
16+
17+ [ CI Train Bot ]
18+ * New rebuild forced.
19+ * Resync trunk.
20+
21+ [ Daniel d'Andrada ]
22+ * Introducing FloatingFlickable
23+ * Make Ubuntu.Gestures components install TouchRegistry by themselves
24+
25+ [ Michael Terry ]
26+ * Fix a possible crash in our PAM threading code. (LP: #1425362) (LP:
27+ #1425362)
28+ * Fix the lockscreen becoming unresponsive after testing an app on the
29+ device from QtCreator. (LP: #1435364)
30+
31+ [ Nick Dedekind ]
32+ * Fixed desktop stage app focus.
33+ * Fixed issue in laggy indicator autpilot tests (LP: #1446846)
34+
35+ -- CI Train Bot <ci-train-bot@canonical.com> Mon, 18 May 2015 23:04:39 +0000
36+
37+unity8 (8.02+15.04.20150511-0ubuntu1) vivid; urgency=medium
38+
39+ [ Albert Astals Cid ]
40+ * Workarounds for concierge mode.
41+
42+ [ CI Train Bot ]
43+ * New rebuild forced.
44+ * Resync trunk.
45+
46+ -- CI Train Bot <ci-train-bot@canonical.com> Mon, 11 May 2015 08:29:58 +0000
47+
7unity8 (8.02+15.04.20150505-0ubuntu1) vivid; urgency=medium
48unity8 (8.02+15.04.20150505-0ubuntu1) vivid; urgency=medium
8
49
9 [ Albert Astals Cid ]
50 [ Albert Astals Cid ]
libs/UbuntuGestures/CandidateInactivityTimer.cpp+7−2
@@ -19,12 +19,12 @@
19namespace UbuntuGestures {
19namespace UbuntuGestures {
20
20
21CandidateInactivityTimer::CandidateInactivityTimer(int touchId, QQuickItem *candidate,
21CandidateInactivityTimer::CandidateInactivityTimer(int touchId, QQuickItem *candidate,
22− AbstractTimerFactory &timerFactory, QObject *parent)
22+ AbstractTimer *timer, QObject *parent)
23 : QObject(parent)
23 : QObject(parent)
24+ , m_timer(timer)
24 , m_touchId(touchId)
25 , m_touchId(touchId)
25 , m_candidate(candidate)
26 , m_candidate(candidate)
26{
27{
27− m_timer = timerFactory.createTimer(this);
28 connect(m_timer, &AbstractTimer::timeout,
28 connect(m_timer, &AbstractTimer::timeout,
29 this, &CandidateInactivityTimer::onTimeout);
29 this, &CandidateInactivityTimer::onTimeout);
30 m_timer->setInterval(durationMs);
30 m_timer->setInterval(durationMs);
@@ -32,6 +32,11 @@ CandidateInactivityTimer::CandidateInactivityTimer(int touchId, QQuickItem *cand
32 m_timer->start();
32 m_timer->start();
33}
33}
34
34
35+CandidateInactivityTimer::~CandidateInactivityTimer()
36+{
37+ delete m_timer;
38+}
39+
35void CandidateInactivityTimer::onTimeout()
40void CandidateInactivityTimer::onTimeout()
36{
41{
37 qWarning("[TouchRegistry] Candidate for touch %d defaulted!", m_touchId);
42 qWarning("[TouchRegistry] Candidate for touch %d defaulted!", m_touchId);
libs/UbuntuGestures/CandidateInactivityTimer.h+3−1
@@ -29,9 +29,11 @@ class UBUNTUGESTURES_EXPORT CandidateInactivityTimer : public QObject {
29 Q_OBJECT
29 Q_OBJECT
30public:
30public:
31 CandidateInactivityTimer(int touchId, QQuickItem *candidate,
31 CandidateInactivityTimer(int touchId, QQuickItem *candidate,
32− AbstractTimerFactory &timerFactory,
32+ AbstractTimer *timer,
33 QObject *parent = nullptr);
33 QObject *parent = nullptr);
34
34
35+ virtual ~CandidateInactivityTimer();
36+
35 const int durationMs = 1000;
37 const int durationMs = 1000;
36
38
37Q_SIGNALS:
39Q_SIGNALS:
libs/UbuntuGestures/Timer.cpp−10
@@ -115,16 +115,6 @@ FakeTimerFactory::FakeTimerFactory()
115 m_timeSource.reset(new FakeTimeSource);
115 m_timeSource.reset(new FakeTimeSource);
116}
116}
117
117
118−FakeTimerFactory::~FakeTimerFactory()
119−{
120− for (int i = 0; i < timers.count(); ++i) {
121− FakeTimer *timer = timers[i].data();
122− if (timer) {
123− delete timer;
124− }
125− }
126−}
127−
128void FakeTimerFactory::updateTime(qint64 targetTime)
118void FakeTimerFactory::updateTime(qint64 targetTime)
129{
119{
130 qint64 minTimeoutTime = targetTime;
120 qint64 minTimeoutTime = targetTime;
libs/UbuntuGestures/Timer.h+1−1
@@ -101,7 +101,7 @@ class UBUNTUGESTURES_EXPORT FakeTimerFactory : public AbstractTimerFactory
101{
101{
102public:
102public:
103 FakeTimerFactory();
103 FakeTimerFactory();
104− virtual ~FakeTimerFactory();
104+ virtual ~FakeTimerFactory() {}
105
105
106 void updateTime(qint64 msecsSinceReference);
106 void updateTime(qint64 msecsSinceReference);
107 QSharedPointer<TimeSource> timeSource() { return m_timeSource; }
107 QSharedPointer<TimeSource> timeSource() { return m_timeSource; }
libs/UbuntuGestures/TouchRegistry.cpp+16−12
@@ -41,20 +41,10 @@ using namespace UbuntuGestures;
41TouchRegistry *TouchRegistry::m_instance = nullptr;
41TouchRegistry *TouchRegistry::m_instance = nullptr;
42
42
43TouchRegistry::TouchRegistry(QObject *parent)
43TouchRegistry::TouchRegistry(QObject *parent)
44− : TouchRegistry(parent, new TimerFactory)
45−{
46−}
47−
48−TouchRegistry::TouchRegistry(QObject *parent, AbstractTimerFactory *timerFactory)
49 : QObject(parent)
44 : QObject(parent)
50 , m_inDispatchLoop(false)
45 , m_inDispatchLoop(false)
51− , m_timerFactory(timerFactory)
46+ , m_timerFactory(new TimerFactory)
52{
47{
53− if (m_instance == nullptr) {
54− m_instance = this;
55− } else {
56− qFatal("Cannot have more than one instance of TouchRegistry. It must be a singleton.");
57− }
58}
48}
59
49
60TouchRegistry::~TouchRegistry()
50TouchRegistry::~TouchRegistry()
@@ -64,6 +54,20 @@ TouchRegistry::~TouchRegistry()
64 delete m_timerFactory;
54 delete m_timerFactory;
65}
55}
66
56
57+TouchRegistry *TouchRegistry::instance()
58+{
59+ if (m_instance == nullptr) {
60+ m_instance = new TouchRegistry;
61+ }
62+ return m_instance;
63+}
64+
65+void TouchRegistry::setTimerFactory(AbstractTimerFactory *timerFactory)
66+{
67+ delete m_timerFactory;
68+ m_timerFactory = timerFactory;
69+}
70+
67void TouchRegistry::update(const QTouchEvent *event)
71void TouchRegistry::update(const QTouchEvent *event)
68{
72{
69 #if TOUCHREGISTRY_DEBUG
73 #if TOUCHREGISTRY_DEBUG
@@ -261,7 +265,7 @@ void TouchRegistry::addCandidateOwnerForTouch(int id, QQuickItem *candidate)
261 candidateInfo.state = CandidateInfo::Undecided;
265 candidateInfo.state = CandidateInfo::Undecided;
262 candidateInfo.item = candidate;
266 candidateInfo.item = candidate;
263 candidateInfo.inactivityTimer = new CandidateInactivityTimer(id, candidate,
267 candidateInfo.inactivityTimer = new CandidateInactivityTimer(id, candidate,
264− *m_timerFactory,
268+ m_timerFactory->createTimer(),
265 this);
269 this);
266 connect(candidateInfo.inactivityTimer, &CandidateInactivityTimer::candidateDefaulted,
270 connect(candidateInfo.inactivityTimer, &CandidateInactivityTimer::candidateDefaulted,
267 this, &TouchRegistry::rejectCandidateOwnerForTouch);
271 this, &TouchRegistry::rejectCandidateOwnerForTouch);
libs/UbuntuGestures/TouchRegistry.h+8−6
@@ -25,6 +25,7 @@
25
25
26#include "UbuntuGesturesGlobal.h"
26#include "UbuntuGesturesGlobal.h"
27#include "CandidateInactivityTimer.h"
27#include "CandidateInactivityTimer.h"
28+#include "Timer.h"
28#include "Pool.h"
29#include "Pool.h"
29
30
30namespace UbuntuGestures {
31namespace UbuntuGestures {
@@ -93,15 +94,10 @@ class UBUNTUGESTURES_EXPORT TouchRegistry : public QObject
93{
94{
94 Q_OBJECT
95 Q_OBJECT
95public:
96public:
96− TouchRegistry(QObject *parent = nullptr);
97− // Useful for tests, where you should feed a fake timer
98− TouchRegistry(QObject *parent, UbuntuGestures::AbstractTimerFactory *timerFactory);
99−
100 virtual ~TouchRegistry();
97 virtual ~TouchRegistry();
101
98
102 // Returns a pointer to the application's TouchRegistry instance.
99 // Returns a pointer to the application's TouchRegistry instance.
103− // If no instance has been allocated, null is returned.
104− static TouchRegistry *instance() { return m_instance; }
100+ static TouchRegistry *instance();
105
101
106 void update(const QTouchEvent *event);
102 void update(const QTouchEvent *event);
107
103
@@ -128,10 +124,16 @@ public:
128 // but would nonetheless like to be kept up-to-date on its state.
124 // but would nonetheless like to be kept up-to-date on its state.
129 void addTouchWatcher(int touchId, QQuickItem *watcherItem);
125 void addTouchWatcher(int touchId, QQuickItem *watcherItem);
130
126
127+ // Useful for tests, where you should use fake timers
128+ void setTimerFactory(UbuntuGestures::AbstractTimerFactory *timerFactory);
129+
131private Q_SLOTS:
130private Q_SLOTS:
132 void rejectCandidateOwnerForTouch(int id, QQuickItem *candidate);
131 void rejectCandidateOwnerForTouch(int id, QQuickItem *candidate);
133
132
134private:
133private:
134+ // Only instance() can cronstruct one
135+ TouchRegistry(QObject *parent = nullptr);
136+
135 class CandidateInfo {
137 class CandidateInfo {
136 public:
138 public:
137 enum {
139 enum {
plugins/AccountsService/plugin.h+1−1
@@ -28,7 +28,7 @@ class AccountsServicePlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32};
32};
33
33
34#endif
34#endif
plugins/Dash/CardCreator.js+20−5
@@ -64,11 +64,26 @@ var kArtShapeHolderCode = 'Item { \n\
64 active: cardData && cardData["art"] || false; \n\
64 active: cardData && cardData["art"] || false; \n\
65 asynchronous: root.asynchronous; \n\
65 asynchronous: root.asynchronous; \n\
66 visible: status == Loader.Ready; \n\
66 visible: status == Loader.Ready; \n\
67− sourceComponent: UbuntuShape { \n\
67+ sourceComponent: Item { \n\
68 id: artShape; \n\
68 id: artShape; \n\
69 objectName: "artShape"; \n\
69 objectName: "artShape"; \n\
70− radius: "medium"; \n\
70+ property bool doShapeItem: components["art"]["conciergeMode"] !== true; \n\
71 visible: image.status == Image.Ready; \n\
71 visible: image.status == Image.Ready; \n\
72+ readonly property alias image: artImage.image; \n\
73+ ShaderEffectSource { \n\
74+ id: artShapeSource; \n\
75+ sourceItem: artImage; \n\
76+ anchors.centerIn: parent; \n\
77+ width: 1; \n\
78+ height: 1; \n\
79+ hideSource: doShapeItem; \n\
80+ } \n\
81+ Shape { \n\
82+ image: artShapeSource; \n\
83+ anchors.fill: parent; \n\
84+ visible: doShapeItem; \n\
85+ radius: "medium"; \n\
86+ } \n\
72 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
87 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
73 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
88 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
74 Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } \n\
89 Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } \n\
@@ -87,11 +102,9 @@ var kArtShapeHolderCode = 'Item { \n\
87 objectName: "artImage"; \n\
102 objectName: "artImage"; \n\
88 source: cardData && cardData["art"] || ""; \n\
103 source: cardData && cardData["art"] || ""; \n\
89 asynchronous: root.asynchronous; \n\
104 asynchronous: root.asynchronous; \n\
90− visible: false; \n\
91 width: %2; \n\
105 width: %2; \n\
92 height: %3; \n\
106 height: %3; \n\
93 } \n\
107 } \n\
94− image: artImage.image; \n\
95 } \n\
108 } \n\
96 } \n\
109 } \n\
97 }\n';
110 }\n';
@@ -322,7 +335,7 @@ function cardString(template, components) {
322
335
323 var hasArt = components["art"] && components["art"]["field"] || false;
336 var hasArt = components["art"] && components["art"]["field"] || false;
324 var hasSummary = components["summary"] || false;
337 var hasSummary = components["summary"] || false;
325− var artAndSummary = hasArt && hasSummary;
338+ var artAndSummary = hasArt && hasSummary && components["art"]["conciergeMode"] !== true;
326 var isHorizontal = template["card-layout"] === "horizontal";
339 var isHorizontal = template["card-layout"] === "horizontal";
327 var hasBackground = (!isHorizontal && (template["card-background"] || components["background"] || artAndSummary)) ||
340 var hasBackground = (!isHorizontal && (template["card-background"] || components["background"] || artAndSummary)) ||
328 (hasSummary && (template["card-background"] || components["background"]));
341 (hasSummary && (template["card-background"] || components["background"]));
@@ -631,6 +644,8 @@ function cardString(template, components) {
631 var implicitHeight = 'implicitHeight: ';
644 var implicitHeight = 'implicitHeight: ';
632 if (hasSummary) {
645 if (hasSummary) {
633 implicitHeight += 'summary.y + summary.height + units.gu(1);\n';
646 implicitHeight += 'summary.y + summary.height + units.gu(1);\n';
647+ } else if (headerAsOverlay) {
648+ implicitHeight += 'artShapeHolder.height;\n';
634 } else if (hasHeaderRow) {
649 } else if (hasHeaderRow) {
635 implicitHeight += 'row.y + row.height + units.gu(1);\n';
650 implicitHeight += 'row.y + row.height + units.gu(1);\n';
636 } else if (hasMascot) {
651 } else if (hasMascot) {
plugins/Dash/plugin.h+1−1
@@ -27,7 +27,7 @@ class DashPlugin : public QQmlExtensionPlugin
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28
28
29public:
29public:
30− void registerTypes(const char *uri);
30+ void registerTypes(const char *uri) override;
31};
31};
32
32
33#endif
33#endif
plugins/Greeter/Unity/Launcher/launchermodelas.h+9−9
@@ -37,19 +37,19 @@ public:
37 LauncherModel(QObject *parent = 0);
37 LauncherModel(QObject *parent = 0);
38 ~LauncherModel();
38 ~LauncherModel();
39
39
40− int rowCount(const QModelIndex &parent = QModelIndex()) const;
40+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
41
41
42− QVariant data(const QModelIndex &index, int role) const;
42+ QVariant data(const QModelIndex &index, int role) const override;
43
43
44− Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const;
44+ Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
45− Q_INVOKABLE void move(int oldIndex, int newIndex);
45+ Q_INVOKABLE void move(int oldIndex, int newIndex) override;
46− Q_INVOKABLE void pin(const QString &appId, int index = -1);
46+ Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
47− Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
47+ Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
48− Q_INVOKABLE void setUser(const QString &username);
48+ Q_INVOKABLE void setUser(const QString &username) override;
49 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
49 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
50
50
51− unity::shell::application::ApplicationManagerInterface* applicationManager() const;
51+ unity::shell::application::ApplicationManagerInterface* applicationManager() const override;
52− void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager);
52+ void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager) override;
53
53
54 bool onlyPinned() const override;
54 bool onlyPinned() const override;
55 void setOnlyPinned(bool onlyPinned) override;
55 void setOnlyPinned(bool onlyPinned) override;
plugins/Greeter/Unity/Launcher/plugin.h+1−1
@@ -26,7 +26,7 @@ class UnityLauncherPlugin : public QQmlExtensionPlugin
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27
27
28public:
28public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
30};
30};
31
31
32#endif
32#endif
plugins/Greeter/Unity/Launcher/quicklistmodel.h+2−2
@@ -45,8 +45,8 @@ public:
45
45
46 QuickListEntry get(int index) const;
46 QuickListEntry get(int index) const;
47
47
48− int rowCount(const QModelIndex &parent = QModelIndex()) const;
48+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
49− QVariant data(const QModelIndex &index, int role) const;
49+ QVariant data(const QModelIndex &index, int role) const override;
50
50
51private:
51private:
52 QList<QuickListEntry> m_list;
52 QList<QuickListEntry> m_list;
plugins/LightDM/UsersModel.cpp+1−1
@@ -32,7 +32,7 @@ class MangleModel : public QSortFilterProxyModel
32public:
32public:
33 explicit MangleModel(QObject* parent=0);
33 explicit MangleModel(QObject* parent=0);
34
34
35− virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
35+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
36};
36};
37
37
38MangleModel::MangleModel(QObject* parent)
38MangleModel::MangleModel(QObject* parent)
plugins/LightDM/liblightdm/GreeterPrivate.cpp+29−5
@@ -56,7 +56,8 @@ public:
56 this, SLOT(handleMessage(pam_handle *, QString, QLightDM::Greeter::MessageType)));
56 this, SLOT(handleMessage(pam_handle *, QString, QLightDM::Greeter::MessageType)));
57 // This next connect is how we pass ResponseFutures between threads
57 // This next connect is how we pass ResponseFutures between threads
58 connect(this, SIGNAL(showPrompt(pam_handle *, QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)),
58 connect(this, SIGNAL(showPrompt(pam_handle *, QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)),
59− this, SLOT(handlePrompt(pam_handle *, QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)));
59+ this, SLOT(handlePrompt(pam_handle *, QString, QLightDM::Greeter::PromptType, QLightDM::GreeterImpl::ResponseFuture)),
60+ Qt::BlockingQueuedConnection);
60 }
61 }
61
62
62 ~GreeterImpl()
63 ~GreeterImpl()
@@ -68,6 +69,13 @@ public:
68 {
69 {
69 // Clear out any existing PAM interactions first
70 // Clear out any existing PAM interactions first
70 cancelPam();
71 cancelPam();
72+ if (pamHandle != nullptr) {
73+ // While we were cancelling pam above, we processed Qt events.
74+ // Which may have allowed someone to call start() on us again.
75+ // In which case, we'll bail on our current start() call.
76+ // This isn't racy because it's all in the same thread.
77+ return;
78+ }
71
79
72 AppData *appData = new AppData();
80 AppData *appData = new AppData();
73 appData->impl = this;
81 appData->impl = this;
@@ -79,7 +87,7 @@ public:
79
87
80 if (pam_start("lightdm", username.toUtf8(), &conversation, &pamHandle) == PAM_SUCCESS) {
88 if (pam_start("lightdm", username.toUtf8(), &conversation, &pamHandle) == PAM_SUCCESS) {
81 appData->handle = pamHandle;
89 appData->handle = pamHandle;
82− futureWatcher.setFuture(QtConcurrent::run(authenticateWithPam, pamHandle));
90+ futureWatcher.setFuture(QtConcurrent::mapped(QList<pam_handle*>() << pamHandle, authenticateWithPam));
83 } else {
91 } else {
84 delete appData;
92 delete appData;
85 greeterPrivate->authenticated = false;
93 greeterPrivate->authenticated = false;
@@ -88,7 +96,7 @@ public:
88 }
96 }
89 }
97 }
90
98
91− static int authenticateWithPam(pam_handle* pamHandle)
99+ static int authenticateWithPam(pam_handle* const& pamHandle)
92 {
100 {
93 int pamStatus = pam_authenticate(pamHandle, 0);
101 int pamStatus = pam_authenticate(pamHandle, 0);
94 if (pamStatus == PAM_SUCCESS) {
102 if (pamStatus == PAM_SUCCESS) {
@@ -242,11 +250,22 @@ private Q_SLOTS:
242private:
250private:
243 void cancelPam()
251 void cancelPam()
244 {
252 {
245− // Unfortunately we can't simply cancel our QFuture because QtConcurrent::run doesn't support cancel
246 if (pamHandle != nullptr) {
253 if (pamHandle != nullptr) {
254+ QFuture<int> pamFuture = futureWatcher.future();
247 pam_handle *handle = pamHandle;
255 pam_handle *handle = pamHandle;
248 pamHandle = nullptr; // to disable normal finishPam() handling
256 pamHandle = nullptr; // to disable normal finishPam() handling
257+ pamFuture.cancel();
258+
259+ // Note the empty loop, we just want to clear the futures queue.
260+ // Any further prompts from the pam thread will be immediately
261+ // responded to/dismissed in handlePrompt().
249− while (respond(QString())); // clear our local queue of QFutures
262+ while (respond(QString()));
263+
264+ // Now let signal/slot handling happen so the thread can finish
265+ while (!pamFuture.isFinished()) {
266+ QCoreApplication::processEvents();
267+ }
268+
250 pam_end(handle, PAM_CONV_ERR);
269 pam_end(handle, PAM_CONV_ERR);
251 }
270 }
252 }
271 }
@@ -266,6 +285,11 @@ GreeterPrivate::GreeterPrivate(Greeter* parent)
266{
285{
267}
286}
268
287
288+GreeterPrivate::~GreeterPrivate()
289+{
290+ delete m_impl;
291+}
292+
269void GreeterPrivate::handleAuthenticate()
293void GreeterPrivate::handleAuthenticate()
270{
294{
271 m_impl->start(authenticationUser);
295 m_impl->start(authenticationUser);
plugins/LightDM/liblightdm/GreeterPrivate.h+1−1
@@ -30,7 +30,7 @@ class GreeterPrivate
30{
30{
31public:
31public:
32 explicit GreeterPrivate(Greeter* parent=0);
32 explicit GreeterPrivate(Greeter* parent=0);
33− virtual ~GreeterPrivate() = default;
33+ virtual ~GreeterPrivate();
34
34
35 // These variables may not be used by all subclasses, that's no problem
35 // These variables may not be used by all subclasses, that's no problem
36 bool authenticated;
36 bool authenticated;
plugins/LightDM/liblightdm/UsersModel.h+2−2
@@ -53,8 +53,8 @@ public:
53 BackgroundPathRole
53 BackgroundPathRole
54 };
54 };
55
55
56− int rowCount(const QModelIndex &parent) const;
56+ int rowCount(const QModelIndex &parent) const override;
57− QVariant data(const QModelIndex &index, int role) const;
57+ QVariant data(const QModelIndex &index, int role) const override;
58
58
59private:
59private:
60 UsersModelPrivate * const d_ptr;
60 UsersModelPrivate * const d_ptr;
plugins/LightDM/plugin.h+1−1
@@ -29,7 +29,7 @@ class LightDMPlugin : public QQmlExtensionPlugin
29 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
30
30
31public:
31public:
32− void registerTypes(const char *uri);
32+ void registerTypes(const char *uri) override;
33};
33};
34
34
35#endif
35#endif
plugins/Lights/plugin.h+1−1
@@ -28,7 +28,7 @@ class LightsPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32};
32};
33
33
34#endif
34#endif
plugins/Powerd/plugin.h+1−1
@@ -29,7 +29,7 @@ class PowerdPlugin : public QQmlExtensionPlugin
29 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
30
30
31public:
31public:
32− void registerTypes(const char *uri);
32+ void registerTypes(const char *uri) override;
33};
33};
34
34
35#endif
35#endif
plugins/ScreenGrabber/plugin.h+1−1
@@ -27,7 +27,7 @@ class ScreenGrabberPlugin : public QQmlExtensionPlugin
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28
28
29public:
29public:
30− void registerTypes(const char *uri);
30+ void registerTypes(const char *uri) override;
31};
31};
32
32
33#endif // SCREENGRABBER_PLUGIN_H
33#endif // SCREENGRABBER_PLUGIN_H
plugins/SessionBroadcast/plugin.h+1−1
@@ -27,7 +27,7 @@ class SessionBroadcastPlugin : public QQmlExtensionPlugin
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28
28
29public:
29public:
30− void registerTypes(const char *uri);
30+ void registerTypes(const char *uri) override;
31};
31};
32
32
33#endif
33#endif
plugins/Ubuntu/DownloadDaemonListener/plugin.h+2−2
@@ -31,7 +31,7 @@ class BackendPlugin : public QQmlExtensionPlugin
31 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
31 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
32
32
33public:
33public:
34− void registerTypes(const char *uri);
34+ void registerTypes(const char *uri) override;
35− void initializeEngine(QQmlEngine *engine, const char *uri);
35+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
36};
36};
37#endif // BACKEND_PLUGIN_H
37#endif // BACKEND_PLUGIN_H
plugins/Ubuntu/Gestures/CMakeLists.txt+1
@@ -7,6 +7,7 @@ set(UbuntuGesturesQml_SOURCES
7 Damper.cpp
7 Damper.cpp
8 Direction.cpp
8 Direction.cpp
9 DirectionalDragArea.cpp
9 DirectionalDragArea.cpp
10+ FloatingFlickable.cpp
10 PressedOutsideNotifier.cpp
11 PressedOutsideNotifier.cpp
11 TouchDispatcher.cpp
12 TouchDispatcher.cpp
12 TouchGate.cpp
13 TouchGate.cpp
plugins/Ubuntu/Gestures/Direction.cpp+6−3
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,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
@@ -25,12 +25,15 @@ bool Direction::isHorizontal(Direction::Type type)
25
25
26bool Direction::isVertical(Direction::Type type)
26bool Direction::isVertical(Direction::Type type)
27{
27{
28− return type == Direction::Upwards || type == Direction::Downwards;
28+ return type == Direction::Upwards
29+ || type == Direction::Downwards
30+ || type == Direction::Vertical;
29}
31}
30
32
31bool Direction::isPositive(Direction::Type type)
33bool Direction::isPositive(Direction::Type type)
32{
34{
33 return type == Rightwards
35 return type == Rightwards
34 || type == Downwards
36 || type == Downwards
35− || type == Horizontal;
37+ || type == Horizontal
38+ || type == Vertical;
36}
39}
plugins/Ubuntu/Gestures/Direction.h+3−2
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,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
@@ -34,7 +34,8 @@ public:
34 Leftwards, // Along the negative direction of the X axis
34 Leftwards, // Along the negative direction of the X axis
35 Downwards, // Along the positive direction of the Y axis
35 Downwards, // Along the positive direction of the Y axis
36 Upwards, // Along the negative direction of the Y axis
36 Upwards, // Along the negative direction of the Y axis
37− Horizontal // Along the X axis, in any direction
37+ Horizontal, // Along the X axis, in any direction
38+ Vertical // Along the Y axis, in any direction
38 };
39 };
39
40
40 Q_INVOKABLE static bool isHorizontal(Direction::Type type);
41 Q_INVOKABLE static bool isHorizontal(Direction::Type type);
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp+5−2
@@ -506,7 +506,7 @@ const QTouchEvent::TouchPoint *DirectionalDragAreaPrivate::fetchTargetTouchPoint
506
506
507bool DirectionalDragAreaPrivate::movingInRightDirection() const
507bool DirectionalDragAreaPrivate::movingInRightDirection() const
508{
508{
509− if (direction == Direction::Horizontal) {
509+ if (direction == Direction::Horizontal || direction == Direction::Vertical) {
510 return true;
510 return true;
511 } else {
511 } else {
512 QPointF movementVector(dampedScenePos.x() - previousDampedScenePos.x(),
512 QPointF movementVector(dampedScenePos.x() - previousDampedScenePos.x(),
@@ -532,7 +532,7 @@ bool DirectionalDragAreaPrivate::movedFarEnoughAlongGestureAxis() const
532 ddaDebug(" movedFarEnoughAlongGestureAxis: scalarProjection=" << scalarProjection
532 ddaDebug(" movedFarEnoughAlongGestureAxis: scalarProjection=" << scalarProjection
533 << ", distanceThreshold=" << distanceThreshold);
533 << ", distanceThreshold=" << distanceThreshold);
534
534
535− if (direction == Direction::Horizontal) {
535+ if (direction == Direction::Horizontal || direction == Direction::Vertical) {
536 return qAbs(scalarProjection) > distanceThreshold;
536 return qAbs(scalarProjection) > distanceThreshold;
537 } else {
537 } else {
538 return scalarProjection > distanceThreshold;
538 return scalarProjection > distanceThreshold;
@@ -712,6 +712,8 @@ void DirectionalDragArea::itemChange(ItemChange change, const ItemChangeData &va
712{
712{
713 if (change == QQuickItem::ItemSceneChange) {
713 if (change == QQuickItem::ItemSceneChange) {
714 if (value.window != nullptr) {
714 if (value.window != nullptr) {
715+ value.window->installEventFilter(TouchRegistry::instance());
716+
715 // TODO: Handle window->screen() changes (ie window changing screens)
717 // TODO: Handle window->screen() changes (ie window changing screens)
716 qreal pixelsPerMm = value.window->screen()->physicalDotsPerInch() / 25.4;
718 qreal pixelsPerMm = value.window->screen()->physicalDotsPerInch() / 25.4;
717 d->setPixelsPerMm(pixelsPerMm);
719 d->setPixelsPerMm(pixelsPerMm);
@@ -843,6 +845,7 @@ void DirectionalDragAreaPrivate::updateSceneDirectionVector()
843 localDirection.ry() = -1.;
845 localDirection.ry() = -1.;
844 break;
846 break;
845 case Direction::Downwards:
847 case Direction::Downwards:
848+ case Direction::Vertical:
846 localDirection.rx() = 0.;
849 localDirection.rx() = 0.;
847 localDirection.ry() = 1;
850 localDirection.ry() = 1;
848 break;
851 break;
plugins/Ubuntu/Gestures/DirectionalDragArea.h+2−2
@@ -125,8 +125,8 @@ Q_SIGNALS:
125 void immediateRecognitionChanged(bool value);
125 void immediateRecognitionChanged(bool value);
126
126
127protected:
127protected:
128− virtual void touchEvent(QTouchEvent *event);
128+ void touchEvent(QTouchEvent *event) override;
129− virtual void itemChange(ItemChange change, const ItemChangeData &value);
129+ void itemChange(ItemChange change, const ItemChangeData &value) override;
130
130
131public: // so tests can access it
131public: // so tests can access it
132 DirectionalDragAreaPrivate *d;
132 DirectionalDragAreaPrivate *d;
plugins/Ubuntu/Gestures/FloatingFlickable.cppnew file+150
@@ -0,0 +1,150 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "FloatingFlickable.h"
18+
19+#include <private/qquickflickable_p.h>
20+#include "DirectionalDragArea.h"
21+
22+#include <QDebug>
23+
24+FloatingFlickable::FloatingFlickable(QQuickItem *parent)
25+ : QQuickItem(parent)
26+ , m_mousePressed(false)
27+{
28+ m_dragArea = new DirectionalDragArea(this);
29+ m_dragArea->setWidth(width());
30+ m_dragArea->setHeight(height());
31+ m_dragArea->setDirection(Direction::Horizontal);
32+ connect(m_dragArea, &DirectionalDragArea::touchXChanged,
33+ this, &FloatingFlickable::onDragAreaTouchPosChanged);
34+ connect(m_dragArea, &DirectionalDragArea::touchYChanged,
35+ this, &FloatingFlickable::onDragAreaTouchPosChanged);
36+ connect(m_dragArea, &DirectionalDragArea::draggingChanged,
37+ this, &FloatingFlickable::onDragAreaDraggingChanged);
38+ connect(m_dragArea, &DirectionalDragArea::directionChanged, this, &FloatingFlickable::directionChanged);
39+
40+ m_flickable = new QQuickFlickable(this);
41+ m_flickable->setEnabled(false);
42+ m_flickable->setWidth(width());
43+ m_flickable->setHeight(height());
44+ connect(m_flickable, &QQuickFlickable::contentWidthChanged, this, &FloatingFlickable::contentWidthChanged);
45+ connect(m_flickable, &QQuickFlickable::contentHeightChanged, this, &FloatingFlickable::contentHeightChanged);
46+ connect(m_flickable, &QQuickFlickable::contentXChanged, this, &FloatingFlickable::contentXChanged);
47+ connect(m_flickable, &QQuickFlickable::contentYChanged, this, &FloatingFlickable::contentYChanged);
48+
49+ connect(this, &QQuickItem::widthChanged, this, &FloatingFlickable::updateChildrenWidth);
50+ connect(this, &QQuickItem::heightChanged, this, &FloatingFlickable::updateChildrenHeight);
51+}
52+
53+qreal FloatingFlickable::contentWidth() const
54+{
55+ return m_flickable->contentWidth();
56+}
57+
58+void FloatingFlickable::setContentWidth(qreal contentWidth)
59+{
60+ m_flickable->setContentWidth(contentWidth);
61+}
62+
63+qreal FloatingFlickable::contentHeight() const
64+{
65+ return m_flickable->contentHeight();
66+}
67+
68+void FloatingFlickable::setContentHeight(qreal contentHeight)
69+{
70+ m_flickable->setContentHeight(contentHeight);
71+}
72+
73+qreal FloatingFlickable::contentX() const
74+{
75+ return m_flickable->contentX();
76+}
77+
78+void FloatingFlickable::setContentX(qreal contentX)
79+{
80+ m_flickable->setContentX(contentX);
81+}
82+
83+qreal FloatingFlickable::contentY() const
84+{
85+ return m_flickable->contentY();
86+}
87+
88+void FloatingFlickable::setContentY(qreal contentY)
89+{
90+ m_flickable->setContentY(contentY);
91+}
92+
93+Direction::Type FloatingFlickable::direction() const
94+{
95+ return m_dragArea->direction();
96+}
97+
98+void FloatingFlickable::setDirection(Direction::Type direction)
99+{
100+ m_dragArea->setDirection(direction);
101+ if (Direction::isHorizontal(direction)) {
102+ m_flickable->setFlickableDirection(QQuickFlickable::HorizontalFlick);
103+ } else {
104+ m_flickable->setFlickableDirection(QQuickFlickable::VerticalFlick);
105+ }
106+}
107+
108+void FloatingFlickable::updateChildrenWidth()
109+{
110+ m_dragArea->setWidth(width());
111+ m_flickable->setWidth(width());
112+}
113+
114+void FloatingFlickable::updateChildrenHeight()
115+{
116+ m_dragArea->setHeight(height());
117+ m_flickable->setHeight(height());
118+}
119+
120+void FloatingFlickable::onDragAreaTouchPosChanged(qreal)
121+{
122+ if (m_mousePressed) {
123+ QMouseEvent mouseEvent(QEvent::MouseMove,
124+ QPointF(m_dragArea->touchX(),m_dragArea->touchY()),
125+ Qt::NoButton, Qt::LeftButton, Qt::NoModifier);
126+
127+ QCoreApplication::sendEvent(m_flickable, &mouseEvent);
128+
129+ }
130+}
131+
132+void FloatingFlickable::onDragAreaDraggingChanged(bool dragging)
133+{
134+ if (dragging && !m_mousePressed) {
135+ QMouseEvent mouseEvent(QEvent::MouseButtonPress,
136+ QPointF(m_dragArea->touchX(),m_dragArea->touchY()),
137+ Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
138+
139+ QCoreApplication::sendEvent(m_flickable, &mouseEvent);
140+ m_mousePressed = true;
141+
142+ } else if (!dragging && m_mousePressed) {
143+ QMouseEvent mouseEvent(QEvent::MouseButtonRelease,
144+ QPointF(m_dragArea->touchX(),m_dragArea->touchY()),
145+ Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
146+
147+ QCoreApplication::sendEvent(m_flickable, &mouseEvent);
148+ m_mousePressed = false;
149+ }
150+}
plugins/Ubuntu/Gestures/FloatingFlickable.hnew file+86
@@ -0,0 +1,86 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef FLOATING_FLICKABLE_H
18+#define FLOATING_FLICKABLE_H
19+
20+#include <QQuickItem>
21+#include "UbuntuGesturesQmlGlobal.h"
22+#include "Direction.h"
23+
24+class DirectionalDragArea;
25+class QQuickFlickable;
26+
27+/*
28+ A Flickable that can be put in front of the item to be flicked and
29+ still have the item-to-be-flicked receive input events that are not flicks.
30+
31+ Ie, it's a Flickable that, input-wise, is transparent to non-flick gestures.
32+
33+ With a regular Flickable you would have to make the item-to-be-flicked a child
34+ of Flicakble to achieve the same result. FloatingFlickable has no such requirement
35+ or limitation.
36+ */
37+class UBUNTUGESTURESQML_EXPORT FloatingFlickable : public QQuickItem {
38+ Q_OBJECT
39+
40+ Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged)
41+ Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged)
42+ Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
43+ Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
44+
45+ Q_PROPERTY(Direction::Type direction READ direction WRITE setDirection NOTIFY directionChanged)
46+
47+Q_SIGNALS:
48+ void contentWidthChanged();
49+ void contentHeightChanged();
50+ void contentXChanged();
51+ void contentYChanged();
52+ void directionChanged();
53+
54+public:
55+ FloatingFlickable(QQuickItem *parent = nullptr);
56+
57+ qreal contentWidth() const;
58+ void setContentWidth(qreal contentWidth);
59+
60+ qreal contentHeight() const;
61+ void setContentHeight(qreal contentHeight);
62+
63+ qreal contentX() const;
64+ void setContentX(qreal contentX);
65+
66+ qreal contentY() const;
67+ void setContentY(qreal contentY);
68+
69+ Direction::Type direction() const;
70+ void setDirection(Direction::Type);
71+
72+private Q_SLOTS:
73+ void updateChildrenWidth();
74+ void updateChildrenHeight();
75+ void onDragAreaTouchPosChanged(qreal);
76+ void onDragAreaDraggingChanged(bool value);
77+
78+private:
79+ DirectionalDragArea *m_dragArea;
80+ QQuickFlickable *m_flickable;
81+ bool m_mousePressed;
82+
83+ friend class tst_FloatingFlickable;
84+};
85+
86+#endif // FLOATING_FLICKABLE_H
plugins/Ubuntu/Gestures/TouchGate.cpp+10
@@ -18,6 +18,7 @@
18
18
19#include <QCoreApplication>
19#include <QCoreApplication>
20#include <QDebug>
20#include <QDebug>
21+#include <QQuickWindow>
21
22
22#include <TouchOwnershipEvent.h>
23#include <TouchOwnershipEvent.h>
23#include <TouchRegistry.h>
24#include <TouchRegistry.h>
@@ -102,6 +103,15 @@ void TouchGate::touchEvent(QTouchEvent *event)
102 }
103 }
103}
104}
104
105
106+void TouchGate::itemChange(ItemChange change, const ItemChangeData &value)
107+{
108+ if (change == QQuickItem::ItemSceneChange) {
109+ if (value.window != nullptr) {
110+ value.window->installEventFilter(TouchRegistry::instance());
111+ }
112+ }
113+}
114+
105void TouchGate::touchOwnershipEvent(TouchOwnershipEvent *event)
115void TouchGate::touchOwnershipEvent(TouchOwnershipEvent *event)
106{
116{
107 // TODO: Optimization: batch those actions as TouchOwnershipEvents
117 // TODO: Optimization: batch those actions as TouchOwnershipEvents
plugins/Ubuntu/Gestures/TouchGate.h+1
@@ -57,6 +57,7 @@ Q_SIGNALS:
57
57
58protected:
58protected:
59 void touchEvent(QTouchEvent *event) override;
59 void touchEvent(QTouchEvent *event) override;
60+ void itemChange(ItemChange change, const ItemChangeData &value) override;
60
61
61private Q_SLOTS:
62private Q_SLOTS:
62 void onEnabledChanged();
63 void onEnabledChanged();
plugins/Ubuntu/Gestures/plugin.cpp+3−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,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
@@ -18,6 +18,7 @@
18#include "AxisVelocityCalculator.h"
18#include "AxisVelocityCalculator.h"
19#include "Direction.h"
19#include "Direction.h"
20#include "DirectionalDragArea.h"
20#include "DirectionalDragArea.h"
21+#include "FloatingFlickable.h"
21#include "PressedOutsideNotifier.h"
22#include "PressedOutsideNotifier.h"
22#include "TouchGate.h"
23#include "TouchGate.h"
23
24
@@ -34,6 +35,7 @@ void UbuntuGesturesQmlPlugin::registerTypes(const char *uri)
34 qmlRegisterSingletonType<Direction>(uri, 0, 1, "Direction", directionSingleton);
35 qmlRegisterSingletonType<Direction>(uri, 0, 1, "Direction", directionSingleton);
35 qmlRegisterType<DirectionalDragArea>(uri, 0, 1, "DirectionalDragArea");
36 qmlRegisterType<DirectionalDragArea>(uri, 0, 1, "DirectionalDragArea");
36 qmlRegisterType<AxisVelocityCalculator>(uri, 0, 1, "AxisVelocityCalculator");
37 qmlRegisterType<AxisVelocityCalculator>(uri, 0, 1, "AxisVelocityCalculator");
38+ qmlRegisterType<FloatingFlickable>(uri, 0, 1, "FloatingFlickable");
37 qmlRegisterType<PressedOutsideNotifier>(uri, 0, 1, "PressedOutsideNotifier");
39 qmlRegisterType<PressedOutsideNotifier>(uri, 0, 1, "PressedOutsideNotifier");
38 qmlRegisterType<TouchGate>(uri, 0, 1, "TouchGate");
40 qmlRegisterType<TouchGate>(uri, 0, 1, "TouchGate");
39}
41}
plugins/Ubuntu/Gestures/plugin.h+1−1
@@ -24,7 +24,7 @@ class UbuntuGesturesQmlPlugin : public QQmlExtensionPlugin
24 Q_OBJECT
24 Q_OBJECT
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26public:
26public:
27− void registerTypes(const char *uri);
27+ void registerTypes(const char *uri) override;
28};
28};
29
29
30
30
plugins/Ubuntu/Payments/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
26
27public:
27public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
29};
29};
30
30
31#endif // PAYMENTS_PLUGIN_H
31#endif // PAYMENTS_PLUGIN_H
plugins/Ubuntu/SystemImage/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
26
27public:
27public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
29};
29};
30
30
31#endif // SYSTEMIMAGE_PLUGIN_H
31#endif // SYSTEMIMAGE_PLUGIN_H
plugins/Unity/Connectivity/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
26
27public:
27public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
29};
29};
30
30
31#endif // CONNECTIVITY_PLUGIN_H
31#endif // CONNECTIVITY_PLUGIN_H
plugins/Unity/DashCommunicator/plugin.h+1−1
@@ -28,7 +28,7 @@ class DashCommunicatorPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32};
32};
33
33
34#endif
34#endif
plugins/Unity/Indicators/indicatorsmodel.h+5−5
@@ -50,11 +50,11 @@ public:
50 void setProfile(const QString& profile);
50 void setProfile(const QString& profile);
51
51
52 /* QAbstractItemModel */
52 /* QAbstractItemModel */
53− QHash<int, QByteArray> roleNames() const;
53+ QHash<int, QByteArray> roleNames() const override;
54− int columnCount(const QModelIndex &parent = QModelIndex()) const;
54+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
55− QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
55+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
56− QModelIndex parent (const QModelIndex &index) const;
56+ QModelIndex parent (const QModelIndex &index) const override;
57− int rowCount(const QModelIndex &parent = QModelIndex()) const;
57+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
58
58
59
59
60Q_SIGNALS:
60Q_SIGNALS:
plugins/Unity/Indicators/menucontentactivator.cpp+4−4
@@ -28,10 +28,10 @@ public:
28 connect(&m_timer, &QTimer::timeout,
28 connect(&m_timer, &QTimer::timeout,
29 this, &UnityIndicators::AbstractTimer::timeout);
29 this, &UnityIndicators::AbstractTimer::timeout);
30 }
30 }
31− virtual int interval() const { return m_timer.interval(); }
31+ int interval() const override { return m_timer.interval(); }
32− virtual void setInterval(int msecs) { m_timer.setInterval(msecs); }
32+ void setInterval(int msecs) override { m_timer.setInterval(msecs); }
33− virtual void start() { m_timer.start(); UnityIndicators::AbstractTimer::start(); }
33+ void start() override { m_timer.start(); UnityIndicators::AbstractTimer::start(); }
34− virtual void stop() { m_timer.stop(); UnityIndicators::AbstractTimer::stop(); }
34+ void stop() override { m_timer.stop(); UnityIndicators::AbstractTimer::stop(); }
35private:
35private:
36 QTimer m_timer;
36 QTimer m_timer;
37};
37};
plugins/Unity/Indicators/plugin.h+1−1
@@ -27,7 +27,7 @@ class IndicatorsPlugin : public QQmlExtensionPlugin
27 Q_OBJECT
27 Q_OBJECT
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29public:
29public:
30− void registerTypes(const char *uri);
30+ void registerTypes(const char *uri) override;
31};
31};
32
32
33#endif // INDICATORS2_PLUGIN_H
33#endif // INDICATORS2_PLUGIN_H
plugins/Unity/Launcher/launchermodel.h+10−10
@@ -41,19 +41,19 @@ public:
41 LauncherModel(QObject *parent = 0);
41 LauncherModel(QObject *parent = 0);
42 ~LauncherModel();
42 ~LauncherModel();
43
43
44− int rowCount(const QModelIndex &parent = QModelIndex()) const;
44+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
45
45
46− QVariant data(const QModelIndex &index, int role) const;
46+ QVariant data(const QModelIndex &index, int role) const override;
47
47
48− Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const;
48+ Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
49− Q_INVOKABLE void move(int oldIndex, int newIndex);
49+ Q_INVOKABLE void move(int oldIndex, int newIndex) override;
50− Q_INVOKABLE void pin(const QString &appId, int index = -1);
50+ Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
51− Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
51+ Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
52− Q_INVOKABLE void setUser(const QString &username);
52+ Q_INVOKABLE void setUser(const QString &username) override;
53 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
53 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
54
54
55− unity::shell::application::ApplicationManagerInterface* applicationManager() const;
55+ unity::shell::application::ApplicationManagerInterface* applicationManager() const override;
56− void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager);
56+ void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager) override;
57
57
58 bool onlyPinned() const override;
58 bool onlyPinned() const override;
59 void setOnlyPinned(bool onlyPinned) override;
59 void setOnlyPinned(bool onlyPinned) override;
@@ -61,7 +61,7 @@ public:
61 int findApplication(const QString &appId);
61 int findApplication(const QString &appId);
62
62
63public Q_SLOTS:
63public Q_SLOTS:
64− void requestRemove(const QString &appId);
64+ void requestRemove(const QString &appId) override;
65 Q_INVOKABLE void refresh();
65 Q_INVOKABLE void refresh();
66
66
67private:
67private:
plugins/Unity/Launcher/plugin.h+1−1
@@ -28,7 +28,7 @@ class UnityLauncherPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32};
32};
33
33
34#endif
34#endif
plugins/Unity/Launcher/quicklistmodel.h+2−2
@@ -48,8 +48,8 @@ public:
48
48
49 QuickListEntry get(int index) const;
49 QuickListEntry get(int index) const;
50
50
51− int rowCount(const QModelIndex &parent = QModelIndex()) const;
51+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
52− QVariant data(const QModelIndex &index, int role) const;
52+ QVariant data(const QModelIndex &index, int role) const override;
53
53
54private:
54private:
55 QList<QuickListEntry> m_list;
55 QList<QuickListEntry> m_list;
plugins/Unity/Session/plugin.h+1−1
@@ -28,7 +28,7 @@ class SessionPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32};
32};
33
33
34#endif
34#endif
plugins/Utils/HomeKeyWatcher.h+1−1
@@ -49,7 +49,7 @@ public:
49
49
50 virtual ~HomeKeyWatcher();
50 virtual ~HomeKeyWatcher();
51
51
52− bool eventFilter(QObject *watched, QEvent *event);
52+ bool eventFilter(QObject *watched, QEvent *event) override;
53
53
54 void update(QEvent *event);
54 void update(QEvent *event);
55
55
plugins/Utils/plugin.h+2−2
@@ -28,8 +28,8 @@ class UtilsPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32− void initializeEngine(QQmlEngine *engine, const char *uri);
32+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
33};
33};
34
34
35#endif
35#endif
plugins/Utils/qlimitproxymodelqml.h+2−2
@@ -32,8 +32,8 @@ public:
32
32
33 /* getters */
33 /* getters */
34 int limit() const;
34 int limit() const;
35− int rowCount(const QModelIndex &parent = QModelIndex()) const;
35+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
36− QHash<int, QByteArray> roleNames() const;
36+ QHash<int, QByteArray> roleNames() const override;
37
37
38 /* setters */
38 /* setters */
39 void setModel(QAbstractItemModel *model);
39 void setModel(QAbstractItemModel *model);
plugins/Utils/qvariantlistmodel.h+6−6
@@ -54,14 +54,14 @@ public:
54
54
55 ~QVariantListModel();
55 ~QVariantListModel();
56
56
57− int rowCount(const QModelIndex &parent = QModelIndex()) const;
57+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
58− QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
58+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
59
59
60− QVariant data(const QModelIndex &index, int role) const;
60+ QVariant data(const QModelIndex &index, int role) const override;
61− bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
61+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
62
62
63− bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
63+ bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
64− bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
64+ bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
65
65
66 QVariantList variantList() const;
66 QVariantList variantList() const;
67 void setVariantList(const QVariantList &list);
67 void setVariantList(const QVariantList &list);
plugins/Utils/timeformatter.h+1−1
@@ -62,7 +62,7 @@ public:
62 GDateTimeFormatter(QObject *parent = 0);
62 GDateTimeFormatter(QObject *parent = 0);
63
63
64protected:
64protected:
65− virtual QString formatTime() const;
65+ QString formatTime() const override;
66};
66};
67
67
68#endif
68#endif
plugins/Utils/unitysortfilterproxymodelqml.h+2−2
@@ -36,12 +36,12 @@ public:
36 Q_INVOKABLE int count();
36 Q_INVOKABLE int count();
37 Q_INVOKABLE int findFirst(int role, const QVariant& value) const;
37 Q_INVOKABLE int findFirst(int role, const QVariant& value) const;
38 Q_INVOKABLE int mapRowToSource(int row);
38 Q_INVOKABLE int mapRowToSource(int row);
39− virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
39+ bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
40
40
41 /* getters */
41 /* getters */
42 int totalCount() const;
42 int totalCount() const;
43 bool invertMatch() const;
43 bool invertMatch() const;
44− QHash<int, QByteArray> roleNames() const;
44+ QHash<int, QByteArray> roleNames() const override;
45
45
46 /* setters */
46 /* setters */
47 void setModel(QAbstractItemModel *model);
47 void setModel(QAbstractItemModel *model);
plugins/Utils/windowkeysfilter.h+1−1
@@ -39,7 +39,7 @@ class WindowKeysFilter : public QQuickItem
39public:
39public:
40 WindowKeysFilter(QQuickItem *parent = 0);
40 WindowKeysFilter(QQuickItem *parent = 0);
41
41
42− bool eventFilter(QObject *watched, QEvent *event);
42+ bool eventFilter(QObject *watched, QEvent *event) override;
43
43
44private Q_SLOTS:
44private Q_SLOTS:
45 void setupFilterOnWindow(QQuickWindow *window);
45 void setupFilterOnWindow(QQuickWindow *window);
plugins/Wizard/plugin.h+1−1
@@ -26,7 +26,7 @@ class WizardPlugin : public QQmlExtensionPlugin
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27
27
28public:
28public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
30};
30};
31
31
32#endif
32#endif
po/cs.po+136−119
@@ -8,132 +8,138 @@ msgstr ""
8"Project-Id-Version: unity8\n"
8"Project-Id-Version: unity8\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2015-04-14 16:13+0200\n"
10"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2014-01-08 10:11+0000\n"
11+"PO-Revision-Date: 2015-05-11 20:42+0000\n"
12"Last-Translator: Tadeáš Pařík <tadeas.parik@gmail.com>\n"
12"Last-Translator: Tadeáš Pařík <tadeas.parik@gmail.com>\n"
13"Language-Team: Czech <cs@li.org>\n"
13"Language-Team: Czech <cs@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
17"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
18+"X-Launchpad-Export-Date: 2015-05-13 05:31+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
19+"X-Generator: Launchpad (build 17493)\n"
20+"Language: cs\n"
20
21
21#: plugins/LightDM/Greeter.cpp:112
22#: plugins/LightDM/Greeter.cpp:112
22msgid "Password: "
23msgid "Password: "
23−msgstr ""
24+msgstr "Heslo: "
24
25
25#: plugins/Unity/Launcher/launcheritem.cpp:45
26#: plugins/Unity/Launcher/launcheritem.cpp:45
26#: plugins/Unity/Launcher/launcheritem.cpp:100
27#: plugins/Unity/Launcher/launcheritem.cpp:100
27msgid "Pin shortcut"
28msgid "Pin shortcut"
28−msgstr ""
29+msgstr "Připíchnout zkratku"
29
30
30#: plugins/Unity/Launcher/launcheritem.cpp:100
31#: plugins/Unity/Launcher/launcheritem.cpp:100
31msgid "Unpin shortcut"
32msgid "Unpin shortcut"
32−msgstr ""
33+msgstr "Odpíchnout zkratku"
33
34
34#: qml/Components/DelayedLockscreen.qml:49
35#: qml/Components/DelayedLockscreen.qml:49
35msgid "Device Locked"
36msgid "Device Locked"
36−msgstr ""
37+msgstr "Zařízení uzamčeno"
37
38
38#: qml/Components/DelayedLockscreen.qml:64
39#: qml/Components/DelayedLockscreen.qml:64
39msgid "You have been locked out due to too many failed passphrase attempts."
40msgid "You have been locked out due to too many failed passphrase attempts."
40msgstr ""
41msgstr ""
42+"Zařízení bylo uzamčeno z důvodu mnoha neúspěšných pokusů o přihlášení."
41
43
42#: qml/Components/DelayedLockscreen.qml:65
44#: qml/Components/DelayedLockscreen.qml:65
43msgid "You have been locked out due to too many failed passcode attempts."
45msgid "You have been locked out due to too many failed passcode attempts."
44msgstr ""
46msgstr ""
47+"Zařízení bylo uzamčeno z důvodu mnoha neúspěšných pokusů o přihlášení."
45
48
46#: qml/Components/DelayedLockscreen.qml:74
49#: qml/Components/DelayedLockscreen.qml:74
47#, qt-format
50#, qt-format
48msgid "Please wait %1 minute and then try again…"
51msgid "Please wait %1 minute and then try again…"
49msgid_plural "Please wait %1 minutes and then try again…"
52msgid_plural "Please wait %1 minutes and then try again…"
50−msgstr[0] ""
53+msgstr[0] "Počkejte, prosím, %1 minut a poté to zkuste znovu..."
51−msgstr[1] ""
54+msgstr[1] "Počkejte, prosím, %1 minuty a poté to zkuste znovu..."
55+msgstr[2] "Počkejte, prosím, %1 minut a poté to zkuste znovu..."
52
56
53#: qml/Components/Dialogs.qml:69
57#: qml/Components/Dialogs.qml:69
54msgctxt "Title: Lock/Log out dialog"
58msgctxt "Title: Lock/Log out dialog"
55msgid "Log out"
59msgid "Log out"
56−msgstr ""
60+msgstr "Odhlásit se"
57
61
58#: qml/Components/Dialogs.qml:70
62#: qml/Components/Dialogs.qml:70
59msgid "Are you sure you want to log out?"
63msgid "Are you sure you want to log out?"
60−msgstr ""
64+msgstr "Jste si jistí, že se chcete odhlásit?"
61
65
62#: qml/Components/Dialogs.qml:72
66#: qml/Components/Dialogs.qml:72
63msgctxt "Button: Lock the system"
67msgctxt "Button: Lock the system"
64msgid "Lock"
68msgid "Lock"
65−msgstr ""
69+msgstr "Uzamknout"
66
70
67#: qml/Components/Dialogs.qml:79
71#: qml/Components/Dialogs.qml:79
68msgctxt "Button: Log out from the system"
72msgctxt "Button: Log out from the system"
69msgid "Log Out"
73msgid "Log Out"
70−msgstr ""
74+msgstr "Odhlásit"
71
75
72#: qml/Components/Dialogs.qml:86 qml/Components/Dialogs.qml:117
76#: qml/Components/Dialogs.qml:86 qml/Components/Dialogs.qml:117
73#: qml/Components/Dialogs.qml:173
77#: qml/Components/Dialogs.qml:173
74msgid "Cancel"
78msgid "Cancel"
75−msgstr ""
79+msgstr "Zrušit"
76
80
77#: qml/Components/Dialogs.qml:98
81#: qml/Components/Dialogs.qml:98
78msgctxt "Title: Reboot/Shut down dialog"
82msgctxt "Title: Reboot/Shut down dialog"
79msgid "Shut down"
83msgid "Shut down"
80−msgstr ""
84+msgstr "Vypnout"
81
85
82#: qml/Components/Dialogs.qml:99
86#: qml/Components/Dialogs.qml:99
83msgid "Are you sure you want to shut down?"
87msgid "Are you sure you want to shut down?"
84−msgstr ""
88+msgstr "Jste si jistí, že chcete zařízení vypnout?"
85
89
86#: qml/Components/Dialogs.qml:101
90#: qml/Components/Dialogs.qml:101
87msgctxt "Button: Reboot the system"
91msgctxt "Button: Reboot the system"
88msgid "Reboot"
92msgid "Reboot"
89−msgstr ""
93+msgstr "Restartovat"
90
94
91#: qml/Components/Dialogs.qml:109
95#: qml/Components/Dialogs.qml:109
92msgctxt "Button: Shut down the system"
96msgctxt "Button: Shut down the system"
93msgid "Shut down"
97msgid "Shut down"
94−msgstr ""
98+msgstr "Vypnout"
95
99
96#: qml/Components/Dialogs.qml:129
100#: qml/Components/Dialogs.qml:129
97msgctxt "Title: Reboot dialog"
101msgctxt "Title: Reboot dialog"
98msgid "Reboot"
102msgid "Reboot"
99−msgstr ""
103+msgstr "Restartovat"
100
104
101#: qml/Components/Dialogs.qml:130
105#: qml/Components/Dialogs.qml:130
102msgid "Are you sure you want to reboot?"
106msgid "Are you sure you want to reboot?"
103−msgstr ""
107+msgstr "Jste si jistí, že chcete zařízení restartovat?"
104
108
105#: qml/Components/Dialogs.qml:132
109#: qml/Components/Dialogs.qml:132
106msgid "No"
110msgid "No"
107−msgstr ""
111+msgstr "Ne"
108
112
109#: qml/Components/Dialogs.qml:138
113#: qml/Components/Dialogs.qml:138
110msgid "Yes"
114msgid "Yes"
111−msgstr ""
115+msgstr "Ano"
112
116
113#: qml/Components/Dialogs.qml:152
117#: qml/Components/Dialogs.qml:152
114msgctxt "Title: Power off/Restart dialog"
118msgctxt "Title: Power off/Restart dialog"
115msgid "Power"
119msgid "Power"
116−msgstr ""
120+msgstr "Vypnutí"
117
121
118#: qml/Components/Dialogs.qml:153
122#: qml/Components/Dialogs.qml:153
119msgid ""
123msgid ""
120"Are you sure you would like\n"
124"Are you sure you would like\n"
121"to power off?"
125"to power off?"
122msgstr ""
126msgstr ""
127+"Jste si jistí, že chcete\n"
128+"telefon vypnout?"
123
129
124#: qml/Components/Dialogs.qml:155
130#: qml/Components/Dialogs.qml:155
125msgctxt "Button: Power off the system"
131msgctxt "Button: Power off the system"
126msgid "Power off"
132msgid "Power off"
127−msgstr ""
133+msgstr "Vypnutí"
128
134
129#: qml/Components/Dialogs.qml:164
135#: qml/Components/Dialogs.qml:164
130msgctxt "Button: Restart the system"
136msgctxt "Button: Restart the system"
131msgid "Restart"
137msgid "Restart"
132−msgstr ""
138+msgstr "Reboot"
133
139
134#: qml/Components/Lockscreen.qml:245
140#: qml/Components/Lockscreen.qml:245
135msgid "Return to Call"
141msgid "Return to Call"
136−msgstr ""
142+msgstr "Vrátit se k hovoru"
137
143
138#: qml/Components/Lockscreen.qml:245
144#: qml/Components/Lockscreen.qml:245
139msgid "Emergency Call"
145msgid "Emergency Call"
@@ -141,51 +147,51 @@ msgstr "Tísňové volání"
141
147
142#: qml/Components/Lockscreen.qml:277
148#: qml/Components/Lockscreen.qml:277
143msgid "OK"
149msgid "OK"
144−msgstr ""
150+msgstr "OK"
145
151
146#: qml/Dash/GenericScopeView.qml:532 qml/Dash/GenericScopeView.qml:690
152#: qml/Dash/GenericScopeView.qml:532 qml/Dash/GenericScopeView.qml:690
147msgid "See less"
153msgid "See less"
148−msgstr ""
154+msgstr "Zobrazit méně"
149
155
150#: qml/Dash/GenericScopeView.qml:532
156#: qml/Dash/GenericScopeView.qml:532
151msgid "See all"
157msgid "See all"
152−msgstr ""
158+msgstr "Zobrazit vše"
153
159
154#: qml/Dash/GenericScopeView.qml:594
160#: qml/Dash/GenericScopeView.qml:594
155msgctxt "Label: Hint for dash search line edit"
161msgctxt "Label: Hint for dash search line edit"
156msgid "Search"
162msgid "Search"
157−msgstr ""
163+msgstr "Hledat"
158
164
159#: qml/Dash/PageHeader.qml:269
165#: qml/Dash/PageHeader.qml:269
160msgctxt "Button: Open the Ubuntu Store"
166msgctxt "Button: Open the Ubuntu Store"
161msgid "Store"
167msgid "Store"
162−msgstr ""
168+msgstr "Obchod"
163
169
164#: qml/Dash/PageHeader.qml:276
170#: qml/Dash/PageHeader.qml:276
165msgctxt "Button: Start a search in the current dash scope"
171msgctxt "Button: Start a search in the current dash scope"
166msgid "Search"
172msgid "Search"
167−msgstr ""
173+msgstr "Hledat"
168
174
169#: qml/Dash/PageHeader.qml:286
175#: qml/Dash/PageHeader.qml:286
170msgctxt "Button: Show the current dash scope settings"
176msgctxt "Button: Show the current dash scope settings"
171msgid "Settings"
177msgid "Settings"
172−msgstr ""
178+msgstr "Nastavení"
173
179
174#: qml/Dash/PageHeader.qml:293
180#: qml/Dash/PageHeader.qml:293
175msgid "Remove from Favorites"
181msgid "Remove from Favorites"
176−msgstr ""
182+msgstr "Odstranit z oblíbených"
177
183
178#: qml/Dash/PageHeader.qml:293
184#: qml/Dash/PageHeader.qml:293
179msgid "Add to Favorites"
185msgid "Add to Favorites"
180−msgstr ""
186+msgstr "Přidat do oblíbených"
181
187
182#: qml/Dash/Previews/PreviewActionCombo.qml:35
188#: qml/Dash/Previews/PreviewActionCombo.qml:35
183msgid "More..."
189msgid "More..."
184−msgstr ""
190+msgstr "Více..."
185
191
186#: qml/Dash/Previews/PreviewActionCombo.qml:35
192#: qml/Dash/Previews/PreviewActionCombo.qml:35
187msgid "Less..."
193msgid "Less..."
188−msgstr ""
194+msgstr "Méně..."
189
195
190#: qml/Dash/Previews/PreviewRatingInput.qml:81
196#: qml/Dash/Previews/PreviewRatingInput.qml:81
191msgid "Rate this"
197msgid "Rate this"
@@ -201,93 +207,97 @@ msgstr "Odeslat"
201
207
202#: qml/Dash/PullToRefreshScopeStyle.qml:55
208#: qml/Dash/PullToRefreshScopeStyle.qml:55
203msgid "Pull to refresh…"
209msgid "Pull to refresh…"
204−msgstr ""
210+msgstr "Vytáhněte pro obnovení..."
205
211
206#: qml/Dash/PullToRefreshScopeStyle.qml:60
212#: qml/Dash/PullToRefreshScopeStyle.qml:60
207msgid "Release to refresh…"
213msgid "Release to refresh…"
208−msgstr ""
214+msgstr "Pusťte pro obnovení..."
209
215
210#: qml/Dash/ScopeSettings/ScopeSettingBoolean.qml:43
216#: qml/Dash/ScopeSettings/ScopeSettingBoolean.qml:43
211msgid "Enable location data"
217msgid "Enable location data"
212−msgstr ""
218+msgstr "Povolit údaje umístění"
213
219
214#: qml/Dash/ScopesList.qml:66
220#: qml/Dash/ScopesList.qml:66
215msgid "Manage"
221msgid "Manage"
216−msgstr ""
222+msgstr "Spravovat"
217
223
218#: qml/Dash/ScopesList.qml:112
224#: qml/Dash/ScopesList.qml:112
219msgid "Home"
225msgid "Home"
220−msgstr ""
226+msgstr "Domů"
221
227
222#: qml/Dash/ScopesList.qml:113
228#: qml/Dash/ScopesList.qml:113
223msgid "Also installed"
229msgid "Also installed"
224−msgstr ""
230+msgstr "Také nainstalováno"
225
231
226#: qml/Greeter/CoverPage.qml:107
232#: qml/Greeter/CoverPage.qml:107
227msgid "Unlock"
233msgid "Unlock"
228−msgstr ""
234+msgstr "Odemknout"
229
235
230#: qml/Greeter/LoginList.qml:236
236#: qml/Greeter/LoginList.qml:236
231msgid "Retry"
237msgid "Retry"
232−msgstr ""
238+msgstr "Znovu"
233
239
234#: qml/Greeter/LoginList.qml:237
240#: qml/Greeter/LoginList.qml:237
235msgid "Tap to unlock"
241msgid "Tap to unlock"
236−msgstr ""
242+msgstr "Klepnout pro odemčení"
237
243
238#: qml/Greeter/NarrowView.qml:53 qml/Wizard/Pages/passwd-confirm.qml:53
244#: qml/Greeter/NarrowView.qml:53 qml/Wizard/Pages/passwd-confirm.qml:53
239msgid "Sorry, incorrect passphrase."
245msgid "Sorry, incorrect passphrase."
240−msgstr ""
246+msgstr "Zadali jste špatné heslo."
241
247
242#: qml/Greeter/NarrowView.qml:54 qml/Wizard/Pages/passwd-confirm.qml:54
248#: qml/Greeter/NarrowView.qml:54 qml/Wizard/Pages/passwd-confirm.qml:54
243msgid "Sorry, incorrect passcode."
249msgid "Sorry, incorrect passcode."
244−msgstr ""
250+msgstr "Zadali jste špatné heslo."
245
251
246#: qml/Greeter/NarrowView.qml:55
252#: qml/Greeter/NarrowView.qml:55
247msgid "This will be your last attempt."
253msgid "This will be your last attempt."
248−msgstr ""
254+msgstr "Toto je váš poslední pokus."
249
255
250#: qml/Greeter/NarrowView.qml:57
256#: qml/Greeter/NarrowView.qml:57
251msgid ""
257msgid ""
252"If passphrase is entered incorrectly, your phone will conduct a factory "
258"If passphrase is entered incorrectly, your phone will conduct a factory "
253"reset and all personal data will be deleted."
259"reset and all personal data will be deleted."
254msgstr ""
260msgstr ""
261+"Pokud bude heslo zadáno nesprávně, bude telefon obnoven do továrního "
262+"nastavení a všechna osobní data budou smazána."
255
263
256#: qml/Greeter/NarrowView.qml:58
264#: qml/Greeter/NarrowView.qml:58
257msgid ""
265msgid ""
258"If passcode is entered incorrectly, your phone will conduct a factory reset "
266"If passcode is entered incorrectly, your phone will conduct a factory reset "
259"and all personal data will be deleted."
267"and all personal data will be deleted."
260msgstr ""
268msgstr ""
269+"Pokud bude heslo zadáno nesprávně, bude telefon obnoven do továrního "
270+"nastavení a všechna osobní data budou smazána."
261
271
262#: qml/Greeter/NarrowView.qml:115
272#: qml/Greeter/NarrowView.qml:115
263#, qt-format
273#, qt-format
264msgid "Enter %1"
274msgid "Enter %1"
265−msgstr ""
275+msgstr "Vložte %1"
266
276
267#: qml/Greeter/NarrowView.qml:116 qml/Wizard/Pages/passwd-set.qml:60
277#: qml/Greeter/NarrowView.qml:116 qml/Wizard/Pages/passwd-set.qml:60
268msgid "Enter passphrase"
278msgid "Enter passphrase"
269−msgstr ""
279+msgstr "Vložte heslo"
270
280
271#: qml/Greeter/NarrowView.qml:117
281#: qml/Greeter/NarrowView.qml:117
272msgid "Enter passcode"
282msgid "Enter passcode"
273−msgstr ""
283+msgstr "Vložte heslo"
274
284
275#: qml/Greeter/NarrowView.qml:118
285#: qml/Greeter/NarrowView.qml:118
276#, qt-format
286#, qt-format
277msgid "Sorry, incorrect %1"
287msgid "Sorry, incorrect %1"
278−msgstr ""
288+msgstr "Špatné %1"
279
289
280#: qml/Greeter/NarrowView.qml:119
290#: qml/Greeter/NarrowView.qml:119
281msgid "Sorry, incorrect passphrase"
291msgid "Sorry, incorrect passphrase"
282−msgstr ""
292+msgstr "Špatné heslo"
283
293
284#: qml/Greeter/NarrowView.qml:120
294#: qml/Greeter/NarrowView.qml:120
285msgid "Please re-enter"
295msgid "Please re-enter"
286−msgstr ""
296+msgstr "Vložte znovu"
287
297
288#: qml/Greeter/NarrowView.qml:121
298#: qml/Greeter/NarrowView.qml:121
289msgid "Sorry, incorrect passcode"
299msgid "Sorry, incorrect passcode"
290−msgstr ""
300+msgstr "Špatné heslo"
291
301
292#: qml/Notifications/NotificationMenuItemFactory.qml:128
302#: qml/Notifications/NotificationMenuItemFactory.qml:128
293msgid "Show password"
303msgid "Show password"
@@ -295,211 +305,211 @@ msgstr "Zobrazit heslo"
295
305
296#: qml/Panel/ActiveCallHint.qml:79
306#: qml/Panel/ActiveCallHint.qml:79
297msgid "Tap to return to call..."
307msgid "Tap to return to call..."
298−msgstr ""
308+msgstr "Klepnutím se vrátíte k hovoru..."
299
309
300#: qml/Panel/ActiveCallHint.qml:92
310#: qml/Panel/ActiveCallHint.qml:92
301msgid "Conference"
311msgid "Conference"
302−msgstr ""
312+msgstr "Konferenční hovor"
303
313
304#: qml/Panel/Indicators/MenuItemFactory.qml:639
314#: qml/Panel/Indicators/MenuItemFactory.qml:639
305msgid "Nothing is playing"
315msgid "Nothing is playing"
306−msgstr ""
316+msgstr "Nic se nepřehrává"
307
317
308#: qml/Panel/Indicators/MenuItemFactory.qml:787
318#: qml/Panel/Indicators/MenuItemFactory.qml:787
309msgid "In queue…"
319msgid "In queue…"
310−msgstr ""
320+msgstr "Ve frontě..."
311
321
312#: qml/Panel/Indicators/MenuItemFactory.qml:791
322#: qml/Panel/Indicators/MenuItemFactory.qml:791
313msgid "Downloading"
323msgid "Downloading"
314−msgstr ""
324+msgstr "Stahování"
315
325
316#: qml/Panel/Indicators/MenuItemFactory.qml:793
326#: qml/Panel/Indicators/MenuItemFactory.qml:793
317msgid "Paused, tap to resume"
327msgid "Paused, tap to resume"
318−msgstr ""
328+msgstr "Pauza, pro pokračování klepněte"
319
329
320#: qml/Panel/Indicators/MenuItemFactory.qml:795
330#: qml/Panel/Indicators/MenuItemFactory.qml:795
321msgid "Canceled"
331msgid "Canceled"
322−msgstr ""
332+msgstr "Zrušeno"
323
333
324#: qml/Panel/Indicators/MenuItemFactory.qml:797
334#: qml/Panel/Indicators/MenuItemFactory.qml:797
325msgid "Finished"
335msgid "Finished"
326−msgstr ""
336+msgstr "Dokončeno"
327
337
328#: qml/Panel/Indicators/MenuItemFactory.qml:799
338#: qml/Panel/Indicators/MenuItemFactory.qml:799
329msgid "Failed, tap to retry"
339msgid "Failed, tap to retry"
330−msgstr ""
340+msgstr "Nezdařilo se, opakujte klepnutím"
331
341
332#: qml/Panel/Indicators/MessageMenuItemFactory.qml:149
342#: qml/Panel/Indicators/MessageMenuItemFactory.qml:149
333msgctxt "Label: Hint in message indicator line edit"
343msgctxt "Label: Hint in message indicator line edit"
334msgid "Reply"
344msgid "Reply"
335−msgstr ""
345+msgstr "Odpovědět"
336
346
337#: qml/Panel/Indicators/ModemInfoItem.qml:105
347#: qml/Panel/Indicators/ModemInfoItem.qml:105
338msgid "Unlock SIM"
348msgid "Unlock SIM"
339−msgstr ""
349+msgstr "Odemknout SIM"
340
350
341#: qml/Panel/Indicators/RoamingIndication.qml:27
351#: qml/Panel/Indicators/RoamingIndication.qml:27
342msgid "Roaming"
352msgid "Roaming"
343−msgstr ""
353+msgstr "Roaming"
344
354
345#: qml/Tutorial/TutorialBottomFinish.qml:24
355#: qml/Tutorial/TutorialBottomFinish.qml:24
346msgid "This action does different things for different apps"
356msgid "This action does different things for different apps"
347−msgstr ""
357+msgstr "Tato akce vyvolá různé reakce v rozdílných aplikacích"
348
358
349#: qml/Tutorial/TutorialBottomFinish.qml:25
359#: qml/Tutorial/TutorialBottomFinish.qml:25
350msgid "Tap here to finish."
360msgid "Tap here to finish."
351−msgstr ""
361+msgstr "Klepněte zde pro dokončení."
352
362
353#: qml/Tutorial/TutorialBottom.qml:28
363#: qml/Tutorial/TutorialBottom.qml:28
354msgid "Open special menus"
364msgid "Open special menus"
355−msgstr ""
365+msgstr "Otevřít speciální menu"
356
366
357#: qml/Tutorial/TutorialBottom.qml:29
367#: qml/Tutorial/TutorialBottom.qml:29
358msgid "Swipe up from the bottom edge."
368msgid "Swipe up from the bottom edge."
359−msgstr ""
369+msgstr "Potáhněte prstem z dola nahoru."
360
370
361#: qml/Tutorial/TutorialContent.qml:81 qml/Tutorial/TutorialLeftFinish.qml:25
371#: qml/Tutorial/TutorialContent.qml:81 qml/Tutorial/TutorialLeftFinish.qml:25
362#: qml/Tutorial/TutorialRight.qml:144
372#: qml/Tutorial/TutorialRight.qml:144
363msgid "Tap here to continue."
373msgid "Tap here to continue."
364−msgstr ""
374+msgstr "Klepněte zde pro pokračování."
365
375
366#: qml/Tutorial/TutorialContent.qml:81
376#: qml/Tutorial/TutorialContent.qml:81
367msgid "Click here to finish."
377msgid "Click here to finish."
368−msgstr ""
378+msgstr "Klikněte zde pro dokončení."
369
379
370#: qml/Tutorial/TutorialLeftFinish.qml:24
380#: qml/Tutorial/TutorialLeftFinish.qml:24
371msgid "These are the shortcuts to favorite apps"
381msgid "These are the shortcuts to favorite apps"
372−msgstr ""
382+msgstr "Zde jsou odkazy na vaše oblíbené aplikace"
373
383
374#: qml/Tutorial/TutorialLeft.qml:26
384#: qml/Tutorial/TutorialLeft.qml:26
375msgid "Open the launcher"
385msgid "Open the launcher"
376−msgstr ""
386+msgstr "Otevřete launcher"
377
387
378#: qml/Tutorial/TutorialLeft.qml:27
388#: qml/Tutorial/TutorialLeft.qml:27
379msgid "Short swipe from the left edge."
389msgid "Short swipe from the left edge."
380−msgstr ""
390+msgstr "Potáhněte krátce z levého okraje."
381
391
382#: qml/Tutorial/TutorialPage.qml:178
392#: qml/Tutorial/TutorialPage.qml:178
383msgid "You almost got it!"
393msgid "You almost got it!"
384−msgstr ""
394+msgstr "Už to skoro máte!"
385
395
386#: qml/Tutorial/TutorialPage.qml:195
396#: qml/Tutorial/TutorialPage.qml:195
387msgid "Try again."
397msgid "Try again."
388−msgstr ""
398+msgstr "Zkuste to znovu."
389
399
390#: qml/Tutorial/TutorialRight.qml:31
400#: qml/Tutorial/TutorialRight.qml:31
391msgid "To view open apps"
401msgid "To view open apps"
392−msgstr ""
402+msgstr "K zobrazení otevřených aplikací"
393
403
394#: qml/Tutorial/TutorialRight.qml:32
404#: qml/Tutorial/TutorialRight.qml:32
395msgid "Long swipe from the right edge."
405msgid "Long swipe from the right edge."
396−msgstr ""
406+msgstr "Potáhněte dlouho z pravého okraje."
397
407
398#: qml/Tutorial/TutorialRight.qml:122
408#: qml/Tutorial/TutorialRight.qml:122
399msgid "View all your running tasks."
409msgid "View all your running tasks."
400−msgstr ""
410+msgstr "Zobrazíte všechny běžící procesy."
401
411
402#: qml/Wizard/Page.qml:89
412#: qml/Wizard/Page.qml:89
403msgctxt "Button: Go back one page in the Wizard"
413msgctxt "Button: Go back one page in the Wizard"
404msgid "Back"
414msgid "Back"
405−msgstr ""
415+msgstr "Zpět"
406
416
407#: qml/Wizard/Pages/10-welcome.qml:27
417#: qml/Wizard/Pages/10-welcome.qml:27
408msgid "Hi!"
418msgid "Hi!"
409−msgstr ""
419+msgstr "Ahoj!"
410
420
411#: qml/Wizard/Pages/10-welcome.qml:44
421#: qml/Wizard/Pages/10-welcome.qml:44
412msgid "Welcome to your Ubuntu phone."
422msgid "Welcome to your Ubuntu phone."
413−msgstr ""
423+msgstr "Vítejte ve vašem Ubuntu telefonu."
414
424
415#: qml/Wizard/Pages/10-welcome.qml:52
425#: qml/Wizard/Pages/10-welcome.qml:52
416msgid "Let’s get started."
426msgid "Let’s get started."
417−msgstr ""
427+msgstr "Začněme."
418
428
419#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
429#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
420#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
430#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
421#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
431#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
422#: qml/Wizard/Pages/passwd-set.qml:90
432#: qml/Wizard/Pages/passwd-set.qml:90
423msgid "Continue"
433msgid "Continue"
424−msgstr ""
434+msgstr "Pokračovat"
425
435
426#: qml/Wizard/Pages/20-sim.qml:25
436#: qml/Wizard/Pages/20-sim.qml:25
427msgid "Add a SIM card and restart your device"
437msgid "Add a SIM card and restart your device"
428−msgstr ""
438+msgstr "Vložte SIM kartu a restartujte své zařízení"
429
439
430#: qml/Wizard/Pages/20-sim.qml:59
440#: qml/Wizard/Pages/20-sim.qml:59
431msgid "Without it, you won’t be able to make calls or use text messaging."
441msgid "Without it, you won’t be able to make calls or use text messaging."
432−msgstr ""
442+msgstr "Bez ni nebudete moci telefonovat nebo posílat textové zprávy."
433
443
434#: qml/Wizard/Pages/20-sim.qml:73 qml/Wizard/Pages/40-wifi.qml:215
444#: qml/Wizard/Pages/20-sim.qml:73 qml/Wizard/Pages/40-wifi.qml:215
435msgid "Skip"
445msgid "Skip"
436−msgstr ""
446+msgstr "Přeskočit"
437
447
438#: qml/Wizard/Pages/30-passwd-type.qml:39
448#: qml/Wizard/Pages/30-passwd-type.qml:39
439msgid "Lock security"
449msgid "Lock security"
440−msgstr ""
450+msgstr "Bezpečnostní uzamčení"
441
451
442#: qml/Wizard/Pages/30-passwd-type.qml:74
452#: qml/Wizard/Pages/30-passwd-type.qml:74
443msgid "Please select how you’d like to unlock your phone."
453msgid "Please select how you’d like to unlock your phone."
444−msgstr ""
454+msgstr "Zvolte, prosím, jak chcete svůj telefon odemykat."
445
455
446#: qml/Wizard/Pages/30-passwd-type.qml:97
456#: qml/Wizard/Pages/30-passwd-type.qml:97
447msgctxt "Label: Type of security method"
457msgctxt "Label: Type of security method"
448msgid "Swipe"
458msgid "Swipe"
449−msgstr ""
459+msgstr "Potažením prstu"
450
460
451#: qml/Wizard/Pages/30-passwd-type.qml:98
461#: qml/Wizard/Pages/30-passwd-type.qml:98
452msgctxt "Label: Description of security method"
462msgctxt "Label: Description of security method"
453msgid "No security"
463msgid "No security"
454−msgstr ""
464+msgstr "Bez zabezpečení"
455
465
456#: qml/Wizard/Pages/30-passwd-type.qml:100
466#: qml/Wizard/Pages/30-passwd-type.qml:100
457msgctxt "Label: Type of security method"
467msgctxt "Label: Type of security method"
458msgid "Passcode"
468msgid "Passcode"
459−msgstr ""
469+msgstr "Číselné heslo"
460
470
461#: qml/Wizard/Pages/30-passwd-type.qml:101
471#: qml/Wizard/Pages/30-passwd-type.qml:101
462msgctxt "Label: Description of security method"
472msgctxt "Label: Description of security method"
463msgid "4 digits only"
473msgid "4 digits only"
464−msgstr ""
474+msgstr "Pouze 4 čísla"
465
475
466#: qml/Wizard/Pages/30-passwd-type.qml:103
476#: qml/Wizard/Pages/30-passwd-type.qml:103
467msgctxt "Label: Type of security method"
477msgctxt "Label: Type of security method"
468msgid "Passphrase"
478msgid "Passphrase"
469−msgstr ""
479+msgstr "Heslo"
470
480
471#: qml/Wizard/Pages/30-passwd-type.qml:104
481#: qml/Wizard/Pages/30-passwd-type.qml:104
472msgctxt "Label: Description of security method"
482msgctxt "Label: Description of security method"
473msgid "Numbers and letters"
483msgid "Numbers and letters"
474−msgstr ""
484+msgstr "Čísla a písmena"
475
485
476#: qml/Wizard/Pages/40-wifi.qml:29
486#: qml/Wizard/Pages/40-wifi.qml:29
477msgid "Connect to Wi‑Fi"
487msgid "Connect to Wi‑Fi"
478−msgstr ""
488+msgstr "Připojte se k Wi-Fi"
479
489
480#: qml/Wizard/Pages/40-wifi.qml:168
490#: qml/Wizard/Pages/40-wifi.qml:168
481msgid "Available networks…"
491msgid "Available networks…"
482−msgstr ""
492+msgstr "Dostupné sítě..."
483
493
484#: qml/Wizard/Pages/40-wifi.qml:169
494#: qml/Wizard/Pages/40-wifi.qml:169
485msgid "No available networks."
495msgid "No available networks."
486−msgstr ""
496+msgstr "Žádná dostupná síť."
487
497
488#: qml/Wizard/Pages/50-location.qml:27
498#: qml/Wizard/Pages/50-location.qml:27
489msgid "Location"
499msgid "Location"
490−msgstr ""
500+msgstr "Umístění"
491
501
492#: qml/Wizard/Pages/50-location.qml:62
502#: qml/Wizard/Pages/50-location.qml:62
493msgid "Let the phone detect your location:"
503msgid "Let the phone detect your location:"
494−msgstr ""
504+msgstr "Povolte telefonu zjistit, kde se zrovna nacházíte:"
495
505
496#: qml/Wizard/Pages/50-location.qml:69
506#: qml/Wizard/Pages/50-location.qml:69
497msgid "Using GPS only (less accurate)"
507msgid "Using GPS only (less accurate)"
498−msgstr ""
508+msgstr "Používat pouze GPS (méně přesné)"
499
509
500#: qml/Wizard/Pages/50-location.qml:86
510#: qml/Wizard/Pages/50-location.qml:86
501msgid "Using GPS, anonymized Wi-Fi and cellular network info (recommended)"
511msgid "Using GPS, anonymized Wi-Fi and cellular network info (recommended)"
502−msgstr ""
512+msgstr "Používat GPS, anonymní Wi-Fi a datovou síť (doporučeno)"
503
513
504#. TRANSLATORS: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
514#. TRANSLATORS: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
505#: qml/Wizard/Pages/50-location.qml:103
515#: qml/Wizard/Pages/50-location.qml:103
@@ -507,81 +517,88 @@ msgid ""
507"By selecting this option you agree to the Nokia HERE <a href='#'>terms and "
517"By selecting this option you agree to the Nokia HERE <a href='#'>terms and "
508"conditions</a>."
518"conditions</a>."
509msgstr ""
519msgstr ""
520+"Zvolením této možnosti souhlasíte s <a href='#'>pravidly a podmínkami</a> "
521+"Nokia HERE."
510
522
511#: qml/Wizard/Pages/50-location.qml:112
523#: qml/Wizard/Pages/50-location.qml:112
512msgid "Not at all"
524msgid "Not at all"
513−msgstr ""
525+msgstr "V žádném případě"
514
526
515#: qml/Wizard/Pages/50-location.qml:124
527#: qml/Wizard/Pages/50-location.qml:124
516msgid "You can change your mind later in <b>System Settings</b>."
528msgid "You can change your mind later in <b>System Settings</b>."
517msgstr ""
529msgstr ""
530+"Pokud změníte názor, můžete nastavení změnit v <b>Nastavení systému</b>."
518
531
519#: qml/Wizard/Pages/60-reporting.qml:24
532#: qml/Wizard/Pages/60-reporting.qml:24
520msgid "Improving your experience"
533msgid "Improving your experience"
521−msgstr ""
534+msgstr "Zlepšete své zkušenosti"
522
535
523#: qml/Wizard/Pages/60-reporting.qml:36
536#: qml/Wizard/Pages/60-reporting.qml:36
524msgid ""
537msgid ""
525"Your phone is set up to automatically report errors to Canonical and its "
538"Your phone is set up to automatically report errors to Canonical and its "
526"partners, the makers of the operating system."
539"partners, the makers of the operating system."
527msgstr ""
540msgstr ""
541+"Váš telefon je nastaven tak, aby automaticky odesílal informace o chybách "
542+"společnosti Canonical a partnerům, kteří stvořili tento operační systém."
528
543
529#: qml/Wizard/Pages/60-reporting.qml:43
544#: qml/Wizard/Pages/60-reporting.qml:43
530msgid ""
545msgid ""
531"This can be disabled in <b>System Settings</b> under <b>Security &amp; "
546"This can be disabled in <b>System Settings</b> under <b>Security &amp; "
532"Privacy</b>"
547"Privacy</b>"
533msgstr ""
548msgstr ""
549+"To může být vypnuto v <b>Nastavení systému</b> v <b>Zabezpečení a "
550+"soukromí</b>"
534
551
535#: qml/Wizard/Pages/80-finished.qml:24
552#: qml/Wizard/Pages/80-finished.qml:24
536msgid "All done"
553msgid "All done"
537−msgstr ""
554+msgstr "Vše je hotovo"
538
555
539#: qml/Wizard/Pages/80-finished.qml:39
556#: qml/Wizard/Pages/80-finished.qml:39
540msgid "Nice work!"
557msgid "Nice work!"
541−msgstr ""
558+msgstr "Skvělá práce!"
542
559
543#: qml/Wizard/Pages/80-finished.qml:46
560#: qml/Wizard/Pages/80-finished.qml:46
544msgid "Your phone is now ready to use."
561msgid "Your phone is now ready to use."
545−msgstr ""
562+msgstr "Váš telefon je nyní připraven k použití."
546
563
547#: qml/Wizard/Pages/80-finished.qml:53
564#: qml/Wizard/Pages/80-finished.qml:53
548msgid "Finish"
565msgid "Finish"
549−msgstr ""
566+msgstr "Dokončit"
550
567
551#: qml/Wizard/Pages/here-terms.qml:27
568#: qml/Wizard/Pages/here-terms.qml:27
552msgid "Terms & Conditions"
569msgid "Terms & Conditions"
553−msgstr ""
570+msgstr "Pravidla a podmínky"
554
571
555#: qml/Wizard/Pages/passwd-confirm.qml:49
572#: qml/Wizard/Pages/passwd-confirm.qml:49
556msgid "Confirm passphrase"
573msgid "Confirm passphrase"
557−msgstr ""
574+msgstr "Potvrdit heslo"
558
575
559#: qml/Wizard/Pages/passwd-confirm.qml:50
576#: qml/Wizard/Pages/passwd-confirm.qml:50
560msgid "Confirm passcode"
577msgid "Confirm passcode"
561−msgstr ""
578+msgstr "Potvrdit číselné heslo"
562
579
563#: qml/Wizard/Pages/passwd-confirm.qml:53
580#: qml/Wizard/Pages/passwd-confirm.qml:53
564#: qml/Wizard/Pages/passwd-confirm.qml:54
581#: qml/Wizard/Pages/passwd-confirm.qml:54
565msgid "Please try again."
582msgid "Please try again."
566−msgstr ""
583+msgstr "Zkuste to, prosím, znovu."
567
584
568#: qml/Wizard/Pages/passwd-set.qml:61
585#: qml/Wizard/Pages/passwd-set.qml:61
569msgid "Choose your passcode"
586msgid "Choose your passcode"
570−msgstr ""
587+msgstr "Zvolte své heslo"
571
588
572#: qml/Wizard/Pages/passwd-set.qml:68
589#: qml/Wizard/Pages/passwd-set.qml:68
573msgid "Passphrase must be 4 characters long"
590msgid "Passphrase must be 4 characters long"
574−msgstr ""
591+msgstr "Heslo musí být alespoň 4 znaky dlouhé"
575
592
576#: qml/Wizard/StackButton.qml:39
593#: qml/Wizard/StackButton.qml:39
577#, qt-format
594#, qt-format
578msgid "〈 %1"
595msgid "〈 %1"
579−msgstr ""
596+msgstr "〈 %1"
580
597
581#: qml/Wizard/StackButton.qml:42
598#: qml/Wizard/StackButton.qml:42
582#, qt-format
599#, qt-format
583msgid "%1 〉"
600msgid "%1 〉"
584−msgstr ""
601+msgstr "%1 〉"
585
602
586#~ msgid "Try swiping from the right edge to unlock the phone"
603#~ msgid "Try swiping from the right edge to unlock the phone"
587#~ msgstr "Pokuste se odemknout telefon potažením prstu z pravého okraje."
604#~ msgstr "Pokuste se odemknout telefon potažením prstu z pravého okraje."
po/de.po+30−30
@@ -8,15 +8,15 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2015-04-14 16:13+0200\n"
10"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-03-06 14:24+0000\n"
11+"PO-Revision-Date: 2015-05-14 15:49+0000\n"
12−"Last-Translator: Niklas Wenzel <nikwen.developer@gmail.com>\n"
12+"Last-Translator: Tobias Bannert <Unknown>\n"
13"Language-Team: German <de@li.org>\n"
13"Language-Team: German <de@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
18+"X-Launchpad-Export-Date: 2015-05-15 05:31+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
19+"X-Generator: Launchpad (build 17493)\n"
20
20
21#: plugins/LightDM/Greeter.cpp:112
21#: plugins/LightDM/Greeter.cpp:112
22msgid "Password: "
22msgid "Password: "
@@ -51,13 +51,13 @@ msgstr ""
51#, qt-format
51#, qt-format
52msgid "Please wait %1 minute and then try again…"
52msgid "Please wait %1 minute and then try again…"
53msgid_plural "Please wait %1 minutes and then try again…"
53msgid_plural "Please wait %1 minutes and then try again…"
54−msgstr[0] "Bitte warten Sie %1 Minute und versuchen Sie es dann erneut..."
54+msgstr[0] "Bitte %1 Minute warten und es dann erneut versuchen …"
55−msgstr[1] "Bitte warten Sie %1 Minuten und versuchen Sie es dann erneut..."
55+msgstr[1] "Bitte %1 Minuten warten und es dann erneut versuchen …"
56
56
57#: qml/Components/Dialogs.qml:69
57#: qml/Components/Dialogs.qml:69
58msgctxt "Title: Lock/Log out dialog"
58msgctxt "Title: Lock/Log out dialog"
59msgid "Log out"
59msgid "Log out"
60−msgstr ""
60+msgstr "Abmelden"
61
61
62#: qml/Components/Dialogs.qml:70
62#: qml/Components/Dialogs.qml:70
63msgid "Are you sure you want to log out?"
63msgid "Are you sure you want to log out?"
@@ -66,12 +66,12 @@ msgstr "Sind Sie sicher, dass Sie sich abmelden wollen?"
66#: qml/Components/Dialogs.qml:72
66#: qml/Components/Dialogs.qml:72
67msgctxt "Button: Lock the system"
67msgctxt "Button: Lock the system"
68msgid "Lock"
68msgid "Lock"
69−msgstr ""
69+msgstr "Sperren"
70
70
71#: qml/Components/Dialogs.qml:79
71#: qml/Components/Dialogs.qml:79
72msgctxt "Button: Log out from the system"
72msgctxt "Button: Log out from the system"
73msgid "Log Out"
73msgid "Log Out"
74−msgstr ""
74+msgstr "Abmelden"
75
75
76#: qml/Components/Dialogs.qml:86 qml/Components/Dialogs.qml:117
76#: qml/Components/Dialogs.qml:86 qml/Components/Dialogs.qml:117
77#: qml/Components/Dialogs.qml:173
77#: qml/Components/Dialogs.qml:173
@@ -81,7 +81,7 @@ msgstr "Abbrechen"
81#: qml/Components/Dialogs.qml:98
81#: qml/Components/Dialogs.qml:98
82msgctxt "Title: Reboot/Shut down dialog"
82msgctxt "Title: Reboot/Shut down dialog"
83msgid "Shut down"
83msgid "Shut down"
84−msgstr ""
84+msgstr "Ausschalten"
85
85
86#: qml/Components/Dialogs.qml:99
86#: qml/Components/Dialogs.qml:99
87msgid "Are you sure you want to shut down?"
87msgid "Are you sure you want to shut down?"
@@ -90,17 +90,17 @@ msgstr "Sind Sie sicher, dass Sie herunterfahren wollen?"
90#: qml/Components/Dialogs.qml:101
90#: qml/Components/Dialogs.qml:101
91msgctxt "Button: Reboot the system"
91msgctxt "Button: Reboot the system"
92msgid "Reboot"
92msgid "Reboot"
93−msgstr ""
93+msgstr "Neustarten"
94
94
95#: qml/Components/Dialogs.qml:109
95#: qml/Components/Dialogs.qml:109
96msgctxt "Button: Shut down the system"
96msgctxt "Button: Shut down the system"
97msgid "Shut down"
97msgid "Shut down"
98−msgstr ""
98+msgstr "Ausschalten"
99
99
100#: qml/Components/Dialogs.qml:129
100#: qml/Components/Dialogs.qml:129
101msgctxt "Title: Reboot dialog"
101msgctxt "Title: Reboot dialog"
102msgid "Reboot"
102msgid "Reboot"
103−msgstr ""
103+msgstr "Neustarten"
104
104
105#: qml/Components/Dialogs.qml:130
105#: qml/Components/Dialogs.qml:130
106msgid "Are you sure you want to reboot?"
106msgid "Are you sure you want to reboot?"
@@ -117,7 +117,7 @@ msgstr "Ja"
117#: qml/Components/Dialogs.qml:152
117#: qml/Components/Dialogs.qml:152
118msgctxt "Title: Power off/Restart dialog"
118msgctxt "Title: Power off/Restart dialog"
119msgid "Power"
119msgid "Power"
120−msgstr ""
120+msgstr "Leistung"
121
121
122#: qml/Components/Dialogs.qml:153
122#: qml/Components/Dialogs.qml:153
123msgid ""
123msgid ""
@@ -130,12 +130,12 @@ msgstr ""
130#: qml/Components/Dialogs.qml:155
130#: qml/Components/Dialogs.qml:155
131msgctxt "Button: Power off the system"
131msgctxt "Button: Power off the system"
132msgid "Power off"
132msgid "Power off"
133−msgstr ""
133+msgstr "Ausschalten"
134
134
135#: qml/Components/Dialogs.qml:164
135#: qml/Components/Dialogs.qml:164
136msgctxt "Button: Restart the system"
136msgctxt "Button: Restart the system"
137msgid "Restart"
137msgid "Restart"
138−msgstr ""
138+msgstr "Neustarten"
139
139
140#: qml/Components/Lockscreen.qml:245
140#: qml/Components/Lockscreen.qml:245
141msgid "Return to Call"
141msgid "Return to Call"
@@ -160,22 +160,22 @@ msgstr "Alle anzeigen"
160#: qml/Dash/GenericScopeView.qml:594
160#: qml/Dash/GenericScopeView.qml:594
161msgctxt "Label: Hint for dash search line edit"
161msgctxt "Label: Hint for dash search line edit"
162msgid "Search"
162msgid "Search"
163−msgstr ""
163+msgstr "Suchen"
164
164
165#: qml/Dash/PageHeader.qml:269
165#: qml/Dash/PageHeader.qml:269
166msgctxt "Button: Open the Ubuntu Store"
166msgctxt "Button: Open the Ubuntu Store"
167msgid "Store"
167msgid "Store"
168−msgstr ""
168+msgstr "Speichern"
169
169
170#: qml/Dash/PageHeader.qml:276
170#: qml/Dash/PageHeader.qml:276
171msgctxt "Button: Start a search in the current dash scope"
171msgctxt "Button: Start a search in the current dash scope"
172msgid "Search"
172msgid "Search"
173−msgstr ""
173+msgstr "Suchen"
174
174
175#: qml/Dash/PageHeader.qml:286
175#: qml/Dash/PageHeader.qml:286
176msgctxt "Button: Show the current dash scope settings"
176msgctxt "Button: Show the current dash scope settings"
177msgid "Settings"
177msgid "Settings"
178−msgstr ""
178+msgstr "Einstellungen"
179
179
180#: qml/Dash/PageHeader.qml:293
180#: qml/Dash/PageHeader.qml:293
181msgid "Remove from Favorites"
181msgid "Remove from Favorites"
@@ -305,7 +305,7 @@ msgstr "Passwort anzeigen"
305
305
306#: qml/Panel/ActiveCallHint.qml:79
306#: qml/Panel/ActiveCallHint.qml:79
307msgid "Tap to return to call..."
307msgid "Tap to return to call..."
308−msgstr "Tippen um zum Anruf zurückzugehen"
308+msgstr "Tippen, um zum Anruf zurückzugehen …"
309
309
310#: qml/Panel/ActiveCallHint.qml:92
310#: qml/Panel/ActiveCallHint.qml:92
311msgid "Conference"
311msgid "Conference"
@@ -342,7 +342,7 @@ msgstr "Fehlgeschlagen, tippen Sie zum Wiederholen"
342#: qml/Panel/Indicators/MessageMenuItemFactory.qml:149
342#: qml/Panel/Indicators/MessageMenuItemFactory.qml:149
343msgctxt "Label: Hint in message indicator line edit"
343msgctxt "Label: Hint in message indicator line edit"
344msgid "Reply"
344msgid "Reply"
345−msgstr ""
345+msgstr "Antworten"
346
346
347#: qml/Panel/Indicators/ModemInfoItem.qml:105
347#: qml/Panel/Indicators/ModemInfoItem.qml:105
348msgid "Unlock SIM"
348msgid "Unlock SIM"
@@ -376,7 +376,7 @@ msgstr "Zum Fortfahren hier tippen."
376
376
377#: qml/Tutorial/TutorialContent.qml:81
377#: qml/Tutorial/TutorialContent.qml:81
378msgid "Click here to finish."
378msgid "Click here to finish."
379−msgstr ""
379+msgstr "Zum Abschließen bitte hier klicken."
380
380
381#: qml/Tutorial/TutorialLeftFinish.qml:24
381#: qml/Tutorial/TutorialLeftFinish.qml:24
382msgid "These are the shortcuts to favorite apps"
382msgid "These are the shortcuts to favorite apps"
@@ -413,7 +413,7 @@ msgstr "Sehen Sie alle Ihre laufenden Anwendungen."
413#: qml/Wizard/Page.qml:89
413#: qml/Wizard/Page.qml:89
414msgctxt "Button: Go back one page in the Wizard"
414msgctxt "Button: Go back one page in the Wizard"
415msgid "Back"
415msgid "Back"
416−msgstr ""
416+msgstr "Zurück"
417
417
418#: qml/Wizard/Pages/10-welcome.qml:27
418#: qml/Wizard/Pages/10-welcome.qml:27
419msgid "Hi!"
419msgid "Hi!"
@@ -457,32 +457,32 @@ msgstr "Bitte wählen Sie aus, wie Sie Ihr Telefon entsperren wollen."
457#: qml/Wizard/Pages/30-passwd-type.qml:97
457#: qml/Wizard/Pages/30-passwd-type.qml:97
458msgctxt "Label: Type of security method"
458msgctxt "Label: Type of security method"
459msgid "Swipe"
459msgid "Swipe"
460−msgstr ""
460+msgstr "Wischen"
461
461
462#: qml/Wizard/Pages/30-passwd-type.qml:98
462#: qml/Wizard/Pages/30-passwd-type.qml:98
463msgctxt "Label: Description of security method"
463msgctxt "Label: Description of security method"
464msgid "No security"
464msgid "No security"
465−msgstr ""
465+msgstr "Keine Sicherheitssperre"
466
466
467#: qml/Wizard/Pages/30-passwd-type.qml:100
467#: qml/Wizard/Pages/30-passwd-type.qml:100
468msgctxt "Label: Type of security method"
468msgctxt "Label: Type of security method"
469msgid "Passcode"
469msgid "Passcode"
470−msgstr ""
470+msgstr "PIN"
471
471
472#: qml/Wizard/Pages/30-passwd-type.qml:101
472#: qml/Wizard/Pages/30-passwd-type.qml:101
473msgctxt "Label: Description of security method"
473msgctxt "Label: Description of security method"
474msgid "4 digits only"
474msgid "4 digits only"
475−msgstr ""
475+msgstr "nur vier Ziffern"
476
476
477#: qml/Wizard/Pages/30-passwd-type.qml:103
477#: qml/Wizard/Pages/30-passwd-type.qml:103
478msgctxt "Label: Type of security method"
478msgctxt "Label: Type of security method"
479msgid "Passphrase"
479msgid "Passphrase"
480−msgstr ""
480+msgstr "Kennwort"
481
481
482#: qml/Wizard/Pages/30-passwd-type.qml:104
482#: qml/Wizard/Pages/30-passwd-type.qml:104
483msgctxt "Label: Description of security method"
483msgctxt "Label: Description of security method"
484msgid "Numbers and letters"
484msgid "Numbers and letters"
485−msgstr ""
485+msgstr "Ziffern und Buchstaben"
486
486
487#: qml/Wizard/Pages/40-wifi.qml:29
487#: qml/Wizard/Pages/40-wifi.qml:29
488msgid "Connect to Wi‑Fi"
488msgid "Connect to Wi‑Fi"
po/fi.po+4−4
@@ -8,15 +8,15 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2015-04-14 16:13+0200\n"
10"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-03-25 07:55+0000\n"
11+"PO-Revision-Date: 2015-05-19 09:14+0000\n"
12"Last-Translator: Jiri Grönroos <Unknown>\n"
12"Last-Translator: Jiri Grönroos <Unknown>\n"
13"Language-Team: Finnish <fi@li.org>\n"
13"Language-Team: Finnish <fi@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
18+"X-Launchpad-Export-Date: 2015-05-20 05:29+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
19+"X-Generator: Launchpad (build 17508)\n"
20
20
21#: plugins/LightDM/Greeter.cpp:112
21#: plugins/LightDM/Greeter.cpp:112
22msgid "Password: "
22msgid "Password: "
@@ -373,7 +373,7 @@ msgstr "Napauta tästä jatkaaksesi."
373
373
374#: qml/Tutorial/TutorialContent.qml:81
374#: qml/Tutorial/TutorialContent.qml:81
375msgid "Click here to finish."
375msgid "Click here to finish."
376−msgstr ""
376+msgstr "Viimeistele napsauttamalla tästä."
377
377
378#: qml/Tutorial/TutorialLeftFinish.qml:24
378#: qml/Tutorial/TutorialLeftFinish.qml:24
379msgid "These are the shortcuts to favorite apps"
379msgid "These are the shortcuts to favorite apps"
po/nn.ponew file+584
@@ -0,0 +1,584 @@
1+# Norwegian Nynorsk translation for unity8
2+# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
3+# This file is distributed under the same license as the unity8 package.
4+# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
5+#
6+msgid ""
7+msgstr ""
8+"Project-Id-Version: unity8\n"
9+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10+"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11+"PO-Revision-Date: 2015-05-12 11:32+0000\n"
12+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13+"Language-Team: Norwegian Nynorsk <nn@li.org>\n"
14+"MIME-Version: 1.0\n"
15+"Content-Type: text/plain; charset=UTF-8\n"
16+"Content-Transfer-Encoding: 8bit\n"
17+"Plural-Forms: nplurals=2; plural=n != 1;\n"
18+"X-Launchpad-Export-Date: 2015-05-13 05:31+0000\n"
19+"X-Generator: Launchpad (build 17493)\n"
20+
21+#: plugins/LightDM/Greeter.cpp:112
22+msgid "Password: "
23+msgstr ""
24+
25+#: plugins/Unity/Launcher/launcheritem.cpp:45
26+#: plugins/Unity/Launcher/launcheritem.cpp:100
27+msgid "Pin shortcut"
28+msgstr ""
29+
30+#: plugins/Unity/Launcher/launcheritem.cpp:100
31+msgid "Unpin shortcut"
32+msgstr ""
33+
34+#: qml/Components/DelayedLockscreen.qml:49
35+msgid "Device Locked"
36+msgstr ""
37+
38+#: qml/Components/DelayedLockscreen.qml:64
39+msgid "You have been locked out due to too many failed passphrase attempts."
40+msgstr ""
41+
42+#: qml/Components/DelayedLockscreen.qml:65
43+msgid "You have been locked out due to too many failed passcode attempts."
44+msgstr ""
45+
46+#: qml/Components/DelayedLockscreen.qml:74
47+#, qt-format
48+msgid "Please wait %1 minute and then try again…"
49+msgid_plural "Please wait %1 minutes and then try again…"
50+msgstr[0] ""
51+msgstr[1] ""
52+
53+#: qml/Components/Dialogs.qml:69
54+msgctxt "Title: Lock/Log out dialog"
55+msgid "Log out"
56+msgstr ""
57+
58+#: qml/Components/Dialogs.qml:70
59+msgid "Are you sure you want to log out?"
60+msgstr ""
61+
62+#: qml/Components/Dialogs.qml:72
63+msgctxt "Button: Lock the system"
64+msgid "Lock"
65+msgstr ""
66+
67+#: qml/Components/Dialogs.qml:79
68+msgctxt "Button: Log out from the system"
69+msgid "Log Out"
70+msgstr ""
71+
72+#: qml/Components/Dialogs.qml:86 qml/Components/Dialogs.qml:117
73+#: qml/Components/Dialogs.qml:173
74+msgid "Cancel"
75+msgstr ""
76+
77+#: qml/Components/Dialogs.qml:98
78+msgctxt "Title: Reboot/Shut down dialog"
79+msgid "Shut down"
80+msgstr ""
81+
82+#: qml/Components/Dialogs.qml:99
83+msgid "Are you sure you want to shut down?"
84+msgstr ""
85+
86+#: qml/Components/Dialogs.qml:101
87+msgctxt "Button: Reboot the system"
88+msgid "Reboot"
89+msgstr ""
90+
91+#: qml/Components/Dialogs.qml:109
92+msgctxt "Button: Shut down the system"
93+msgid "Shut down"
94+msgstr ""
95+
96+#: qml/Components/Dialogs.qml:129
97+msgctxt "Title: Reboot dialog"
98+msgid "Reboot"
99+msgstr ""
100+
101+#: qml/Components/Dialogs.qml:130
102+msgid "Are you sure you want to reboot?"
103+msgstr ""
104+
105+#: qml/Components/Dialogs.qml:132
106+msgid "No"
107+msgstr ""
108+
109+#: qml/Components/Dialogs.qml:138
110+msgid "Yes"
111+msgstr ""
112+
113+#: qml/Components/Dialogs.qml:152
114+msgctxt "Title: Power off/Restart dialog"
115+msgid "Power"
116+msgstr ""
117+
118+#: qml/Components/Dialogs.qml:153
119+msgid ""
120+"Are you sure you would like\n"
121+"to power off?"
122+msgstr ""
123+
124+#: qml/Components/Dialogs.qml:155
125+msgctxt "Button: Power off the system"
126+msgid "Power off"
127+msgstr ""
128+
129+#: qml/Components/Dialogs.qml:164
130+msgctxt "Button: Restart the system"
131+msgid "Restart"
132+msgstr ""
133+
134+#: qml/Components/Lockscreen.qml:245
135+msgid "Return to Call"
136+msgstr ""
137+
138+#: qml/Components/Lockscreen.qml:245
139+msgid "Emergency Call"
140+msgstr ""
141+
142+#: qml/Components/Lockscreen.qml:277
143+msgid "OK"
144+msgstr ""
145+
146+#: qml/Dash/GenericScopeView.qml:532 qml/Dash/GenericScopeView.qml:690
147+msgid "See less"
148+msgstr ""
149+
150+#: qml/Dash/GenericScopeView.qml:532
151+msgid "See all"
152+msgstr ""
153+
154+#: qml/Dash/GenericScopeView.qml:594
155+msgctxt "Label: Hint for dash search line edit"
156+msgid "Search"
157+msgstr ""
158+
159+#: qml/Dash/PageHeader.qml:269
160+msgctxt "Button: Open the Ubuntu Store"
161+msgid "Store"
162+msgstr ""
163+
164+#: qml/Dash/PageHeader.qml:276
165+msgctxt "Button: Start a search in the current dash scope"
166+msgid "Search"
167+msgstr ""
168+
169+#: qml/Dash/PageHeader.qml:286
170+msgctxt "Button: Show the current dash scope settings"
171+msgid "Settings"
172+msgstr ""
173+
174+#: qml/Dash/PageHeader.qml:293
175+msgid "Remove from Favorites"
176+msgstr ""
177+
178+#: qml/Dash/PageHeader.qml:293
179+msgid "Add to Favorites"
180+msgstr ""
181+
182+#: qml/Dash/Previews/PreviewActionCombo.qml:35
183+msgid "More..."
184+msgstr ""
185+
186+#: qml/Dash/Previews/PreviewActionCombo.qml:35
187+msgid "Less..."
188+msgstr ""
189+
190+#: qml/Dash/Previews/PreviewRatingInput.qml:81
191+msgid "Rate this"
192+msgstr ""
193+
194+#: qml/Dash/Previews/PreviewRatingInput.qml:126
195+msgid "Add a review"
196+msgstr ""
197+
198+#: qml/Dash/Previews/PreviewRatingInput.qml:166
199+msgid "Send"
200+msgstr ""
201+
202+#: qml/Dash/PullToRefreshScopeStyle.qml:55
203+msgid "Pull to refresh…"
204+msgstr ""
205+
206+#: qml/Dash/PullToRefreshScopeStyle.qml:60
207+msgid "Release to refresh…"
208+msgstr ""
209+
210+#: qml/Dash/ScopeSettings/ScopeSettingBoolean.qml:43
211+msgid "Enable location data"
212+msgstr ""
213+
214+#: qml/Dash/ScopesList.qml:66
215+msgid "Manage"
216+msgstr ""
217+
218+#: qml/Dash/ScopesList.qml:112
219+msgid "Home"
220+msgstr ""
221+
222+#: qml/Dash/ScopesList.qml:113
223+msgid "Also installed"
224+msgstr ""
225+
226+#: qml/Greeter/CoverPage.qml:107
227+msgid "Unlock"
228+msgstr ""
229+
230+#: qml/Greeter/LoginList.qml:236
231+msgid "Retry"
232+msgstr ""
233+
234+#: qml/Greeter/LoginList.qml:237
235+msgid "Tap to unlock"
236+msgstr ""
237+
238+#: qml/Greeter/NarrowView.qml:53 qml/Wizard/Pages/passwd-confirm.qml:53
239+msgid "Sorry, incorrect passphrase."
240+msgstr ""
241+
242+#: qml/Greeter/NarrowView.qml:54 qml/Wizard/Pages/passwd-confirm.qml:54
243+msgid "Sorry, incorrect passcode."
244+msgstr ""
245+
246+#: qml/Greeter/NarrowView.qml:55
247+msgid "This will be your last attempt."
248+msgstr ""
249+
250+#: qml/Greeter/NarrowView.qml:57
251+msgid ""
252+"If passphrase is entered incorrectly, your phone will conduct a factory "
253+"reset and all personal data will be deleted."
254+msgstr ""
255+
256+#: qml/Greeter/NarrowView.qml:58
257+msgid ""
258+"If passcode is entered incorrectly, your phone will conduct a factory reset "
259+"and all personal data will be deleted."
260+msgstr ""
261+
262+#: qml/Greeter/NarrowView.qml:115
263+#, qt-format
264+msgid "Enter %1"
265+msgstr ""
266+
267+#: qml/Greeter/NarrowView.qml:116 qml/Wizard/Pages/passwd-set.qml:60
268+msgid "Enter passphrase"
269+msgstr ""
270+
271+#: qml/Greeter/NarrowView.qml:117
272+msgid "Enter passcode"
273+msgstr ""
274+
275+#: qml/Greeter/NarrowView.qml:118
276+#, qt-format
277+msgid "Sorry, incorrect %1"
278+msgstr ""
279+
280+#: qml/Greeter/NarrowView.qml:119
281+msgid "Sorry, incorrect passphrase"
282+msgstr ""
283+
284+#: qml/Greeter/NarrowView.qml:120
285+msgid "Please re-enter"
286+msgstr ""
287+
288+#: qml/Greeter/NarrowView.qml:121
289+msgid "Sorry, incorrect passcode"
290+msgstr ""
291+
292+#: qml/Notifications/NotificationMenuItemFactory.qml:128
293+msgid "Show password"
294+msgstr ""
295+
296+#: qml/Panel/ActiveCallHint.qml:79
297+msgid "Tap to return to call..."
298+msgstr ""
299+
300+#: qml/Panel/ActiveCallHint.qml:92
301+msgid "Conference"
302+msgstr ""
303+
304+#: qml/Panel/Indicators/MenuItemFactory.qml:639
305+msgid "Nothing is playing"
306+msgstr ""
307+
308+#: qml/Panel/Indicators/MenuItemFactory.qml:787
309+msgid "In queue…"
310+msgstr ""
311+
312+#: qml/Panel/Indicators/MenuItemFactory.qml:791
313+msgid "Downloading"
314+msgstr ""
315+
316+#: qml/Panel/Indicators/MenuItemFactory.qml:793
317+msgid "Paused, tap to resume"
318+msgstr ""
319+
320+#: qml/Panel/Indicators/MenuItemFactory.qml:795
321+msgid "Canceled"
322+msgstr ""
323+
324+#: qml/Panel/Indicators/MenuItemFactory.qml:797
325+msgid "Finished"
326+msgstr ""
327+
328+#: qml/Panel/Indicators/MenuItemFactory.qml:799
329+msgid "Failed, tap to retry"
330+msgstr ""
331+
332+#: qml/Panel/Indicators/MessageMenuItemFactory.qml:149
333+msgctxt "Label: Hint in message indicator line edit"
334+msgid "Reply"
335+msgstr ""
336+
337+#: qml/Panel/Indicators/ModemInfoItem.qml:105
338+msgid "Unlock SIM"
339+msgstr ""
340+
341+#: qml/Panel/Indicators/RoamingIndication.qml:27
342+msgid "Roaming"
343+msgstr ""
344+
345+#: qml/Tutorial/TutorialBottomFinish.qml:24
346+msgid "This action does different things for different apps"
347+msgstr ""
348+
349+#: qml/Tutorial/TutorialBottomFinish.qml:25
350+msgid "Tap here to finish."
351+msgstr ""
352+
353+#: qml/Tutorial/TutorialBottom.qml:28
354+msgid "Open special menus"
355+msgstr ""
356+
357+#: qml/Tutorial/TutorialBottom.qml:29
358+msgid "Swipe up from the bottom edge."
359+msgstr ""
360+
361+#: qml/Tutorial/TutorialContent.qml:81 qml/Tutorial/TutorialLeftFinish.qml:25
362+#: qml/Tutorial/TutorialRight.qml:144
363+msgid "Tap here to continue."
364+msgstr ""
365+
366+#: qml/Tutorial/TutorialContent.qml:81
367+msgid "Click here to finish."
368+msgstr ""
369+
370+#: qml/Tutorial/TutorialLeftFinish.qml:24
371+msgid "These are the shortcuts to favorite apps"
372+msgstr ""
373+
374+#: qml/Tutorial/TutorialLeft.qml:26
375+msgid "Open the launcher"
376+msgstr ""
377+
378+#: qml/Tutorial/TutorialLeft.qml:27
379+msgid "Short swipe from the left edge."
380+msgstr ""
381+
382+#: qml/Tutorial/TutorialPage.qml:178
383+msgid "You almost got it!"
384+msgstr ""
385+
386+#: qml/Tutorial/TutorialPage.qml:195
387+msgid "Try again."
388+msgstr ""
389+
390+#: qml/Tutorial/TutorialRight.qml:31
391+msgid "To view open apps"
392+msgstr ""
393+
394+#: qml/Tutorial/TutorialRight.qml:32
395+msgid "Long swipe from the right edge."
396+msgstr ""
397+
398+#: qml/Tutorial/TutorialRight.qml:122
399+msgid "View all your running tasks."
400+msgstr ""
401+
402+#: qml/Wizard/Page.qml:89
403+msgctxt "Button: Go back one page in the Wizard"
404+msgid "Back"
405+msgstr ""
406+
407+#: qml/Wizard/Pages/10-welcome.qml:27
408+msgid "Hi!"
409+msgstr ""
410+
411+#: qml/Wizard/Pages/10-welcome.qml:44
412+msgid "Welcome to your Ubuntu phone."
413+msgstr ""
414+
415+#: qml/Wizard/Pages/10-welcome.qml:52
416+msgid "Let’s get started."
417+msgstr ""
418+
419+#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
420+#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
421+#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
422+#: qml/Wizard/Pages/passwd-set.qml:90
423+msgid "Continue"
424+msgstr ""
425+
426+#: qml/Wizard/Pages/20-sim.qml:25
427+msgid "Add a SIM card and restart your device"
428+msgstr ""
429+
430+#: qml/Wizard/Pages/20-sim.qml:59
431+msgid "Without it, you won’t be able to make calls or use text messaging."
432+msgstr ""
433+
434+#: qml/Wizard/Pages/20-sim.qml:73 qml/Wizard/Pages/40-wifi.qml:215
435+msgid "Skip"
436+msgstr ""
437+
438+#: qml/Wizard/Pages/30-passwd-type.qml:39
439+msgid "Lock security"
440+msgstr ""
441+
442+#: qml/Wizard/Pages/30-passwd-type.qml:74
443+msgid "Please select how you’d like to unlock your phone."
444+msgstr ""
445+
446+#: qml/Wizard/Pages/30-passwd-type.qml:97
447+msgctxt "Label: Type of security method"
448+msgid "Swipe"
449+msgstr ""
450+
451+#: qml/Wizard/Pages/30-passwd-type.qml:98
452+msgctxt "Label: Description of security method"
453+msgid "No security"
454+msgstr ""
455+
456+#: qml/Wizard/Pages/30-passwd-type.qml:100
457+msgctxt "Label: Type of security method"
458+msgid "Passcode"
459+msgstr ""
460+
461+#: qml/Wizard/Pages/30-passwd-type.qml:101
462+msgctxt "Label: Description of security method"
463+msgid "4 digits only"
464+msgstr ""
465+
466+#: qml/Wizard/Pages/30-passwd-type.qml:103
467+msgctxt "Label: Type of security method"
468+msgid "Passphrase"
469+msgstr ""
470+
471+#: qml/Wizard/Pages/30-passwd-type.qml:104
472+msgctxt "Label: Description of security method"
473+msgid "Numbers and letters"
474+msgstr ""
475+
476+#: qml/Wizard/Pages/40-wifi.qml:29
477+msgid "Connect to Wi‑Fi"
478+msgstr ""
479+
480+#: qml/Wizard/Pages/40-wifi.qml:168
481+msgid "Available networks…"
482+msgstr ""
483+
484+#: qml/Wizard/Pages/40-wifi.qml:169
485+msgid "No available networks."
486+msgstr ""
487+
488+#: qml/Wizard/Pages/50-location.qml:27
489+msgid "Location"
490+msgstr ""
491+
492+#: qml/Wizard/Pages/50-location.qml:62
493+msgid "Let the phone detect your location:"
494+msgstr ""
495+
496+#: qml/Wizard/Pages/50-location.qml:69
497+msgid "Using GPS only (less accurate)"
498+msgstr ""
499+
500+#: qml/Wizard/Pages/50-location.qml:86
501+msgid "Using GPS, anonymized Wi-Fi and cellular network info (recommended)"
502+msgstr ""
503+
504+#. TRANSLATORS: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
505+#: qml/Wizard/Pages/50-location.qml:103
506+msgid ""
507+"By selecting this option you agree to the Nokia HERE <a href='#'>terms and "
508+"conditions</a>."
509+msgstr ""
510+
511+#: qml/Wizard/Pages/50-location.qml:112
512+msgid "Not at all"
513+msgstr ""
514+
515+#: qml/Wizard/Pages/50-location.qml:124
516+msgid "You can change your mind later in <b>System Settings</b>."
517+msgstr ""
518+
519+#: qml/Wizard/Pages/60-reporting.qml:24
520+msgid "Improving your experience"
521+msgstr ""
522+
523+#: qml/Wizard/Pages/60-reporting.qml:36
524+msgid ""
525+"Your phone is set up to automatically report errors to Canonical and its "
526+"partners, the makers of the operating system."
527+msgstr ""
528+
529+#: qml/Wizard/Pages/60-reporting.qml:43
530+msgid ""
531+"This can be disabled in <b>System Settings</b> under <b>Security &amp; "
532+"Privacy</b>"
533+msgstr ""
534+
535+#: qml/Wizard/Pages/80-finished.qml:24
536+msgid "All done"
537+msgstr ""
538+
539+#: qml/Wizard/Pages/80-finished.qml:39
540+msgid "Nice work!"
541+msgstr ""
542+
543+#: qml/Wizard/Pages/80-finished.qml:46
544+msgid "Your phone is now ready to use."
545+msgstr ""
546+
547+#: qml/Wizard/Pages/80-finished.qml:53
548+msgid "Finish"
549+msgstr ""
550+
551+#: qml/Wizard/Pages/here-terms.qml:27
552+msgid "Terms & Conditions"
553+msgstr ""
554+
555+#: qml/Wizard/Pages/passwd-confirm.qml:49
556+msgid "Confirm passphrase"
557+msgstr ""
558+
559+#: qml/Wizard/Pages/passwd-confirm.qml:50
560+msgid "Confirm passcode"
561+msgstr ""
562+
563+#: qml/Wizard/Pages/passwd-confirm.qml:53
564+#: qml/Wizard/Pages/passwd-confirm.qml:54
565+msgid "Please try again."
566+msgstr ""
567+
568+#: qml/Wizard/Pages/passwd-set.qml:61
569+msgid "Choose your passcode"
570+msgstr ""
571+
572+#: qml/Wizard/Pages/passwd-set.qml:68
573+msgid "Passphrase must be 4 characters long"
574+msgstr ""
575+
576+#: qml/Wizard/StackButton.qml:39
577+#, qt-format
578+msgid "〈 %1"
579+msgstr ""
580+
581+#: qml/Wizard/StackButton.qml:42
582+#, qt-format
583+msgid "%1 〉"
584+msgstr ""
po/pt.po+7−7
@@ -8,15 +8,15 @@ msgstr ""
8"Project-Id-Version: unity8\n"
8"Project-Id-Version: unity8\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2015-04-14 16:13+0200\n"
10"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-04-18 02:15+0000\n"
11+"PO-Revision-Date: 2015-05-19 03:42+0000\n"
12"Last-Translator: António Miranda <Unknown>\n"
12"Last-Translator: António Miranda <Unknown>\n"
13"Language-Team: Portuguese <pt@li.org>\n"
13"Language-Team: Portuguese <pt@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
18+"X-Launchpad-Export-Date: 2015-05-20 05:29+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
19+"X-Generator: Launchpad (build 17508)\n"
20
20
21#: plugins/LightDM/Greeter.cpp:112
21#: plugins/LightDM/Greeter.cpp:112
22msgid "Password: "
22msgid "Password: "
@@ -262,7 +262,7 @@ msgid ""
262"If passcode is entered incorrectly, your phone will conduct a factory reset "
262"If passcode is entered incorrectly, your phone will conduct a factory reset "
263"and all personal data will be deleted."
263"and all personal data will be deleted."
264msgstr ""
264msgstr ""
265−"Se o código seja introduzido incorretamente, todos os dados pessoais do seu "
265+"Se o código não for introduzido corretamente, todos os dados pessoais do seu "
266"telemóvel serão apagados."
266"telemóvel serão apagados."
267
267
268#: qml/Greeter/NarrowView.qml:115
268#: qml/Greeter/NarrowView.qml:115
@@ -276,7 +276,7 @@ msgstr "Indique a palavra-passe"
276
276
277#: qml/Greeter/NarrowView.qml:117
277#: qml/Greeter/NarrowView.qml:117
278msgid "Enter passcode"
278msgid "Enter passcode"
279−msgstr "Introduza código"
279+msgstr "Introduza o código"
280
280
281#: qml/Greeter/NarrowView.qml:118
281#: qml/Greeter/NarrowView.qml:118
282#, qt-format
282#, qt-format
@@ -293,7 +293,7 @@ msgstr "Por favor, volte a introduzir"
293
293
294#: qml/Greeter/NarrowView.qml:121
294#: qml/Greeter/NarrowView.qml:121
295msgid "Sorry, incorrect passcode"
295msgid "Sorry, incorrect passcode"
296−msgstr "Código incorreta"
296+msgstr "Código incorreto"
297
297
298#: qml/Notifications/NotificationMenuItemFactory.qml:128
298#: qml/Notifications/NotificationMenuItemFactory.qml:128
299msgid "Show password"
299msgid "Show password"
@@ -371,7 +371,7 @@ msgstr "Toque aqui para continuar."
371
371
372#: qml/Tutorial/TutorialContent.qml:81
372#: qml/Tutorial/TutorialContent.qml:81
373msgid "Click here to finish."
373msgid "Click here to finish."
374−msgstr ""
374+msgstr "Clique aqui para finalizar."
375
375
376#: qml/Tutorial/TutorialLeftFinish.qml:24
376#: qml/Tutorial/TutorialLeftFinish.qml:24
377msgid "These are the shortcuts to favorite apps"
377msgid "These are the shortcuts to favorite apps"
qml/Dash/GenericScopeView.qml+6−6
@@ -67,8 +67,8 @@ FocusScope {
67 subPageLoader.closeSubPage()
67 subPageLoader.closeSubPage()
68 }
68 }
69
69
70− function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount) {
70+ function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount, categoryId) {
71− if (itemModel.uri.indexOf("scope://") === 0 || scope.id === "clickscope") {
71+ if (itemModel.uri.indexOf("scope://") === 0 || scope.id === "clickscope" || (scope.id === "videoaggregator" && categoryId === "myvideos-getstarted")) {
72 // TODO Technically it is possible that calling activate() will make the scope emit
72 // TODO Technically it is possible that calling activate() will make the scope emit
73 // previewRequested so that we show a preview but there's no scope that does that yet
73 // previewRequested so that we show a preview but there's no scope that does that yet
74 // so it's not implemented
74 // so it's not implemented
@@ -80,8 +80,8 @@ FocusScope {
80 }
80 }
81 }
81 }
82
82
83− function itemPressedAndHeld(index, result, itemModel, resultsModel, limitedCategoryItemCount) {
83+ function itemPressedAndHeld(index, result, itemModel, resultsModel, limitedCategoryItemCount, categoryId) {
84− if (itemModel.uri.indexOf("scope://") !== 0) {
84+ if (itemModel.uri.indexOf("scope://") !== 0 && !(scope.id === "videoaggregator" && categoryId === "myvideos-getstarted")) {
85 if (scope.preview(result)) {
85 if (scope.preview(result)) {
86 openPreview(index, resultsModel, limitedCategoryItemCount);
86 openPreview(index, resultsModel, limitedCategoryItemCount);
87 }
87 }
@@ -346,11 +346,11 @@ FocusScope {
346 Connections {
346 Connections {
347 target: rendererLoader.item
347 target: rendererLoader.item
348 onClicked: {
348 onClicked: {
349− scopeView.itemClicked(index, result, item, itemModel, target.model, categoryItemCount());
349+ scopeView.itemClicked(index, result, item, itemModel, target.model, categoryItemCount(), baseItem.category);
350 }
350 }
351
351
352 onPressAndHold: {
352 onPressAndHold: {
353− scopeView.itemPressedAndHeld(index, result, itemModel, target.model, categoryItemCount());
353+ scopeView.itemPressedAndHeld(index, result, itemModel, target.model, categoryItemCount(), baseItem.category);
354 }
354 }
355
355
356 function categoryItemCount() {
356 function categoryItemCount() {
qml/Dash/Previews/PreviewRatingDisplay.qml+9−44
@@ -49,53 +49,18 @@ PreviewWidget {
49 objectName: "reviewsRepeater"
49 objectName: "reviewsRepeater"
50 model: root.widgetData["reviews"]
50 model: root.widgetData["reviews"]
51
51
52− delegate: Column {
52+ delegate: PreviewRatingSingleDisplay {
53− id: reviewItem
54 objectName: "reviewItem" + index
53 objectName: "reviewItem" + index
55− anchors { left: parent.left; right: parent.right;}
56− spacing: units.gu(1)
57
54
58− Rating {
55+ anchors { left: parent.left; right: parent.right; }
59− id: rating
60− objectName: "rating"
61− size: 5
62− value: modelData["rating"] || -1
63− visible: value >= 0
64− interactive: false
65
56
57+ rating: modelData["rating"] || -1
58+ author: modelData["author"] || ""
59+ review: modelData["review"] || ""
66− property var urlIconEmpty: widgetData["rating-icon-empty"]
60+ urlIconEmpty: widgetData["rating-icon-empty"]
67− property var urlIconFull: widgetData["rating-icon-full"]
61+ urlIconFull: widgetData["rating-icon-full"]
68− property var urlIconHalf: widgetData["rating-icon-half"]
62+ urlIconHalf: widgetData["rating-icon-half"]
69− }
70−
71− Label {
72− id: authorLabel
73− objectName: "authorLabel"
74− anchors { left: parent.left; right: parent.right }
75− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
76− opacity: .8
77− text: modelData["author"] || ""
78− visible: text !== ""
79− wrapMode: Text.Wrap
80− }
81−
82− Label {
83− id: reviewLabel
84− objectName: "reviewLabel"
85− anchors { left: parent.left; right: parent.right }
86− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
63+ labelColor: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
87− opacity: .8
88− text: modelData["review"] || ""
89− visible: text !== ""
90− wrapMode: Text.Wrap
91− }
92−
93− Item {
94− id: spacing
95− anchors { left: parent.left; right: parent.right }
96− height: units.gu(2)
97− visible: rating.visible || authorLabel.visible || reviewLabel.visible
98− }
99 }
64 }
100 }
65 }
101 }
66 }
qml/Dash/Previews/PreviewRatingEdit.qmlnew file+80
@@ -0,0 +1,80 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 0.1
19+import "../../Components"
20+
21+/*! \brief Preview widget for editable rating.
22+
23+ Shows a single display rating that can be switched by the user to edit mode
24+ and then behaves as a rating display widget
25+
26+ The display part uses widgetData["author"], widgetData["review"] and widgetData["rating"].
27+
28+ The edit part uses the same fields as the "rating-input" widget
29+*/
30+
31+PreviewWidget {
32+ id: root
33+ implicitHeight: display.visible ? display.implicitHeight : input.implicitHeight
34+
35+ Button {
36+ id: editIcon
37+ objectName: "editButton"
38+
39+ iconName: "edit"
40+ width: height
41+ anchors.right: parent.right
42+ visible: display.visible
43+ onClicked: display.visible = false
44+ }
45+
46+ PreviewRatingSingleDisplay {
47+ id: display
48+ objectName: "display"
49+
50+ anchors.left: parent.left
51+ anchors.right: editIcon.left
52+
53+ rating: widgetData["rating"] || -1
54+ author: widgetData["author"] || ""
55+ review: widgetData["review"] || ""
56+ urlIconEmpty: widgetData["rating-icon-empty"]
57+ urlIconFull: widgetData["rating-icon-full"]
58+ urlIconHalf: widgetData["rating-icon-half"]
59+ labelColor: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
60+ }
61+
62+ PreviewRatingInput {
63+ id: input
64+ objectName: "input"
65+
66+ visible: !display.visible
67+ width: parent.width
68+
69+ widgetId: root.widgetId
70+ widgetData: root.widgetData
71+ isCurrentPreview: root.isCurrentPreview
72+ scopeStyle: root.scopeStyle
73+
74+ ratingValue: widgetData["rating"]
75+ reviewText: widgetData["review"]
76+
77+ onTriggered: root.triggered(widgetId, actionId, data);
78+ }
79+
80+}
qml/Dash/Previews/PreviewRatingInput.qml+3
@@ -48,6 +48,9 @@ PreviewWidget {
48 }
48 }
49 }
49 }
50
50
51+ property alias ratingValue: rating.value
52+ property alias reviewText: reviewTextArea.text
53+
51 function submit() {
54 function submit() {
52 // checks rating-input requirements
55 // checks rating-input requirements
53 if (((widgetData["required"] === "both" ||
56 if (((widgetData["required"] === "both" ||
qml/Dash/Previews/PreviewRatingSingleDisplay.qmlnew file+70
@@ -0,0 +1,70 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 0.1
19+import "../../Components"
20+
21+Column {
22+ id: reviewItem
23+ spacing: units.gu(1)
24+
25+ property alias rating: ratingItem.value
26+ property alias author: authorLabel.text
27+ property alias review: reviewLabel.text
28+ property alias urlIconEmpty: ratingItem.urlIconEmpty
29+ property alias urlIconFull: ratingItem.urlIconFull
30+ property alias urlIconHalf: ratingItem.urlIconHalf
31+ property alias labelColor: authorLabel.color
32+
33+ Rating {
34+ id: ratingItem
35+ objectName: "rating"
36+ size: 5
37+ visible: value >= 0
38+ interactive: false
39+
40+ property var urlIconEmpty
41+ property var urlIconFull
42+ property var urlIconHalf
43+ }
44+
45+ Label {
46+ id: authorLabel
47+ objectName: "authorLabel"
48+ anchors { left: parent.left; right: parent.right }
49+ opacity: .8
50+ visible: text !== ""
51+ wrapMode: Text.Wrap
52+ }
53+
54+ Label {
55+ id: reviewLabel
56+ objectName: "reviewLabel"
57+ anchors { left: parent.left; right: parent.right }
58+ color: authorLabel.color
59+ opacity: .8
60+ visible: text !== ""
61+ wrapMode: Text.Wrap
62+ }
63+
64+ Item {
65+ id: spacing
66+ anchors { left: parent.left; right: parent.right }
67+ height: units.gu(2)
68+ visible: rating.visible || authorLabel.visible || reviewLabel.visible
69+ }
70+}
qml/Dash/Previews/PreviewWidgetFactory.qml+1
@@ -57,6 +57,7 @@ Loader {
57 case "progress": return "PreviewProgress.qml";
57 case "progress": return "PreviewProgress.qml";
58 case "payments": return "PreviewPayments.qml";
58 case "payments": return "PreviewPayments.qml";
59 case "rating-input": return "PreviewRatingInput.qml";
59 case "rating-input": return "PreviewRatingInput.qml";
60+ case "rating-edit": return "PreviewRatingEdit.qml";
60 case "reviews": return "PreviewRatingDisplay.qml";
61 case "reviews": return "PreviewRatingDisplay.qml";
61 case "table": return "PreviewTable.qml";
62 case "table": return "PreviewTable.qml";
62 case "text": return "PreviewTextSummary.qml";
63 case "text": return "PreviewTextSummary.qml";
qml/Greeter/Greeter.qml+4−2
@@ -143,8 +143,10 @@ Showable {
143 enabled = false;
143 enabled = false;
144 if (LightDM.Greeter.startSessionSync()) {
144 if (LightDM.Greeter.startSessionSync()) {
145 sessionStarted();
145 sessionStarted();
146+ if (loader.item) {
146− loader.item.notifyAuthenticationSucceeded();
147+ loader.item.notifyAuthenticationSucceeded();
148+ }
147− } else {
149+ } else if (loader.item) {
148 loader.item.notifyAuthenticationFailed();
150 loader.item.notifyAuthenticationFailed();
149 }
151 }
150 enabled = true;
152 enabled = true;
qml/Shell.qml−1
@@ -140,7 +140,6 @@ Item {
140
140
141 GSettings {
141 GSettings {
142 id: backgroundSettings
142 id: backgroundSettings
143− objectName: "backgroundSettings"
144 schema.id: "org.gnome.desktop.background"
143 schema.id: "org.gnome.desktop.background"
145 }
144 }
146
145
qml/Stages/DecoratedWindow.qml+1
@@ -42,6 +42,7 @@ FocusScope {
42
42
43 WindowDecoration {
43 WindowDecoration {
44 id: decoration
44 id: decoration
45+ objectName: application ? "appWindowDecoration_" + application.appId : "appWindowDecoration_null"
45 anchors { left: parent.left; top: parent.top; right: parent.right }
46 anchors { left: parent.left; top: parent.top; right: parent.right }
46 height: units.gu(3)
47 height: units.gu(3)
47 title: model.name
48 title: model.name
qml/Stages/DesktopStage.qml+20−14
@@ -20,9 +20,8 @@ import QtQuick 2.3
20import Ubuntu.Components 1.1
20import Ubuntu.Components 1.1
21import Unity.Application 0.1
21import Unity.Application 0.1
22import "../Components/PanelState"
22import "../Components/PanelState"
23−import Utils 0.1
24
23
25−FocusScope {
24+Rectangle {
26 id: root
25 id: root
27
26
28 anchors.fill: parent
27 anchors.fill: parent
@@ -52,8 +51,6 @@ FocusScope {
52
51
53 property alias background: wallpaper.source
52 property alias background: wallpaper.source
54
53
55− property var windowStateStorage: WindowStateStorage
56−
57 CrossFadeImage {
54 CrossFadeImage {
58 id: wallpaper
55 id: wallpaper
59 anchors.fill: parent
56 anchors.fill: parent
@@ -81,7 +78,16 @@ FocusScope {
81 id: priv
78 id: priv
82
79
83 readonly property string focusedAppId: ApplicationManager.focusedApplicationId
80 readonly property string focusedAppId: ApplicationManager.focusedApplicationId
84− readonly property var focusedAppDelegate: focusedAppId ? appRepeater.itemAt(indexOf(focusedAppId)) : null
81+ readonly property var focusedAppDelegate: {
82+ var index = indexOf(focusedAppId);
83+ return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
84+ }
85+
86+ onFocusedAppDelegateChanged: {
87+ if (focusedAppDelegate) {
88+ focusedAppDelegate.focus = true;
89+ }
90+ }
85
91
86 function indexOf(appId) {
92 function indexOf(appId) {
87 for (var i = 0; i < ApplicationManager.count; i++) {
93 for (var i = 0; i < ApplicationManager.count; i++) {
@@ -112,13 +118,19 @@ FocusScope {
112 id: appRepeater
118 id: appRepeater
113 model: ApplicationManager
119 model: ApplicationManager
114
120
115− delegate: Item {
121+ delegate: FocusScope {
116 id: appDelegate
122 id: appDelegate
117 z: ApplicationManager.count - index
123 z: ApplicationManager.count - index
118 y: units.gu(3)
124 y: units.gu(3)
119 width: units.gu(60)
125 width: units.gu(60)
120 height: units.gu(50)
126 height: units.gu(50)
121
127
128+ onFocusChanged: {
129+ if (focus) {
130+ ApplicationManager.requestFocusApplication(model.appId);
131+ }
132+ }
133+
122 readonly property int minWidth: units.gu(10)
134 readonly property int minWidth: units.gu(10)
123 readonly property int minHeight: units.gu(10)
135 readonly property int minHeight: units.gu(10)
124
136
@@ -142,14 +154,13 @@ FocusScope {
142 ]
154 ]
143
155
144 WindowMoveResizeArea {
156 WindowMoveResizeArea {
145− windowStateStorage: root.windowStateStorage
146 target: appDelegate
157 target: appDelegate
147 minWidth: appDelegate.minWidth
158 minWidth: appDelegate.minWidth
148 minHeight: appDelegate.minHeight
159 minHeight: appDelegate.minHeight
149 resizeHandleWidth: units.gu(0.5)
160 resizeHandleWidth: units.gu(0.5)
150 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
161 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
151
162
152− onPressed: decoratedWindow.focus = true;
163+ onPressed: appDelegate.focus = true;
153 }
164 }
154
165
155 DecoratedWindow {
166 DecoratedWindow {
@@ -158,12 +169,7 @@ FocusScope {
158 anchors.fill: parent
169 anchors.fill: parent
159 application: ApplicationManager.get(index)
170 application: ApplicationManager.get(index)
160 active: ApplicationManager.focusedApplicationId === model.appId
171 active: ApplicationManager.focusedApplicationId === model.appId
161−
162− onFocusChanged: {
163− if (focus) {
172+ focus: true
164− ApplicationManager.requestFocusApplication(model.appId);
165− }
166− }
167
173
168 onClose: ApplicationManager.stopApplication(model.appId)
174 onClose: ApplicationManager.stopApplication(model.appId)
169 onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")
175 onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")
qml/Stages/PhoneStage.qml+5−4
@@ -176,15 +176,16 @@ Rectangle {
176 id: priv
176 id: priv
177
177
178 property string focusedAppId: root.applicationManager.focusedApplicationId
178 property string focusedAppId: root.applicationManager.focusedApplicationId
179− property var focusedApplication: root.applicationManager.findApplication(focusedAppId)
180− property var focusedAppDelegate: null
181 property bool focusedAppOrientationChangesEnabled: false
179 property bool focusedAppOrientationChangesEnabled: false
180+ readonly property int firstSpreadIndex: root.focusFirstApp ? 1 : 0
181+ readonly property var focusedAppDelegate: {
182+ var index = indexOf(focusedAppId);
183+ return index >= 0 && index < spreadRepeater.count ? spreadRepeater.itemAt(index) : null
184+ }
182
185
183 property real oldInverseProgress: 0
186 property real oldInverseProgress: 0
184 property bool animateX: false
187 property bool animateX: false
185
188
186− onFocusedAppIdChanged: focusedAppDelegate = spreadRepeater.itemAt(0);
187−
188 onFocusedAppDelegateChanged: {
189 onFocusedAppDelegateChanged: {
189 if (focusedAppDelegate) {
190 if (focusedAppDelegate) {
190 focusedAppDelegate.focus = true;
191 focusedAppDelegate.focus = true;
qml/Stages/TabletStage.qml+10−12
@@ -119,6 +119,11 @@ Rectangle {
119 id: priv
119 id: priv
120
120
121 property string focusedAppId: ApplicationManager.focusedApplicationId
121 property string focusedAppId: ApplicationManager.focusedApplicationId
122+ readonly property var focusedAppDelegate: {
123+ var index = indexOf(focusedAppId);
124+ return index >= 0 && index < spreadRepeater.count ? spreadRepeater.itemAt(index) : null
125+ }
126+
122 property string oldFocusedAppId: ""
127 property string oldFocusedAppId: ""
123 property bool mainAppOrientationChangesEnabled: false
128 property bool mainAppOrientationChangesEnabled: false
124
129
@@ -150,19 +155,11 @@ Rectangle {
150
155
151 appId0 = ApplicationManager.count >= 1 ? ApplicationManager.get(0).appId : "";
156 appId0 = ApplicationManager.count >= 1 ? ApplicationManager.get(0).appId : "";
152 appId1 = ApplicationManager.count > 1 ? ApplicationManager.get(1).appId : "";
157 appId1 = ApplicationManager.count > 1 ? ApplicationManager.get(1).appId : "";
153−
154− // Update the QML focus accordingly
155− updateSpreadDelegateFocus();
156 }
158 }
157
159
158− function updateSpreadDelegateFocus() {
160+ onFocusedAppDelegateChanged: {
159− if (priv.focusedAppId) {
161+ if (focusedAppDelegate) {
160− var focusedAppIndex = priv.indexOf(priv.focusedAppId);
162+ focusedAppDelegate.focus = true;
161− if (focusedAppIndex !== -1) {
162− spreadRepeater.itemAt(focusedAppIndex).focus = true;
163− } else {
164− console.warn("TabletStage: Failed to find the SpreadDelegate for appID=" + priv.focusedAppId);
165− }
166 }
163 }
167 }
164 }
168
165
@@ -597,7 +594,8 @@ Rectangle {
597
594
598 delegate: TransformedTabletSpreadDelegate {
595 delegate: TransformedTabletSpreadDelegate {
599 id: spreadTile
596 id: spreadTile
600− objectName: "spreadDelegate_" + model.appId
597+ objectName: model.appId ? "tabletSpreadDelegate_" + model.appId
598+ : "tabletSpreadDelegate_null";
601 width: {
599 width: {
602 if (wantsMainStage) {
600 if (wantsMainStage) {
603 return spreadView.width;
601 return spreadView.width;
src/Dash/main.cpp−6
@@ -31,9 +31,6 @@
31#include "../ApplicationArguments.h"
31#include "../ApplicationArguments.h"
32#include "../CachingNetworkManagerFactory.h"
32#include "../CachingNetworkManagerFactory.h"
33
33
34−// Ubuntu Gestures
35−#include <TouchRegistry.h>
36−
37int main(int argc, const char *argv[])
34int main(int argc, const char *argv[])
38{
35{
39 QGuiApplication *application = new QGuiApplication(argc, (char**)argv);
36 QGuiApplication *application = new QGuiApplication(argc, (char**)argv);
@@ -97,9 +94,6 @@ int main(int argc, const char *argv[])
97 view->setTitle("Scopes");
94 view->setTitle("Scopes");
98 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
95 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
99
96
100− TouchRegistry touchRegistry;
101− view->installEventFilter(&touchRegistry);
102−
103 // You will need this if you want to interact with touch-only components using a mouse
97 // You will need this if you want to interact with touch-only components using a mouse
104 // Needed only when manually testing on a desktop.
98 // Needed only when manually testing on a desktop.
105 MouseTouchAdaptor *mouseTouchAdaptor = 0;
99 MouseTouchAdaptor *mouseTouchAdaptor = 0;
src/main.cpp−5
@@ -35,9 +35,6 @@
35#include "CachingNetworkManagerFactory.h"
35#include "CachingNetworkManagerFactory.h"
36#include "UnityCommandLineParser.h"
36#include "UnityCommandLineParser.h"
37
37
38−// Ubuntu Gestures
39−#include <TouchRegistry.h>
40−
41int main(int argc, const char *argv[])
38int main(int argc, const char *argv[])
42{
39{
43 bool isMirServer = false;
40 bool isMirServer = false;
@@ -99,8 +96,6 @@ int main(int argc, const char *argv[])
99 if (parser.hasFrameless()) {
96 if (parser.hasFrameless()) {
100 view->setFlags(Qt::FramelessWindowHint);
97 view->setFlags(Qt::FramelessWindowHint);
101 }
98 }
102− TouchRegistry touchRegistry;
103− view->installEventFilter(&touchRegistry);
104
99
105 // You will need this if you want to interact with touch-only components using a mouse
100 // You will need this if you want to interact with touch-only components using a mouse
106 // Needed only when manually testing on a desktop.
101 // Needed only when manually testing on a desktop.
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+13−3
@@ -21,6 +21,7 @@
21
21
22import logging
22import logging
23import os
23import os
24+import threading
24
25
25from autopilot.platform import model
26from autopilot.platform import model
26
27
@@ -90,10 +91,19 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
90 """Greeter should hide when an app is opened"""
91 """Greeter should hide when an app is opened"""
91 process_helpers.lock_unity()
92 process_helpers.lock_unity()
92
93
93− application_name = self.launch_fake_app()
94+ # FIXME - this is because the device greeter uses a password.
95+ # Need to be able to selectively enable mocks so that we can use the fake greeter.
96+ def unlock_thread_worker(greeter):
97+ greeter.wait_swiped_away()
98+ process_helpers.unlock_unity()
99+ greeter.created.wait_for(False)
100+
94 greeter = self.main_window.get_greeter()
101 greeter = self.main_window.get_greeter()
95− greeter.wait_swiped_away()
102+ unlock_thread = threading.Thread(target=unlock_thread_worker, args=(greeter,))
96− process_helpers.unlock_unity()
103+ unlock_thread.start()
104+ application_name = self.launch_fake_app()
105+ unlock_thread.join(10)
106+
97 self.assert_current_focused_application(application_name)
107 self.assert_current_focused_application(application_name)
98
108
99 def test_greeter_hides_on_app_focus(self):
109 def test_greeter_hides_on_app_focus(self):
tests/autopilot/unity8/indicators/tests/test_action_latency.py+4−2
@@ -70,10 +70,11 @@ class TestServerValueUpdate(TestIndicatorBaseTestCase):
70 switch_menu = self.indicator_page.get_switch_menu()
70 switch_menu = self.indicator_page.get_switch_menu()
71
71
72 switch.change_state()
72 switch.change_state()
73+ final_value = switch.checked
73
74
74 self.assertThat(
75 self.assertThat(
75 switch_menu.serverChecked,
76 switch_menu.serverChecked,
76− Eventually(Equals(switch.checked), timeout=20)
77+ Eventually(Equals(final_value), timeout=20)
77 )
78 )
78
79
79 def test_slider_reaches_server_value(self):
80 def test_slider_reaches_server_value(self):
@@ -82,6 +83,7 @@ class TestServerValueUpdate(TestIndicatorBaseTestCase):
82
83
83 old_value = slider.value
84 old_value = slider.value
84 slider.slide_left()
85 slider.slide_left()
86+ final_value = slider.value
85
87
86 self.assertThat(
88 self.assertThat(
87 slider_menu.serverValue,
89 slider_menu.serverValue,
@@ -90,7 +92,7 @@ class TestServerValueUpdate(TestIndicatorBaseTestCase):
90
92
91 self.assertThat(
93 self.assertThat(
92 slider_menu.serverValue,
94 slider_menu.serverValue,
93− Eventually(Equals(slider.value), timeout=20)
95+ Eventually(Equals(final_value), timeout=20)
94 )
96 )
95
97
96
98
tests/libs/UbuntuGestures/tst_TouchRegistry.cpp+75−76
@@ -53,8 +53,8 @@ private Q_SLOTS:
53 void initTestCase() {} // will be called before the first test function is executed
53 void initTestCase() {} // will be called before the first test function is executed
54 void cleanupTestCase() {} // will be called after the last test function was executed.
54 void cleanupTestCase() {} // will be called after the last test function was executed.
55
55
56− void init() {} // called right before each and every test function is executed
56+ void init(); // called right before each and every test function is executed
57− void cleanup() {} // called right after each and every test function is executed
57+ void cleanup(); // called right after each and every test function is executed
58
58
59 void requestWithNoCandidates();
59 void requestWithNoCandidates();
60 void lateCandidateRequestGetsNothing();
60 void lateCandidateRequestGetsNothing();
@@ -67,11 +67,23 @@ private Q_SLOTS:
67 void rejectingTouchfterItsEnd();
67 void rejectingTouchfterItsEnd();
68 void removeOldUndecidedCandidates();
68 void removeOldUndecidedCandidates();
69 void interimOwnerWontGetUnownedTouchEvents();
69 void interimOwnerWontGetUnownedTouchEvents();
70+
71+private:
72+ TouchRegistry *touchRegistry;
70};
73};
71
74
75+void tst_TouchRegistry::init()
76+{
77+ touchRegistry = TouchRegistry::instance();
78+}
79+
80+void tst_TouchRegistry::cleanup()
81+{
82+ delete touchRegistry;
83+}
84+
72void tst_TouchRegistry::requestWithNoCandidates()
85void tst_TouchRegistry::requestWithNoCandidates()
73{
86{
74− TouchRegistry touchRegistry;
75 DummyCandidate candidate;
87 DummyCandidate candidate;
76
88
77 {
89 {
@@ -83,17 +95,16 @@ void tst_TouchRegistry::requestWithNoCandidates()
83 Qt::NoModifier,
95 Qt::NoModifier,
84 Qt::TouchPointPressed,
96 Qt::TouchPointPressed,
85 touchPoints);
97 touchPoints);
86− touchRegistry.update(&touchEvent);
98+ touchRegistry->update(&touchEvent);
87 }
99 }
88
100
89− touchRegistry.requestTouchOwnership(0, &candidate);
101+ touchRegistry->requestTouchOwnership(0, &candidate);
90
102
91 QVERIFY(candidate.ownedTouches.contains(0));
103 QVERIFY(candidate.ownedTouches.contains(0));
92}
104}
93
105
94void tst_TouchRegistry::lateCandidateRequestGetsNothing()
106void tst_TouchRegistry::lateCandidateRequestGetsNothing()
95{
107{
96− TouchRegistry touchRegistry;
97 DummyCandidate earlyCandidate;
108 DummyCandidate earlyCandidate;
98 earlyCandidate.setObjectName("early");
109 earlyCandidate.setObjectName("early");
99 DummyCandidate lateCandidate;
110 DummyCandidate lateCandidate;
@@ -108,21 +119,21 @@ void tst_TouchRegistry::lateCandidateRequestGetsNothing()
108 Qt::NoModifier,
119 Qt::NoModifier,
109 Qt::TouchPointPressed,
120 Qt::TouchPointPressed,
110 touchPoints);
121 touchPoints);
111− touchRegistry.update(&touchEvent);
122+ touchRegistry->update(&touchEvent);
112 }
123 }
113
124
114− touchRegistry.addCandidateOwnerForTouch(0, &earlyCandidate);
125+ touchRegistry->addCandidateOwnerForTouch(0, &earlyCandidate);
115− touchRegistry.addCandidateOwnerForTouch(0, &lateCandidate);
126+ touchRegistry->addCandidateOwnerForTouch(0, &lateCandidate);
116
127
117 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
128 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
118 QVERIFY(lateCandidate.ownedTouches.isEmpty());
129 QVERIFY(lateCandidate.ownedTouches.isEmpty());
119
130
120− touchRegistry.requestTouchOwnership(0, &lateCandidate);
131+ touchRegistry->requestTouchOwnership(0, &lateCandidate);
121
132
122 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
133 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
123 QVERIFY(lateCandidate.ownedTouches.isEmpty());
134 QVERIFY(lateCandidate.ownedTouches.isEmpty());
124
135
125− touchRegistry.requestTouchOwnership(0, &earlyCandidate);
136+ touchRegistry->requestTouchOwnership(0, &earlyCandidate);
126
137
127 QVERIFY(earlyCandidate.ownedTouches.contains(0));
138 QVERIFY(earlyCandidate.ownedTouches.contains(0));
128 QVERIFY(lateCandidate.ownedTouches.isEmpty());
139 QVERIFY(lateCandidate.ownedTouches.isEmpty());
@@ -130,7 +141,6 @@ void tst_TouchRegistry::lateCandidateRequestGetsNothing()
130
141
131void tst_TouchRegistry::lateCandidateGestOwnershipOnceEarlyCandidateQuits()
142void tst_TouchRegistry::lateCandidateGestOwnershipOnceEarlyCandidateQuits()
132{
143{
133− TouchRegistry touchRegistry;
134 DummyCandidate earlyCandidate;
144 DummyCandidate earlyCandidate;
135 DummyCandidate lateCandidate;
145 DummyCandidate lateCandidate;
136
146
@@ -143,21 +153,21 @@ void tst_TouchRegistry::lateCandidateGestOwnershipOnceEarlyCandidateQuits()
143 Qt::NoModifier,
153 Qt::NoModifier,
144 Qt::TouchPointPressed,
154 Qt::TouchPointPressed,
145 touchPoints);
155 touchPoints);
146− touchRegistry.update(&touchEvent);
156+ touchRegistry->update(&touchEvent);
147 }
157 }
148
158
149− touchRegistry.addCandidateOwnerForTouch(0, &earlyCandidate);
159+ touchRegistry->addCandidateOwnerForTouch(0, &earlyCandidate);
150− touchRegistry.addCandidateOwnerForTouch(0, &lateCandidate);
160+ touchRegistry->addCandidateOwnerForTouch(0, &lateCandidate);
151
161
152 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
162 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
153 QVERIFY(lateCandidate.ownedTouches.isEmpty());
163 QVERIFY(lateCandidate.ownedTouches.isEmpty());
154
164
155− touchRegistry.requestTouchOwnership(0, &lateCandidate);
165+ touchRegistry->requestTouchOwnership(0, &lateCandidate);
156
166
157 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
167 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
158 QVERIFY(lateCandidate.ownedTouches.isEmpty());
168 QVERIFY(lateCandidate.ownedTouches.isEmpty());
159
169
160− touchRegistry.removeCandidateOwnerForTouch(0, &earlyCandidate);
170+ touchRegistry->removeCandidateOwnerForTouch(0, &earlyCandidate);
161
171
162 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
172 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
163 QVERIFY(lateCandidate.ownedTouches.contains(0));
173 QVERIFY(lateCandidate.ownedTouches.contains(0));
@@ -165,7 +175,6 @@ void tst_TouchRegistry::lateCandidateGestOwnershipOnceEarlyCandidateQuits()
165
175
166void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
176void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
167{
177{
168− TouchRegistry touchRegistry;
169 QQuickItem rootItem;
178 QQuickItem rootItem;
170
179
171 DummyCandidate candidate0;
180 DummyCandidate candidate0;
@@ -190,10 +199,10 @@ void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
190 Qt::NoModifier,
199 Qt::NoModifier,
191 Qt::TouchPointPressed,
200 Qt::TouchPointPressed,
192 touchPoints);
201 touchPoints);
193− touchRegistry.update(&touchEvent);
202+ touchRegistry->update(&touchEvent);
194 }
203 }
195
204
196− touchRegistry.addCandidateOwnerForTouch(0, &candidate0);
205+ touchRegistry->addCandidateOwnerForTouch(0, &candidate0);
197
206
198 {
207 {
199 QList<QTouchEvent::TouchPoint> touchPoints;
208 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -208,7 +217,7 @@ void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
208 Qt::NoModifier,
217 Qt::NoModifier,
209 Qt::TouchPointPressed | Qt::TouchPointMoved,
218 Qt::TouchPointPressed | Qt::TouchPointMoved,
210 touchPoints);
219 touchPoints);
211− touchRegistry.update(&touchEvent);
220+ touchRegistry->update(&touchEvent);
212 }
221 }
213
222
214 // candidate0 should have received an update on the touch he's interested on.
223 // candidate0 should have received an update on the touch he's interested on.
@@ -220,7 +229,7 @@ void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
220 QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].rect().x(), 11 - candidate0.x());
229 QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].rect().x(), 11 - candidate0.x());
221 QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].rect().y(), 11 - candidate0.y());
230 QCOMPARE(candidate0.unownedTouchEvents[0].touchPoints[0].rect().y(), 11 - candidate0.y());
222
231
223− touchRegistry.addCandidateOwnerForTouch(1, &candidate1);
232+ touchRegistry->addCandidateOwnerForTouch(1, &candidate1);
224
233
225 {
234 {
226 QList<QTouchEvent::TouchPoint> touchPoints;
235 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -235,7 +244,7 @@ void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
235 Qt::NoModifier,
244 Qt::NoModifier,
236 Qt::TouchPointPressed | Qt::TouchPointMoved,
245 Qt::TouchPointPressed | Qt::TouchPointMoved,
237 touchPoints);
246 touchPoints);
238− touchRegistry.update(&touchEvent);
247+ touchRegistry->update(&touchEvent);
239 }
248 }
240
249
241 // candidate0 gets updates only for touch 0 and
250 // candidate0 gets updates only for touch 0 and
@@ -252,7 +261,6 @@ void tst_TouchRegistry::dispatchesTouchEventsToCandidates()
252
261
253void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
262void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
254{
263{
255− TouchRegistry touchRegistry;
256 QQuickItem rootItem;
264 QQuickItem rootItem;
257
265
258 DummyCandidate watcher;
266 DummyCandidate watcher;
@@ -271,10 +279,10 @@ void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
271 Qt::NoModifier,
279 Qt::NoModifier,
272 Qt::TouchPointPressed,
280 Qt::TouchPointPressed,
273 touchPoints);
281 touchPoints);
274− touchRegistry.update(&touchEvent);
282+ touchRegistry->update(&touchEvent);
275 }
283 }
276
284
277− touchRegistry.addTouchWatcher(0, &watcher);
285+ touchRegistry->addTouchWatcher(0, &watcher);
278
286
279 {
287 {
280 QList<QTouchEvent::TouchPoint> touchPoints;
288 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -289,7 +297,7 @@ void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
289 Qt::NoModifier,
297 Qt::NoModifier,
290 Qt::TouchPointPressed | Qt::TouchPointMoved,
298 Qt::TouchPointPressed | Qt::TouchPointMoved,
291 touchPoints);
299 touchPoints);
292− touchRegistry.update(&touchEvent);
300+ touchRegistry->update(&touchEvent);
293 }
301 }
294
302
295 // watcher should have received an update on the touch he's interested on.
303 // watcher should have received an update on the touch he's interested on.
@@ -314,7 +322,7 @@ void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
314 Qt::NoModifier,
322 Qt::NoModifier,
315 Qt::TouchPointPressed | Qt::TouchPointMoved,
323 Qt::TouchPointPressed | Qt::TouchPointMoved,
316 touchPoints);
324 touchPoints);
317− touchRegistry.update(&touchEvent);
325+ touchRegistry->update(&touchEvent);
318 }
326 }
319
327
320 // watcher gets updates only for touch 0
328 // watcher gets updates only for touch 0
@@ -326,7 +334,6 @@ void tst_TouchRegistry::dispatchesTouchEventsToWatchers()
326
334
327void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
335void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
328{
336{
329− TouchRegistry touchRegistry;
330 DummyCandidate item;
337 DummyCandidate item;
331
338
332 {
339 {
@@ -338,10 +345,10 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
338 Qt::NoModifier,
345 Qt::NoModifier,
339 Qt::TouchPointPressed,
346 Qt::TouchPointPressed,
340 touchPoints);
347 touchPoints);
341− touchRegistry.update(&touchEvent);
348+ touchRegistry->update(&touchEvent);
342 }
349 }
343
350
344− touchRegistry.addCandidateOwnerForTouch(0, &item);
351+ touchRegistry->addCandidateOwnerForTouch(0, &item);
345
352
346 {
353 {
347 QList<QTouchEvent::TouchPoint> touchPoints;
354 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -354,7 +361,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
354 Qt::NoModifier,
361 Qt::NoModifier,
355 Qt::TouchPointPressed | Qt::TouchPointMoved,
362 Qt::TouchPointPressed | Qt::TouchPointMoved,
356 touchPoints);
363 touchPoints);
357− touchRegistry.update(&touchEvent);
364+ touchRegistry->update(&touchEvent);
358 }
365 }
359
366
360 QCOMPARE(item.unownedTouchEvents.count(), 1);
367 QCOMPARE(item.unownedTouchEvents.count(), 1);
@@ -362,7 +369,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
362 QCOMPARE(item.unownedTouchEvents[0].touchPoints[0].id(), 0);
369 QCOMPARE(item.unownedTouchEvents[0].touchPoints[0].id(), 0);
363 item.unownedTouchEvents.clear();
370 item.unownedTouchEvents.clear();
364
371
365− touchRegistry.addTouchWatcher(1, &item);
372+ touchRegistry->addTouchWatcher(1, &item);
366
373
367 {
374 {
368 QList<QTouchEvent::TouchPoint> touchPoints;
375 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -375,7 +382,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
375 Qt::NoModifier,
382 Qt::NoModifier,
376 Qt::TouchPointMoved,
383 Qt::TouchPointMoved,
377 touchPoints);
384 touchPoints);
378− touchRegistry.update(&touchEvent);
385+ touchRegistry->update(&touchEvent);
379 }
386 }
380
387
381 QCOMPARE(item.unownedTouchEvents.count(), 1);
388 QCOMPARE(item.unownedTouchEvents.count(), 1);
@@ -395,7 +402,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
395 Qt::NoModifier,
402 Qt::NoModifier,
396 Qt::TouchPointReleased | Qt::TouchPointMoved,
403 Qt::TouchPointReleased | Qt::TouchPointMoved,
397 touchPoints);
404 touchPoints);
398− touchRegistry.update(&touchEvent);
405+ touchRegistry->update(&touchEvent);
399 }
406 }
400
407
401 QCOMPARE(item.unownedTouchEvents.count(), 1);
408 QCOMPARE(item.unownedTouchEvents.count(), 1);
@@ -404,7 +411,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
404 QVERIFY(item.unownedTouchEvents[0].containsTouchWithId(1));
411 QVERIFY(item.unownedTouchEvents[0].containsTouchWithId(1));
405 item.unownedTouchEvents.clear();
412 item.unownedTouchEvents.clear();
406
413
407− touchRegistry.removeCandidateOwnerForTouch(0, &item);
414+ touchRegistry->removeCandidateOwnerForTouch(0, &item);
408
415
409 {
416 {
410 QList<QTouchEvent::TouchPoint> touchPoints;
417 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -415,7 +422,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
415 Qt::NoModifier,
422 Qt::NoModifier,
416 Qt::TouchPointReleased,
423 Qt::TouchPointReleased,
417 touchPoints);
424 touchPoints);
418− touchRegistry.update(&touchEvent);
425+ touchRegistry->update(&touchEvent);
419 }
426 }
420
427
421 QCOMPARE(item.unownedTouchEvents.count(), 1);
428 QCOMPARE(item.unownedTouchEvents.count(), 1);
@@ -423,7 +430,7 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
423 QVERIFY(item.unownedTouchEvents[0].containsTouchWithId(1));
430 QVERIFY(item.unownedTouchEvents[0].containsTouchWithId(1));
424 item.unownedTouchEvents.clear();
431 item.unownedTouchEvents.clear();
425
432
426− QVERIFY(touchRegistry.m_touchInfoPool.isEmpty());
433+ QVERIFY(touchRegistry->m_touchInfoPool.isEmpty());
427}
434}
428
435
429/*
436/*
@@ -432,7 +439,6 @@ void tst_TouchRegistry::keepDispatchingToWatchersAfterLastCandidateGivesUp()
432 */
439 */
433void tst_TouchRegistry::candidatesAndWatchers_1()
440void tst_TouchRegistry::candidatesAndWatchers_1()
434{
441{
435− TouchRegistry touchRegistry;
436 DummyCandidate item;
442 DummyCandidate item;
437
443
438 {
444 {
@@ -444,10 +450,10 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
444 Qt::NoModifier,
450 Qt::NoModifier,
445 Qt::TouchPointPressed,
451 Qt::TouchPointPressed,
446 touchPoints);
452 touchPoints);
447− touchRegistry.update(&touchEvent);
453+ touchRegistry->update(&touchEvent);
448 }
454 }
449
455
450− touchRegistry.addCandidateOwnerForTouch(0, &item);
456+ touchRegistry->addCandidateOwnerForTouch(0, &item);
451
457
452 {
458 {
453 QList<QTouchEvent::TouchPoint> touchPoints;
459 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -460,14 +466,14 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
460 Qt::NoModifier,
466 Qt::NoModifier,
461 Qt::TouchPointPressed | Qt::TouchPointMoved,
467 Qt::TouchPointPressed | Qt::TouchPointMoved,
462 touchPoints);
468 touchPoints);
463− touchRegistry.update(&touchEvent);
469+ touchRegistry->update(&touchEvent);
464 }
470 }
465
471
466− touchRegistry.addTouchWatcher(1, &item);
472+ touchRegistry->addTouchWatcher(1, &item);
467
473
468− touchRegistry.removeCandidateOwnerForTouch(0, &item);
474+ touchRegistry->removeCandidateOwnerForTouch(0, &item);
469
475
470− touchRegistry.addTouchWatcher(0, &item);
476+ touchRegistry->addTouchWatcher(0, &item);
471
477
472 {
478 {
473 QList<QTouchEvent::TouchPoint> touchPoints;
479 QList<QTouchEvent::TouchPoint> touchPoints;
@@ -480,7 +486,7 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
480 Qt::NoModifier,
486 Qt::NoModifier,
481 Qt::TouchPointReleased | Qt::TouchPointMoved,
487 Qt::TouchPointReleased | Qt::TouchPointMoved,
482 touchPoints);
488 touchPoints);
483− touchRegistry.update(&touchEvent);
489+ touchRegistry->update(&touchEvent);
484 }
490 }
485
491
486 {
492 {
@@ -492,10 +498,10 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
492 Qt::NoModifier,
498 Qt::NoModifier,
493 Qt::TouchPointReleased,
499 Qt::TouchPointReleased,
494 touchPoints);
500 touchPoints);
495− touchRegistry.update(&touchEvent);
501+ touchRegistry->update(&touchEvent);
496 }
502 }
497
503
498− QVERIFY(touchRegistry.m_touchInfoPool.isEmpty());
504+ QVERIFY(touchRegistry->m_touchInfoPool.isEmpty());
499
505
500 item.unownedTouchEvents.clear();
506 item.unownedTouchEvents.clear();
501
507
@@ -508,7 +514,7 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
508 Qt::NoModifier,
514 Qt::NoModifier,
509 Qt::TouchPointPressed,
515 Qt::TouchPointPressed,
510 touchPoints);
516 touchPoints);
511− touchRegistry.update(&touchEvent);
517+ touchRegistry->update(&touchEvent);
512 }
518 }
513
519
514 // Haven't made any subscription for that new touch 0.
520 // Haven't made any subscription for that new touch 0.
@@ -521,8 +527,6 @@ void tst_TouchRegistry::candidatesAndWatchers_1()
521 */
527 */
522void tst_TouchRegistry::candidatesAndWatchers_2()
528void tst_TouchRegistry::candidatesAndWatchers_2()
523{
529{
524− TouchRegistry touchRegistry;
525−
526 DummyCandidate directionalDragArea;
530 DummyCandidate directionalDragArea;
527 directionalDragArea.setObjectName("DirectionalDragArea");
531 directionalDragArea.setObjectName("DirectionalDragArea");
528
532
@@ -539,14 +543,14 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
539 Qt::NoModifier,
543 Qt::NoModifier,
540 Qt::TouchPointPressed,
544 Qt::TouchPointPressed,
541 touchPoints);
545 touchPoints);
542− touchRegistry.update(&touchEvent);
546+ touchRegistry->update(&touchEvent);
543 }
547 }
544
548
545 // [TouchRegistry] addCandidateOwnerForTouch id 0 candidate DirectionalDragArea
549 // [TouchRegistry] addCandidateOwnerForTouch id 0 candidate DirectionalDragArea
546− touchRegistry.addCandidateOwnerForTouch(0, &directionalDragArea);
550+ touchRegistry->addCandidateOwnerForTouch(0, &directionalDragArea);
547
551
548 // [TouchRegistry] requestTouchOwnership id 0 candidate TouchGate
552 // [TouchRegistry] requestTouchOwnership id 0 candidate TouchGate
549− touchRegistry.requestTouchOwnership(0, &touchGate);
553+ touchRegistry->requestTouchOwnership(0, &touchGate);
550
554
551 //[TouchRegistry] got TouchUpdate (id:0, state:moved, scenePos:(147,1023)) (id:1, state:pressed, scenePos:(327,792))
555 //[TouchRegistry] got TouchUpdate (id:0, state:moved, scenePos:(147,1023)) (id:1, state:pressed, scenePos:(327,792))
552 {
556 {
@@ -560,24 +564,24 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
560 Qt::NoModifier,
564 Qt::NoModifier,
561 Qt::TouchPointPressed | Qt::TouchPointMoved,
565 Qt::TouchPointPressed | Qt::TouchPointMoved,
562 touchPoints);
566 touchPoints);
563− touchRegistry.update(&touchEvent);
567+ touchRegistry->update(&touchEvent);
564 }
568 }
565
569
566 // [TouchRegistry] addTouchWatcher id 1 watcher DirectionalDragArea
570 // [TouchRegistry] addTouchWatcher id 1 watcher DirectionalDragArea
567− touchRegistry.addTouchWatcher(1, &directionalDragArea);
571+ touchRegistry->addTouchWatcher(1, &directionalDragArea);
568
572
569 // [TouchRegistry] removeCandidateOwnerForTouch id 0 candidate DirectionalDragArea
573 // [TouchRegistry] removeCandidateOwnerForTouch id 0 candidate DirectionalDragArea
570− touchRegistry.removeCandidateOwnerForTouch(0, &directionalDragArea);
574+ touchRegistry->removeCandidateOwnerForTouch(0, &directionalDragArea);
571
575
572 //[TouchRegistry] sending TouchWonershipEvent(id = 0 gained) to candidate TouchGate
576 //[TouchRegistry] sending TouchWonershipEvent(id = 0 gained) to candidate TouchGate
573 QCOMPARE(touchGate.ownedTouches.count(), 1);
577 QCOMPARE(touchGate.ownedTouches.count(), 1);
574 QVERIFY(touchGate.ownedTouches.contains(0));
578 QVERIFY(touchGate.ownedTouches.contains(0));
575
579
576 // [TouchRegistry] addTouchWatcher id 0 watcher DirectionalDragArea
580 // [TouchRegistry] addTouchWatcher id 0 watcher DirectionalDragArea
577− touchRegistry.addTouchWatcher(0, &directionalDragArea);
581+ touchRegistry->addTouchWatcher(0, &directionalDragArea);
578
582
579 // [TouchRegistry] requestTouchOwnership id 1 candidate TouchGate
583 // [TouchRegistry] requestTouchOwnership id 1 candidate TouchGate
580− touchRegistry.requestTouchOwnership(1, &touchGate);
584+ touchRegistry->requestTouchOwnership(1, &touchGate);
581
585
582 //[TouchRegistry] sending TouchWonershipEvent(id = 1 gained) to candidate TouchGate
586 //[TouchRegistry] sending TouchWonershipEvent(id = 1 gained) to candidate TouchGate
583 QCOMPARE(touchGate.ownedTouches.count(), 2);
587 QCOMPARE(touchGate.ownedTouches.count(), 2);
@@ -598,7 +602,7 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
598 Qt::NoModifier,
602 Qt::NoModifier,
599 Qt::TouchPointMoved,
603 Qt::TouchPointMoved,
600 touchPoints);
604 touchPoints);
601− touchRegistry.update(&touchEvent);
605+ touchRegistry->update(&touchEvent);
602 }
606 }
603
607
604 //vvvvv DDA Watchers are being ignored from now on vvvvvvv
608 //vvvvv DDA Watchers are being ignored from now on vvvvvvv
@@ -624,7 +628,7 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
624 Qt::NoModifier,
628 Qt::NoModifier,
625 Qt::TouchPointMoved | Qt::TouchPointReleased,
629 Qt::TouchPointMoved | Qt::TouchPointReleased,
626 touchPoints);
630 touchPoints);
627− touchRegistry.update(&touchEvent);
631+ touchRegistry->update(&touchEvent);
628 }
632 }
629
633
630 QCOMPARE(directionalDragArea.unownedTouchEvents.count(), 1);
634 QCOMPARE(directionalDragArea.unownedTouchEvents.count(), 1);
@@ -646,7 +650,7 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
646 Qt::NoModifier,
650 Qt::NoModifier,
647 Qt::TouchPointReleased,
651 Qt::TouchPointReleased,
648 touchPoints);
652 touchPoints);
649− touchRegistry.update(&touchEvent);
653+ touchRegistry->update(&touchEvent);
650 }
654 }
651
655
652 QCOMPARE(directionalDragArea.unownedTouchEvents.count(), 1);
656 QCOMPARE(directionalDragArea.unownedTouchEvents.count(), 1);
@@ -658,7 +662,6 @@ void tst_TouchRegistry::candidatesAndWatchers_2()
658
662
659void tst_TouchRegistry::rejectingTouchfterItsEnd()
663void tst_TouchRegistry::rejectingTouchfterItsEnd()
660{
664{
661− TouchRegistry touchRegistry;
662 DummyCandidate earlyCandidate;
665 DummyCandidate earlyCandidate;
663 DummyCandidate lateCandidate;
666 DummyCandidate lateCandidate;
664
667
@@ -671,16 +674,16 @@ void tst_TouchRegistry::rejectingTouchfterItsEnd()
671 Qt::NoModifier,
674 Qt::NoModifier,
672 Qt::TouchPointPressed,
675 Qt::TouchPointPressed,
673 touchPoints);
676 touchPoints);
674− touchRegistry.update(&touchEvent);
677+ touchRegistry->update(&touchEvent);
675 }
678 }
676
679
677− touchRegistry.addCandidateOwnerForTouch(0, &earlyCandidate);
680+ touchRegistry->addCandidateOwnerForTouch(0, &earlyCandidate);
678− touchRegistry.addCandidateOwnerForTouch(0, &lateCandidate);
681+ touchRegistry->addCandidateOwnerForTouch(0, &lateCandidate);
679
682
680 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
683 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
681 QVERIFY(lateCandidate.ownedTouches.isEmpty());
684 QVERIFY(lateCandidate.ownedTouches.isEmpty());
682
685
683− touchRegistry.requestTouchOwnership(0, &lateCandidate);
686+ touchRegistry->requestTouchOwnership(0, &lateCandidate);
684
687
685 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
688 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
686 QVERIFY(lateCandidate.ownedTouches.isEmpty());
689 QVERIFY(lateCandidate.ownedTouches.isEmpty());
@@ -694,25 +697,25 @@ void tst_TouchRegistry::rejectingTouchfterItsEnd()
694 Qt::NoModifier,
697 Qt::NoModifier,
695 Qt::TouchPointPressed,
698 Qt::TouchPointPressed,
696 touchPoints);
699 touchPoints);
697− touchRegistry.update(&touchEvent);
700+ touchRegistry->update(&touchEvent);
698 }
701 }
699
702
700 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
703 QVERIFY(earlyCandidate.ownedTouches.isEmpty());
701 QVERIFY(lateCandidate.ownedTouches.isEmpty());
704 QVERIFY(lateCandidate.ownedTouches.isEmpty());
702
705
703− touchRegistry.removeCandidateOwnerForTouch(0, &earlyCandidate);
706+ touchRegistry->removeCandidateOwnerForTouch(0, &earlyCandidate);
704
707
705 QCOMPARE(lateCandidate.ownedTouches.count(), 1);
708 QCOMPARE(lateCandidate.ownedTouches.count(), 1);
706 QCOMPARE(lateCandidate.ownedTouches.contains(0), 1);
709 QCOMPARE(lateCandidate.ownedTouches.contains(0), 1);
707
710
708 // Check that there's no trace left of touch 0 as we no longer need to keep tabs on it.
711 // Check that there's no trace left of touch 0 as we no longer need to keep tabs on it.
709− QVERIFY(!touchRegistry.findTouchInfo(0));
712+ QVERIFY(!touchRegistry->findTouchInfo(0));
710}
713}
711
714
712void tst_TouchRegistry::removeOldUndecidedCandidates()
715void tst_TouchRegistry::removeOldUndecidedCandidates()
713{
716{
714 FakeTimerFactory *fakeTimerFactory = new FakeTimerFactory;
717 FakeTimerFactory *fakeTimerFactory = new FakeTimerFactory;
715− TouchRegistry *touchRegistry = new TouchRegistry(nullptr, fakeTimerFactory);
718+ touchRegistry->setTimerFactory(fakeTimerFactory);
716
719
717 DummyCandidate undecidedCandidate;
720 DummyCandidate undecidedCandidate;
718 undecidedCandidate.setObjectName("undecided");
721 undecidedCandidate.setObjectName("undecided");
@@ -749,8 +752,6 @@ void tst_TouchRegistry::removeOldUndecidedCandidates()
749 QVERIFY(undecidedCandidate.lostTouches.contains(0));
752 QVERIFY(undecidedCandidate.lostTouches.contains(0));
750 QVERIFY(candidateThatWantsTouch.ownedTouches.contains(0));
753 QVERIFY(candidateThatWantsTouch.ownedTouches.contains(0));
751 QVERIFY(candidateThatWantsTouch.lostTouches.isEmpty());
754 QVERIFY(candidateThatWantsTouch.lostTouches.isEmpty());
752−
753− delete touchRegistry;
754}
755}
755
756
756/*
757/*
@@ -762,7 +763,7 @@ void tst_TouchRegistry::removeOldUndecidedCandidates()
762void tst_TouchRegistry::interimOwnerWontGetUnownedTouchEvents()
763void tst_TouchRegistry::interimOwnerWontGetUnownedTouchEvents()
763{
764{
764 FakeTimerFactory *fakeTimerFactory = new FakeTimerFactory;
765 FakeTimerFactory *fakeTimerFactory = new FakeTimerFactory;
765− TouchRegistry *touchRegistry = new TouchRegistry(nullptr, fakeTimerFactory);
766+ touchRegistry->setTimerFactory(fakeTimerFactory);
766
767
767 DummyCandidate undecidedCandidate;
768 DummyCandidate undecidedCandidate;
768 undecidedCandidate.setObjectName("undecided");
769 undecidedCandidate.setObjectName("undecided");
@@ -814,8 +815,6 @@ void tst_TouchRegistry::interimOwnerWontGetUnownedTouchEvents()
814
815
815 QCOMPARE(undecidedCandidate.unownedTouchEvents.count(), 2);
816 QCOMPARE(undecidedCandidate.unownedTouchEvents.count(), 2);
816 QCOMPARE(interimOwner.unownedTouchEvents.count(), 0);
817 QCOMPARE(interimOwner.unownedTouchEvents.count(), 0);
817−
818− delete touchRegistry;
819}
818}
820
819
821////////////// TouchMemento //////////
820////////////// TouchMemento //////////
tests/mocks/AccountsService/plugin.h+1−1
@@ -29,7 +29,7 @@ class AccountsServicePlugin : public QQmlExtensionPlugin
29 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
30
30
31public:
31public:
32− void registerTypes(const char *uri);
32+ void registerTypes(const char *uri) override;
33};
33};
34
34
35#endif
35#endif
tests/mocks/CMakeLists.txt+1
@@ -41,6 +41,7 @@ add_subdirectory(Ubuntu)
41add_subdirectory(Unity)
41add_subdirectory(Unity)
42add_subdirectory(QtMultimedia)
42add_subdirectory(QtMultimedia)
43add_subdirectory(Wizard)
43add_subdirectory(Wizard)
44+add_subdirectory(Utils)
44
45
45install(
46install(
46 DIRECTORY data
47 DIRECTORY data
tests/mocks/GSettings.1.0/fake_gsettings.h+2−2
@@ -78,10 +78,10 @@ public:
78 ~GSettingsControllerQml();
78 ~GSettingsControllerQml();
79
79
80 QString pictureUri() const;
80 QString pictureUri() const;
81− void setPictureUri(const QString &str);
81+ Q_INVOKABLE void setPictureUri(const QString &str);
82
82
83 QString usageMode() const;
83 QString usageMode() const;
84− void setUsageMode(const QString &usageMode);
84+ Q_INVOKABLE void setUsageMode(const QString &usageMode);
85
85
86Q_SIGNALS:
86Q_SIGNALS:
87 void pictureUriChanged(const QString&);
87 void pictureUriChanged(const QString&);
tests/mocks/GSettings.1.0/plugin.cpp+6
@@ -19,8 +19,14 @@
19
19
20#include <QtQml/qqml.h>
20#include <QtQml/qqml.h>
21
21
22+static QObject* controllerProvider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
23+{
24+ return GSettingsControllerQml::instance();
25+}
26+
22void FakeGSettingsQmlPlugin::registerTypes(const char *uri)
27void FakeGSettingsQmlPlugin::registerTypes(const char *uri)
23{
28{
29+ qmlRegisterSingletonType<GSettingsControllerQml>(uri, 1, 0, "GSettingsController", controllerProvider);
24 qmlRegisterType<GSettingsQml>(uri, 1, 0, "GSettings");
30 qmlRegisterType<GSettingsQml>(uri, 1, 0, "GSettings");
25 qmlRegisterUncreatableType<GSettingsSchemaQml>(uri, 1, 0, "GSettingsSchema",
31 qmlRegisterUncreatableType<GSettingsSchemaQml>(uri, 1, 0, "GSettingsSchema",
26 "GSettingsSchema can only be used inside of a GSettings component");
32 "GSettingsSchema can only be used inside of a GSettings component");
tests/mocks/GSettings.1.0/plugin.h+1−1
@@ -25,7 +25,7 @@ class FakeGSettingsQmlPlugin : public QQmlExtensionPlugin
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
26
27public:
27public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
29};
29};
30
30
31#endif // PLUGIN_H
31#endif // PLUGIN_H
tests/mocks/LightDM/liblightdm/UsersModel.h+2−2
@@ -53,8 +53,8 @@ public:
53 BackgroundPathRole
53 BackgroundPathRole
54 };
54 };
55
55
56− int rowCount(const QModelIndex &parent) const;
56+ int rowCount(const QModelIndex &parent) const override;
57− QVariant data(const QModelIndex &index, int role) const;
57+ QVariant data(const QModelIndex &index, int role) const override;
58
58
59 QString mockMode() const;
59 QString mockMode() const;
60 void setMockMode(QString mockMode);
60 void setMockMode(QString mockMode);
tests/mocks/LightDM/plugin.h+1−1
@@ -26,7 +26,7 @@ class LightDMPlugin : public QQmlExtensionPlugin
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27
27
28public:
28public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
30};
30};
31
31
32#endif
32#endif
tests/mocks/Lights/plugin.h+1−1
@@ -26,7 +26,7 @@ class PowerdPlugin : public QQmlExtensionPlugin
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27
27
28public:
28public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
30};
30};
31
31
32#endif
32#endif
tests/mocks/MeeGo/QOfono/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
26
27public:
27public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
29};
29};
30
30
31#endif // MOCK_QOFONO_PLUGIN_H
31#endif // MOCK_QOFONO_PLUGIN_H
tests/mocks/Powerd/plugin.h+1−1
@@ -28,7 +28,7 @@ class PowerdPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32};
32};
33
33
34#endif
34#endif
tests/mocks/QMenuModel/plugin.h+1−1
@@ -28,7 +28,7 @@ class QMenuModelPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32};
32};
33
33
34#endif
34#endif
tests/mocks/QMenuModel/unitymenumodel.h+6−6
@@ -61,12 +61,12 @@ public:
61
61
62 QString nameOwner() const;
62 QString nameOwner() const;
63
63
64− int rowCount(const QModelIndex &parent = QModelIndex()) const;
64+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
65− int columnCount(const QModelIndex &parent = QModelIndex()) const;
65+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
66− QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
66+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
67− QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
67+ QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override;
68− QModelIndex parent(const QModelIndex &index) const;
68+ QModelIndex parent(const QModelIndex &index) const override;
69− QHash<int, QByteArray> roleNames() const;
69+ QHash<int, QByteArray> roleNames() const override;
70
70
71 Q_INVOKABLE QObject * submenu(int position, QQmlComponent* actionStateParser = nullptr);
71 Q_INVOKABLE QObject * submenu(int position, QQmlComponent* actionStateParser = nullptr);
72 Q_INVOKABLE bool loadExtendedAttributes(int position, const QVariantMap &schema);
72 Q_INVOKABLE bool loadExtendedAttributes(int position, const QVariantMap &schema);
tests/mocks/QtMultimedia/plugin.h+1−1
@@ -28,7 +28,7 @@ class MockQtMultimediaPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32};
32};
33
33
34#endif
34#endif
tests/mocks/Ubuntu/Connectivity/plugin.h+2−2
@@ -28,8 +28,8 @@ class QmlConnectivityNetworkingPlugin : public QQmlExtensionPlugin {
28 Q_INTERFACES(QQmlExtensionInterface)
28 Q_INTERFACES(QQmlExtensionInterface)
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32− void initializeEngine(QQmlEngine *engine, const char *uri);
32+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
33};
33};
34
34
35#endif // QML_CONNECTIVITY_PLUGIN_H
35#endif // QML_CONNECTIVITY_PLUGIN_H
tests/mocks/Ubuntu/DownloadDaemonListener/plugin.h+1−1
@@ -24,7 +24,7 @@ class FakeUbuntuDownloadDaemonListenerQmlPlugin : public QQmlExtensionPlugin
24 Q_OBJECT
24 Q_OBJECT
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26public:
26public:
27− void registerTypes(const char *uri);
27+ void registerTypes(const char *uri) override;
28};
28};
29
29
30#endif
30#endif
tests/mocks/Ubuntu/Payments/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
26
27public:
27public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
29};
29};
30
30
31#endif // PAYMENTS_PLUGIN_H
31#endif // PAYMENTS_PLUGIN_H
tests/mocks/Ubuntu/SystemImage/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
26
27public:
27public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
29};
29};
30
30
31#endif // MOCK_SYSTEMIMAGE_PLUGIN_H
31#endif // MOCK_SYSTEMIMAGE_PLUGIN_H
tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
26
27public:
27public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
29};
29};
30
30
31#endif // MOCK_SECURITYPRIVACY_PLUGIN_H
31#endif // MOCK_SECURITYPRIVACY_PLUGIN_H
tests/mocks/Ubuntu/Telephony/MockCallEntry.h+1−1
@@ -53,7 +53,7 @@ Q_SIGNALS:
53 void elapsedTimerRunningChanged();
53 void elapsedTimerRunningChanged();
54
54
55protected:
55protected:
56− void timerEvent(QTimerEvent * event);
56+ void timerEvent(QTimerEvent * event) override;
57
57
58private:
58private:
59 QString m_phoneNumber;
59 QString m_phoneNumber;
tests/mocks/Ubuntu/Telephony/plugin.h+2−2
@@ -27,8 +27,8 @@ class FakeUbuntuTelephonyQmlPlugin : public QQmlExtensionPlugin
27 Q_OBJECT
27 Q_OBJECT
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29public:
29public:
30− void initializeEngine(QQmlEngine *engine, const char *uri);
30+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32
32
33private:
33private:
34 QQmlContext *mRootContext;
34 QQmlContext *mRootContext;
tests/mocks/Unity/Application/ApplicationManager.cpp+1−1
@@ -143,7 +143,7 @@ QModelIndex ApplicationManager::findIndex(ApplicationInfo* application)
143}
143}
144
144
145void ApplicationManager::add(ApplicationInfo *application) {
145void ApplicationManager::add(ApplicationInfo *application) {
146− if (!application) {
146+ if (!application || m_runningApplications.contains(application)) {
147 return;
147 return;
148 }
148 }
149
149
tests/mocks/Unity/Application/ObjectListModel.h+1−1
@@ -76,7 +76,7 @@ public:
76 return QVariant();
76 return QVariant();
77 }
77 }
78
78
79− QHash<int, QByteArray> roleNames() const
79+ QHash<int, QByteArray> roleNames() const override
80 {
80 {
81 QHash<int, QByteArray> roleNames;
81 QHash<int, QByteArray> roleNames;
82 roleNames.insert(RoleModelData, "modelData");
82 roleNames.insert(RoleModelData, "modelData");
tests/mocks/Unity/Application/plugin.h+2−2
@@ -24,8 +24,8 @@ class FakeUnityApplicationQmlPlugin : public QQmlExtensionPlugin
24 Q_OBJECT
24 Q_OBJECT
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26public:
26public:
27− void registerTypes(const char *uri);
27+ void registerTypes(const char *uri) override;
28− void initializeEngine(QQmlEngine *engine, const char *uri);
28+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
29};
29};
30
30
31#endif
31#endif
tests/mocks/Unity/Connectivity/plugin.h+1−1
@@ -25,7 +25,7 @@ class BackendPlugin : public QQmlExtensionPlugin
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
26
27public:
27public:
28− void registerTypes(const char *uri);
28+ void registerTypes(const char *uri) override;
29};
29};
30
30
31#endif // MOCK_CONNECTIVITY_PLUGIN_H
31#endif // MOCK_CONNECTIVITY_PLUGIN_H
tests/mocks/Unity/DashCommunicator/plugin.h+1−1
@@ -28,7 +28,7 @@ class DashCommunicatorPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32};
32};
33
33
34#endif
34#endif
tests/mocks/Unity/Indicators/fakeindicatorsmodel.h+5−5
@@ -50,11 +50,11 @@ public:
50 QVariant modelData() const { return m_modelData; }
50 QVariant modelData() const { return m_modelData; }
51
51
52 /* QAbstractItemModel */
52 /* QAbstractItemModel */
53− QHash<int, QByteArray> roleNames() const;
53+ QHash<int, QByteArray> roleNames() const override;
54− int columnCount(const QModelIndex &parent = QModelIndex()) const;
54+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
55− QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
55+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
56− QModelIndex parent (const QModelIndex &index) const;
56+ QModelIndex parent (const QModelIndex &index) const override;
57− int rowCount(const QModelIndex &parent = QModelIndex()) const;
57+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
58
58
59Q_SIGNALS:
59Q_SIGNALS:
60 void countChanged();
60 void countChanged();
tests/mocks/Unity/Indicators/fakeplugin.h+1−1
@@ -26,7 +26,7 @@ class IndicatorsFakePlugin : public QQmlExtensionPlugin
26 Q_OBJECT
26 Q_OBJECT
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28public:
28public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
30};
30};
31
31
32#endif // INDICATORS_FAKE_PLUGIN_H
32#endif // INDICATORS_FAKE_PLUGIN_H
tests/mocks/Unity/Launcher/MockLauncherItem.h+2−2
@@ -43,9 +43,9 @@ public:
43 int progress() const override;
43 int progress() const override;
44 int count() const override;
44 int count() const override;
45 bool countVisible() const override;
45 bool countVisible() const override;
46− bool focused() const;
46+ bool focused() const override;
47
47
48− unity::shell::launcher::QuickListModelInterface *quickList() const;
48+ unity::shell::launcher::QuickListModelInterface *quickList() const override;
49
49
50private:
50private:
51 void setPinned(bool pinned);
51 void setPinned(bool pinned);
tests/mocks/Unity/Launcher/MockLauncherModel.h+10−10
@@ -34,20 +34,20 @@ public:
34 MockLauncherModel(QObject* parent = 0);
34 MockLauncherModel(QObject* parent = 0);
35 ~MockLauncherModel();
35 ~MockLauncherModel();
36
36
37− int rowCount(const QModelIndex& parent) const;
37+ int rowCount(const QModelIndex& parent) const override;
38
38
39− QVariant data(const QModelIndex& index, int role) const;
39+ QVariant data(const QModelIndex& index, int role) const override;
40
40
41− Q_INVOKABLE unity::shell::launcher::LauncherItemInterface *get(int index) const;
41+ Q_INVOKABLE unity::shell::launcher::LauncherItemInterface *get(int index) const override;
42− Q_INVOKABLE void move(int oldIndex, int newIndex);
42+ Q_INVOKABLE void move(int oldIndex, int newIndex) override;
43− Q_INVOKABLE void pin(const QString &appId, int index = -1);
43+ Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
44− Q_INVOKABLE void requestRemove(const QString &appId);
44+ Q_INVOKABLE void requestRemove(const QString &appId) override;
45− Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex);
45+ Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
46− Q_INVOKABLE void setUser(const QString &username);
46+ Q_INVOKABLE void setUser(const QString &username) override;
47 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
47 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
48
48
49− unity::shell::application::ApplicationManagerInterface *applicationManager() const;
49+ unity::shell::application::ApplicationManagerInterface *applicationManager() const override;
50− void setApplicationManager(unity::shell::application::ApplicationManagerInterface *applicationManager);
50+ void setApplicationManager(unity::shell::application::ApplicationManagerInterface *applicationManager) override;
51
51
52 bool onlyPinned() const override;
52 bool onlyPinned() const override;
53 void setOnlyPinned(bool onlyPinned) override;
53 void setOnlyPinned(bool onlyPinned) override;
tests/mocks/Unity/Launcher/MockQuickListModel.h+2−2
@@ -30,9 +30,9 @@ class MockQuickListModel: public QuickListModelInterface
30public:
30public:
31 MockQuickListModel(QObject *parent = 0);
31 MockQuickListModel(QObject *parent = 0);
32
32
33− QVariant data(const QModelIndex &index, int role) const;
33+ QVariant data(const QModelIndex &index, int role) const override;
34
34
35− int rowCount(const QModelIndex &parent = QModelIndex()) const;
35+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
36};
36};
37
37
38#endif // MOCKQUICKLISTMODEL_H
38#endif // MOCKQUICKLISTMODEL_H
tests/mocks/Unity/Launcher/plugin.h+1−1
@@ -29,7 +29,7 @@ class TestLauncherPlugin : public QQmlExtensionPlugin
29 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
30
30
31public:
31public:
32− void registerTypes(const char* uri);
32+ void registerTypes(const char* uri) override;
33};
33};
34
34
35#endif // TESTLAUNCHER_PLUGIN_H
35#endif // TESTLAUNCHER_PLUGIN_H
tests/mocks/Unity/Notifications/MockActionModel.h+3−3
@@ -32,9 +32,9 @@ public:
32 ActionModel(QObject *parent=nullptr);
32 ActionModel(QObject *parent=nullptr);
33 virtual ~ActionModel();
33 virtual ~ActionModel();
34
34
35− virtual int rowCount(const QModelIndex &index) const;
35+ int rowCount(const QModelIndex &index) const override;
36− virtual QVariant data(const QModelIndex &index, int role) const;
36+ QVariant data(const QModelIndex &index, int role) const override;
37− virtual QHash<int, QByteArray> roleNames() const;
37+ QHash<int, QByteArray> roleNames() const override;
38
38
39 Q_ENUMS(ActionsRoles)
39 Q_ENUMS(ActionsRoles)
40 enum ActionsRoles {
40 enum ActionsRoles {
tests/mocks/Unity/Notifications/MockNotificationModel.h+3−3
@@ -35,9 +35,9 @@ public:
35 MockNotificationModel(QObject *parent=nullptr);
35 MockNotificationModel(QObject *parent=nullptr);
36 virtual ~MockNotificationModel();
36 virtual ~MockNotificationModel();
37
37
38− virtual int rowCount(const QModelIndex &parent) const;
38+ int rowCount(const QModelIndex &parent) const override;
39− virtual QVariant data(const QModelIndex &index, int role) const;
39+ QVariant data(const QModelIndex &index, int role) const override;
40− virtual QHash<int, QByteArray> roleNames() const;
40+ QHash<int, QByteArray> roleNames() const override;
41
41
42 Q_INVOKABLE void append(MockNotification* n);
42 Q_INVOKABLE void append(MockNotification* n);
43 MockNotification* getNotification(int id) const;
43 MockNotification* getNotification(int id) const;
tests/mocks/Unity/Notifications/plugin.h+1−1
@@ -28,7 +28,7 @@ class TestNotificationPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char* uri);
31+ void registerTypes(const char* uri) override;
32};
32};
33
33
34#endif // TESTNOTIFICATION_PLUGIN_H
34#endif // TESTNOTIFICATION_PLUGIN_H
tests/mocks/Unity/fake_scopes.h+2−2
@@ -50,8 +50,8 @@ public:
50 Q_INVOKABLE void clearFavorites();
50 Q_INVOKABLE void clearFavorites();
51 Q_INVOKABLE void load();
51 Q_INVOKABLE void load();
52
52
53− QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
53+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
54− QModelIndex parent ( const QModelIndex & index ) const;
54+ QModelIndex parent ( const QModelIndex & index ) const override;
55
55
56 bool loaded() const override;
56 bool loaded() const override;
57 int count() const override;
57 int count() const override;
tests/mocks/Unity/fake_unity_plugin.h+1−1
@@ -28,7 +28,7 @@ class FakeUnityPlugin : public QQmlExtensionPlugin
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
29
30public:
30public:
31− void registerTypes(const char *uri);
31+ void registerTypes(const char *uri) override;
32};
32};
33
33
34#endif
34#endif
tests/mocks/Utils/CMakeLists.txtnew file+39
@@ -0,0 +1,39 @@
1+pkg_search_module(GIO REQUIRED gio-2.0)
2+
3+include_directories(
4+ ${CMAKE_CURRENT_SOURCE_DIR}
5+ ${CMAKE_CURRENT_BINARY_DIR}
6+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
7+ ${GIO_INCLUDE_DIRS}
8+ ${CMAKE_SOURCE_DIR}/plugins/Utils
9+)
10+
11+set(QMLPLUGIN_SRC
12+ ${CMAKE_SOURCE_DIR}/plugins/Utils/inputwatcher.cpp
13+ ${CMAKE_SOURCE_DIR}/plugins/Utils/qlimitproxymodelqml.cpp
14+ ${CMAKE_SOURCE_DIR}/plugins/Utils/unitysortfilterproxymodelqml.cpp
15+ ${CMAKE_SOURCE_DIR}/plugins/Utils/relativetimeformatter.cpp
16+ ${CMAKE_SOURCE_DIR}/plugins/Utils/timeformatter.cpp
17+ ${CMAKE_SOURCE_DIR}/plugins/Utils/unitymenumodelpaths.cpp
18+ ${CMAKE_SOURCE_DIR}/plugins/Utils/windowkeysfilter.cpp
19+ ${CMAKE_SOURCE_DIR}/plugins/Utils/easingcurve.cpp
20+ constants.cpp
21+ plugin.cpp
22+ windowstatestorage.cpp
23+ )
24+
25+add_library(FakeUtils-qml SHARED
26+ ${QMLPLUGIN_SRC}
27+ )
28+
29+target_link_libraries(FakeUtils-qml ${GIO_LDFLAGS})
30+
31+# Because this is an internal support library, we want
32+# to expose all symbols in it. Consider changing this
33+# either to a static library or just using the
34+# files directly in targets.
35+set_target_properties(FakeUtils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
36+
37+qt5_use_modules(FakeUtils-qml Qml Quick DBus Network Gui)
38+
39+add_unity8_mock(Utils 0.1 Utils TARGETS FakeUtils-qml)
tests/mocks/Utils/HomeKeyWatcher.qmlnew file+21
@@ -0,0 +1,21 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+
19+QtObject {
20+ signal activated()
21+}
tests/mocks/Utils/Style.jsnew file+37
@@ -0,0 +1,37 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+.pragma library
18+
19+/*! \brief Calculate average luminance of the passed colors
20+
21+ \note If not fully opaque, luminance is dependant on blending.
22+ */
23+function luminance() {
24+ var sum = 0;
25+ // TODO this was originally
26+ // for (var k in arguments) {
27+ // but for some unkown reason was causing crashes in testDash/testDashContent
28+ // investigate when we have some time
29+ for (var k = 0; k < arguments.length; ++k) {
30+ // only way to convert string to color
31+ var c = Qt.lighter(arguments[k], 1.0);
32+
33+ sum += 0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b;
34+ }
35+
36+ return sum / arguments.length;
37+}
tests/mocks/Utils/Utils.qmltypesnew file+175
@@ -0,0 +1,175 @@
1+import QtQuick.tooling 1.1
2+
3+// This file describes the plugin-supplied types contained in the library.
4+// It is used for QML tooling purposes only.
5+//
6+// This file was auto-generated by:
7+// 'qmlplugindump -notrelocatable Utils 0.1 plugins'
8+
9+Module {
10+ Component {
11+ name: "EasingCurve"
12+ prototype: "QObject"
13+ exports: ["Utils/EasingCurve 0.1"]
14+ exportMetaObjectRevisions: [0]
15+ Property { name: "type"; type: "QEasingCurve::Type" }
16+ Property { name: "period"; type: "double" }
17+ Property { name: "progress"; type: "double" }
18+ Property { name: "value"; type: "double"; isReadonly: true }
19+ }
20+ Component {
21+ name: "QAbstractProxyModel"
22+ prototype: "QAbstractItemModel"
23+ Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
24+ }
25+ Component { name: "QIdentityProxyModel"; prototype: "QAbstractProxyModel" }
26+ Component {
27+ name: "QLimitProxyModelQML"
28+ prototype: "QIdentityProxyModel"
29+ exports: ["Utils/LimitProxyModel 0.1"]
30+ exportMetaObjectRevisions: [0]
31+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
32+ Property { name: "limit"; type: "int" }
33+ Property { name: "count"; type: "int"; isReadonly: true }
34+ Signal { name: "totalCountChanged" }
35+ }
36+ Component {
37+ name: "QSortFilterProxyModel"
38+ prototype: "QAbstractProxyModel"
39+ Property { name: "filterRegExp"; type: "QRegExp" }
40+ Property { name: "filterKeyColumn"; type: "int" }
41+ Property { name: "dynamicSortFilter"; type: "bool" }
42+ Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" }
43+ Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" }
44+ Property { name: "isSortLocaleAware"; type: "bool" }
45+ Property { name: "sortRole"; type: "int" }
46+ Property { name: "filterRole"; type: "int" }
47+ Method {
48+ name: "setFilterRegExp"
49+ Parameter { name: "pattern"; type: "string" }
50+ }
51+ Method {
52+ name: "setFilterWildcard"
53+ Parameter { name: "pattern"; type: "string" }
54+ }
55+ Method {
56+ name: "setFilterFixedString"
57+ Parameter { name: "pattern"; type: "string" }
58+ }
59+ Method { name: "clear" }
60+ Method { name: "invalidate" }
61+ }
62+ Component {
63+ name: "RelativeTimeFormatter"
64+ prototype: "TimeFormatter"
65+ exports: ["Utils/RelativeTimeFormatter 0.1"]
66+ exportMetaObjectRevisions: [0]
67+ }
68+ Component {
69+ name: "TimeFormatter"
70+ prototype: "QObject"
71+ exports: ["Utils/GDateTimeFormatter 0.1", "Utils/TimeFormatter 0.1"]
72+ exportMetaObjectRevisions: [0, 0]
73+ Property { name: "format"; type: "string" }
74+ Property { name: "timeString"; type: "string"; isReadonly: true }
75+ Property { name: "time"; type: "qlonglong" }
76+ Signal {
77+ name: "formatChanged"
78+ Parameter { name: "format"; type: "string" }
79+ }
80+ Signal {
81+ name: "timeStringChanged"
82+ Parameter { name: "timeString"; type: "string" }
83+ }
84+ Signal {
85+ name: "timeChanged"
86+ Parameter { name: "time"; type: "qlonglong" }
87+ }
88+ }
89+ Component {
90+ name: "UnityMenuModelPaths"
91+ prototype: "QObject"
92+ exports: ["Utils/UnityMenuModelPaths 0.1"]
93+ exportMetaObjectRevisions: [0]
94+ Property { name: "source"; type: "QVariant" }
95+ Property { name: "busName"; type: "QByteArray"; isReadonly: true }
96+ Property { name: "actions"; type: "QVariantMap"; isReadonly: true }
97+ Property { name: "menuObjectPath"; type: "QByteArray"; isReadonly: true }
98+ Property { name: "busNameHint"; type: "QByteArray" }
99+ Property { name: "actionsHint"; type: "QByteArray" }
100+ Property { name: "menuObjectPathHint"; type: "QByteArray" }
101+ }
102+ Component {
103+ name: "UnitySortFilterProxyModelQML"
104+ prototype: "QSortFilterProxyModel"
105+ exports: ["Utils/UnitySortFilterProxyModel 0.1"]
106+ exportMetaObjectRevisions: [0]
107+ Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
108+ Property { name: "totalCount"; type: "int"; isReadonly: true }
109+ Property { name: "count"; type: "int"; isReadonly: true }
110+ Property { name: "invertMatch"; type: "bool" }
111+ Signal {
112+ name: "invertMatchChanged"
113+ Parameter { type: "bool" }
114+ }
115+ Method {
116+ name: "get"
117+ type: "QVariantMap"
118+ Parameter { name: "row"; type: "int" }
119+ }
120+ Method {
121+ name: "data"
122+ type: "QVariant"
123+ Parameter { name: "row"; type: "int" }
124+ Parameter { name: "role"; type: "int" }
125+ }
126+ Method { name: "count"; type: "int" }
127+ Method {
128+ name: "findFirst"
129+ type: "int"
130+ Parameter { name: "role"; type: "int" }
131+ Parameter { name: "value"; type: "QVariant" }
132+ }
133+ Method {
134+ name: "mapRowToSource"
135+ type: "int"
136+ Parameter { name: "row"; type: "int" }
137+ }
138+ Method {
139+ name: "mapFromSource"
140+ type: "int"
141+ Parameter { name: "row"; type: "int" }
142+ }
143+ Method {
144+ name: "mapToSource"
145+ type: "int"
146+ Parameter { name: "row"; type: "int" }
147+ }
148+ }
149+ Component {
150+ name: "WindowKeysFilter"
151+ defaultProperty: "data"
152+ prototype: "QQuickItem"
153+ exports: ["Utils/WindowKeysFilter 0.1"]
154+ exportMetaObjectRevisions: [0]
155+ }
156+ Component {
157+ name: "WindowStateStorage"
158+ prototype: "QObject"
159+ exports: ["Utils/WindowStateStorage 0.1"]
160+ isCreatable: false
161+ isSingleton: true
162+ exportMetaObjectRevisions: [0]
163+ Method {
164+ name: "saveGeometry"
165+ Parameter { name: "windowId"; type: "string" }
166+ Parameter { name: "rect"; type: "QRect" }
167+ }
168+ Method {
169+ name: "getGeometry"
170+ type: "QRect"
171+ Parameter { name: "windowId"; type: "string" }
172+ Parameter { name: "defaultValue"; type: "QRect" }
173+ }
174+ }
175+}
tests/mocks/Utils/constants.cppnew file+23
@@ -0,0 +1,23 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+*/
16+
17+#include "constants.h"
18+
19+Constants::Constants(QObject *parent)
20+ : QObject(parent)
21+{
22+ m_indicatorValueTimeout = 5000;
23+}
tests/mocks/Utils/constants.hnew file+43
@@ -0,0 +1,43 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+*/
16+
17+#ifndef CONSTANTS_H
18+#define CONSTANTS_H
19+
20+#include <QObject>
21+
22+/**
23+ * @brief The Constants class
24+ *
25+ * This singleton class exposes contants to Qml
26+ *
27+ */
28+
29+class Constants: public QObject
30+{
31+ Q_OBJECT
32+ Q_PROPERTY(int indicatorValueTimeout READ indicatorValueTimeout CONSTANT)
33+
34+public:
35+ Constants(QObject *parent = 0);
36+
37+ int indicatorValueTimeout() const { return m_indicatorValueTimeout; }
38+
39+private:
40+ int m_indicatorValueTimeout;
41+};
42+
43+#endif
tests/mocks/Utils/plugin.cppnew file+73
@@ -0,0 +1,73 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+// Qt
18+#include <QtQml/qqml.h>
19+#include <QDBusConnection>
20+#include <QQmlContext>
21+#include <QtQuick/QQuickWindow>
22+#include <QDebug>
23+
24+// local
25+#include "plugin.h"
26+#include "windowstatestorage.h"
27+#include "constants.h"
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+
39+static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
40+{
41+ Q_UNUSED(engine)
42+ Q_UNUSED(scriptEngine)
43+ return new WindowStateStorage();
44+}
45+
46+static QObject *createConstants(QQmlEngine *engine, QJSEngine *scriptEngine)
47+{
48+ Q_UNUSED(engine)
49+ Q_UNUSED(scriptEngine)
50+ return new Constants();
51+}
52+
53+void FakeUtilsPlugin::registerTypes(const char *uri)
54+{
55+ Q_ASSERT(uri == QLatin1String("Utils"));;
56+ qmlRegisterType<QAbstractItemModel>();
57+ qmlRegisterType<QLimitProxyModelQML>(uri, 0, 1, "LimitProxyModel");
58+ qmlRegisterType<UnitySortFilterProxyModelQML>(uri, 0, 1, "UnitySortFilterProxyModel");
59+ qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths");
60+ qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter");
61+ qmlRegisterType<WindowKeysFilter>(uri, 0, 1, "WindowKeysFilter");
62+ qmlRegisterType<GDateTimeFormatter>(uri, 0, 1, "GDateTimeFormatter");
63+ qmlRegisterType<EasingCurve>(uri, 0, 1, "EasingCurve");
64+ qmlRegisterType<RelativeTimeFormatter>(uri, 0, 1, "RelativeTimeFormatter");
65+ qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);
66+ qmlRegisterType<InputWatcher>(uri, 0, 1, "InputWatcher");
67+ qmlRegisterSingletonType<Constants>(uri, 0, 1, "Constants", createConstants);
68+}
69+
70+void FakeUtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
71+{
72+ QQmlExtensionPlugin::initializeEngine(engine, uri);
73+}
tests/mocks/Utils/plugin.hnew file+33
@@ -0,0 +1,33 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef FAKE_UTILS_PLUGIN_H
18+#define FAKE_UTILS_PLUGIN_H
19+
20+#include <QtQml/QQmlEngine>
21+#include <QtQml/QQmlExtensionPlugin>
22+
23+class FakeUtilsPlugin : public QQmlExtensionPlugin
24+{
25+ Q_OBJECT
26+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27+
28+public:
29+ void registerTypes(const char *uri);
30+ void initializeEngine(QQmlEngine *engine, const char *uri);
31+};
32+
33+#endif
tests/mocks/Utils/qmldirnew file+5
@@ -0,0 +1,5 @@
1+module Utils
2+plugin FakeUtils-qml
3+typeinfo Utils.qmltypes
4+Style 0.1 Style.js
5+HomeKeyWatcher 0.1 HomeKeyWatcher.qml
tests/mocks/Utils/windowstatestorage.cppnew file+48
@@ -0,0 +1,48 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "windowstatestorage.h"
18+
19+#include <QRect>
20+
21+WindowStateStorage::WindowStateStorage(QObject *parent):
22+ QObject(parent)
23+{
24+}
25+
26+void WindowStateStorage::setGeometry(const QVariantMap& geometry)
27+{
28+ if (geometry != m_geometry) {
29+ m_geometry = geometry;
30+ Q_EMIT geometryChanged(m_geometry);
31+ }
32+}
33+
34+QVariantMap WindowStateStorage::geometry() const
35+{
36+ return m_geometry;
37+}
38+
39+void WindowStateStorage::saveGeometry(const QString &windowId, const QRect &rect)
40+{
41+ m_geometry[windowId] = rect;
42+}
43+
44+QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defaultValue)
45+{
46+ if (!m_geometry.contains(windowId)) return defaultValue;
47+ return m_geometry.value(windowId).toRect();
48+}
tests/mocks/Utils/windowstatestorage.hnew file+38
@@ -0,0 +1,38 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include <QObject>
18+#include <QVariantMap>
19+
20+class WindowStateStorage: public QObject
21+{
22+ Q_OBJECT
23+ Q_PROPERTY(QVariantMap geometry READ geometry WRITE setGeometry NOTIFY geometryChanged)
24+public:
25+ WindowStateStorage(QObject *parent = 0);
26+
27+ Q_INVOKABLE void saveGeometry(const QString &windowId, const QRect &rect);
28+ Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect &defaultValue);
29+
30+Q_SIGNALS:
31+ void geometryChanged(const QVariantMap& geometry);
32+
33+private:
34+ void setGeometry(const QVariantMap& geometry);
35+ QVariantMap geometry() const;
36+
37+ QVariantMap m_geometry;
38+};
tests/mocks/Wizard/mockplugin.h+1−1
@@ -26,7 +26,7 @@ class MockWizardPlugin : public QQmlExtensionPlugin
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27
27
28public:
28public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
30};
30};
31
31
32#endif
32#endif
tests/mocks/indicator-service/mock-indicator-service.c+76−12
@@ -27,8 +27,15 @@ typedef struct
27 guint actions_export_id;
27 guint actions_export_id;
28 guint menu_export_id;
28 guint menu_export_id;
29 int action_delay;
29 int action_delay;
30+ int change_interval;
30} IndicatorTestService;
31} IndicatorTestService;
31
32
33+typedef struct
34+{
35+ GSimpleAction *action;
36+ GVariant* value;
37+} Action;
38+
32static void
39static void
33bus_acquired (GDBusConnection *connection,
40bus_acquired (GDBusConnection *connection,
34 const gchar *name,
41 const gchar *name,
@@ -96,10 +103,10 @@ actual_switch (gpointer user_data)
96 gboolean state = g_variant_get_boolean (v);
103 gboolean state = g_variant_get_boolean (v);
97 GVariant *new_state = g_variant_new_boolean (state == TRUE ? FALSE : TRUE);
104 GVariant *new_state = g_variant_new_boolean (state == TRUE ? FALSE : TRUE);
98
105
99− g_simple_action_set_state(G_SIMPLE_ACTION(action), new_state);
106+ g_simple_action_set_state(action, new_state);
100
107
101 g_variant_unref (v);
108 g_variant_unref (v);
102− g_message ("switching");
109+ g_message ("switching %d", state);
103 return FALSE;
110 return FALSE;
104}
111}
105
112
@@ -120,13 +127,12 @@ activate_switch (GSimpleAction *action,
120static gboolean
127static gboolean
121actual_slide (gpointer user_data)
128actual_slide (gpointer user_data)
122{
129{
123− GSimpleAction *action = user_data;
130+ Action *slide_action = user_data;
124−
125− GVariant* new_state = g_object_get_qdata (G_OBJECT (action), slider_value_quark ());
126
131
127− g_simple_action_set_state(G_SIMPLE_ACTION(action), new_state);
132+ g_simple_action_set_state(G_SIMPLE_ACTION(slide_action->action), slide_action->value);
133+ g_message ("sliding %f", g_variant_get_double(slide_action->value));
134+ free(slide_action);
128
135
129− g_message ("switching");
130 return FALSE;
136 return FALSE;
131}
137}
132
138
@@ -136,10 +142,40 @@ void change_slider (GSimpleAction *action,
136{
142{
137 IndicatorTestService *indicator = user_data;
143 IndicatorTestService *indicator = user_data;
138
144
139− g_object_set_qdata (G_OBJECT (action), slider_value_quark (), g_variant_ref(value));
145+ Action* slide_action = malloc(sizeof(Action));
146+ slide_action->action = action;
147+ slide_action->value = g_variant_ref(value);
140
148
141− g_timeout_add(indicator->action_delay, actual_slide, action);
149+ g_timeout_add(indicator->action_delay, actual_slide, slide_action);
142− g_message ("slide delay %.03f", g_variant_get_double(value));
150+ g_message ("slide delay %f", g_variant_get_double(value));
151+}
152+
153+static gboolean
154+change_interval (gpointer user_data)
155+{
156+ g_message ("change interval");
157+
158+ IndicatorTestService *indicator = user_data;
159+
160+ GAction* action_switch = g_action_map_lookup_action(G_ACTION_MAP(indicator->actions), "action.switch");
161+ actual_switch(G_SIMPLE_ACTION(action_switch));
162+
163+ GAction* action_checkbox = g_action_map_lookup_action(G_ACTION_MAP(indicator->actions), "action.checkbox");
164+ actual_switch(G_SIMPLE_ACTION(action_checkbox));
165+
166+ GAction* action_accessPoint = g_action_map_lookup_action(G_ACTION_MAP(indicator->actions), "action.accessPoint");
167+ actual_switch(G_SIMPLE_ACTION(action_accessPoint));
168+
169+ GAction* action_slider = g_action_map_lookup_action(G_ACTION_MAP(indicator->actions), "action.slider");
170+ static double old_value = 0.25;
171+ double new_value = old_value == 0.25 ? 0.75 : 0.25;
172+ old_value = new_value;
173+ Action* slide_action = malloc(sizeof(Action));
174+ slide_action->action = G_SIMPLE_ACTION(action_slider);
175+ slide_action->value = g_variant_new_double(new_value);
176+ actual_slide(slide_action);
177+
178+ return TRUE;
143}
179}
144
180
145int
181int
@@ -147,6 +183,7 @@ main (int argc, char **argv)
147{
183{
148 IndicatorTestService indicator = { 0 };
184 IndicatorTestService indicator = { 0 };
149 indicator.action_delay = -1;
185 indicator.action_delay = -1;
186+ indicator.change_interval = -1;
150 GMenuItem *item;
187 GMenuItem *item;
151 GMenu *submenu;
188 GMenu *submenu;
152 GActionEntry entries[] = {
189 GActionEntry entries[] = {
@@ -191,6 +228,27 @@ main (int argc, char **argv)
191 }
228 }
192 break;
229 break;
193 }
230 }
231+
232+ case 'c':
233+ {
234+ arg += 2;
235+ if (!arg[0] && i < argc-1) {
236+ i++;
237+ int interval = -1;
238+
239+ if (sscanf(argv[i], "%d", &interval) == 1) {
240+ indicator.change_interval = interval;
241+ } else {
242+ printf("Invalid change interval value: %s\n", argv[i]);
243+ help = 1;
244+ }
245+ } else {
246+ printf("Invalid change interval value: %s\n", argv[i]);
247+ help = 1;
248+ }
249+ break;
250+ }
251+
194 case 'h':
252 case 'h':
195 help = 1;
253 help = 1;
196 break;
254 break;
@@ -201,8 +259,9 @@ main (int argc, char **argv)
201
259
202 if (help) {
260 if (help) {
203 printf("Usage: %s [<options>]\n"
261 printf("Usage: %s [<options>]\n"
204− " -t DELAY Action activation delay\n"
262+ " -t DELAY Action activation delay\n"
263+ " -c CHANGE_INTERVAL Interval to change action values\n"
205− " -h Show this help text\n"
264+ " -h Show this help text\n"
206 , argv[0]);
265 , argv[0]);
207 return 0;
266 return 0;
208 }
267 }
@@ -249,6 +308,11 @@ main (int argc, char **argv)
249 NULL);
308 NULL);
250
309
251 loop = g_main_loop_new (NULL, FALSE);
310 loop = g_main_loop_new (NULL, FALSE);
311+
312+ if (indicator.change_interval != -1) {
313+ g_timeout_add(indicator.change_interval, change_interval, &indicator);
314+ }
315+
252 g_main_loop_run (loop);
316 g_main_loop_run (loop);
253
317
254 g_object_unref (submenu);
318 g_object_unref (submenu);
tests/plugins/Dash/cardcreator/1.res+21−8
@@ -28,12 +28,27 @@ Item {
28 active: cardData && cardData["art"] || false;
28 active: cardData && cardData["art"] || false;
29 asynchronous: root.asynchronous;
29 asynchronous: root.asynchronous;
30 visible: status == Loader.Ready;
30 visible: status == Loader.Ready;
31− sourceComponent: UbuntuShape {
31+ sourceComponent: Item {
32− id: artShape;
32+ id: artShape;
33− objectName: "artShape";
33+ objectName: "artShape";
34− radius: "medium";
34+ property bool doShapeItem: components["art"]["conciergeMode"] !== true;
35− visible: image.status == Image.Ready;
35+ visible: image.status == Image.Ready;
36+ readonly property alias image: artImage.image;
37+ ShaderEffectSource {
38+ id: artShapeSource;
39+ sourceItem: artImage;
40+ anchors.centerIn: parent;
41+ width: 1;
42+ height: 1;
43+ hideSource: doShapeItem;
44+ }
45+ Shape {
46+ image: artShapeSource;
47+ anchors.fill: parent;
48+ visible: doShapeItem;
49+ radius: "medium";
50+ }
36− readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
51+ readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
37 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
52 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
38 Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
53 Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
39 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
54 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
@@ -51,11 +66,9 @@ Item {
51 objectName: "artImage";
66 objectName: "artImage";
52 source: cardData && cardData["art"] || "";
67 source: cardData && cardData["art"] || "";
53 asynchronous: root.asynchronous;
68 asynchronous: root.asynchronous;
54− visible: false;
55 width: root.width;
69 width: root.width;
56 height: width / artShape.aspect;
70 height: width / artShape.aspect;
57 }
71 }
58− image: artImage.image;
59 }
72 }
60 }
73 }
61 }
74 }
tests/plugins/Dash/cardcreator/3.res+31−18
@@ -28,34 +28,47 @@ Item {
28 active: cardData && cardData["art"] || false;
28 active: cardData && cardData["art"] || false;
29 asynchronous: root.asynchronous;
29 asynchronous: root.asynchronous;
30 visible: status == Loader.Ready;
30 visible: status == Loader.Ready;
31− sourceComponent: UbuntuShape {
31+ sourceComponent: Item {
32− id: artShape;
32+ id: artShape;
33− objectName: "artShape";
33+ objectName: "artShape";
34− radius: "medium";
34+ property bool doShapeItem: components["art"]["conciergeMode"] !== true;
35− visible: image.status == Image.Ready;
35+ visible: image.status == Image.Ready;
36+ readonly property alias image: artImage.image;
37+ ShaderEffectSource {
38+ id: artShapeSource;
39+ sourceItem: artImage;
40+ anchors.centerIn: parent;
41+ width: 1;
42+ height: 1;
43+ hideSource: doShapeItem;
44+ }
45+ Shape {
46+ image: artShapeSource;
47+ anchors.fill: parent;
48+ visible: doShapeItem;
49+ radius: "medium";
50+ }
36− readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
51+ readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
37− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
52+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
38− Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
53+ Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
39− Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
54+ Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
40− function updateWidthHeightBindings() {
55+ function updateWidthHeightBindings() {
41− if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
56+ if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
42− width = root.fixedArtShapeSize.width;
57+ width = root.fixedArtShapeSize.width;
43− height = root.fixedArtShapeSize.height;
58+ height = root.fixedArtShapeSize.height;
44− } else {
59+ } else {
45 width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
60 width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
46 height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
61 height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
47 }
62 }
48− }
63+ }
49 CroppedImageMinimumSourceSize {
64 CroppedImageMinimumSourceSize {
50 id: artImage;
65 id: artImage;
51 objectName: "artImage";
66 objectName: "artImage";
52− source: cardData && cardData["art"] || "";
67+ source: cardData && cardData["art"] || "";
53 asynchronous: root.asynchronous;
68 asynchronous: root.asynchronous;
54− visible: false;
55 width: root.width;
69 width: root.width;
56 height: width / artShape.aspect;
70 height: width / artShape.aspect;
57 }
71 }
58− image: artImage.image;
59 }
72 }
60 }
73 }
61 }
74 }
tests/plugins/Dash/cardcreator/5.res+32−19
@@ -28,34 +28,47 @@ Item {
28 active: cardData && cardData["art"] || false;
28 active: cardData && cardData["art"] || false;
29 asynchronous: root.asynchronous;
29 asynchronous: root.asynchronous;
30 visible: status == Loader.Ready;
30 visible: status == Loader.Ready;
31− sourceComponent: UbuntuShape {
31+ sourceComponent: Item {
32− id: artShape;
32+ id: artShape;
33− objectName: "artShape";
33+ objectName: "artShape";
34− radius: "medium";
34+ property bool doShapeItem: components["art"]["conciergeMode"] !== true;
35− visible: image.status == Image.Ready;
35+ visible: image.status == Image.Ready;
36+ readonly property alias image: artImage.image;
37+ ShaderEffectSource {
38+ id: artShapeSource;
39+ sourceItem: artImage;
40+ anchors.centerIn: parent;
41+ width: 1;
42+ height: 1;
43+ hideSource: doShapeItem;
44+ }
45+ Shape {
46+ image: artShapeSource;
47+ anchors.fill: parent;
48+ visible: doShapeItem;
49+ radius: "medium";
50+ }
36− readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
51+ readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
37− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
52+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
38− Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
53+ Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
39− Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
54+ Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
40− function updateWidthHeightBindings() {
55+ function updateWidthHeightBindings() {
41− if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
56+ if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
42− width = root.fixedArtShapeSize.width;
57+ width = root.fixedArtShapeSize.width;
43− height = root.fixedArtShapeSize.height;
58+ height = root.fixedArtShapeSize.height;
44− } else {
59+ } else {
45 width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
60 width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
46 height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
61 height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
47 }
62 }
48− }
63+ }
49 CroppedImageMinimumSourceSize {
64 CroppedImageMinimumSourceSize {
50 id: artImage;
65 id: artImage;
51 objectName: "artImage";
66 objectName: "artImage";
52− source: cardData && cardData["art"] || "";
67+ source: cardData && cardData["art"] || "";
53 asynchronous: root.asynchronous;
68 asynchronous: root.asynchronous;
54− visible: false;
55 width: root.width;
69 width: root.width;
56 height: width / artShape.aspect;
70 height: width / artShape.aspect;
57 }
71 }
58− image: artImage.image;
59 }
72 }
60 }
73 }
61 }
74 }
@@ -150,5 +163,5 @@ UbuntuShape {
150 radius: "medium";
163 radius: "medium";
151 borderSource: "radius_pressed.sci"
164 borderSource: "radius_pressed.sci"
152}
165}
153−implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);
166+implicitHeight: artShapeHolder.height;
154}
167}
tests/plugins/Dash/horizontaljournaltest.cpp+3−3
@@ -32,19 +32,19 @@
32
32
33class WidthModel : public QAbstractListModel {
33class WidthModel : public QAbstractListModel {
34public:
34public:
35− QHash<int, QByteArray> roleNames() const
35+ QHash<int, QByteArray> roleNames() const override
36 {
36 {
37 QHash<int, QByteArray> roles;
37 QHash<int, QByteArray> roles;
38 roles.insert(Qt::DisplayRole, "modelWidth");
38 roles.insert(Qt::DisplayRole, "modelWidth");
39 return roles;
39 return roles;
40 }
40 }
41
41
42− int rowCount(const QModelIndex & /*parent*/) const
42+ int rowCount(const QModelIndex & /*parent*/) const override
43 {
43 {
44 return m_list.count();
44 return m_list.count();
45 }
45 }
46
46
47− QVariant data(const QModelIndex &index, int /*role*/) const
47+ QVariant data(const QModelIndex &index, int /*role*/) const override
48 {
48 {
49 return m_list[index.row()];
49 return m_list[index.row()];
50 }
50 }
tests/plugins/Dash/horizontaljournaltry.cpp+1−1
@@ -29,7 +29,7 @@
29class QWidthModela : public QStringListModel {
29class QWidthModela : public QStringListModel {
30 Q_OBJECT
30 Q_OBJECT
31public:
31public:
32− QHash<int, QByteArray> roleNames() const
32+ QHash<int, QByteArray> roleNames() const override
33 {
33 {
34 QHash<int, QByteArray> roles;
34 QHash<int, QByteArray> roles;
35 roles.insert(Qt::DisplayRole, "modelWidth");
35 roles.insert(Qt::DisplayRole, "modelWidth");
tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cpp+3−3
@@ -37,7 +37,7 @@ public:
37 list << "A" << "B" << "C" << "D" << "E" << "F" << "G" << "H";
37 list << "A" << "B" << "C" << "D" << "E" << "F" << "G" << "H";
38 }
38 }
39
39
40− int rowCount(const QModelIndex &parent) const
40+ int rowCount(const QModelIndex &parent) const override
41 {
41 {
42 if (parent.isValid())
42 if (parent.isValid())
43 return 0;
43 return 0;
@@ -45,14 +45,14 @@ public:
45 return list.count();
45 return list.count();
46 }
46 }
47
47
48− QVariant data(const QModelIndex &index, int role) const
48+ QVariant data(const QModelIndex &index, int role) const override
49 {
49 {
50 if (role == Qt::SizeHintRole) return 50;
50 if (role == Qt::SizeHintRole) return 50;
51 else if (role == Qt::DisplayRole) return list[index.row()];
51 else if (role == Qt::DisplayRole) return list[index.row()];
52 return QVariant();
52 return QVariant();
53 }
53 }
54
54
55− QHash<int, QByteArray> roleNames() const
55+ QHash<int, QByteArray> roleNames() const override
56 {
56 {
57 QHash<int, QByteArray> hash;
57 QHash<int, QByteArray> hash;
58 hash.insert(Qt::DisplayRole, "type");
58 hash.insert(Qt::DisplayRole, "type");
tests/plugins/Dash/organicgridtest.cpp+2−2
@@ -34,12 +34,12 @@ class DummyModel : public QAbstractListModel {
34public:
34public:
35 DummyModel() : m_count(0) {}
35 DummyModel() : m_count(0) {}
36
36
37− int rowCount(const QModelIndex & /*parent*/) const
37+ int rowCount(const QModelIndex & /*parent*/) const override
38 {
38 {
39 return m_count;
39 return m_count;
40 }
40 }
41
41
42− QVariant data(const QModelIndex & /*index*/, int /*role*/) const
42+ QVariant data(const QModelIndex & /*index*/, int /*role*/) const override
43 {
43 {
44 return QVariant();
44 return QVariant();
45 }
45 }
tests/plugins/Dash/organicgridtry.cpp+2−2
@@ -31,12 +31,12 @@ class DummyModel : public QAbstractListModel {
31public:
31public:
32 DummyModel() : m_count(0) {}
32 DummyModel() : m_count(0) {}
33
33
34− int rowCount(const QModelIndex & /*parent*/) const
34+ int rowCount(const QModelIndex & /*parent*/) const override
35 {
35 {
36 return m_count;
36 return m_count;
37 }
37 }
38
38
39− QVariant data(const QModelIndex & /*index*/, int /*role*/) const
39+ QVariant data(const QModelIndex & /*index*/, int /*role*/) const override
40 {
40 {
41 return QVariant();
41 return QVariant();
42 }
42 }
tests/plugins/Dash/verticaljournaltest.cpp+3−3
@@ -32,19 +32,19 @@
32
32
33class HeightModel : public QAbstractListModel {
33class HeightModel : public QAbstractListModel {
34public:
34public:
35− QHash<int, QByteArray> roleNames() const
35+ QHash<int, QByteArray> roleNames() const override
36 {
36 {
37 QHash<int, QByteArray> roles;
37 QHash<int, QByteArray> roles;
38 roles.insert(Qt::DisplayRole, "modelHeight");
38 roles.insert(Qt::DisplayRole, "modelHeight");
39 return roles;
39 return roles;
40 }
40 }
41
41
42− int rowCount(const QModelIndex & /*parent*/) const
42+ int rowCount(const QModelIndex & /*parent*/) const override
43 {
43 {
44 return m_list.count();
44 return m_list.count();
45 }
45 }
46
46
47− QVariant data(const QModelIndex &index, int /*role*/) const
47+ QVariant data(const QModelIndex &index, int /*role*/) const override
48 {
48 {
49 return m_list[index.row()];
49 return m_list[index.row()];
50 }
50 }
tests/plugins/Dash/verticaljournaltry.cpp+1−1
@@ -29,7 +29,7 @@
29class QHeightModel : public QStringListModel {
29class QHeightModel : public QStringListModel {
30 Q_OBJECT
30 Q_OBJECT
31public:
31public:
32− QHash<int, QByteArray> roleNames() const
32+ QHash<int, QByteArray> roleNames() const override
33 {
33 {
34 QHash<int, QByteArray> roles;
34 QHash<int, QByteArray> roles;
35 roles.insert(Qt::DisplayRole, "modelHeight");
35 roles.insert(Qt::DisplayRole, "modelHeight");
tests/plugins/LightDM/CMakeLists.txt+35−16
@@ -1,8 +1,38 @@
1+add_definitions(
2+ -DCURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
3+ )
4+include_directories(
5+ ${CMAKE_CURRENT_BINARY_DIR}
6+ )
7+
1add_executable(GreeterDBusTestExec
8add_executable(GreeterDBusTestExec
2 dbus.cpp
9 dbus.cpp
3 ${CMAKE_SOURCE_DIR}/plugins/LightDM/Greeter.cpp
10 ${CMAKE_SOURCE_DIR}/plugins/LightDM/Greeter.cpp
4 )
11 )
5qt5_use_modules(GreeterDBusTestExec Core DBus Quick Test)
12qt5_use_modules(GreeterDBusTestExec Core DBus Quick Test)
13+target_link_libraries(GreeterDBusTestExec
14+ -L${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm
15+ -llightdm-qt5-2
16+ )
17+target_include_directories(GreeterDBusTestExec PUBLIC
18+ ${CMAKE_SOURCE_DIR}/plugins/LightDM
19+ ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
20+ )
21+add_binary_qml_test(GreeterDBus "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks")
22+
23+add_executable(GreeterPamTestExec
24+ pam.cpp
25+ ${CMAKE_SOURCE_DIR}/plugins/LightDM/liblightdm/GreeterPrivate.cpp
26+ )
27+qt5_use_modules(GreeterPamTestExec Concurrent Core Test)
28+target_link_libraries(GreeterPamTestExec
29+ integratedLightDM
30+ )
31+target_include_directories(GreeterPamTestExec PUBLIC
32+ ${CMAKE_SOURCE_DIR}/plugins/LightDM/liblightdm
33+ )
34+add_qmltest_target(testGreeterPam "${CMAKE_CURRENT_BINARY_DIR}/GreeterPamTestExec" TRUE FALSE)
35+add_dependencies(testGreeterPam GreeterPamTestExec)
6
36
7add_executable(GreeterUsersModelTestExec
37add_executable(GreeterUsersModelTestExec
8 usersmodel.cpp
38 usersmodel.cpp
@@ -10,24 +40,13 @@ add_executable(GreeterUsersModelTestExec
10 ${CMAKE_SOURCE_DIR}/plugins/Utils/unitysortfilterproxymodelqml.cpp
40 ${CMAKE_SOURCE_DIR}/plugins/Utils/unitysortfilterproxymodelqml.cpp
11 )
41 )
12qt5_use_modules(GreeterUsersModelTestExec Core Test)
42qt5_use_modules(GreeterUsersModelTestExec Core Test)
13−
43+target_link_libraries(GreeterUsersModelTestExec
14−include_directories(
44+ -L${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm
15− ${CMAKE_CURRENT_BINARY_DIR}
45+ -llightdm-qt5-2
46+ )
47+target_include_directories(GreeterUsersModelTestExec PUBLIC
16 ${CMAKE_SOURCE_DIR}/plugins/LightDM
48 ${CMAKE_SOURCE_DIR}/plugins/LightDM
17 ${CMAKE_SOURCE_DIR}/plugins/Utils
49 ${CMAKE_SOURCE_DIR}/plugins/Utils
18 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
50 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
19 )
51 )
20−
21−target_link_libraries(GreeterDBusTestExec
22− MockLightDM
23− )
24−
25−target_link_libraries(GreeterUsersModelTestExec
26− MockLightDM
27− )
28−
29−add_definitions(-DCURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
30−
31−add_binary_qml_test(GreeterDBus "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks")
32−
33add_binary_qml_test(GreeterUsersModel "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "LIBLIGHTDM_MOCK_MODE=full")
52add_binary_qml_test(GreeterUsersModel "${CMAKE_BINARY_DIR}/tests/mocks/LightDM/liblightdm" MockLightDM "LIBLIGHTDM_MOCK_MODE=full")
tests/plugins/LightDM/pam.cppnew file+52
@@ -0,0 +1,52 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "GreeterPrivate.h"
18+
19+#include <QtTest>
20+
21+class GreeterPamTest : public QObject
22+{
23+ Q_OBJECT
24+
25+private Q_SLOTS:
26+
27+ void init()
28+ {
29+ m_greeterpriv = new QLightDM::GreeterPrivate();
30+ }
31+
32+ void cleanup()
33+ {
34+ delete m_greeterpriv;
35+ QTRY_COMPARE(QThreadPool::globalInstance()->activeThreadCount(), 0);
36+ }
37+
38+ void testRapidFireAuthentication()
39+ {
40+ m_greeterpriv->authenticationUser = qgetenv("USER");
41+ for (int i = 0; i < 100; i++) {
42+ m_greeterpriv->handleAuthenticate();
43+ }
44+ }
45+
46+private:
47+ QLightDM::GreeterPrivate *m_greeterpriv;
48+};
49+
50+QTEST_GUILESS_MAIN(GreeterPamTest)
51+
52+#include "pam.moc"
tests/plugins/Ubuntu/Gestures/CMakeLists.txt+2−1
@@ -22,7 +22,7 @@ add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins")
22add_definitions(-DTESTS_UTILS_MODULES_DIR="${CMAKE_BINARY_DIR}/tests/utils/modules")
22add_definitions(-DTESTS_UTILS_MODULES_DIR="${CMAKE_BINARY_DIR}/tests/utils/modules")
23
23
24macro(add_gesture_ui_test CLASSNAME)
24macro(add_gesture_ui_test CLASSNAME)
25− add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp)
25+ add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp TestItem.cpp)
26 qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick)
26 qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick)
27 target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml UbuntuGestures)
27 target_link_libraries(${CLASSNAME}TestExec UbuntuGesturesQml UbuntuGestures)
28
28
@@ -46,6 +46,7 @@ macro(add_gesture_test CLASSNAME)
46endmacro(add_gesture_test)
46endmacro(add_gesture_test)
47
47
48add_gesture_ui_test(DirectionalDragArea)
48add_gesture_ui_test(DirectionalDragArea)
49+add_gesture_ui_test(FloatingFlickable)
49add_gesture_ui_test(PressedOutsideNotifier)
50add_gesture_ui_test(PressedOutsideNotifier)
50add_gesture_ui_test(TouchDispatcher)
51add_gesture_ui_test(TouchDispatcher)
51add_gesture_ui_test(TouchGate)
52add_gesture_ui_test(TouchGate)
tests/plugins/Ubuntu/Gestures/GestureTest.cpp+2−1
@@ -53,7 +53,8 @@ void GestureTest::init()
53
53
54 m_fakeTimerFactory = new FakeTimerFactory;
54 m_fakeTimerFactory = new FakeTimerFactory;
55
55
56− m_touchRegistry = new TouchRegistry(nullptr, m_fakeTimerFactory);
56+ m_touchRegistry = TouchRegistry::instance();
57+ m_touchRegistry->setTimerFactory(m_fakeTimerFactory);
57 m_view->installEventFilter(m_touchRegistry);
58 m_view->installEventFilter(m_touchRegistry);
58
59
59 qApp->processEvents();
60 qApp->processEvents();
tests/plugins/Ubuntu/Gestures/TestItem.cppnew file+30
@@ -0,0 +1,30 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "TestItem.h"
18+
19+#include <QTouchEvent>
20+
21+void TestItem::touchEvent(QTouchEvent *event)
22+{
23+ QTouchEvent *clonedEvent = new QTouchEvent(event->type(),
24+ event->device(),
25+ event->modifiers(),
26+ event->touchPointStates(),
27+ event->touchPoints());
28+
29+ touchEventsReceived.append(QSharedPointer<QTouchEvent>(clonedEvent));
30+}
tests/plugins/Ubuntu/Gestures/TestItem.hnew file+33
@@ -0,0 +1,33 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef UBUNTUGESTURES_TEST_ITEM_H
18+#define UBUNTUGESTURES_TEST_ITEM_H
19+
20+#include <QQuickItem>
21+
22+class TestItem : public QQuickItem
23+{
24+ Q_OBJECT
25+
26+public:
27+ QList<QSharedPointer<QTouchEvent>> touchEventsReceived;
28+
29+protected:
30+ void touchEvent(QTouchEvent *event) override;
31+};
32+
33+#endif // UBUNTUGESTURES_TEST_ITEM_H
tests/plugins/Ubuntu/Gestures/tst_AxisVelocityCalculator.cpp+1−1
@@ -24,7 +24,7 @@ class FakeTimeSource : public UbuntuGestures::TimeSource {
24public:
24public:
25 FakeTimeSource() : m_value(0) {}
25 FakeTimeSource() : m_value(0) {}
26
26
27− virtual qint64 msecsSinceReference() {
27+ qint64 msecsSinceReference() override {
28 return m_value;
28 return m_value;
29 }
29 }
30
30
tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp+21−21
@@ -84,7 +84,7 @@ class tst_DirectionalDragArea: public GestureTest
84public:
84public:
85 tst_DirectionalDragArea();
85 tst_DirectionalDragArea();
86private Q_SLOTS:
86private Q_SLOTS:
87− void init(); // called right before each and every test function is executed
87+ void init() override; // called right before each and every test function is executed
88
88
89 void dragWithShortDirectionChange();
89 void dragWithShortDirectionChange();
90 void recognitionTimerUsage();
90 void recognitionTimerUsage();
@@ -202,7 +202,7 @@ void tst_DirectionalDragArea::dragWithShortDirectionChange()
202 DirectionalDragArea *edgeDragArea =
202 DirectionalDragArea *edgeDragArea =
203 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
203 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
204 QVERIFY(edgeDragArea != 0);
204 QVERIFY(edgeDragArea != 0);
205− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
205+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
206 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
206 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
207
207
208 QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea);
208 QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea);
@@ -297,7 +297,7 @@ void tst_DirectionalDragArea::sceneXAndX()
297 DirectionalDragArea *edgeDragArea =
297 DirectionalDragArea *edgeDragArea =
298 m_view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
298 m_view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
299 QVERIFY(edgeDragArea != 0);
299 QVERIFY(edgeDragArea != 0);
300− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
300+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
301 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
301 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
302 edgeDragArea->setImmediateRecognition(true);
302 edgeDragArea->setImmediateRecognition(true);
303
303
@@ -326,7 +326,7 @@ void tst_DirectionalDragArea::sceneYAndY()
326 DirectionalDragArea *edgeDragArea =
326 DirectionalDragArea *edgeDragArea =
327 m_view->rootObject()->findChild<DirectionalDragArea*>("vnDragArea");
327 m_view->rootObject()->findChild<DirectionalDragArea*>("vnDragArea");
328 QVERIFY(edgeDragArea != 0);
328 QVERIFY(edgeDragArea != 0);
329− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
329+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
330 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
330 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
331 edgeDragArea->setImmediateRecognition(true);
331 edgeDragArea->setImmediateRecognition(true);
332
332
@@ -357,7 +357,7 @@ void tst_DirectionalDragArea::twoFingerTap()
357 DirectionalDragArea *edgeDragArea =
357 DirectionalDragArea *edgeDragArea =
358 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
358 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
359 QVERIFY(edgeDragArea != 0);
359 QVERIFY(edgeDragArea != 0);
360− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
360+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
361 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
361 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
362
362
363 // Make touches evenly spaced along the edgeDragArea
363 // Make touches evenly spaced along the edgeDragArea
@@ -439,7 +439,7 @@ void tst_DirectionalDragArea::movingDDA()
439 DirectionalDragArea *edgeDragArea =
439 DirectionalDragArea *edgeDragArea =
440 rightwardsLauncher->findChild<DirectionalDragArea*>("hpDragArea");
440 rightwardsLauncher->findChild<DirectionalDragArea*>("hpDragArea");
441 Q_ASSERT(edgeDragArea != 0);
441 Q_ASSERT(edgeDragArea != 0);
442− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
442+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
443 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
443 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
444
444
445 QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea);
445 QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea);
@@ -479,7 +479,7 @@ void tst_DirectionalDragArea::ignoreOldFinger()
479 DirectionalDragArea *edgeDragArea =
479 DirectionalDragArea *edgeDragArea =
480 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
480 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
481 Q_ASSERT(edgeDragArea != 0);
481 Q_ASSERT(edgeDragArea != 0);
482− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
482+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
483 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
483 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
484
484
485 // Make touches evenly spaced along the edgeDragArea
485 // Make touches evenly spaced along the edgeDragArea
@@ -542,7 +542,7 @@ void tst_DirectionalDragArea::rotated()
542 DirectionalDragArea *edgeDragArea =
542 DirectionalDragArea *edgeDragArea =
543 rightwardsLauncher->findChild<DirectionalDragArea*>("hpDragArea");
543 rightwardsLauncher->findChild<DirectionalDragArea*>("hpDragArea");
544 Q_ASSERT(edgeDragArea != 0);
544 Q_ASSERT(edgeDragArea != 0);
545− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
545+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
546 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
546 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
547
547
548 QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea);
548 QPointF initialTouchPos = calculateInitialTouchPos(edgeDragArea);
@@ -582,7 +582,7 @@ void tst_DirectionalDragArea::sceneDistance()
582 DirectionalDragArea *edgeDragArea =
582 DirectionalDragArea *edgeDragArea =
583 rightwardsLauncher->findChild<DirectionalDragArea*>("hpDragArea");
583 rightwardsLauncher->findChild<DirectionalDragArea*>("hpDragArea");
584 Q_ASSERT(edgeDragArea != 0);
584 Q_ASSERT(edgeDragArea != 0);
585− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
585+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
586 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
586 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
587
587
588 // to disable the position smoothing so that we can more easily check sceneDistance values
588 // to disable the position smoothing so that we can more easily check sceneDistance values
@@ -640,7 +640,7 @@ void tst_DirectionalDragArea::disabledWhileDragging()
640 DirectionalDragArea *edgeDragArea =
640 DirectionalDragArea *edgeDragArea =
641 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
641 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
642 Q_ASSERT(edgeDragArea != 0);
642 Q_ASSERT(edgeDragArea != 0);
643− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
643+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
644 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
644 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
645
645
646 QPointF touchPoint = calculateInitialTouchPos(edgeDragArea);
646 QPointF touchPoint = calculateInitialTouchPos(edgeDragArea);
@@ -678,7 +678,7 @@ void tst_DirectionalDragArea::oneFingerDownFollowedByLateSecondFingerDown()
678 DirectionalDragArea *edgeDragArea =
678 DirectionalDragArea *edgeDragArea =
679 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
679 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
680 Q_ASSERT(edgeDragArea != 0);
680 Q_ASSERT(edgeDragArea != 0);
681− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
681+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
682 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
682 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
683
683
684 // Disable some constraints we're not interested in
684 // Disable some constraints we're not interested in
@@ -753,7 +753,7 @@ void tst_DirectionalDragArea::givesUpWhenLosesTouch()
753 DirectionalDragArea *edgeDragArea =
753 DirectionalDragArea *edgeDragArea =
754 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
754 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
755 Q_ASSERT(edgeDragArea != 0);
755 Q_ASSERT(edgeDragArea != 0);
756− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
756+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
757 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
757 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
758
758
759 // Disable some constraints we're not interested in
759 // Disable some constraints we're not interested in
@@ -798,7 +798,7 @@ void tst_DirectionalDragArea::threeFingerDrag()
798 DirectionalDragArea *edgeDragArea =
798 DirectionalDragArea *edgeDragArea =
799 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
799 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
800 Q_ASSERT(edgeDragArea != 0);
800 Q_ASSERT(edgeDragArea != 0);
801− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
801+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
802 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
802 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
803
803
804 // Disable some constraints we're not interested in
804 // Disable some constraints we're not interested in
@@ -867,7 +867,7 @@ void tst_DirectionalDragArea::immediateRecognitionWhenConstraintsDisabled()
867 DirectionalDragArea *edgeDragArea =
867 DirectionalDragArea *edgeDragArea =
868 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
868 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
869 Q_ASSERT(edgeDragArea != 0);
869 Q_ASSERT(edgeDragArea != 0);
870− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
870+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
871 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
871 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
872
872
873 // Disable the minimum amount of constraints to ensure immediate recognition
873 // Disable the minimum amount of constraints to ensure immediate recognition
@@ -900,7 +900,7 @@ void tst_DirectionalDragArea::withdrawTouchOwnershipCandidacyIfDisabledDuringRec
900 DirectionalDragArea *edgeDragArea =
900 DirectionalDragArea *edgeDragArea =
901 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
901 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
902 Q_ASSERT(edgeDragArea != 0);
902 Q_ASSERT(edgeDragArea != 0);
903− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
903+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
904 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
904 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
905
905
906 QPointF touchPoint = calculateInitialTouchPos(edgeDragArea);
906 QPointF touchPoint = calculateInitialTouchPos(edgeDragArea);
@@ -964,7 +964,7 @@ void tst_DirectionalDragArea::gettingTouchOwnershipMakesMouseAreaBehindGetCancel
964 DirectionalDragArea *edgeDragArea =
964 DirectionalDragArea *edgeDragArea =
965 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
965 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
966 QVERIFY(edgeDragArea != nullptr);
966 QVERIFY(edgeDragArea != nullptr);
967− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
967+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
968 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
968 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
969
969
970 QQuickMouseArea *mouseArea =
970 QQuickMouseArea *mouseArea =
@@ -1014,7 +1014,7 @@ void tst_DirectionalDragArea::interleavedTouches()
1014 DirectionalDragArea *edgeDragArea =
1014 DirectionalDragArea *edgeDragArea =
1015 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
1015 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
1016 QVERIFY(edgeDragArea != 0);
1016 QVERIFY(edgeDragArea != 0);
1017− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
1017+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
1018 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
1018 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
1019
1019
1020 QPointF touch0 = edgeDragArea->mapToScene(
1020 QPointF touch0 = edgeDragArea->mapToScene(
@@ -1109,7 +1109,7 @@ void tst_DirectionalDragArea::makoRightEdgeDrag()
1109 DirectionalDragArea *edgeDragArea =
1109 DirectionalDragArea *edgeDragArea =
1110 m_view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
1110 m_view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
1111 QVERIFY(edgeDragArea != nullptr);
1111 QVERIFY(edgeDragArea != nullptr);
1112− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
1112+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
1113 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
1113 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
1114
1114
1115 StatusSpy *statusSpy = new StatusSpy(edgeDragArea);
1115 StatusSpy *statusSpy = new StatusSpy(edgeDragArea);
@@ -1154,7 +1154,7 @@ void tst_DirectionalDragArea::makoRightEdgeDrag_verticalDownwards()
1154 DirectionalDragArea *edgeDragArea =
1154 DirectionalDragArea *edgeDragArea =
1155 m_view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
1155 m_view->rootObject()->findChild<DirectionalDragArea*>("hnDragArea");
1156 QVERIFY(edgeDragArea != nullptr);
1156 QVERIFY(edgeDragArea != nullptr);
1157− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
1157+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
1158 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
1158 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
1159
1159
1160 edgeDragArea->d->setPixelsPerMm(320.0 /*mako ppi*/ * 0.03937 /* inches per mm*/);
1160 edgeDragArea->d->setPixelsPerMm(320.0 /*mako ppi*/ * 0.03937 /* inches per mm*/);
@@ -1198,7 +1198,7 @@ void tst_DirectionalDragArea::makoLeftEdgeDrag_slowStart()
1198 DirectionalDragArea *edgeDragArea =
1198 DirectionalDragArea *edgeDragArea =
1199 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
1199 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
1200 QVERIFY(edgeDragArea != nullptr);
1200 QVERIFY(edgeDragArea != nullptr);
1201− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
1201+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
1202 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
1202 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
1203
1203
1204 edgeDragArea->d->setPixelsPerMm(320.0 /*mako ppi*/ * 0.03937 /* inches per mm*/);
1204 edgeDragArea->d->setPixelsPerMm(320.0 /*mako ppi*/ * 0.03937 /* inches per mm*/);
@@ -1262,7 +1262,7 @@ void tst_DirectionalDragArea::makoLeftEdgeDrag_movesSlightlyBackwardsOnStart()
1262 DirectionalDragArea *edgeDragArea =
1262 DirectionalDragArea *edgeDragArea =
1263 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
1263 m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
1264 QVERIFY(edgeDragArea != nullptr);
1264 QVERIFY(edgeDragArea != nullptr);
1265− edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer());
1265+ edgeDragArea->d->setRecognitionTimer(m_fakeTimerFactory->createTimer(edgeDragArea));
1266 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
1266 edgeDragArea->d->setTimeSource(m_fakeTimerFactory->timeSource());
1267
1267
1268 edgeDragArea->d->setPixelsPerMm(320.0 /*mako ppi*/ * 0.03937 /* inches per mm*/);
1268 edgeDragArea->d->setPixelsPerMm(320.0 /*mako ppi*/ * 0.03937 /* inches per mm*/);
tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.cppnew file+122
@@ -0,0 +1,122 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include <QtTest>
18+#include <QQuickView>
19+
20+// Ubuntu.Gestures plugin
21+#include <DirectionalDragArea.h>
22+#include <FloatingFlickable.h>
23+
24+#include "GestureTest.h"
25+#include "TestItem.h"
26+
27+using namespace UbuntuGestures;
28+
29+class tst_FloatingFlickable: public GestureTest
30+{
31+ Q_OBJECT
32+public:
33+ tst_FloatingFlickable();
34+private Q_SLOTS:
35+ void tapGoesThrough();
36+ void flickChangesContentX();
37+ void flickChangesContentY();
38+};
39+
40+tst_FloatingFlickable::tst_FloatingFlickable()
41+ : GestureTest(QStringLiteral("tst_FloatingFlickable.qml"))
42+{
43+}
44+
45+void tst_FloatingFlickable::tapGoesThrough()
46+{
47+ FloatingFlickable *floatingFlickable =
48+ m_view->rootObject()->findChild<FloatingFlickable*>("floatingFlickable");
49+ QVERIFY(floatingFlickable != nullptr);
50+
51+ TestItem *testItem = new TestItem;
52+ testItem->setWidth(floatingFlickable->width());
53+ testItem->setHeight(floatingFlickable->height());
54+ testItem->setParentItem(m_view->rootObject());
55+ testItem->setZ(1.0);
56+
57+ floatingFlickable->setZ(2.0);
58+
59+ QTest::touchEvent(m_view, m_device)
60+ .press(0, QPoint(floatingFlickable->width()/2, floatingFlickable->height()/2));
61+
62+ QCOMPARE(testItem->touchEventsReceived.count(), 1);
63+}
64+
65+void tst_FloatingFlickable::flickChangesContentX()
66+{
67+ FloatingFlickable *floatingFlickable =
68+ m_view->rootObject()->findChild<FloatingFlickable*>("floatingFlickable");
69+ QVERIFY(floatingFlickable != nullptr);
70+
71+ floatingFlickable->m_dragArea->removeTimeConstraints();
72+
73+ qreal startContentX = floatingFlickable->contentX();
74+
75+ QPoint startPos(floatingFlickable->width() - 5, 10);
76+ int stepCount = 20;
77+ int step = (startPos.x() - 5) / stepCount;
78+
79+ QTest::touchEvent(m_view, m_device).press(0, startPos);
80+ for (int i = 0; i < stepCount; ++i) {
81+ QTest::qWait(10);
82+ QPoint touchPos = startPos - QPoint(step*i, 0);
83+ QTest::touchEvent(m_view, m_device).move(0, touchPos);
84+ }
85+
86+ QTest::qWait(10);
87+ QTest::touchEvent(m_view, m_device).release(0, QPoint(5, 10));
88+
89+ QVERIFY(floatingFlickable->contentX() > (startContentX + floatingFlickable->width()/2));
90+}
91+
92+void tst_FloatingFlickable::flickChangesContentY()
93+{
94+ FloatingFlickable *floatingFlickable =
95+ m_view->rootObject()->findChild<FloatingFlickable*>("floatingFlickable");
96+ QVERIFY(floatingFlickable != nullptr);
97+
98+ floatingFlickable->setDirection(Direction::Vertical);
99+ floatingFlickable->m_dragArea->removeTimeConstraints();
100+
101+ qreal startContentY = floatingFlickable->contentY();
102+
103+ QPoint startPos(10, floatingFlickable->height() - 5);
104+ int stepCount = 20;
105+ int step = (startPos.y() - 5) / stepCount;
106+
107+ QTest::touchEvent(m_view, m_device).press(0, startPos);
108+ for (int i = 0; i < stepCount; ++i) {
109+ QTest::qWait(10);
110+ QPoint touchPos = startPos - QPoint(0, step*i);
111+ QTest::touchEvent(m_view, m_device).move(0, touchPos);
112+ }
113+
114+ QTest::qWait(10);
115+ QTest::touchEvent(m_view, m_device).release(0, QPoint(10, 5));
116+
117+ QVERIFY(floatingFlickable->contentY() > (startContentY + floatingFlickable->height()/2));
118+}
119+
120+QTEST_MAIN(tst_FloatingFlickable)
121+
122+#include "tst_FloatingFlickable.moc"
tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.qmlnew file+80
@@ -0,0 +1,80 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+import Ubuntu.Gestures 0.1
20+import Unity.Test 0.1
21+
22+Rectangle {
23+ id: root
24+ width: units.gu(60)
25+ height: units.gu(60)
26+ color: "white"
27+
28+ Binding {
29+ target: MouseTouchAdaptor
30+ property: "enabled"
31+ value: true
32+ }
33+
34+ Grid {
35+ id: colorGrid
36+ readonly property bool horizontal: floatingFlickable.direction === Direction.Horizontal
37+ x: horizontal ? -floatingFlickable.contentX : 0
38+ y: horizontal ? 0 : -floatingFlickable.contentY
39+ rows: horizontal ? 1 : 100
40+ columns: horizontal ? 100 : 1
41+ Repeater {
42+ model: 100
43+ Rectangle {
44+ width: colorGrid.horizontal ? units.gu(12) : root.width
45+ height: colorGrid.horizontal ? root.height : units.gu(12)
46+ color: mouseArea.pressed ? "red"
47+ : Qt.rgba(Math.random(), Math.random(), Math.random(), 1)
48+ MouseArea {
49+ id: mouseArea
50+ anchors.fill: parent
51+ }
52+ }
53+ }
54+ }
55+
56+ FloatingFlickable {
57+ id: floatingFlickable
58+ objectName: "floatingFlickable"
59+ anchors.fill: parent
60+ contentWidth: colorGrid.width
61+ contentHeight: colorGrid.height
62+ }
63+
64+ Button {
65+ anchors.bottom: parent.bottom
66+ anchors.right: parent.right
67+ anchors.margins: units.gu(1)
68+
69+ text: floatingFlickable.direction === Direction.Horizontal ? "Horizontal" : "Vertical"
70+ activeFocusOnPress: false
71+
72+ onClicked: {
73+ if (floatingFlickable.direction === Direction.Horizontal) {
74+ floatingFlickable.direction = Direction.Vertical;
75+ } else {
76+ floatingFlickable.direction = Direction.Horizontal;
77+ }
78+ }
79+ }
80+}
tests/plugins/Ubuntu/Gestures/tst_PressedOutsideNotifier.cpp+1−1
@@ -28,7 +28,7 @@ class tst_PressedOutsideNotifier: public GestureTest
28public:
28public:
29 tst_PressedOutsideNotifier();
29 tst_PressedOutsideNotifier();
30private Q_SLOTS:
30private Q_SLOTS:
31− void init(); // called right before each and every test function is executed
31+ void init() override; // called right before each and every test function is executed
32
32
33 void touchOutsideAreaTriggersSignal();
33 void touchOutsideAreaTriggersSignal();
34 void touchInsideAreaHasNoEffect();
34 void touchInsideAreaHasNoEffect();
tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+2−25
@@ -29,16 +29,7 @@
29#include <TouchGate.h>
29#include <TouchGate.h>
30#include <TouchRegistry.h>
30#include <TouchRegistry.h>
31
31
32−class TestItem : public QQuickItem
32+#include "TestItem.h"
33−{
34− Q_OBJECT
35−
36−public:
37− QList<QSharedPointer<QTouchEvent>> touchEventsReceived;
38−
39−protected:
40− void touchEvent(QTouchEvent *event) override;
41−};
42
33
43class CandidateItem : public QQuickItem
34class CandidateItem : public QQuickItem
44{
35{
@@ -104,10 +95,9 @@ void tst_TouchGate::cleanupTestCase()
104
95
105void tst_TouchGate::init()
96void tst_TouchGate::init()
106{
97{
107− touchRegistry = new TouchRegistry;
98+ touchRegistry = TouchRegistry::instance();
108
99
109 view = createView();
100 view = createView();
110− view->installEventFilter(touchRegistry);
111 view->setSource(QUrl::fromLocalFile("touchGateExample.qml"));
101 view->setSource(QUrl::fromLocalFile("touchGateExample.qml"));
112 view->show();
102 view->show();
113 QVERIFY(QTest::qWaitForWindowExposed(view));
103 QVERIFY(QTest::qWaitForWindowExposed(view));
@@ -381,19 +371,6 @@ void tst_TouchGate::disabledWhileHoldingTouch()
381 }
371 }
382}
372}
383
373
384−///////////// TestItem /////////////////////////////////////////////////////////////
385−
386−void TestItem::touchEvent(QTouchEvent *event)
387−{
388− QTouchEvent *clonedEvent = new QTouchEvent(event->type(),
389− event->device(),
390− event->modifiers(),
391− event->touchPointStates(),
392− event->touchPoints());
393−
394− touchEventsReceived.append(QSharedPointer<QTouchEvent>(clonedEvent));
395−}
396−
397///////////// CandidateItem /////////////////////////////////////////////////////////////
374///////////// CandidateItem /////////////////////////////////////////////////////////////
398
375
399void CandidateItem::touchEvent(QTouchEvent *event)
376void CandidateItem::touchEvent(QTouchEvent *event)
tests/plugins/Unity/Indicators/menucontentactivatortest.cpp+2−2
@@ -30,8 +30,8 @@ public:
30 : UnityIndicators::AbstractTimer(parent)
30 : UnityIndicators::AbstractTimer(parent)
31 {}
31 {}
32
32
33− virtual int interval() const { return m_duration; }
33+ int interval() const override { return m_duration; }
34− virtual void setInterval(int msecs) { m_duration = msecs; }
34+ void setInterval(int msecs) override { m_duration = msecs; }
35
35
36 void emitTimeout() {
36 void emitTimeout() {
37 if (isRunning()) {
37 if (isRunning()) {
tests/plugins/Unity/Launcher/launchermodeltest.cpp+21−21
@@ -39,13 +39,13 @@ class MockApp: public unity::shell::application::ApplicationInfoInterface
39 Q_OBJECT
39 Q_OBJECT
40public:
40public:
41 MockApp(const QString &appId, QObject *parent = 0): ApplicationInfoInterface(appId, parent), m_appId(appId), m_focused(false) { }
41 MockApp(const QString &appId, QObject *parent = 0): ApplicationInfoInterface(appId, parent), m_appId(appId), m_focused(false) { }
42− QString appId() const { return m_appId; }
42+ QString appId() const override { return m_appId; }
43− QString name() const { return "mock"; }
43+ QString name() const override { return "mock"; }
44− QString comment() const { return "this is a mock"; }
44+ QString comment() const override { return "this is a mock"; }
45− QUrl icon() const { return QUrl(); }
45+ QUrl icon() const override { return QUrl(); }
46− ApplicationInfoInterface::Stage stage() const { return ApplicationInfoInterface::MainStage; }
46+ ApplicationInfoInterface::Stage stage() const override { return ApplicationInfoInterface::MainStage; }
47− ApplicationInfoInterface::State state() const { return ApplicationInfoInterface::Running; }
47+ ApplicationInfoInterface::State state() const override { return ApplicationInfoInterface::Running; }
48− bool focused() const { return m_focused; }
48+ bool focused() const override { return m_focused; }
49 QString splashTitle() const override { return QString(); }
49 QString splashTitle() const override { return QString(); }
50 QUrl splashImage() const override { return QUrl(); }
50 QUrl splashImage() const override { return QUrl(); }
51 bool splashShowHeader() const override { return true; }
51 bool splashShowHeader() const override { return true; }
@@ -68,16 +68,16 @@ class MockAppManager: public unity::shell::application::ApplicationManagerInterf
68 Q_OBJECT
68 Q_OBJECT
69public:
69public:
70 MockAppManager(QObject *parent = 0): ApplicationManagerInterface(parent) {}
70 MockAppManager(QObject *parent = 0): ApplicationManagerInterface(parent) {}
71− int rowCount(const QModelIndex &) const { return m_list.count(); }
71+ int rowCount(const QModelIndex &) const override { return m_list.count(); }
72− QVariant data(const QModelIndex &, int ) const { return QVariant(); }
72+ QVariant data(const QModelIndex &, int ) const override { return QVariant(); }
73− QString focusedApplicationId() const {
73+ QString focusedApplicationId() const override {
74 Q_FOREACH(MockApp *app, m_list) {
74 Q_FOREACH(MockApp *app, m_list) {
75 if (app->focused()) return app->appId();
75 if (app->focused()) return app->appId();
76 }
76 }
77 return QString();
77 return QString();
78 }
78 }
79− unity::shell::application::ApplicationInfoInterface *get(int index) const { return m_list.at(index); }
79+ unity::shell::application::ApplicationInfoInterface *get(int index) const override { return m_list.at(index); }
80− unity::shell::application::ApplicationInfoInterface *findApplication(const QString &appId) const {
80+ unity::shell::application::ApplicationInfoInterface *findApplication(const QString &appId) const override {
81 Q_FOREACH(MockApp* app, m_list) {
81 Q_FOREACH(MockApp* app, m_list) {
82 if (app->appId() == appId) {
82 if (app->appId() == appId) {
83 return app;
83 return app;
@@ -85,8 +85,8 @@ public:
85 }
85 }
86 return nullptr;
86 return nullptr;
87 }
87 }
88− unity::shell::application::ApplicationInfoInterface *startApplication(const QString &, const QStringList &) { return nullptr; }
88+ unity::shell::application::ApplicationInfoInterface *startApplication(const QString &, const QStringList &) override { return nullptr; }
89− bool stopApplication(const QString &appId) {
89+ bool stopApplication(const QString &appId) override {
90 Q_FOREACH(MockApp* app, m_list) {
90 Q_FOREACH(MockApp* app, m_list) {
91 if (app->appId() == appId) {
91 if (app->appId() == appId) {
92 removeApplication(m_list.indexOf(app));
92 removeApplication(m_list.indexOf(app));
@@ -95,7 +95,7 @@ public:
95 }
95 }
96 return false;
96 return false;
97 }
97 }
98− bool focusApplication(const QString &appId) {
98+ bool focusApplication(const QString &appId) override {
99 Q_FOREACH(MockApp* app, m_list) {
99 Q_FOREACH(MockApp* app, m_list) {
100 app->setFocused(app->appId() == appId);
100 app->setFocused(app->appId() == appId);
101 }
101 }
@@ -103,7 +103,7 @@ public:
103 return true;
103 return true;
104 }
104 }
105
105
106− void unfocusCurrentApplication() { }
106+ void unfocusCurrentApplication() override { }
107
107
108 void addApplication(MockApp *app) {
108 void addApplication(MockApp *app) {
109 beginInsertRows(QModelIndex(), count(), count());
109 beginInsertRows(QModelIndex(), count(), count());
@@ -115,11 +115,11 @@ public:
115 m_list.takeAt(index)->deleteLater();
115 m_list.takeAt(index)->deleteLater();
116 endRemoveRows();
116 endRemoveRows();
117 }
117 }
118− bool requestFocusApplication(const QString &appId) { Q_UNUSED(appId); return true; }
118+ bool requestFocusApplication(const QString &appId) override { Q_UNUSED(appId); return true; }
119− bool suspended() const { return false; }
119+ bool suspended() const override { return false; }
120− void setSuspended(bool) {}
120+ void setSuspended(bool) override {}
121− bool forceDashActive() const { return false; }
121+ bool forceDashActive() const override { return false; }
122− void setForceDashActive(bool) {}
122+ void setForceDashActive(bool) override {}
123
123
124private:
124private:
125 QList<MockApp*> m_list;
125 QList<MockApp*> m_list;
tests/plugins/Utils/qlimitproxymodeltest.cpp+5−5
@@ -36,12 +36,12 @@ public:
36 {
36 {
37 }
37 }
38
38
39− int rowCount(const QModelIndex& /* parent */ = QModelIndex()) const
39+ int rowCount(const QModelIndex& /* parent */ = QModelIndex()) const override
40 {
40 {
41 return m_list.size();
41 return m_list.size();
42 }
42 }
43
43
44− QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const
44+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override
45 {
45 {
46 if (!index.isValid() || index.row() < 0 || index.row() >= m_list.size() || role != Qt::DisplayRole) {
46 if (!index.isValid() || index.row() < 0 || index.row() >= m_list.size() || role != Qt::DisplayRole) {
47 return QVariant();
47 return QVariant();
@@ -49,7 +49,7 @@ public:
49 return QVariant(m_list[index.row()]);
49 return QVariant(m_list[index.row()]);
50 }
50 }
51
51
52− QHash<int, QByteArray> roleNames() const
52+ QHash<int, QByteArray> roleNames() const override
53 {
53 {
54 return m_roles;
54 return m_roles;
55 }
55 }
@@ -65,7 +65,7 @@ public:
65 endRemoveRows();
65 endRemoveRows();
66 }
66 }
67
67
68− bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) {
68+ bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override {
69 beginInsertRows(parent, row, row+count-1);
69 beginInsertRows(parent, row, row+count-1);
70 for (int i=0; i<count; i++) {
70 for (int i=0; i<count; i++) {
71 m_list.insert(i+row, QString::number(i));
71 m_list.insert(i+row, QString::number(i));
@@ -81,7 +81,7 @@ public:
81 return true;
81 return true;
82 }
82 }
83
83
84− bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) {
84+ bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override {
85 beginRemoveRows(parent, row, row+count-1);
85 beginRemoveRows(parent, row, row+count-1);
86 for (int i=0; i<count; i++) {
86 for (int i=0; i<count; i++) {
87 m_list.removeAt(row);
87 m_list.removeAt(row);
tests/plugins/Utils/unitysortfilterproxymodeltest.cpp+5−5
@@ -39,12 +39,12 @@ public:
39 {
39 {
40 }
40 }
41
41
42− int rowCount(const QModelIndex& /* parent */ = QModelIndex()) const
42+ int rowCount(const QModelIndex& /* parent */ = QModelIndex()) const override
43 {
43 {
44 return m_list.size();
44 return m_list.size();
45 }
45 }
46
46
47− QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const
47+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override
48 {
48 {
49 if (!index.isValid() || index.row() < 0 || index.row() >= m_list.size() || role != Qt::DisplayRole) {
49 if (!index.isValid() || index.row() < 0 || index.row() >= m_list.size() || role != Qt::DisplayRole) {
50 return QVariant();
50 return QVariant();
@@ -52,7 +52,7 @@ public:
52 return QVariant(m_list[index.row()]);
52 return QVariant(m_list[index.row()]);
53 }
53 }
54
54
55− QHash<int, QByteArray> roleNames() const
55+ QHash<int, QByteArray> roleNames() const override
56 {
56 {
57 return m_roles;
57 return m_roles;
58 }
58 }
@@ -61,7 +61,7 @@ public:
61 m_roles = roles;
61 m_roles = roles;
62 }
62 }
63
63
64− bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) {
64+ bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override {
65 beginInsertRows(parent, row, row+count-1);
65 beginInsertRows(parent, row, row+count-1);
66 for (int i=0; i<count; i++) {
66 for (int i=0; i<count; i++) {
67 m_list.insert(i+row, QString("test%1").arg(i));
67 m_list.insert(i+row, QString("test%1").arg(i));
@@ -77,7 +77,7 @@ public:
77 return true;
77 return true;
78 }
78 }
79
79
80− bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) {
80+ bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override {
81 beginRemoveRows(parent, row, row+count-1);
81 beginRemoveRows(parent, row, row+count-1);
82 for (int i=0; i<count; i++) {
82 for (int i=0; i<count; i++) {
83 m_list.removeAt(row);
83 m_list.removeAt(row);
tests/qmltests/CMakeLists.txt+1
@@ -50,6 +50,7 @@ add_qml_test(Dash/Previews PreviewImageGallery)
50add_qml_test(Dash/Previews PreviewPayments)
50add_qml_test(Dash/Previews PreviewPayments)
51add_qml_test(Dash/Previews PreviewProgress)
51add_qml_test(Dash/Previews PreviewProgress)
52add_qml_test(Dash/Previews PreviewRatingDisplay)
52add_qml_test(Dash/Previews PreviewRatingDisplay)
53+add_qml_test(Dash/Previews PreviewRatingEdit)
53add_qml_test(Dash/Previews PreviewRatingInput)
54add_qml_test(Dash/Previews PreviewRatingInput)
54add_qml_test(Dash/Previews PreviewTable)
55add_qml_test(Dash/Previews PreviewTable)
55add_qml_test(Dash/Previews PreviewTextSummary)
56add_qml_test(Dash/Previews PreviewTextSummary)
tests/qmltests/Components/tst_DragHandle.cpp−8
@@ -26,7 +26,6 @@
26#include <DirectionalDragArea.h>
26#include <DirectionalDragArea.h>
27#include <DirectionalDragArea_p.h>
27#include <DirectionalDragArea_p.h>
28#include <Timer.h>
28#include <Timer.h>
29−#include <TouchRegistry.h>
30
29
31using namespace UbuntuGestures;
30using namespace UbuntuGestures;
32
31
@@ -61,7 +60,6 @@ private:
61
60
62 QQuickView *createView();
61 QQuickView *createView();
63 QQuickView *m_view;
62 QQuickView *m_view;
64− TouchRegistry *m_touchRegistry;
65 QTouchDevice *m_device;
63 QTouchDevice *m_device;
66 FakeTimer *m_fakeTimer;
64 FakeTimer *m_fakeTimer;
67 QSharedPointer<FakeTimeSource> m_fakeTimeSource;
65 QSharedPointer<FakeTimeSource> m_fakeTimeSource;
@@ -85,10 +83,7 @@ void tst_DragHandle::cleanupTestCase()
85
83
86void tst_DragHandle::init()
84void tst_DragHandle::init()
87{
85{
88− m_touchRegistry = new TouchRegistry;
89−
90 m_view = createView();
86 m_view = createView();
91− m_view->installEventFilter(m_touchRegistry);
92 m_view->setSource(QUrl::fromLocalFile(TEST_DIR"/tst_DragHandle.qml"));
87 m_view->setSource(QUrl::fromLocalFile(TEST_DIR"/tst_DragHandle.qml"));
93 m_view->show();
88 m_view->show();
94 QVERIFY(QTest::qWaitForWindowExposed(m_view));
89 QVERIFY(QTest::qWaitForWindowExposed(m_view));
@@ -108,9 +103,6 @@ void tst_DragHandle::cleanup()
108 delete m_view;
103 delete m_view;
109 m_view = 0;
104 m_view = 0;
110
105
111− delete m_touchRegistry;
112− m_touchRegistry = 0;
113−
114 delete m_fakeTimer;
106 delete m_fakeTimer;
115 m_fakeTimer = 0;
107 m_fakeTimer = 0;
116
108
tests/qmltests/Dash/Previews/tst_PreviewRatingEdit.qmlnew file+80
@@ -0,0 +1,80 @@
1+/*
2+ * Copyright 2014 Canonical Ltd.
3+ *
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
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import QtTest 1.0
19+import Ubuntu.Components 0.1
20+import "../../../../qml/Dash/Previews"
21+import Unity.Test 0.1 as UT
22+
23+Rectangle {
24+ id: root
25+ width: units.gu(40)
26+ height: units.gu(80)
27+ color: Theme.palette.selected.background
28+
29+ property var widgetData0: { "visible": "both", "required": "both", author: "Some dude", rating: 4.5, review: "Very cool app" }
30+
31+ PreviewRatingEdit {
32+ id: previewRatingEdit
33+ anchors.left: parent.left
34+ anchors.right: parent.right
35+ widgetData: widgetData0
36+ widgetId: "previewRatingInput"
37+ }
38+
39+ SignalSpy {
40+ id: spy
41+ signalName: "triggered"
42+ }
43+
44+ UT.UnityTestCase {
45+ name: "PreviewRatingEditTest"
46+ when: windowShown
47+
48+ function test_switch_and_trigger(data) {
49+ spy.target = previewRatingEdit;
50+
51+ var authorLabel = findChild(previewRatingEdit, "authorLabel");
52+ var reviewTextArea = findChild(previewRatingEdit, "reviewTextArea");
53+ var inputRating = findChild(findChild(previewRatingEdit, "input"), "rating");
54+ verify(authorLabel.visible)
55+ verify(!reviewTextArea.visible)
56+
57+ var editButton = findChild(previewRatingEdit, "editButton");
58+ mouseClick(editButton);
59+ verify(!authorLabel.visible)
60+ verify(reviewTextArea.visible)
61+
62+ compare(reviewTextArea.text, "Very cool app");
63+ compare(inputRating.value, 4.5);
64+
65+ reviewTextArea.text = "Ho Ho";
66+ inputRating.value = 3;
67+
68+ var submitButton = findChild(previewRatingEdit, "submitButton")
69+ mouseClick(submitButton);
70+
71+ compare(spy.count, 1);
72+ var args = spy.signalArguments[0];
73+ compare(args[0], previewRatingEdit.widgetId);
74+ compare(args[1], "rated");
75+ compare(args[2]["rating"], 3);
76+ compare(args[2]["review"], "Ho Ho");
77+ verify(args[2]["author"] !== undefined); // Just verifying it exists now
78+ }
79+ }
80+}
tests/qmltests/Dash/tst_DashContent.qml+7−2
@@ -142,7 +142,7 @@ Item {
142
142
143 var startX = dashContentList.width/2;
143 var startX = dashContentList.width/2;
144 var startY = dashContentList.height/2;
144 var startY = dashContentList.height/2;
145− touchFlick(dashContentList, startX - units.gu(2), startY, startX, startY);
145+ touchFlick(dashContentList, startX - units.gu(4), startY, startX, startY);
146 tryCompare(categoryListView, "contentY", units.gu(15) - categoryListView.pageHeader.height);
146 tryCompare(categoryListView, "contentY", units.gu(15) - categoryListView.pageHeader.height);
147 }
147 }
148
148
@@ -153,7 +153,7 @@ Item {
153
153
154 tryCompare(scope, "status", Loader.Ready);
154 tryCompare(scope, "status", Loader.Ready);
155
155
156− var categoryListView = findChild(dashContentList, "categoryListView");
156+ var categoryListView = findChild(scope, "categoryListView");
157 categoryListView.contentY = units.gu(10);
157 categoryListView.contentY = units.gu(10);
158
158
159 compare(dashContentList.currentItem.item.objectName, "MockScope1")
159 compare(dashContentList.currentItem.item.objectName, "MockScope1")
@@ -353,6 +353,8 @@ Item {
353 compare(backButton.visible, true);
353 compare(backButton.visible, true);
354
354
355 tryCompare(navigationList1.navigation, "loaded", true);
355 tryCompare(navigationList1.navigation, "loaded", true);
356+ tryCompare(navigationList1, "implicitHeight", navigationList1.itemHeight * 10);
357+ tryCompare(navigationList1, "height", navigationList1.implicitHeight);
356 navigation = findChild(dashNavigationButton, "navigation1child2");
358 navigation = findChild(dashNavigationButton, "navigation1child2");
357 mouseClick(navigation);
359 mouseClick(navigation);
358 compare(dashNavigationButton.showList, false);
360 compare(dashNavigationButton.showList, false);
@@ -386,6 +388,9 @@ Item {
386 mouseClick(dashNavigationButton);
388 mouseClick(dashNavigationButton);
387 compare(dashNavigationButton.showList, true);
389 compare(dashNavigationButton.showList, true);
388 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
390 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
391+ var navigationList0 = findChild(dashNavigationButton, "navigation0");
392+ tryCompare(navigationList0, "implicitHeight", navigationList0.itemHeight * 8);
393+ tryCompare(navigationList0, "height", navigationList0.implicitHeight);
389 navigation = findChild(dashNavigationButton, "navigation0child2");
394 navigation = findChild(dashNavigationButton, "navigation0child2");
390 mouseClick(navigation);
395 mouseClick(navigation);
391 compare(dashNavigationButton.showList, true);
396 compare(dashNavigationButton.showList, true);
tests/qmltests/Stages/ApplicationCheckBox.qml+49−20
@@ -22,27 +22,67 @@ import Unity.Application 0.1
22RowLayout {
22RowLayout {
23 id: root
23 id: root
24 property string appId
24 property string appId
25− property alias checked: checkbox.checked
25+ property bool checked: false
26
26
27 enabled: appId !== "unity8-dash"
27 enabled: appId !== "unity8-dash"
28
28
29+ onCheckedChanged: {
30+ if (d.bindGuard) { return; }
31+ d.bindGuard = true;
32+
33+ if (checked) {
34+ ApplicationManager.startApplication(root.appId);
35+ } else {
36+ ApplicationManager.stopApplication(root.appId);
37+ }
38+ d.bindGuard = false;
39+ }
40+
41+ QtObject {
42+ id: d
43+ property bool bindGuard: false
44+ property var application: null
45+ Component.onCompleted: {
46+ application = ApplicationManager.findApplication(root.appId);
47+ }
48+ }
49+
50+ Connections {
51+ target: ApplicationManager
52+ onCountChanged: {
53+ d.application = ApplicationManager.findApplication(root.appId);
54+ }
55+ }
56+
29 Layout.fillWidth: true
57 Layout.fillWidth: true
30 CheckBox {
58 CheckBox {
31 id: checkbox
59 id: checkbox
32 checked: false
60 checked: false
33 activeFocusOnPress: false
61 activeFocusOnPress: false
34− property bool noop: false
62+
35− onCheckedChanged: {
63+ onTriggered: {
36− if (noop) {
37− return;
64+ if (d.bindGuard) { return; }
38− }
65+ d.bindGuard = true;
66+
39 if (checked) {
67 if (checked) {
40− var application = ApplicationManager.startApplication(root.appId);
68+ ApplicationManager.startApplication(root.appId);
41− appConnections.target = application;
42 } else {
69 } else {
43− appConnections.target = null;
44 ApplicationManager.stopApplication(root.appId);
70 ApplicationManager.stopApplication(root.appId);
45 }
71 }
72+ d.bindGuard = false;
73+ }
74+ onCheckedChanged: {
75+ if (d.bindGuard) { return; }
76+ d.bindGuard = true;
77+
78+ root.checked = checked;
79+
80+ d.bindGuard = false;
81+ }
82+ Binding {
83+ target: checkbox
84+ property: "checked"
85+ value: d.application != null
46 }
86 }
47 }
87 }
48 Label {
88 Label {
@@ -50,15 +90,4 @@ RowLayout {
50 color: "white"
90 color: "white"
51 anchors.verticalCenter: parent.verticalCenter
91 anchors.verticalCenter: parent.verticalCenter
52 }
92 }
53−
54− Connections {
55− id: appConnections
56− onStateChanged: {
57− if (target.state == ApplicationInfoInterface.Stopped) {
58− checkbox.noop = true;
59− checkbox.checked = false;
60− checkbox.noop = false;
61− }
62− }
63− }
64}
93}
tests/qmltests/Stages/tst_DesktopStage.qml+77−67
@@ -20,6 +20,7 @@ import Ubuntu.Components 1.1
20import Ubuntu.Components.ListItems 1.0 as ListItem
20import Ubuntu.Components.ListItems 1.0 as ListItem
21import Unity.Application 0.1
21import Unity.Application 0.1
22import Unity.Test 0.1
22import Unity.Test 0.1
23+import Utils 0.1
23
24
24import "../../../qml/Stages"
25import "../../../qml/Stages"
25
26
@@ -29,31 +30,18 @@ Rectangle {
29 width: desktopStageLoader.width + controls.width
30 width: desktopStageLoader.width + controls.width
30 height: desktopStageLoader.height
31 height: desktopStageLoader.height
31
32
32− QtObject {
33+ Binding {
33− id: fakeWindowStateStorage
34+ target: MouseTouchAdaptor
34−
35− property var storedGeom: [
35+ property: "enabled"
36− ["unity8-dash", Qt.rect(units.gu(2), units.gu(2), units.gu(50), units.gu(50))],
36+ value: false
37− ["webbrowser-app", Qt.rect(units.gu(60), units.gu(2), units.gu(50), units.gu(50))]
37+ }
38− ]
39
38
40− function saveGeometry(windowId, geometry) {
39+ Component.onCompleted: {
41− for (var i = 0; i < storedGeom.length; ++i) {
40+ // ensures apps which are tested decorations are in view.
42− if (storedGeom[i][0] === windowId) {
41+ WindowStateStorage.geometry = {
43− storedGeom[i][1] = geometry;
42+ 'unity8-dash': Qt.rect(0, units.gu(3), units.gu(50), units.gu(40)),
44− return;
43+ 'dialer-app': Qt.rect(units.gu(51), units.gu(3), units.gu(50), units.gu(40)),
45− }
44+ 'camera-app': Qt.rect(0, units.gu(44), units.gu(50), units.gu(40)),
46− }
47− // if new
48− storedGeom[storedGeom.length] = [windowId, geometry];
49− }
50− function getGeometry(windowId, defaultGeometry) {
51− for (var i = 0; i < storedGeom.length; ++i) {
52− if (storedGeom[i][0] === windowId) {
53− return storedGeom[i][1];
54− }
55− }
56− return defaultGeometry;
57 }
45 }
58 }
46 }
59
47
@@ -70,7 +58,6 @@ Rectangle {
70 sourceComponent: Component {
58 sourceComponent: Component {
71 DesktopStage {
59 DesktopStage {
72 anchors.fill: parent
60 anchors.fill: parent
73− windowStateStorage: fakeWindowStateStorage
74 Component.onDestruction: {
61 Component.onDestruction: {
75 desktopStageLoader.itemDestroyed = true;
62 desktopStageLoader.itemDestroyed = true;
76 }
63 }
@@ -108,9 +95,6 @@ Rectangle {
108
95
109 property Item desktopStage: desktopStageLoader.status === Loader.Ready ? desktopStageLoader.item : null
96 property Item desktopStage: desktopStageLoader.status === Loader.Ready ? desktopStageLoader.item : null
110
97
111− function init() {
112− }
113−
114 function cleanup() {
98 function cleanup() {
115 desktopStageLoader.itemDestroyed = false;
99 desktopStageLoader.itemDestroyed = false;
116 desktopStageLoader.active = false;
100 desktopStageLoader.active = false;
@@ -145,57 +129,83 @@ Rectangle {
145 tryCompare(appWindowStates, "state", "surface");
129 tryCompare(appWindowStates, "state", "surface");
146 }
130 }
147
131
148− function rectsIntersect(aLocal, bLocal) {
132+ function startApplication(appId) {
149−
133+ var app = ApplicationManager.findApplication(appId);
150− var a = aLocal.mapToItem(null, 0, 0, aLocal.width, aLocal.height);
134+ if (!app) {
151− var b = bLocal.mapToItem(null, 0, 0, bLocal.width, bLocal.height);
135+ app = ApplicationManager.startApplication(appId);
152−
136+ }
137+ verify(app);
138+ waitUntilAppSurfaceShowsUp(appId);
139+ verify(app.session.surface);
153− return !((a.y+a.height) < b.y
140+ return app;
154− || a.y > (b.y+b.height)
155− || (a.x+a.width) < b.x
156− || a.x > (b.x+b.width));
157 }
141 }
158
142
159− function test_tappingOnWindowChangesFocusedApp() {
143+ function test_appFocusSwitch_data() {
160− ApplicationManager.startApplication("webbrowser-app");
144+ return [
161− waitUntilAppSurfaceShowsUp("webbrowser-app");
145+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 0, focusTo: 1 },
146+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 1, focusTo: 0 },
147+ ]
148+ }
162
149
163− var webbrowserWindow = findChild(desktopStage, "appWindow_webbrowser-app");
150+ function test_appFocusSwitch(data) {
164− verify(webbrowserWindow);
151+ var i;
165− var dashWindow = findChild(desktopStage, "appWindow_unity8-dash");
152+ for (i = 0; i < data.apps.length; i++) {
166− verify(dashWindow);
153+ startApplication(data.apps[i]);
154+ }
167
155
168− // some sanity check
156+ ApplicationManager.requestFocusApplication(data.apps[data.focusfrom]);
169− compare(rectsIntersect(dashWindow, webbrowserWindow), false);
157+ tryCompare(ApplicationManager.findApplication(data.apps[data.focusfrom]).session.surface, "activeFocus", true);
170
158
171− tap(dashWindow);
159+ ApplicationManager.requestFocusApplication(data.apps[data.focusTo]);
172− compare(dashWindow.application.session.surface.activeFocus, true);
160+ tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
161+ }
173
162
174− tap(webbrowserWindow);
163+ function test_tappingOnWindowChangesFocusedApp_data() {
175− compare(webbrowserWindow.application.session.surface.activeFocus, true);
164+ return [
165+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 0, focusTo: 1 },
166+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 1, focusTo: 0 },
167+ ]
176 }
168 }
177
169
178− function test_tappingOnWindowTitleChangesFocusedApp() {
170+ function test_tappingOnWindowChangesFocusedApp(data) {
171+ var i;
172+ for (i = 0; i < data.apps.length; i++) {
179− ApplicationManager.startApplication("webbrowser-app");
173+ startApplication(data.apps[i]);
180− waitUntilAppSurfaceShowsUp("webbrowser-app");
174+ }
175+
176+ var fromAppWindow = findChild(desktopStage, "appWindow_" + data.apps[data.focusfrom]);
177+ verify(fromAppWindow);
178+ tap(fromAppWindow);
179+ compare(fromAppWindow.application.session.surface.activeFocus, true);
181
180
182− var webbrowserWindow = findChild(desktopStage, "decoratedWindow_webbrowser-app");
181+ var toAppWindow = findChild(desktopStage, "appWindow_" + data.apps[data.focusTo]);
183− verify(webbrowserWindow);
182+ verify(toAppWindow);
184− var webbrowserWindowTitle = findChild(webbrowserWindow, "windowDecorationTitle");
183+ tap(toAppWindow);
185− verify(webbrowserWindowTitle);
184+ compare(toAppWindow.application.session.surface.activeFocus, true);
186− var dashWindow = findChild(desktopStage, "decoratedWindow_unity8-dash");
185+ }
187− verify(dashWindow);
188− var dashWindowTitle = findChild(dashWindow, "windowDecorationTitle");
189− verify(dashWindowTitle);
190
186
191− // some sanity check
187+ function test_tappingOnDecorationFocusesApplication_data() {
192− compare(rectsIntersect(dashWindow, webbrowserWindow), false);
188+ return [
189+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 0, focusTo: 1 },
190+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 1, focusTo: 0 },
191+ ]
192+ }
193+
194+ function test_tappingOnDecorationFocusesApplication(data) {
195+ var i;
196+ for (i = 0; i < data.apps.length; i++) {
197+ startApplication(data.apps[i]);
198+ }
193
199
194− tap(dashWindowTitle);
200+ var fromAppDecoration = findChild(desktopStage, "appWindowDecoration_" + data.apps[data.focusfrom]);
195− compare(dashWindow.application.session.surface.activeFocus, true);
201+ verify(fromAppDecoration);
202+ tap(fromAppDecoration);
203+ tryCompare(ApplicationManager.findApplication(data.apps[data.focusfrom]).session.surface, "activeFocus", true);
196
204
197− tap(webbrowserWindowTitle);
205+ var toAppDecoration = findChild(desktopStage, "appWindowDecoration_" + data.apps[data.focusTo]);
198− compare(webbrowserWindow.application.session.surface.activeFocus, true);
206+ verify(toAppDecoration);
207+ tap(toAppDecoration);
208+ tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
199 }
209 }
200 }
210 }
201}
211}
tests/qmltests/Stages/tst_TabletStage.qml+1−1
@@ -162,7 +162,7 @@ Rectangle {
162
162
163 performEdgeSwipeToShowAppSpread();
163 performEdgeSwipeToShowAppSpread();
164
164
165− var appDelegate = findChild(tabletStage, "spreadDelegate_" + dialerCheckBox.appId);
165+ var appDelegate = findChild(tabletStage, "tabletSpreadDelegate_" + dialerCheckBox.appId);
166 verify(appDelegate);
166 verify(appDelegate);
167 tryCompare(appDelegate, "swipeToCloseEnabled", true);
167 tryCompare(appDelegate, "swipeToCloseEnabled", true);
168
168
tests/qmltests/tst_Shell.qml+136−39
@@ -31,6 +31,7 @@ import Powerd 0.1
31import Wizard 0.1 as Wizard
31import Wizard 0.1 as Wizard
32
32
33import "../../qml"
33import "../../qml"
34+import "Stages"
34
35
35Rectangle {
36Rectangle {
36 id: root
37 id: root
@@ -92,19 +93,25 @@ Rectangle {
92 }
93 }
93 }
94 }
94
95
95− Rectangle {
96+ Flickable {
96 id: controls
97 id: controls
97− color: "darkgrey"
98+ contentHeight: controlRect.height
98− width: units.gu(30)
99+
99 anchors.top: root.top
100 anchors.top: root.top
100 anchors.bottom: root.bottom
101 anchors.bottom: root.bottom
101 anchors.right: root.right
102 anchors.right: root.right
103+ width: units.gu(30)
104+
105+ Rectangle {
106+ id: controlRect
107+ anchors { left: parent.left; right: parent.right }
108+ color: "darkgrey"
109+ height: childrenRect.height + units.gu(2)
110+
111+ Column {
112+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
113+ spacing: units.gu(1)
102
114
103− Column {
104− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
105− spacing: units.gu(1)
106− Row {
107− anchors { left: parent.left; right: parent.right }
108 Button {
115 Button {
109 text: "Show Greeter"
116 text: "Show Greeter"
110 activeFocusOnPress: false
117 activeFocusOnPress: false
@@ -118,30 +125,54 @@ Rectangle {
118 }
125 }
119 }
126 }
120 }
127 }
121− }
122− ListItem.ItemSelector {
128+ ListItem.ItemSelector {
123− anchors { left: parent.left; right: parent.right }
129+ anchors { left: parent.left; right: parent.right }
124− activeFocusOnPress: false
130+ activeFocusOnPress: false
125− text: "LightDM mock mode"
131+ text: "LightDM mock mode"
126− model: ["single", "single-passphrase", "single-pin", "full"]
132+ model: ["single", "single-passphrase", "single-pin", "full"]
127− onSelectedIndexChanged: {
133+ onSelectedIndexChanged: {
128− shellLoader.active = false;
134+ shellLoader.active = false;
129− LightDM.Greeter.mockMode = model[selectedIndex];
135+ LightDM.Greeter.mockMode = model[selectedIndex];
130− LightDM.Users.mockMode = model[selectedIndex];
136+ LightDM.Users.mockMode = model[selectedIndex];
131− shellLoader.active = true;
137+ shellLoader.active = true;
138+ }
132 }
139 }
133− }
134− ListItem.ItemSelector {
140+ ListItem.ItemSelector {
135− anchors { left: parent.left; right: parent.right }
141+ anchors { left: parent.left; right: parent.right }
136− activeFocusOnPress: false
142+ activeFocusOnPress: false
137− text: "Size"
143+ text: "Size"
138− model: ["phone", "tablet"]
144+ model: ["phone", "tablet"]
139− onSelectedIndexChanged: {
145+ onSelectedIndexChanged: {
140− shellLoader.active = false;
146+ shellLoader.active = false;
141− shellLoader.state = model[selectedIndex];
147+ shellLoader.state = model[selectedIndex];
142− shellLoader.active = true;
148+ shellLoader.active = true;
149+ }
150+ }
151+ ListItem.ItemSelector {
152+ id: usageModeSelector
153+ anchors { left: parent.left; right: parent.right }
154+ activeFocusOnPress: false
155+ text: "Usage mode"
156+ model: ["Staged", "Windowed"]
157+ onSelectedIndexChanged: {
158+ GSettingsController.setUsageMode(model[selectedIndex]);
159+ }
160+ }
161+ MouseTouchEmulationCheckbox {
162+ id: mouseEmulation
163+ checked: true
164+ color: "white"
165+ }
166+
167+ Label { text: "Applications"; font.bold: true }
168+
169+ Repeater {
170+ id: appRepeater
171+ model: ApplicationManager.availableApplications
172+ ApplicationCheckBox {
173+ appId: modelData
174+ }
143 }
175 }
144− MouseTouchEmulationCheckbox { color: "white" }
145 }
176 }
146 }
177 }
147 }
178 }
@@ -222,6 +253,7 @@ Rectangle {
222 function cleanup() {
253 function cleanup() {
223 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
254 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
224 tearDown();
255 tearDown();
256+ GSettingsController.setUsageMode("Staged");
225 }
257 }
226
258
227 function loadShell(formFactor) {
259 function loadShell(formFactor) {
@@ -659,22 +691,57 @@ Rectangle {
659
691
660 function test_launchedAppHasActiveFocus_data() {
692 function test_launchedAppHasActiveFocus_data() {
661 return [
693 return [
662− {tag:"phone", formFactor:"phone"},
694+ {tag: "phone", formFactor: "phone", usageMode: "Staged"},
663− {tag:"tablet", formFactor:"tablet"},
695+ {tag: "tablet", formFactor: "tablet", usageMode: "Staged"},
696+ {tag: "desktop", formFactor: "tablet", usageMode: "Windowed"}
664− ];
697+ ]
665 }
698 }
666
699
667 function test_launchedAppHasActiveFocus(data) {
700 function test_launchedAppHasActiveFocus(data) {
701+ GSettingsController.setUsageMode(data.usageMode);
668 loadShell(data.formFactor);
702 loadShell(data.formFactor);
669 swipeAwayGreeter();
703 swipeAwayGreeter();
670
704
671− var dialerApp = ApplicationManager.startApplication("webbrowser-app");
705+ var webApp = ApplicationManager.startApplication("webbrowser-app");
672− verify(dialerApp);
706+ verify(webApp);
673 waitUntilAppSurfaceShowsUp("webbrowser-app")
707 waitUntilAppSurfaceShowsUp("webbrowser-app")
674
708
675− verify(dialerApp.session.surface);
709+ verify(webApp.session.surface);
676
710
711+ tryCompare(webApp.session.surface, "activeFocus", true);
712+ }
713+
714+ function test_launchedAppKeepsActiveFocusOnUsageModeChange() {
715+ loadShell("tablet");
716+ swipeAwayGreeter();
717+
718+ var webApp = ApplicationManager.startApplication("webbrowser-app");
719+ verify(webApp);
720+ waitUntilAppSurfaceShowsUp("webbrowser-app")
721+
722+ verify(webApp.session.surface);
723+
724+ tryCompare(webApp.session.surface, "activeFocus", true);
725+
726+ GSettingsController.setUsageMode("Windowed");
727+
728+ // check that the desktop stage and window have been loaded
729+ {
730+ var desktopWindow = findChild(shell, "decoratedWindow_webbrowser-app");
731+ verify(desktopWindow);
732+ }
733+
734+ tryCompare(webApp.session.surface, "activeFocus", true);
735+
736+ GSettingsController.setUsageMode("Staged");
737+
738+ // check that the tablet stage and app surface delegate have been loaded
739+ {
740+ var desktopWindow = findChild(shell, "tabletSpreadDelegate_webbrowser-app");
741+ verify(desktopWindow);
742+ }
743+
677− tryCompare(dialerApp.session.surface, "activeFocus", true);
744+ tryCompare(webApp.session.surface, "activeFocus", true);
678 }
745 }
679
746
680 function waitUntilAppSurfaceShowsUp(appId) {
747 function waitUntilAppSurfaceShowsUp(appId) {
@@ -1076,8 +1143,7 @@ Rectangle {
1076 loadShell("phone");
1143 loadShell("phone");
1077 swipeAwayGreeter();
1144 swipeAwayGreeter();
1078 AccountsService.backgroundFile = data.accounts;
1145 AccountsService.backgroundFile = data.accounts;
1079− var backgroundSettings = findInvisibleChild(shell, "backgroundSettings");
1146+ GSettingsController.setPictureUri(data.gsettings);
1080− backgroundSettings.pictureUri = data.gsettings;
1081
1147
1082 if (data.output === "defaultBackground") {
1148 if (data.output === "defaultBackground") {
1083 tryCompare(shell, "background", shell.defaultBackground);
1149 tryCompare(shell, "background", shell.defaultBackground);
@@ -1134,5 +1200,36 @@ Rectangle {
1134 tryCompare(passwordInput, "focus", true)
1200 tryCompare(passwordInput, "focus", true)
1135 }
1201 }
1136 }
1202 }
1203+
1204+ function test_stageLoader_data() {
1205+ return [
1206+ {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageMode: "Staged"},
1207+ {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageMode: "Staged"},
1208+ {tag: "desktop", source: "Stages/DesktopStage.qml", formFactor: "tablet", usageMode: "Windowed"}
1209+ ]
1210+ }
1211+
1212+ function test_stageLoader(data) {
1213+ GSettingsController.setUsageMode(data.usageMode);
1214+ loadShell(data.formFactor);
1215+ var stageLoader = findChild(shell, "applicationsDisplayLoader");
1216+ verify(String(stageLoader.source).indexOf(data.source) >= 0);
1217+ }
1218+
1219+ function test_launcherInverted_data() {
1220+ return [
1221+ {tag: "phone", formFactor: "phone", usageMode: "Staged", launcherInverted: true},
1222+ {tag: "tablet", formFactor: "tablet", usageMode: "Staged", launcherInverted: true},
1223+ {tag: "desktop", formFactor: "tablet", usageMode: "Windowed", launcherInverted: false}
1224+ ]
1225+ }
1226+
1227+ function test_launcherInverted(data) {
1228+ GSettingsController.setUsageMode(data.usageMode);
1229+ loadShell(data.formFactor);
1230+
1231+ var launcher = findChild(shell, "launcher");
1232+ compare(launcher.inverted, data.launcherInverted);
1233+ }
1137 }
1234 }
1138}
1235}
tests/uqmlscene/main.cpp−10
@@ -63,9 +63,6 @@
63#include <QtCore/QTranslator>
63#include <QtCore/QTranslator>
64#include <QtCore/QLibraryInfo>
64#include <QtCore/QLibraryInfo>
65
65
66−// UbuntuGestures lib
67−#include <TouchRegistry.h>
68−
69#define UQMLSCENE_DEBUG_ACTIVE_FOCUS 0
66#define UQMLSCENE_DEBUG_ACTIVE_FOCUS 0
70
67
71#if UQMLSCENE_DEBUG_ACTIVE_FOCUS
68#if UQMLSCENE_DEBUG_ACTIVE_FOCUS
@@ -434,11 +431,6 @@ int main(int argc, char ** argv)
434 app.setOrganizationName("Qt Project");
431 app.setOrganizationName("Qt Project");
435 app.setOrganizationDomain("qt-project.org");
432 app.setOrganizationDomain("qt-project.org");
436
433
437− // Create it before loading the module, so that TestUtil
438− // doesn't create one with a fake timer factory.
439− // When interacting manually with a test we want the real deal.
440− new TouchRegistry;
441−
442#ifndef QT_NO_TRANSLATION
434#ifndef QT_NO_TRANSLATION
443 QTranslator translator;
435 QTranslator translator;
444 QTranslator qtTranslator;
436 QTranslator qtTranslator;
@@ -512,8 +504,6 @@ int main(int argc, char ** argv)
512 #if UQMLSCENE_DEBUG_ACTIVE_FOCUS
504 #if UQMLSCENE_DEBUG_ACTIVE_FOCUS
513 activeFocusLogger.setWindow(qxView);
505 activeFocusLogger.setWindow(qxView);
514 #endif
506 #endif
515− TouchRegistry::instance()->setParent(qxView);
516− qxView->installEventFilter(TouchRegistry::instance());
517 window = qxView;
507 window = qxView;
518 // Set window default properties; the qml can still override them
508 // Set window default properties; the qml can still override them
519 QString oname = contentItem->objectName();
509 QString oname = contentItem->objectName();
tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qml+1
@@ -22,6 +22,7 @@ import Unity.Test 0.1
22RowLayout {
22RowLayout {
23 id: root
23 id: root
24 property alias color: label.color
24 property alias color: label.color
25+ property alias checked: checkbox.checked
25
26
26 Binding {
27 Binding {
27 target: MouseTouchAdaptor
28 target: MouseTouchAdaptor
tests/utils/modules/Unity/Test/UnityTestCase.qml−2
@@ -424,8 +424,6 @@ TestCase {
424 }
424 }
425
425
426 Component.onCompleted: {
426 Component.onCompleted: {
427− UT.Util.ensureTouchRegistryInstalled();
428−
429 var rootItem = parent;
427 var rootItem = parent;
430 while (rootItem.parent != undefined) {
428 while (rootItem.parent != undefined) {
431 rootItem = rootItem.parent;
429 rootItem = rootItem.parent;
tests/utils/modules/Unity/Test/plugin.h+1−1
@@ -26,7 +26,7 @@ class UnityTestPlugin : public QQmlExtensionPlugin
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27
27
28public:
28public:
29− void registerTypes(const char *uri);
29+ void registerTypes(const char *uri) override;
30};
30};
31
31
32#endif // UNITY_TEST_PLUGIN_H
32#endif // UNITY_TEST_PLUGIN_H
tests/utils/modules/Unity/Test/testutil.cpp+8−20
@@ -31,6 +31,7 @@ TestUtil::TestUtil(QObject *parent)
31 : QObject(parent)
31 : QObject(parent)
32 , m_targetWindow(0)
32 , m_targetWindow(0)
33 , m_touchDevice(0)
33 , m_touchDevice(0)
34+ , m_putFakeTimerFactoryInTouchRegistry(false)
34{
35{
35}
36}
36
37
@@ -59,7 +60,13 @@ TouchEventSequenceWrapper *TestUtil::touchEvent(QQuickItem *item)
59{
60{
60 ensureTargetWindow();
61 ensureTargetWindow();
61 ensureTouchDevice();
62 ensureTouchDevice();
62− ensureTouchRegistryInstalled();
63+
64+ // Tests can be *very* slow to run and we don't want things timing out because
65+ // of that. So give it fake timers to use (they will never time out)
66+ if (!m_putFakeTimerFactoryInTouchRegistry) {
67+ TouchRegistry::instance()->setTimerFactory(new FakeTimerFactory);
68+ m_putFakeTimerFactoryInTouchRegistry = true;
69+ }
63
70
64 return new TouchEventSequenceWrapper(
71 return new TouchEventSequenceWrapper(
65 QTest::touchEvent(m_targetWindow, m_touchDevice, /* autoCommit */ false), item);
72 QTest::touchEvent(m_targetWindow, m_touchDevice, /* autoCommit */ false), item);
@@ -79,22 +86,3 @@ void TestUtil::ensureTouchDevice()
79 QWindowSystemInterface::registerTouchDevice(m_touchDevice);
86 QWindowSystemInterface::registerTouchDevice(m_touchDevice);
80 }
87 }
81}
88}
82−
83−void TestUtil::ensureTouchRegistryInstalled()
84−{
85− if (TouchRegistry::instance())
86− return;
87−
88− if (!m_targetWindow)
89− return;
90−
91− // Tests can be *very* slow to run and we don't want things timing out because
92− // of that. So give it fake timers to use (they will never time out)
93− TouchRegistry *touchRegistry = new TouchRegistry(this, new FakeTimerFactory);
94−
95− QQuickView *view = qobject_cast<QQuickView*>(m_targetWindow);
96− if (view) {
97− view->installEventFilter(touchRegistry);
98− touchRegistry->setParent(view);
99− }
100−}
tests/utils/modules/Unity/Test/testutil.h+1−1
@@ -34,7 +34,6 @@ public:
34
34
35 Q_INVOKABLE bool isInstanceOf(QObject*, QString);
35 Q_INVOKABLE bool isInstanceOf(QObject*, QString);
36 Q_INVOKABLE TouchEventSequenceWrapper *touchEvent(QQuickItem *item);
36 Q_INVOKABLE TouchEventSequenceWrapper *touchEvent(QQuickItem *item);
37− Q_INVOKABLE void ensureTouchRegistryInstalled();
38
37
39private:
38private:
40 void ensureTargetWindow();
39 void ensureTargetWindow();
@@ -42,6 +41,7 @@ private:
42
41
43 QWindow *m_targetWindow;
42 QWindow *m_targetWindow;
44 QTouchDevice *m_touchDevice;
43 QTouchDevice *m_touchDevice;
44+ bool m_putFakeTimerFactoryInTouchRegistry;
45};
45};
46
46
47QML_DECLARE_TYPE(TestUtil)
47QML_DECLARE_TYPE(TestUtil)