Merge lp:~dandrader/unity-api/shellRotation into lp:unity-api

Proposed by Daniel d'Andrada on 2014-11-19
Status: Merged
Approved by: Gerry Boland on 2015-04-16
Approved revision: 172
Merged at revision: 173
Proposed branch: lp:~dandrader/unity-api/shellRotation
Merge into: lp:unity-api
Diff against target: 125 lines (+46/-2)
6 files modified
debian/changelog (+6/-0)
include/unity/shell/application/ApplicationInfoInterface.h (+24/-1)
include/unity/shell/application/CMakeLists.txt (+1/-1)
test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp (+10/-0)
test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h (+3/-0)
test/qmltest/unity/shell/application/tst_Application.qml (+2/-0)
To merge this branch: bzr merge lp:~dandrader/unity-api/shellRotation
Reviewer Review Type Date Requested Status
Gerry Boland 2014-11-19 Approve on 2015-04-16
PS Jenkins bot continuous-integration Approve on 2015-02-18
Review via email: mp+242212@code.launchpad.net

Commit Message

Add supportedOrientations and rotatesWindowContents to ApplicationInfo

Description of the Change

Work needed for the "shell rotation" feature

To post a comment you must log in.
Gerry Boland (gerboland) wrote :

+ Q_PROPERTY(bool rotatesWindowContents READ rotatesWindowContents CONSTANT)
am not fond if the term "window" here, as I've mentioned in the qtmir review.

Is fine otherwise

review: Needs Fixing
165. By Daniel d'Andrada on 2014-12-08

Merge trunk

[ Albert Astals Cid ]
Add setFavorite/moveFavoriteTo

166. By Daniel d'Andrada on 2015-02-12

Merge trunk

