on xenial help sign in
Merge
commitd247be5d94947ea83658955b2cfeec273f087ca6 authorAlbert Astals <albert.astals@canonical.com> dateWed 18 Dec 2013, 10:50 (13 years ago) parent494d49c209d012
27 files changed+558−452
CMakeLists.txt+2−10 CODING+2−2 Notifications/Notification.qml+211−181 Notifications/NotificationMenuItemFactory.qml+9−2 Notifications/Notifications.qml+3−1 Shell.qml+4−3 data/unity8.override+1 debian/changelog+26 debian/unity8-autopilot.install+1 main.cpp−40 paths.h.in+39 plugins/Unity/Indicators/Messaging/qml/MessageMenuItemFactory.qml+79−47 plugins/Unity/Indicators/qml/IndicatorPage.qml+6−4 plugins/Unity/Indicators/qml/MenuItemFactory.qml+132−85 po/my.po+10−10 po/tr.po+7−7 src/Panel/Indicators/client/indicatorsclient.cpp−35 tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+7−6 tests/autopilot/unity8/shell/tests/test_lock_screen.py+9−8 tests/autopilot/unity8/shell/tests/test_notifications.py+1−1 tests/mocks/LightDM/demo/CMakeLists.txt−1 tests/mocks/Unity/Application/CMakeLists.txt−1 tests/mocks/Unity/Launcher/CMakeLists.txt−1 tests/plugins/AccountsService/CMakeLists.txt+6−1 tests/plugins/Unity/Indicators/menucontentactivatortest.cpp−1 tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp−1 tests/qmltests/Notifications/tst_Notifications.qml+3−4
CMakeLists.txt+2−10
@@ -108,11 +108,7 @@ declare_autopilot_test(shell unity8.shell ${CMAKE_SOURCE_DIR}/tests/autopilot/)
108108
109109set(SHELL_APP unity8)
110110
111−set(shell_app_HDRS
112− )
113−
114111add_executable(${SHELL_APP}
115− ${shellapplication_MOC_SRCS}
116112 ApplicationArguments.h
117113 main.cpp
118114 MouseTouchAdaptor.cpp
@@ -123,14 +119,10 @@ pkg_check_modules(XCB REQUIRED xcb)
123119
124120if (NOT "${XCB_INCLUDE_DIRS}" STREQUAL "")
125121 set_target_properties(${SHELL_APP} PROPERTIES INCLUDE_DIRECTORIES ${XCB_INCLUDE_DIRS})
122+
123+ target_link_libraries(${SHELL_APP} ${XCB_LDFLAGS})
126124endif()
127125
128−target_link_libraries(${SHELL_APP}
129− ${Qt5Qml_LIBRARIES}
130− ${Qt5Quick_LIBRARIES}
131− ${XCB_LDFLAGS}
132− ${CMAKE_DL_LIBS}
133− )
134126
135127# install binaries
136128install(TARGETS ${SHELL_APP}
CODING+2−2
@@ -1,7 +1,7 @@
11Building Unity 8
22================
33
4−Only Ubuntu 13.10 (saucy) is supported as a developement environment.
4+Only Ubuntu 14.04 (trusty) is supported as a developement environment.
55
66download source
77---------------
@@ -68,7 +68,7 @@ Notes
6868
6969Running Unity 8 on devices
7070==========================
71−- Ubuntu Touch builds are currently only available in 13.10 flavour
71+- Ubuntu Touch builds are currently only available in 14.04 flavour
7272- supported hardware should match one of those listed here
7373 https://wiki.ubuntu.com/Touch/Devices#Running_fine
7474- follow the Ubuntu Touch install instructions for your chosen device
Notifications/Notification.qml+211−181
@@ -20,7 +20,7 @@ import Unity.Notifications 1.0
2020import QMenuModel 0.1
2121import Utils 0.1
2222
23−UbuntuShape {
23+Item {
2424 id: notification
2525
2626 property alias iconSource: icon.fileSource
@@ -32,262 +32,292 @@ UbuntuShape {
3232 property var type
3333 property var hints
3434 property var notification
35+ property color color
36+ property bool fullscreen
3537
38+ fullscreen: false
3639 objectName: "background"
37− implicitHeight: type != Notification.PlaceHolder ? contentColumn.height + contentColumn.spacing * 2 : 0
40+ implicitHeight: type != Notification.PlaceHolder ? (fullscreen ? notificationList.fullHeight : contentColumn.height + contentColumn.spacing * 4) : 0
41+
3842 color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
3943 opacity: 0
40− radius: "medium"
4144
42− clip: true
45+ clip: fullscreen ? false : true
4346 visible: type != Notification.PlaceHolder
4447
45− UnityMenuModelPaths {
46− id: paths
47−
48− source: hints["x-canonical-private-menu-model"]
48+ UbuntuShape {
49+ id: shapedBack
4950
50− busNameHint: "busName"
51− actionsHint: "actions"
52− menuObjectPathHint: "menuPath"
51+ visible: !fullscreen
52+ anchors.fill: parent
53+ anchors.margins: notificationList.margin
54+ color: parent.color
55+ opacity: parent.opacity
56+ radius: "medium"
5357 }
5458
55− UnityMenuModel {
56− id: unityMenuModel
59+ Rectangle {
60+ id: nonShapedBack
5761
58− busName: paths.busName
59− actions: paths.actions
60− menuObjectPath: paths.menuObjectPath
62+ visible: fullscreen
63+ anchors.fill: parent
64+ color: parent.color
65+ opacity: parent.opacity
6166 }
6267
63− Behavior on implicitHeight {
64− id: heightBehavior
68+ Item {
69+ id: contents
70+ anchors.fill: fullscreen ? nonShapedBack : shapedBack
6571
66− enabled: false
67− UbuntuNumberAnimation {
68− duration: UbuntuAnimation.SnapDuration
69− }
70− }
72+ UnityMenuModelPaths {
73+ id: paths
7174
72− // delay enabling height behavior until the add transition is complete
73− onOpacityChanged: if (opacity == 1) heightBehavior.enabled = true
75+ source: hints["x-canonical-private-menu-model"]
7476
75− MouseArea {
76− id: interactiveArea
77+ busNameHint: "busName"
78+ actionsHint: "actions"
79+ menuObjectPathHint: "menuPath"
80+ }
7781
78− anchors.fill: contentColumn
79− objectName: "interactiveArea"
80− enabled: notification.type == Notification.Interactive
81− onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
82− }
82+ UnityMenuModel {
83+ id: unityMenuModel
84+
85+ busName: paths.busName
86+ actions: paths.actions
87+ menuObjectPath: paths.menuObjectPath
88+ }
8389
84− Column {
85− id: contentColumn
90+ Behavior on implicitHeight {
91+ id: heightBehavior
8692
87− anchors {
88− left: parent.left
89− right: parent.right
90− top: parent.top
91− margins: spacing
93+ enabled: false
94+ UbuntuNumberAnimation {
95+ duration: UbuntuAnimation.SnapDuration
96+ }
9297 }
9398
94− spacing: units.gu(1)
99+ // delay enabling height behavior until the add transition is complete
100+ onOpacityChanged: if (opacity == 1) heightBehavior.enabled = true
95101
96− Row {
97− id: topRow
102+ MouseArea {
103+ id: interactiveArea
104+
105+ anchors.fill: contentColumn
106+ objectName: "interactiveArea"
107+ enabled: notification.type == Notification.Interactive
108+ onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
109+ }
110+
111+ Column {
112+ id: contentColumn
98113
99− spacing: contentColumn.spacing
100114 anchors {
101115 left: parent.left
102116 right: parent.right
117+ top: parent.top
118+ margins: fullscreen ? 0 : spacing
103119 }
104120
105− ShapedIcon {
106− id: icon
121+ spacing: units.gu(1)
107122
108− objectName: "icon"
109− width: units.gu(6)
110− height: units.gu(6)
111− shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
112− visible: iconSource !== undefined && iconSource != ""
113− }
123+ Row {
124+ id: topRow
114125
115− Image {
116− id: secondaryIcon
126+ spacing: contentColumn.spacing
127+ anchors {
128+ left: parent.left
129+ right: parent.right
130+ }
117131
118− objectName: "secondaryIcon"
119− width: units.gu(2)
120− height: units.gu(2)
121− visible: source !== undefined && source != ""
122− fillMode: Image.PreserveAspectCrop
123− }
132+ ShapedIcon {
133+ id: icon
124134
125− Column {
126− id: labelColumn
127− width: parent.width - x
135+ objectName: "icon"
136+ width: units.gu(6)
137+ height: units.gu(6)
138+ shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
139+ visible: iconSource !== undefined && iconSource != ""
140+ }
128141
129− anchors.verticalCenter: (icon.visible && !bodyLabel.visible) ? icon.verticalCenter : undefined
142+ Image {
143+ id: secondaryIcon
130144
131− Label {
132− id: summaryLabel
145+ objectName: "secondaryIcon"
146+ width: units.gu(2)
147+ height: units.gu(2)
148+ visible: source !== undefined && source != ""
149+ fillMode: Image.PreserveAspectCrop
150+ }
133151
134− objectName: "summaryLabel"
135− anchors {
136− left: parent.left
137− right: parent.right
152+ Column {
153+ id: labelColumn
154+ width: parent.width - x
155+
156+ anchors.verticalCenter: (icon.visible && !bodyLabel.visible) ? icon.verticalCenter : undefined
157+
158+ Label {
159+ id: summaryLabel
160+
161+ objectName: "summaryLabel"
162+ anchors {
163+ left: parent.left
164+ right: parent.right
165+ }
166+ fontSize: "medium"
167+ font.bold: true
168+ color: Theme.palette.selected.backgroundText
169+ elide: Text.ElideRight
138170 }
139− fontSize: "medium"
140− font.bold: true
141− color: Theme.palette.selected.backgroundText
142− elide: Text.ElideRight
143− }
144171
145− Label {
146− id: bodyLabel
172+ Label {
173+ id: bodyLabel
147174
148− objectName: "bodyLabel"
149− anchors {
150− left: parent.left
151− right: parent.right
175+ objectName: "bodyLabel"
176+ anchors {
177+ left: parent.left
178+ right: parent.right
179+ }
180+ visible: body != ""
181+ fontSize: "small"
182+ color: Theme.palette.selected.backgroundText
183+ opacity: 0.6
184+ wrapMode: Text.WordWrap
185+ maximumLineCount: 10
186+ elide: Text.ElideRight
152187 }
153− visible: body != ""
154− fontSize: "small"
155− color: Theme.palette.selected.backgroundText
156− opacity: 0.6
157− wrapMode: Text.WordWrap
158− maximumLineCount: 10
159− elide: Text.ElideRight
160188 }
161189 }
162− }
163190
164− Column {
165− objectName: "dialogListView"
166− spacing: units.gu(2)
191+ Column {
192+ objectName: "dialogListView"
193+ spacing: units.gu(2)
167194
168− visible: count > 0
195+ visible: count > 0
169196
170− anchors.left: parent.left; anchors.right: parent.right
197+ anchors.left: parent.left; anchors.right: parent.right
198+ anchors.top: fullscreen ? parent.top : undefined
199+ anchors.bottom: fullscreen ? parent.bottom : undefined
171200
172− Repeater {
173− model: unityMenuModel
201+ Repeater {
202+ model: unityMenuModel
174203
175− NotificationMenuItemFactory {
176− anchors.left: parent.left; anchors.right: parent.right
204+ NotificationMenuItemFactory {
205+ anchors.left: parent.left; anchors.right: parent.right
177206
178− menuModel: unityMenuModel
179− menuData: model
180− menuIndex: index
207+ menuModel: unityMenuModel
208+ menuData: model
209+ menuIndex: index
210+ }
181211 }
182212 }
183− }
184213
185− Item {
186− id: buttonRow
214+ Item {
215+ id: buttonRow
187216
188− objectName: "buttonRow"
189− anchors {
190− left: parent.left
191− right: parent.right
192− }
193− visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
194− height: units.gu(5)
217+ objectName: "buttonRow"
218+ anchors {
219+ left: parent.left
220+ right: parent.right
221+ }
222+ visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
223+ height: units.gu(5)
195224
196− property real buttonWidth: (width - contentColumn.spacing) / 2
197− property bool expanded
225+ property real buttonWidth: (width - contentColumn.spacing) / 2
226+ property bool expanded
198227
199− Button {
200− id: leftButton
228+ Button {
229+ id: leftButton
201230
202− objectName: "button1"
203− width: parent.expanded ? parent.width : parent.buttonWidth
204− anchors {
205− top: parent.top
206− bottom: parent.bottom
207− }
208− text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
209− gradient: UbuntuColors.greyGradient
210− onClicked: {
211− if (actionRepeater.count > 2) {
212− buttonRow.expanded = !buttonRow.expanded
213− } else {
214− notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
231+ objectName: "button1"
232+ width: parent.expanded ? parent.width : parent.buttonWidth
233+ anchors {
234+ top: parent.top
235+ bottom: parent.bottom
236+ }
237+ text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
238+ gradient: UbuntuColors.greyGradient
239+ onClicked: {
240+ if (actionRepeater.count > 2) {
241+ buttonRow.expanded = !buttonRow.expanded
242+ } else {
243+ notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
244+ }
245+ }
246+
247+ Behavior on width {
248+ UbuntuNumberAnimation {
249+ duration: UbuntuAnimation.SnapDuration
250+ }
215251 }
216252 }
217253
218− Behavior on width {
219− UbuntuNumberAnimation {
220− duration: UbuntuAnimation.SnapDuration
254+ Button {
255+ id: rightButton
256+
257+ objectName: "button0"
258+ anchors {
259+ left: leftButton.right
260+ leftMargin: contentColumn.spacing
261+ right: parent.right
221262 }
263+ text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
264+ anchors {
265+ top: parent.top
266+ bottom: parent.bottom
267+ }
268+ gradient: notification.hints["x-canonical-private-button-tint"] == "true" ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
269+ visible: width > 0
270+ onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
222271 }
223272 }
224273
225− Button {
226− id: rightButton
227−
228− objectName: "button0"
274+ Column {
275+ objectName: "buttonColumn"
276+ spacing: contentColumn.spacing
229277 anchors {
230− left: leftButton.right
231− leftMargin: contentColumn.spacing
278+ left: parent.left
232279 right: parent.right
233280 }
234− text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
235− anchors {
236− top: parent.top
237− bottom: parent.bottom
238− }
239− gradient: notification.hints["x-canonical-private-button-tint"] == "true" ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
240− visible: width > 0
241− onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
242− }
243− }
244281
245− Column {
246− objectName: "buttonColumn"
247− spacing: contentColumn.spacing
248− anchors {
249− left: parent.left
250− right: parent.right
251− }
282+ // calculate initial position before Column takes over
283+ y: buttonRow.y + buttonRow.height + contentColumn.spacing
252284
253− // calculate initial position before Column takes over
254− y: buttonRow.y + buttonRow.height + contentColumn.spacing
285+ visible: notification.type == Notification.SnapDecision && buttonRow.expanded
286+ height: buttonRow.expanded ? implicitHeight : 0
255287
256− visible: notification.type == Notification.SnapDecision
257− height: buttonRow.expanded ? implicitHeight : 0
288+ Repeater {
289+ id: actionRepeater
258290
259− Repeater {
260− id: actionRepeater
291+ model: notification.actions
292+ delegate: Loader {
293+ id: loader
261294
262− model: notification.actions
263− delegate: Loader {
264− id: loader
295+ property string actionId: id
296+ property string actionLabel: label
265297
266− property string actionId: id
267− property string actionLabel: label
298+ anchors {
299+ left: parent.left
300+ right: parent.right
301+ }
268302
269− anchors {
270− left: parent.left
271− right: parent.right
272− }
303+ Component {
304+ id: actionButton
273305
274− Component {
275− id: actionButton
306+ Button {
307+ objectName: "button" + index
308+ anchors {
309+ left: parent.left
310+ right: parent.right
311+ }
276312
277− Button {
278− objectName: "button" + index
279− anchors {
280− left: parent.left
281− right: parent.right
313+ text: loader.actionLabel
314+ height: units.gu(5)
315+ gradient: UbuntuColors.greyGradient
316+ onClicked: notification.notification.invokeAction(loader.actionId)
282317 }
283−
284− text: loader.actionLabel
285− height: units.gu(5)
286− gradient: UbuntuColors.greyGradient
287− onClicked: notification.notification.invokeAction(loader.actionId)
288318 }
319+ sourceComponent: (index == 0 || index == 1) ? undefined : actionButton
289320 }
290− sourceComponent: (index == 0 || index == 1) ? undefined : actionButton
291321 }
292322 }
293323 }
Notifications/NotificationMenuItemFactory.qml+9−2
@@ -28,7 +28,6 @@ Loader {
2828 property QtObject menuModel: null
2929 property QtObject menuData: null
3030 property int menuIndex
31− property var notification
3231
3332 property var _map: {
3433 "com.canonical.snapdecision.textfield": textfield,
@@ -44,6 +43,10 @@ Loader {
4443 }
4544 }
4645
46+ Component.onCompleted: {
47+ notification.fullscreen = menuData.type == "com.canonical.snapdecision.pinlock"
48+ }
49+
4750 Component {
4851 id: textfield
4952
@@ -94,8 +97,12 @@ Loader {
9497
9598 Component {
9699 id: pinLock
97− PinLockscreen {
100+
101+ Lockscreen {
98102 anchors.left: parent.left; anchors.right: parent.right
103+ height: notificationList.fullHeight
104+ placeholderText: i18n.tr("Please enter SIM PIN")
105+ background: shell.background
99106
100107 onEntered: {
101108 menuModel.changeState(menuIndex, passphrase);
Notifications/Notifications.qml+3−1
@@ -24,7 +24,9 @@ ListView {
2424 objectName: "notificationList"
2525 interactive: false
2626
27− spacing: units.gu(.5)
27+ property real margin
28+ property real fullHeight
29+
2830 delegate: Notification {
2931 objectName: "notification" + index
3032 anchors {
Shell.qml+4−3
@@ -704,13 +704,14 @@ FocusScope {
704704 id: notifications
705705
706706 model: NotificationBackend.Model
707+ margin: units.gu(1)
708+ fullHeight: parent.height - panel.panelHeight
709+
707710 anchors {
708711 top: parent.top
709712 right: parent.right
710713 bottom: parent.bottom
711− leftMargin: units.gu(1)
712− rightMargin: units.gu(1)
713− topMargin: panel.panelHeight + units.gu(1)
714+ topMargin: panel.panelHeight
714715 }
715716 states: [
716717 State {
data/unity8.overridenew file+1
@@ -0,0 +1 @@
1+kill timeout 30
debian/changelog+26
@@ -1,3 +1,29 @@
1+unity8 (7.84+14.04.20131212-0ubuntu1) trusty; urgency=low
2+
3+ [ Michał Sawicz ]
4+ * Add PyDev project files for autopilot tests. Also tweak .bzrignore
5+ to not ignore generic Eclipse project definitions.
6+ * Retry unlocking the greeter three times.
7+ * Reduce code duplication and clean up CMakeLists and includes in
8+ indicator tests.
9+
10+ [ Nick Dedekind ]
11+ * Replaced indicator page dynamic menuSelected binding with Connection
12+ to listview selectedIndex property. (LP: #1243146)
13+ * Indicators close when menu items are activated. (LP: #1238182)
14+ * Fixed up connections for changes to model data. (LP: #1253810)
15+
16+ [ Albert Astals ]
17+ * dashItemSelected -> showDashHome Because we are not using the index
18+ at all in the upper layers.
19+ * Fix filtering colllapsing/expanding again Also the delegate creation
20+ range stuff flows up->down not down->up so rearrange the bindings.
21+
22+ [ Ubuntu daily release ]
23+ * Automatic snapshot from revision 590
24+
25+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 12 Dec 2013 21:41:19 +0000
26+
127unity8 (7.84+14.04.20131206.1-0ubuntu1) trusty; urgency=low
228
329 [ Michal Hruby ]
debian/unity8-autopilot.install+1
@@ -1 +1,2 @@
11usr/lib/python*/*/unity*
2+data/unity8.override usr/share/upstart/sessions
main.cpp−40
@@ -19,7 +19,6 @@
1919
2020// Qt
2121#include <QtQuick/QQuickView>
22−#include <QtGui/QIcon>
2322#include <QtGui/QGuiApplication>
2423#include <QtQml/QQmlEngine>
2524#include <QtQml/QQmlContext>
@@ -37,45 +36,6 @@
3736
3837#include <unity-mir/qmirserver.h>
3938
40−namespace {
41−
42−void prependImportPaths(QQmlEngine *engine, const QStringList &paths)
43−{
44− QStringList importPathList = engine->importPathList();
45− for (int i = paths.count() -1; i >= 0; i--) {
46− // don't duplicate
47− const QString& path = paths[i];
48− QStringList::iterator iter = qFind(importPathList.begin(), importPathList.end(), path);
49− if (iter == importPathList.end()) {
50− engine->addImportPath(path);
51− }
52− }
53−}
54−
55−/* When you append and import path to the list of import paths it will be the *last*
56− place where Qt will search for QML modules.
57− The usual QQmlEngine::addImportPath() actually prepends the given path.*/
58−void appendImportPaths(QQmlEngine *engine, const QStringList &paths)
59−{
60− QStringList importPathList = engine->importPathList();
61− Q_FOREACH(const QString& path, paths) {
62− // don't duplicate
63− QStringList::iterator iter = qFind(importPathList.begin(), importPathList.end(), path);
64− if (iter == importPathList.end()) {
65− importPathList.append(path);
66− }
67− }
68− engine->setImportPathList(importPathList);
69−}
70−
71−void resolveIconTheme() {
72− const char *ubuntuIconTheme = getenv("UBUNTU_ICON_THEME");
73− if (ubuntuIconTheme == NULL) {
74− ubuntuIconTheme = "ubuntu-mobile";
75− }
76− QIcon::setThemeName(ubuntuIconTheme);
77−}
78−} // namespace {
7939
8040int startShell(int argc, const char** argv, void* server)
8141{
paths.h.in+39
@@ -23,6 +23,8 @@
2323// Qt
2424#include <QtCore/QCoreApplication>
2525#include <QtCore/QDir>
26+#include <QtGui/QIcon>
27+#include <QtQml/QQmlEngine>
2628#include <QStandardPaths>
2729
2830inline bool isRunningInstalled() {
@@ -86,4 +88,41 @@ inline QString sourceDirectory() {
8688 return QString("@CMAKE_SOURCE_DIR@/");
8789}
8890
91+inline void prependImportPaths(QQmlEngine *engine, const QStringList &paths)
92+{
93+ QStringList importPathList = engine->importPathList();
94+ for (int i = paths.count() -1; i >= 0; i--) {
95+ // don't duplicate
96+ const QString& path = paths[i];
97+ QStringList::iterator iter = qFind(importPathList.begin(), importPathList.end(), path);
98+ if (iter == importPathList.end()) {
99+ engine->addImportPath(path);
100+ }
101+ }
102+}
103+
104+/* When you append and import path to the list of import paths it will be the *last*
105+ place where Qt will search for QML modules.
106+ The usual QQmlEngine::addImportPath() actually prepends the given path.*/
107+inline void appendImportPaths(QQmlEngine *engine, const QStringList &paths)
108+{
109+ QStringList importPathList = engine->importPathList();
110+ Q_FOREACH(const QString& path, paths) {
111+ // don't duplicate
112+ QStringList::iterator iter = qFind(importPathList.begin(), importPathList.end(), path);
113+ if (iter == importPathList.end()) {
114+ importPathList.append(path);
115+ }
116+ }
117+ engine->setImportPathList(importPathList);
118+}
119+
120+inline void resolveIconTheme() {
121+ const char *ubuntuIconTheme = getenv("UBUNTU_ICON_THEME");
122+ if (ubuntuIconTheme == NULL) {
123+ ubuntuIconTheme = "ubuntu-mobile";
124+ }
125+ QIcon::setThemeName(ubuntuIconTheme);
126+}
127+
89128#endif
plugins/Unity/Indicators/Messaging/qml/MessageMenuItemFactory.qml+79−47
@@ -24,12 +24,39 @@ import Unity.Indicators 0.1 as Indicators
2424import QMenuModel 0.1 as QMenuModel
2525
2626Indicators.BaseMenuItem {
27− id: menuItem
28− property var actionsDescription: menu ? menu.ext.xCanonicalMessageActions : undefined
27+ id: messageFactoryItem
28+ property var menuModel: null
29+ property QtObject menuData: null
30+ property int menuIndex: -1
2931
30− implicitHeight: contents.status == Loader.Ready ? contents.item.implicitHeight : 0
32+ property var extendedData: menuData && menuData.ext || undefined
33+ property var actionsDescription: getExtendedProperty(extendedData, "xCanonicalMessageActions", undefined)
34+
35+ onMenuModelChanged: {
36+ loadAttributes();
37+ }
38+ onMenuIndexChanged: {
39+ loadAttributes();
40+ }
3141
32− property var model: null
42+ function loadAttributes() {
43+ if (!menuModel || menuIndex == undefined) return;
44+
45+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-time': 'int64',
46+ 'x-canonical-text': 'string',
47+ 'x-canonical-message-actions': 'variant',
48+ 'icon': 'icon',
49+ 'x-canonical-app-icon': 'icon'});
50+ }
51+
52+ function getExtendedProperty(object, propertyName, defaultValue) {
53+ if (object && object.hasOwnProperty(propertyName)) {
54+ return object[propertyName];
55+ }
56+ return defaultValue;
57+ }
58+
59+ implicitHeight: contents.status == Loader.Ready ? contents.item.implicitHeight : 0
3360
3461 Loader {
3562 id: contents
@@ -41,96 +68,101 @@ Indicators.BaseMenuItem {
4168 id: simpleTextMessage
4269 SimpleTextMessage {
4370 // text
44− title: menu && menu.label ? menu.label : ""
45− time: menu ? menu.ext.xCanonicalTime : 0
46− message: menu && menu.ext.xCanonicalText ? menu.ext.xCanonicalText : ""
71+ title: menuData && menuData.label || ""
72+ time: getExtendedProperty(extendedData, "xCanonicalTime", 0)
73+ message: getExtendedProperty(extendedData, "xCanonicalText", "")
4774 // icons
48− avatar: menu && menu.ext.icon !== undefined ? menu.ext.icon : "qrc:/indicators/artwork/messaging/default_contact.png"
49− appIcon: menu && menu.ext.xCanonicalAppIcon !== undefined ? menu.ext.xCanonicalAppIcon : "qrc:/indicators/artwork/messaging/default_app.svg"
75+ avatar: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_contact.png")
76+ appIcon: getExtendedProperty(extendedData, "xCanonicalAppIcon", "qrc:/indicators/artwork/messaging/default_app.svg")
5077
5178 onActivateApp: {
52− menuItem.model.activate(modelIndex, true);
79+ menuModel.activate(menuIndex, true);
5380 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
5481 }
5582 onDismiss: {
56− menuItem.model.activate(modelIndex, false);
83+ menuModel.activate(menuIndex, false);
5784 }
5885
59− menuSelected: menuItem.menuSelected
60− onSelectMenu: menuItem.selectMenu()
61− onDeselectMenu: menuItem.deselectMenu()
86+ menuSelected: messageFactoryItem.menuSelected
87+ onSelectMenu: messageFactoryItem.selectMenu()
88+ onDeselectMenu: messageFactoryItem.deselectMenu()
6289 }
6390 }
6491 Component {
6592 id: textMessage
6693 TextMessage {
94+ property var replyActionDescription: actionsDescription && actionsDescription.length > 0 ? actionsDescription[0] : undefined
95+
6796 property var replyAction: QMenuModel.UnityMenuAction {
68− model: menuItem.model
69− index: modelIndex
70− name: menu && actionsDescription[0].name ? actionsDescription[0].name : ""
97+ model: menuModel
98+ index: menuIndex
99+ name: getExtendedProperty(replyActionDescription, "name", "")
71100 }
72101
73102 // text
74− title: menu && menu.label ? menu.label : ""
75− time: menu ? menu.ext.xCanonicalTime : 0
76− message: menu && menu.ext.xCanonicalText ? menu.ext.xCanonicalText : ""
77− replyButtonText: actionsDescription && actionsDescription[0].label ? actionsDescription[0].label : "Send"
103+ title: menuData && menuData.label || ""
104+ time: getExtendedProperty(extendedData, "xCanonicalTime", 0)
105+ message: getExtendedProperty(extendedData, "xCanonicalText", "")
106+ replyButtonText: getExtendedProperty(replyActionDescription, "label", "Send")
78107 // icons
79− avatar: menu && menu.ext.icon !== undefined ? menu.ext.icon : "qrc:/indicators/artwork/messaging/default_contact.png"
80− appIcon: menu && menu.ext.xCanonicalAppIcon !== undefined ? menu.ext.xCanonicalAppIcon : "qrc:/indicators/artwork/messaging/default_app.svg"
108+ avatar: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_contact.png")
109+ appIcon: getExtendedProperty(extendedData, "xCanonicalAppIcon", "qrc:/indicators/artwork/messaging/default_app.svg")
81110 // actions
82111 replyEnabled: replyAction.valid && replyAction.enabled
83112
84113 onActivateApp: {
85− menuItem.model.activate(modelIndex, true);
114+ menuModel.activate(menuIndex, true);
86115 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
87116 }
88117 onDismiss: {
89− menuItem.model.activate(modelIndex, false);
118+ menuModel.activate(menuIndex, false);
90119 }
91120 onReply: {
92121 replyAction.activate(value);
93122 }
94123
95− menuSelected: menuItem.menuSelected
96− onSelectMenu: menuItem.selectMenu()
97− onDeselectMenu: menuItem.deselectMenu()
124+ menuSelected: messageFactoryItem.menuSelected
125+ onSelectMenu: messageFactoryItem.selectMenu()
126+ onDeselectMenu: messageFactoryItem.deselectMenu()
98127 }
99128 }
100129 Component {
101130 id: snapDecision
102131 SnapDecision {
132+ property var activateActionDescription: actionsDescription && actionsDescription.length > 0 ? actionsDescription[0] : undefined
133+ property var replyActionDescription: actionsDescription && actionsDescription.length > 1 ? actionsDescription[1] : undefined
134+
103135 property var activateAction: QMenuModel.UnityMenuAction {
104− model: menuItem.model
105− index: modelIndex
106− name: menu && actionsDescription[0].name ? actionsDescription[0].name : ""
136+ model: menuModel
137+ index: menuIndex
138+ name: getExtendedProperty(activateActionDescription, "name", "")
107139 }
108140 property var replyAction: QMenuModel.UnityMenuAction {
109− model: menuItem.model
110− index: modelIndex
111− name: menu && actionsDescription[1].name ? actionsDescription[1].name : ""
141+ model: menuModel
142+ index: menuIndex
143+ name: getExtendedProperty(replyActionDescription, "name", "")
112144 }
113145
114146 // text
115− title: menu && menu.label ? menu.label : ""
116− time: menu ? menu.ext.xCanonicalTime : ""
117− message: menu && menu.ext.xCanonicalText ? menu.ext.xCanonicalText : ""
118− actionButtonText: actionsDescription && actionsDescription[0].label ? actionsDescription[0].label : "Call back"
119− replyButtonText: actionsDescription && actionsDescription[1].label ? actionsDescription[1].label : "Send"
120− replyMessages: actionsDescription && actionsDescription[1]["parameter-hint"] ? actionsDescription[1]["parameter-hint"] : ""
147+ title: menuData && menuData.label || ""
148+ time: getExtendedProperty(extendedData, "xCanonicalTime", 0)
149+ message: getExtendedProperty(extendedData, "xCanonicalText", "")
150+ actionButtonText: getExtendedProperty(activateActionDescription, "label", "Call back")
151+ replyButtonText: getExtendedProperty(replyActionDescription, "label", "Send")
152+ replyMessages: getExtendedProperty(replyActionDescription, "parameter-hint", "")
121153 // icons
122− avatar: menu && menu.ext.icon !== undefined ? menu.ext.icon : "qrc:/indicators/artwork/messaging/default_contact.png"
123− appIcon: menu && menu.ext.xCanonicalAppIcon !== undefined ? menu.ext.xCanonicalAppIcon : "qrc:/indicators/artwork/messaging/default_app.svg"
154+ avatar: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_contact.png")
155+ appIcon: getExtendedProperty(extendedData, "xCanonicalAppIcon", "qrc:/indicators/artwork/messaging/default_app.svg")
124156 // actions
125157 activateEnabled: activateAction.valid && activateAction.enabled
126158 replyEnabled: replyAction.valid && replyAction.enabled
127159
128160 onActivateApp: {
129− menuItem.model.activate(modelIndex, true);
161+ menuModel.activate(menuIndex, true);
130162 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
131163 }
132164 onDismiss: {
133− menuItem.model.activate(modelIndex, false);
165+ menuModel.activate(menuIndex, false);
134166 }
135167 onActivate: {
136168 activateAction.activate();
@@ -139,9 +171,9 @@ Indicators.BaseMenuItem {
139171 replyAction.activate(value);
140172 }
141173
142− menuSelected: menuItem.menuSelected
143− onSelectMenu: menuItem.selectMenu()
144− onDeselectMenu: menuItem.deselectMenu()
174+ menuSelected: messageFactoryItem.menuSelected
175+ onSelectMenu: messageFactoryItem.selectMenu()
176+ onDeselectMenu: messageFactoryItem.deselectMenu()
145177 }
146178 }
147179 }
plugins/Unity/Indicators/qml/IndicatorPage.qml+6−4
@@ -144,9 +144,11 @@ IndicatorBase {
144144 item.selectMenu.connect(function() { mainMenu.selectedIndex = index; });
145145 item.deselectMenu.connect(function() { mainMenu.selectedIndex = -1; });
146146 }
147−
148− if (item.hasOwnProperty("menu")) {
149− item.menu = Qt.binding(function() { return model; });
147+ if (item.hasOwnProperty("menuData")) {
148+ item.menuData = Qt.binding(function() { return model; });
149+ }
150+ if (item.hasOwnProperty("menuIndex")) {
151+ item.menuIndex = Qt.binding(function() { return modelIndex; });
150152 }
151153 }
152154
@@ -172,7 +174,7 @@ IndicatorBase {
172174
173175 MenuItemFactory {
174176 id: factory
175− model: mainMenu.model
177+ menuModel: mainMenu.model ? mainMenu.model : null
176178 }
177179
178180 Components.Label {
plugins/Unity/Indicators/qml/MenuItemFactory.qml+132−85
@@ -27,7 +27,7 @@ import Ubuntu.Components 0.1
2727Item {
2828 id: menuFactory
2929
30− property var model: null
30+ property var menuModel: null
3131
3232 property var _map: {
3333 "unity.widgets.systemsettings.tablet.volumecontrol" : sliderMenu,
@@ -50,38 +50,55 @@ Item {
5050 "unity.widgets.systemsettings.tablet.accesspoint" : accessPoint,
5151 }
5252
53+ function getExtendedProperty(object, propertyName, defaultValue) {
54+ if (object && object.hasOwnProperty(propertyName)) {
55+ return object[propertyName];
56+ }
57+ return defaultValue;
58+ }
59+
5360 Component { id: divMenu; Indicators.DivMenuItem {} }
5461
5562 Component {
5663 id: sliderMenu;
5764 Indicators.SliderMenuItem {
58− property QtObject menu: null
65+ property QtObject menuData: null
66+ property var menuModel: menuFactory.menuModel
67+ property int menuIndex: -1
68+ property var extendedData: menuData && menuData.ext || undefined
5969
60− text: menu && menu.label ? menu.label : ""
61− icon: menu && menu.icon ? menu.icon : ""
62− minIcon: menu && menu.ext.minIcon ? menu.ext.minIcon : ""
63− maxIcon: menu && menu.ext.maxIcon ? menu.ext.maxIcon : ""
70+ text: menuData && menuData.label || ""
71+ iconSource: menuData && menuData.icon || ""
72+ minIcon: getExtendedProperty(extendedData, "minIcon", "")
73+ maxIcon: getExtendedProperty(extendedData, "maxIcon", "")
6474
65− minimumValue: menu.ext.minValue ? menu.ext.minValue : 0.0
75+ minimumValue: getExtendedProperty(extendedData, "minValue", 0.0)
6676 maximumValue: {
67− var maximum = menu.ext.maxValue ? menu.ext.maxValue : 1.0
77+ var maximum = getExtendedProperty(extendedData, "maxValue", 1.0);
6878 if (maximum <= minimumValue) {
6979 return minimumValue + 1;
7080 }
7181 return maximum;
7282 }
73− value: menu ? menu.actionState : 0.0
74− enabled: menu ? menu.sensitive : false
83+ value: menuData && menuData.actionState || 0.0
84+ enabled: menuData && menuData.sensitive || false
7585
76− Component.onCompleted: {
77− model.loadExtendedAttributes(modelIndex, {'min-value': 'double',
78− 'max-value': 'double',
79− 'min-icon': 'icon',
80− 'max-icon': 'icon'});
86+ onMenuModelChanged: {
87+ loadAttributes();
88+ }
89+ onMenuIndexChanged: {
90+ loadAttributes();
8191 }
82−
8392 onChangeState: {
84− model.changeState(modelIndex, value);
93+ menuModel.changeState(menuIndex, value);
94+ }
95+
96+ function loadAttributes() {
97+ if (!menuModel || menuIndex == undefined) return;
98+ menuModel.loadExtendedAttributes(menuIndex, {'min-value': 'double',
99+ 'max-value': 'double',
100+ 'min-icon': 'icon',
101+ 'max-icon': 'icon'});
85102 }
86103 }
87104 }
@@ -89,13 +106,15 @@ Item {
89106 Component {
90107 id: buttonMenu;
91108 Indicators.ButtonMenuItem {
92− property QtObject menu: null
109+ property QtObject menuData: null
110+ property var menuModel: menuFactory.menuModel
111+ property int menuIndex: -1
93112
94− text: menu && menu.label ? menu.label : ""
95− enabled: menu ? menu.sensitive : false
113+ text: menuData && menuData.label || ""
114+ enabled: menuData && menuData.sensitive || false
96115
97116 onActivate: {
98− model.activate(modelIndex);
117+ menuModel.activate(menuIndex);
99118 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
100119 }
101120 }
@@ -103,37 +122,40 @@ Item {
103122 Component {
104123 id: sectionMenu;
105124 Indicators.SectionMenuItem {
106− property QtObject menu: null
125+ property QtObject menuData: null
126+ property var menuIndex: undefined
107127
108− text: menu && menu.label ? menu.label : ""
128+ text: menuData && menuData.label || ""
109129 }
110130 }
111131
112132 Component {
113133 id: progressMenu;
114134 Indicators.ProgressMenuItem {
115− property QtObject menu: null
135+ property QtObject menuData: null
136+ property int menuIndex: -1
116137
117− text: menu && menu.label ? menu.label : ""
118− icon: menu ? menu.icon : ""
119− value : menu ? menu.actionState : 0.0
120− enabled: menu ? menu.sensitive : false
138+ text: menuData && menuData.label || ""
139+ iconSource: menuData && menuData.icon || ""
140+ value : menuData && menuData.actionState || 0.0
141+ enabled: menuData && menuData.sensitive || false
121142 }
122143 }
123144
124145 Component {
125146 id: standardMenu;
126147 Indicators.StandardMenuItem {
127− property QtObject menu: null
148+ property QtObject menuData: null
149+ property int menuIndex: -1
128150
129− text: menu && menu.label ? menu.label : ""
130− icon: menu && menu.icon ? menu.icon : ""
131− checkable: menu ? (menu.isCheck || menu.isRadio) : false
132− checked: checkable ? menu.isToggled : false
133− enabled: menu ? menu.sensitive : false
151+ text: menuData && menuData.label || ""
152+ iconSource: menuData && menuData.icon || ""
153+ enabled: menuData && menuData.sensitive || false
154+ checkable: menuData ? (menuData.isCheck || menuData.isRadio) : false
155+ checked: checkable ? menuData.isToggled : false
134156
135157 onActivate: {
136− model.activate(modelIndex);
158+ menuModel.activate(menuIndex);
137159 shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
138160 }
139161 }
@@ -142,15 +164,16 @@ Item {
142164 Component {
143165 id: switchMenu;
144166 Indicators.SwitchMenuItem {
145− property QtObject menu: null
167+ property QtObject menuData: null
168+ property int menuIndex: -1
146169
147− text: menu && menu.label ? menu.label : ""
148− icon: menu && menu.icon ? menu.icon : ""
149− checked: menu ? menu.isToggled : false
150− enabled: menu ? menu.sensitive : false
170+ text: menuData && menuData.label || ""
171+ iconSource: menuData && menuData.icon || ""
172+ enabled: menuData && menuData.sensitive || false
173+ checked: menuData ? menuData.isToggled : false
151174
152175 onActivate: {
153− model.activate(modelIndex);
176+ menuModel.activate(menuIndex);
154177 shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
155178 }
156179 }
@@ -159,13 +182,24 @@ Item {
159182 Component {
160183 id: wifiSection;
161184 Indicators.SectionMenuItem {
162− property QtObject menu: null
185+ property QtObject menuData: null
186+ property var menuModel: menuFactory.menuModel
187+ property int menuIndex: -1
188+ property var extendedData: menuData && menuData.ext || undefined
189+
190+ text: menuData && menuData.label || ""
191+ busy: getExtendedProperty(extendedData, "xCanonicalBusyAction", false)
163192
164− text: menu && menu.label ? menu.label : ""
165− busy: menu ? menu.ext.xCanonicalBusyAction : false
193+ onMenuModelChanged: {
194+ loadAttributes();
195+ }
196+ onMenuIndexChanged: {
197+ loadAttributes();
198+ }
166199
167− Component.onCompleted: {
168− model.loadExtendedAttributes(modelIndex, {'x-canonical-busy-action': 'bool'});
200+ function loadAttributes() {
201+ if (!menuModel || menuIndex == undefined) return;
202+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-busy-action': 'bool'})
169203 }
170204 }
171205 }
@@ -173,67 +207,81 @@ Item {
173207 Component {
174208 id: accessPoint;
175209 ICNetwork.AccessPoint {
176− property QtObject menu: null
210+ property QtObject menuData: null
211+ property var menuModel: menuFactory.menuModel
212+ property int menuIndex: -1
213+ property var extendedData: menuData && menuData.ext || undefined
214+
177215 property var strengthAction: QMenuModel.UnityMenuAction {
178− model: menuFactory.model ? menuFactory.model : null
179− index: modelIndex
180− name: menu ? menu.ext.xCanonicalWifiApStrengthAction : ""
216+ model: menuModel
217+ index: menuIndex
218+ name: getExtendedProperty(extendedData, "xCanonicalWifiApStrengthAction", "")
181219 }
182220
183− text: menu && menu.label ? menu.label : ""
184− secure: menu ? menu.ext.xCanonicalWifiApIsSecure : false
185− adHoc: menu ? menu.ext.xCanonicalWifiApIsAdhoc : false
186− checked: menu ? menu.isToggled : false
221+ text: menuData && menuData.label || ""
222+ enabled: menuData && menuData.sensitive || false
223+ secure: getExtendedProperty(extendedData, "xCanonicalWifiApIsSecure", false)
224+ adHoc: getExtendedProperty(extendedData, "xCanonicalWifiApIsAdhoc", false)
225+ checked: menuData ? menuData.isToggled : false
187226 signalStrength: strengthAction.valid ? strengthAction.state : 0
188− enabled: menu ? menu.sensitive : false
189227
190− Component.onCompleted: {
191− model.loadExtendedAttributes(modelIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool',
192− 'x-canonical-wifi-ap-is-secure': 'bool',
193− 'x-canonical-wifi-ap-strength-action': 'string'});
228+ onMenuModelChanged: {
229+ loadAttributes();
230+ }
231+ onMenuIndexChanged: {
232+ loadAttributes();
194233 }
195234 onActivate: {
196− model.activate(modelIndex);
235+ menuModel.activate(menuIndex);
197236 shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
198237 }
238+
239+ function loadAttributes() {
240+ if (!menuModel || menuIndex == undefined) return;
241+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool',
242+ 'x-canonical-wifi-ap-is-secure': 'bool',
243+ 'x-canonical-wifi-ap-strength-action': 'string'});
244+ }
199245 }
200246 }
201247
202248 Component {
203249 id: messageItem
204250 ICMessaging.MessageMenuItemFactory {
205−
206− property QtObject menu: null
207− model: menuFactory.model ? menuFactory.model : null
208−
209− Component.onCompleted: {
210− model.loadExtendedAttributes(modelIndex, {'x-canonical-time': 'int64',
211− 'x-canonical-text': 'string',
212− 'x-canonical-message-actions': 'variant',
213− 'icon': 'icon',
214− 'x-canonical-app-icon': 'icon'});
215− }
251+ menuModel: menuFactory.menuModel
216252 }
217253 }
218254
219255 Component {
220256 id: groupedMessage
221257 ICMessaging.GroupedMessage {
222− property QtObject menu: null
223−
224− title: menu && menu.label ? menu.label : ""
225− count: menu && menu.actionState[0] ? menu.actionState[0] : "0"
226− appIcon: menu && menu.ext.icon !== undefined ? menu.ext.icon : "qrc:/indicators/artwork/messaging/default_app.svg"
227−
228− Component.onCompleted: {
229− model.loadExtendedAttributes(modelIndex, {'icon': 'icon'});
258+ property QtObject menuData: null
259+ property var menuModel: menuFactory.menuModel
260+ property int menuIndex: -1
261+ property var extendedData: menuData && menuData.ext || undefined
262+
263+ title: menuData && menuData.label || ""
264+ appIcon: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_app.svg")
265+ count: menuData && menuData.actionState.length > 0 ? menuData.actionState[0] : "0"
266+ enabled: menuData && menuData.sensitive || false
267+
268+ onMenuModelChanged: {
269+ loadAttributes();
270+ }
271+ onMenuIndexChanged: {
272+ loadAttributes();
230273 }
231274 onActivateApp: {
232− model.activate(modelIndex, true);
275+ menuModel.activate(menuIndex, true);
233276 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
234277 }
235278 onDismiss: {
236− model.activate(modelIndex, false);
279+ menuModel.activate(menuIndex, false);
280+ }
281+
282+ function loadAttributes() {
283+ if (!menuModel || menuIndex == undefined) return;
284+ menuModel.loadExtendedAttributes(modelIndex, {'icon': 'icon'});
237285 }
238286 }
239287 }
@@ -244,10 +292,9 @@ Item {
244292 if (component !== undefined) {
245293 return component;
246294 }
247− } else {
248− if (modelData.isSeparator) {
249− return divMenu;
250− }
295+ }
296+ if (modelData.isSeparator) {
297+ return divMenu;
251298 }
252299 return standardMenu;
253300 }
po/my.po+10−10
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2013-11-29 09:21+0100\n"
11−"PO-Revision-Date: 2013-10-09 11:35+0000\n"
11+"PO-Revision-Date: 2013-12-12 11:12+0000\n"
1212"Last-Translator: Pyae Sone <Unknown>\n"
1313"Language-Team: Burmese <my@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-11-30 05:33+0000\n"
19−"X-Generator: Launchpad (build 16856)\n"
18+"X-Launchpad-Export-Date: 2013-12-13 06:46+0000\n"
19+"X-Generator: Launchpad (build 16869)\n"
2020
2121#: Components/EdgeDemoOverlay.qml:151
2222msgid "Skip intro"
@@ -104,16 +104,16 @@ msgstr "မှတ်ချက်များ-"
104104
105105#: Greeter/Lockscreen.qml:149
106106msgid "Emergency Call"
107−msgstr ""
107+msgstr "အရေးပေါ်ခေါ်မည်"
108108
109109#: Greeter/PassphraseLockscreen.qml:59
110110#, qt-format
111111msgid "Hello %1"
112−msgstr ""
112+msgstr "ဟဲလို %1"
113113
114114#: Greeter/PassphraseLockscreen.qml:59
115115msgid "Hello"
116−msgstr ""
116+msgstr "ဟဲလို"
117117
118118#: Hud/HudParametrizedActionsPage.qml:132
119119msgid "Confirm"
@@ -137,7 +137,7 @@ msgstr "ပြောနေသည်"
137137
138138#: Notifications/NotificationMenuItemFactory.qml:89
139139msgid "Show password"
140−msgstr ""
140+msgstr "စကားဝှက်ကိုပြ"
141141
142142#: Panel/SearchIndicator.qml:27
143143msgid "Search"
@@ -146,13 +146,13 @@ msgstr "ရှာဖွေ"
146146#: plugins/Unity/Launcher/launcheritem.cpp:43
147147#: plugins/Unity/Launcher/launcheritem.cpp:73
148148msgid "Lock to Launcher"
149−msgstr ""
149+msgstr "Launcher တွင်ထားမည်"
150150
151151#: plugins/Unity/Launcher/launcheritem.cpp:73
152152msgid "Unlock from Launcher"
153−msgstr ""
153+msgstr "Launcher မှဖြုတ်မည်"
154154
155155#: Shell.qml:439
156156#, qt-format
157157msgid "Please enter %1"
158−msgstr ""
158+msgstr "%1ကိုရိုက်ထည့်ပါ"
po/tr.po+7−7
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2013-11-29 09:21+0100\n"
11−"PO-Revision-Date: 2013-10-01 13:21+0000\n"
12−"Last-Translator: Volkan Gezer <Unknown>\n"
11+"PO-Revision-Date: 2013-12-12 16:06+0000\n"
12+"Last-Translator: Arda Ünlü <aarda.uunlu@gmail.com>\n"
1313"Language-Team: Turkish <tr@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-11-30 05:33+0000\n"
19−"X-Generator: Launchpad (build 16856)\n"
18+"X-Launchpad-Export-Date: 2013-12-13 06:46+0000\n"
19+"X-Generator: Launchpad (build 16869)\n"
2020
2121#: Components/EdgeDemoOverlay.qml:151
2222msgid "Skip intro"
@@ -138,7 +138,7 @@ msgstr "Konuşuyor..."
138138
139139#: Notifications/NotificationMenuItemFactory.qml:89
140140msgid "Show password"
141−msgstr ""
141+msgstr "Parolayı göster"
142142
143143#: Panel/SearchIndicator.qml:27
144144msgid "Search"
@@ -147,11 +147,11 @@ msgstr "Ara"
147147#: plugins/Unity/Launcher/launcheritem.cpp:43
148148#: plugins/Unity/Launcher/launcheritem.cpp:73
149149msgid "Lock to Launcher"
150−msgstr ""
150+msgstr "Başlatıcıya Sabitle"
151151
152152#: plugins/Unity/Launcher/launcheritem.cpp:73
153153msgid "Unlock from Launcher"
154−msgstr ""
154+msgstr "Başlatıcıdan Ayır"
155155
156156#: Shell.qml:439
157157#, qt-format
src/Panel/Indicators/client/indicatorsclient.cpp−35
@@ -26,41 +26,6 @@
2626#include <QQmlEngine>
2727#include <QDebug>
2828
29−namespace {
30−
31−void prependImportPaths(QQmlEngine *engine, const QStringList &paths)
32−{
33− QStringList importPathList = engine->importPathList();
34− for (int i = paths.count()-1; i >= 0; i--) {
35− importPathList.prepend(paths[i]);
36− }
37− engine->setImportPathList(importPathList);
38−}
39−
40−/* When you append and import path to the list of import paths it will be the *last*
41− place where Qt will search for QML modules.
42− The usual QQmlEngine::addImportPath() actually prepends the given path.*/
43−void appendImportPaths(QQmlEngine *engine, const QStringList &paths)
44−{
45− QStringList importPathList = engine->importPathList();
46− Q_FOREACH(const QString& path, paths) {
47− // don't duplicate
48− QStringList::iterator iter = qFind(importPathList.begin(), importPathList.end(), path);
49− if (iter == importPathList.end()) {
50− importPathList.append(path);
51− }
52− }
53− engine->setImportPathList(importPathList);
54−}
55−
56−void resolveIconTheme() {
57− QString ubuntuIconTheme = getenv("UBUNTU_ICON_THEME");
58− if (ubuntuIconTheme.isEmpty()) {
59− QIcon::setThemeName("ubuntu-mobile");
60− }
61−}
62−} // namespace
63−
6429IndicatorsClient::IndicatorsClient(int &argc, char **argv)
6530 : QObject(0),
6631 m_view(0)
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+7−6
@@ -21,6 +21,7 @@
2121
2222from __future__ import absolute_import
2323
24+from unity8.process_helpers import unlock_unity
2425from unity8.shell import disable_qml_mocking
2526from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2627
@@ -78,8 +79,8 @@ class ApplicationLifecycleTests(UnityTestCase):
7879 @disable_qml_mocking
7980 def test_can_launch_application(self):
8081 """Must be able to launch an application."""
81− self.launch_unity()
82− self.main_window.get_greeter().swipe()
82+ unity_proxy = self.launch_unity()
83+ unlock_unity(unity_proxy)
8384
8485 app = self._launch_app("messaging-app")
8586
@@ -92,8 +93,8 @@ class ApplicationLifecycleTests(UnityTestCase):
9293 @disable_qml_mocking
9394 def test_can_launch_multiple_applications(self):
9495 """A second application launched must be focused."""
95− self.launch_unity()
96− self.main_window.get_greeter().swipe()
96+ unity_proxy = self.launch_unity()
97+ unlock_unity(unity_proxy)
9798
9899 self._launch_app("messaging-app")
99100 self.assertThat(
@@ -113,8 +114,8 @@ class ApplicationLifecycleTests(UnityTestCase):
113114 brought back to the focused state.
114115
115116 """
116− self.launch_unity()
117− self.main_window.get_greeter().swipe()
117+ unity_proxy = self.launch_unity()
118+ unlock_unity(unity_proxy)
118119
119120 self._launch_app("messaging-app")
120121 self.assertThat(
tests/autopilot/unity8/shell/tests/test_lock_screen.py+9−8
@@ -20,6 +20,7 @@
2020
2121from __future__ import absolute_import
2222
23+from unity8.process_helpers import unlock_unity
2324from unity8.shell import with_lightdm_mock
2425from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2526
@@ -40,11 +41,11 @@ class TestLockscreen(UnityTestCase):
4041 @with_lightdm_mock("single-pin")
4142 def test_can_unlock_pin_screen(self):
4243 """Must be able to unlock the PIN entry lock screen."""
43− self.launch_unity()
44+ unity_proxy = self.launch_unity()
4445 greeter = self.main_window.get_greeter()
4546
4647 if greeter.narrowMode:
47− greeter.swipe()
48+ unlock_unity(unity_proxy)
4849 lockscreen = self._wait_for_lockscreen()
4950 self._enter_pincode("1234")
5051 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
@@ -55,11 +56,11 @@ class TestLockscreen(UnityTestCase):
5556 @with_lightdm_mock("single-passphrase")
5657 def test_can_unlock_passphrase_screen(self):
5758 """Must be able to unlock the passphrase entry screen."""
58− self.launch_unity()
59+ unity_proxy = self.launch_unity()
5960 greeter = self.main_window.get_greeter()
6061
6162 if greeter.narrowMode:
62− greeter.swipe()
63+ unlock_unity(unity_proxy)
6364 lockscreen = self._wait_for_lockscreen()
6465 self._enter_pin_passphrase("password")
6566 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
@@ -70,11 +71,11 @@ class TestLockscreen(UnityTestCase):
7071 @with_lightdm_mock("single-pin")
7172 def test_pin_screen_wrong_code(self):
7273 """Entering the wrong pin code must not dismiss the lock screen."""
73− self.launch_unity()
74+ unity_proxy = self.launch_unity()
7475 greeter = self.main_window.get_greeter()
7576
7677 if greeter.narrowMode:
77− greeter.swipe()
78+ unlock_unity(unity_proxy)
7879 lockscreen = self._wait_for_lockscreen()
7980 self._enter_pincode("4321")
8081 pinentryField = self.main_window.get_pinentryField()
@@ -89,11 +90,11 @@ class TestLockscreen(UnityTestCase):
8990 @with_lightdm_mock("single-passphrase")
9091 def test_passphrase_screen_wrong_password(self):
9192 """Entering the wrong password must not dismiss the lock screen."""
92− self.launch_unity()
93+ unity_proxy = self.launch_unity()
9394 greeter = self.main_window.get_greeter()
9495
9596 if greeter.narrowMode:
96− greeter.swipe()
97+ unlock_unity(unity_proxy)
9798 lockscreen = self._wait_for_lockscreen()
9899 self._enter_pin_passphrase("foobar")
99100 pinentryField = self.main_window.get_pinentryField()
tests/autopilot/unity8/shell/tests/test_notifications.py+1−1
@@ -65,7 +65,7 @@ class NotificationsBase(UnityTestCase):
6565 def _get_notifications_list(self):
6666 main_view = self.main_window.get_qml_view()
6767 return main_view.select_single(
68− "QQuickListView",
68+ "Notifications",
6969 objectName='notificationList'
7070 )
7171
tests/mocks/LightDM/demo/CMakeLists.txt−1
@@ -1,4 +1,3 @@
1−include(FindPkgConfig)
21pkg_check_modules(LIBUSERMETRICSOUTPUT REQUIRED libusermetricsoutput-1)
32
43set(LibLightDM_SOURCES
tests/mocks/Unity/Application/CMakeLists.txt−1
@@ -1,4 +1,3 @@
1−include(FindPkgConfig)
21pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application)
32
43set(FakeUnityApplicationQml_SOURCES
tests/mocks/Unity/Launcher/CMakeLists.txt−1
@@ -1,4 +1,3 @@
1−include(FindPkgConfig)
21pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=3)
32
43add_definitions(-DTOP_SRCDIR="${CMAKE_SOURCE_DIR}")
tests/plugins/AccountsService/CMakeLists.txt+6−1
@@ -1,6 +1,11 @@
1+if(DEFINED ENV{DEB_BUILD_MULTIARCH})
2+ set(QDBUSXML2CPP_EXECUTABLE "/usr/lib/$ENV{DEB_BUILD_MULTIARCH}/qt5/bin/qdbusxml2cpp")
3+else()
4+ FIND_PROGRAM(QDBUSXML2CPP_EXECUTABLE qdbusxml2cpp)
5+endif()
16macro(make_dbus_class NAME INTERFACE)
27 if(${CMAKE_CURRENT_SOURCE_DIR}/interfaces.xml IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/${NAME}Adaptor.h)
3− execute_process(COMMAND qdbusxml2cpp -c ${NAME}Adaptor -a ${CMAKE_CURRENT_BINARY_DIR}/${NAME}Adaptor ${CMAKE_CURRENT_SOURCE_DIR}/interfaces.xml ${INTERFACE})
8+ execute_process(COMMAND ${QDBUSXML2CPP_EXECUTABLE} -c ${NAME}Adaptor -a ${CMAKE_CURRENT_BINARY_DIR}/${NAME}Adaptor ${CMAKE_CURRENT_SOURCE_DIR}/interfaces.xml ${INTERFACE})
49 endif()
510endmacro(make_dbus_class)
611
tests/plugins/Unity/Indicators/menucontentactivatortest.cpp−1
@@ -18,7 +18,6 @@
1818 */
1919
2020#include "menucontentactivator.h"
21−#include "paths.h"
2221
2322#include <QtTest>
2423#include <QDebug>
tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp−1
@@ -18,7 +18,6 @@
1818 */
1919
2020#include "indicatorsmanager.h"
21−#include "paths.h"
2221#include "unitymenumodelstack.h"
2322
2423#include <QtTest>
tests/qmltests/Notifications/tst_Notifications.qml+3−4
@@ -140,8 +140,10 @@ Row {
140140 Notifications {
141141 id: notifications
142142
143+ margin: units.gu(1)
144+ fullHeight: parent.height
145+
143146 anchors.fill: parent
144− anchors.margins: units.gu(1)
145147 model: mockModel
146148 }
147149 }
@@ -401,9 +403,6 @@ Row {
401403 actionSpy.wait()
402404 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
403405 compare(clickThroughSpy.count, 0, "click on interactive notification fell through")
404− } else {
405− mouseClick(notification, notification.width / 2, notification.height / 2)
406− clickThroughSpy.wait()
407406 }
408407
409408 compare(secondaryIcon.visible, data.secondaryIconVisible, "secondary-icon visibility is incorrect")