[ Michael Zanetti ]
* add onlyPinned property to launcher model
[ MichaƂ Sawicz ]
* Add :native to g++ dependency for cross-building and wrap-and-sort
  for good measure. Python needs :any, too. (LP: #1353855)

167. By Daniel d'Andrada on 2015-02-12

Drop the ":native" part as PPA's can't handle it

168. By Daniel d'Andrada on 2015-02-18

Merge trunk

[ Pawel Stolowski ]
Added close method to scopes interface.

Gerry Boland (gerboland) wrote :

- g++-4.9:native,
+ g++-4.9,
Please undo

review: Needs Fixing
Gerry Boland (gerboland) wrote :

+ * Copyright 2013-2014 Canonical Ltd.
heh, think we need 2015 now

Daniel d'Andrada (dandrader) wrote :

On 23/02/15 10:48, Gerry Boland wrote:
> Review: Needs Fixing
>
> - g++-4.9:native,
> + g++-4.9,
> Please undo
If I undo that,
https://launchpad.net/~unity-team/+archive/ubuntu/demo-stuff PPA won't build

169. By Daniel d'Andrada on 2015-04-16

Add :native back again

170. By Daniel d'Andrada on 2015-04-16

Update copyright year

171. By Daniel d'Andrada on 2015-04-16

Merge trunk

[ CI Train Bot ]
* New rebuild forced.
[ Michi Henning ]
* Reverted commit 93 because it cost me a cool 1.5 hours today. Turns
  out that libmcheck is not thread-safe and causes the most amazing
  crashes in unpredictable ways :-(

Daniel d'Andrada (dandrader) wrote :

> + * Copyright 2013-2014 Canonical Ltd.
> heh, think we need 2015 now

Done.

Daniel d'Andrada (dandrader) wrote :

> - g++-4.9:native,
> + g++-4.9,
> Please undo

Done.

172. By Daniel d'Andrada on 2015-04-16

Update debian/changelog date & time

Gerry Boland (gerboland) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-04-10 16:07:40 +0000
3+++ debian/changelog 2015-04-16 16:46:55 +0000
4@@ -1,3 +1,9 @@
5+unity-api (7.97) UNRELEASED; urgency=medium
6+
7+ * add supportedOrientations and rotatesWindowContents to ApplicationInfo
8+
9+ -- Daniel d'Andrada <daniel.dandrada@canonical.com> Thu, 16 Apr 2015 13:46:18 -0300
10+
11 unity-api (7.96+15.04.20150410.2-0ubuntu1) vivid; urgency=medium
12
13 [ CI Train Bot ]
14
15=== modified file 'include/unity/shell/application/ApplicationInfoInterface.h'
16--- include/unity/shell/application/ApplicationInfoInterface.h 2014-09-09 15:51:47 +0000
17+++ include/unity/shell/application/ApplicationInfoInterface.h 2015-04-16 16:46:55 +0000
18@@ -1,5 +1,5 @@
19 /*
20- * Copyright 2013 Canonical Ltd.
21+ * Copyright 2013,2015 Canonical Ltd.
22 *
23 * This program is free software; you can redistribute it and/or modify
24 * it under the terms of the GNU Lesser General Public License as published by
25@@ -15,6 +15,7 @@
26 *
27 * Authors:
28 * Michael Zanetti <michael.zanetti@canonical.com>
29+ * Daniel d'Andrada <daniel.dandrada@canonical.com>
30 */
31
32 #ifndef UNITY_SHELL_APPLICATION_APPLICATIONINFOINTERFACE_H
33@@ -176,6 +177,26 @@
34 */
35 Q_PROPERTY(QColor splashColorFooter READ splashColorFooter CONSTANT)
36
37+ /**
38+ * @brief The orientations supported by the application UI
39+ * @see rotatesContents
40+ */
41+ Q_PROPERTY(Qt::ScreenOrientations supportedOrientations READ supportedOrientations CONSTANT)
42+
43+ /**
44+ * @brief Whether the application UI will rotate itself to match the screen orientation
45+ *
46+ * Returns true if the application will rotate the UI in its windows to match the screen
47+ * orientation.
48+ *
49+ * If false, it means that the application never rotates its UI, so it will
50+ * rely on the window manager to appropriately rotate his windows to match the screen
51+ * orientation instead.
52+ *
53+ * @see supportedOrientations
54+ */
55+ Q_PROPERTY(bool rotatesWindowContents READ rotatesWindowContents CONSTANT)
56+
57 protected:
58 /// @cond
59 ApplicationInfoInterface(const QString &appId, QObject* parent = 0): QObject(parent) { Q_UNUSED(appId) }
60@@ -230,6 +251,8 @@
61 virtual QColor splashColor() const = 0;
62 virtual QColor splashColorHeader() const = 0;
63 virtual QColor splashColorFooter() const = 0;
64+ virtual Qt::ScreenOrientations supportedOrientations() const = 0;
65+ virtual bool rotatesWindowContents() const = 0;
66 /// @endcond
67
68 Q_SIGNALS:
69
70=== modified file 'include/unity/shell/application/CMakeLists.txt'
71--- include/unity/shell/application/CMakeLists.txt 2014-09-29 09:13:40 +0000
72+++ include/unity/shell/application/CMakeLists.txt 2015-04-16 16:46:55 +0000
73@@ -7,7 +7,7 @@
74
75 set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
76
77-set(VERSION 5)
78+set(VERSION 6)
79 set(PKGCONFIG_NAME "unity-shell-application")
80 set(PKGCONFIG_DESCRIPTION "Unity shell Application APIs")
81 set(PKGCONFIG_REQUIRES "Qt5Core")
82
83=== modified file 'test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp'
84--- test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp 2014-09-03 22:59:26 +0000
85+++ test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp 2015-04-16 16:46:55 +0000
86@@ -125,3 +125,13 @@
87 {
88 return QColor(0,0,0,0);
89 }
90+
91+Qt::ScreenOrientations MockApplicationInfo::supportedOrientations() const
92+{
93+ return Qt::PortraitOrientation | Qt::LandscapeOrientation;
94+}
95+
96+bool MockApplicationInfo::rotatesWindowContents() const
97+{
98+ return false;
99+}
100
101=== modified file 'test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h'
102--- test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h 2014-09-03 22:59:26 +0000
103+++ test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h 2015-04-16 16:46:55 +0000
104@@ -53,6 +53,9 @@
105 QColor splashColorHeader() const override;
106 QColor splashColorFooter() const override;
107
108+ Qt::ScreenOrientations supportedOrientations() const override;
109+ bool rotatesWindowContents() const override;
110+
111 private:
112 QString m_appId;
113 QString m_name;
114
115=== modified file 'test/qmltest/unity/shell/application/tst_Application.qml'
116--- test/qmltest/unity/shell/application/tst_Application.qml 2014-09-29 10:58:06 +0000
117+++ test/qmltest/unity/shell/application/tst_Application.qml 2015-04-16 16:46:55 +0000
118@@ -150,6 +150,8 @@
119 { tag: "ApplicationInfo.properties[splashColor]", constant: "splashColor", type: "color"},
120 { tag: "ApplicationInfo.properties[splashColorHeader]", constant: "splashColorHeader", type: "color"},
121 { tag: "ApplicationInfo.properties[splashColorFooter]", constant: "splashColorFooter", type: "color"},
122+ { tag: "ApplicationInfo.properties[supportedOrientations]", constant: "supportedOrientations", type: "number"},
123+ { tag: "ApplicationInfo.properties[rotatesWindowContents]", constant: "rotatesWindowContents", type: "boolean"},
124 ];
125 }
126

Subscribers

People subscribed via source and target branches

to all changes: