on xenial help sign in
Merge new-scopes
3f2582eAlbert Astals
cmake/modules/autopilot.cmake+10−1
@@ -2,7 +2,7 @@ add_custom_target(autopilot)
2
2
3function(declare_autopilot_test TEST_NAME TEST_SUITE WORKING_DIR)
3function(declare_autopilot_test TEST_NAME TEST_SUITE WORKING_DIR)
4 add_custom_target(autopilot-${TEST_NAME}
4 add_custom_target(autopilot-${TEST_NAME}
5− COMMAND LANG=C UBUNTU_ICON_THEME=ubuntu-mobile QML2_IMPORT_PATH=${SHELL_INSTALL_QML}/mocks autopilot run ${TEST_SUITE}
5+ COMMAND LANG=C UBUNTU_ICON_THEME=ubuntu-mobile QML2_IMPORT_PATH=${SHELL_INSTALL_QML}/mocks python3 -m autopilot.run run ${TEST_SUITE}
6 WORKING_DIRECTORY ${WORKING_DIR}
6 WORKING_DIRECTORY ${WORKING_DIR}
7 DEPENDS fake_install
7 DEPENDS fake_install
8 )
8 )
@@ -12,4 +12,13 @@ function(declare_autopilot_test TEST_NAME TEST_SUITE WORKING_DIR)
12 )
12 )
13
13
14 add_dependencies(autopilot autopilot-${TEST_NAME})
14 add_dependencies(autopilot autopilot-${TEST_NAME})
15+
16+ add_custom_target(autopilot2-${TEST_NAME}
17+ COMMAND LANG=C UBUNTU_ICON_THEME=ubuntu-mobile QML2_IMPORT_PATH=${SHELL_INSTALL_QML}/mocks python2 -m autopilot.run run ${TEST_SUITE}
18+ WORKING_DIRECTORY ${WORKING_DIR}
19+ DEPENDS fake_install
20+ )
21+
22+ add_dependencies(autopilot autopilot2-${TEST_NAME})
23+
15endfunction()
24endfunction()
data/unity8.conf+6
@@ -28,10 +28,16 @@ pre-start script
28 initctl set-env --global MIR_SOCKET=$MIR_SERVER_FILE
28 initctl set-env --global MIR_SOCKET=$MIR_SERVER_FILE
29 gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SOCKET': '$MIR_SERVER_FILE'}"
29 gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SOCKET': '$MIR_SERVER_FILE'}"
30 fi
30 fi
31+
31 if [ -z "$UNITY_SCOPES_LIST" ]; then
32 if [ -z "$UNITY_SCOPES_LIST" ]; then
32 # FIXME: remove once we have this in dconf
33 # FIXME: remove once we have this in dconf
33 initctl set-env UNITY_SCOPES_LIST="scopes;clickscope;musicaggregator;videoaggregator"
34 initctl set-env UNITY_SCOPES_LIST="scopes;clickscope;musicaggregator;videoaggregator"
34 fi
35 fi
36+
37+ # Remove the socket if still there
38+ if [ -S "$MIR_SERVER_FILE" ]; then
39+ rm "$MIR_SERVER_FILE"
40+ fi
35end script
41end script
36
42
37exec ${BINARY:-unity8} $ARGS
43exec ${BINARY:-unity8} $ARGS
debian/changelog+49
@@ -1,3 +1,52 @@
1+unity8 (7.84+14.04.20140304-0ubuntu1) trusty; urgency=low
2+
3+ [ Michael Terry ]
4+ * Ensure that the selected() signal is emitted by the greeter on
5+ startup, fixing the background on startup for the first user in
6+ tablet mode.
7+
8+ [ Nick Dedekind ]
9+ * Remocked IndicatorModel to fix qt5.2.1 changes.
10+
11+ [ Albert Astals ]
12+ * Initialize m_distance (LP: #1285385)
13+ * import Ubuntu.Components so we can use UbuntuAnimation
14+
15+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 04 Mar 2014 11:43:04 +0000
16+
17+unity8 (7.84+14.04.20140228-0ubuntu1) trusty; urgency=low
18+
19+ [ Michał Sawicz ]
20+ * Fix CardHeader title font weight.
21+ * Delete stale sockets. (LP: #1285215)
22+
23+ [ Dmitrijs Ledkovs ]
24+ * Ship python3 autopilot modules.
25+
26+ [ Albert Astals ]
27+ * Cleanup DashContent Remove unused signals and properties
28+
29+ [ Michał Karnicki ]
30+ * Take it easy on the logging.
31+ * Fix CardHeader title font weight.
32+
33+ [ Nick Dedekind ]
34+ * Added ability to change indicator profile in shell (env
35+ UNITY_INDICATOR_PROFILE)
36+
37+ [ Andrea Cimitan ]
38+ * Rename PreviewRating to PreviewRatingInput
39+ * Adds PreviewRatingDisplay
40+
41+ [ Daniel d'Andrada ]
42+ * DirectionalDragArea: Reset status if disabled while dragging (LP:
43+ #1276122)
44+
45+ [ Dimitri John Ledkov ]
46+ * Ship python3 autopilot modules.
47+
48+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 28 Feb 2014 10:48:06 +0000
49+
1unity8 (7.84+14.04.20140221-0ubuntu1) trusty; urgency=low
50unity8 (7.84+14.04.20140221-0ubuntu1) trusty; urgency=low
2
51
3 [ Michał Sawicz ]
52 [ Michał Sawicz ]
debian/control+8−1
@@ -28,7 +28,8 @@ Build-Depends: cmake,
28 pkg-config,
28 pkg-config,
29 python:any (>= 2.7),
29 python:any (>= 2.7),
30 python-setuptools,
30 python-setuptools,
31− python3:any,
31+ python3-all:any,
32+ python3-setuptools,
32 qt5-default,
33 qt5-default,
33 qtbase5-dev,
34 qtbase5-dev,
34 qtbase5-dev-tools,
35 qtbase5-dev-tools,
@@ -110,16 +111,22 @@ Depends: gir1.2-glib-2.0,
110 libautopilot-qt (>= 1.4),
111 libautopilot-qt (>= 1.4),
111 libqt5test5,
112 libqt5test5,
112 libqt5widgets5,
113 libqt5widgets5,
114+ python-autopilot,
113 python-evdev,
115 python-evdev,
114 python-fixtures,
116 python-fixtures,
115 python-gi,
117 python-gi,
116 python-mock,
118 python-mock,
119+ python3-autopilot,
120+ python3-evdev,
121+ python3-fixtures,
122+ python3-gi,
117 ubuntu-ui-toolkit-autopilot,
123 ubuntu-ui-toolkit-autopilot,
118 unity8 (>= ${source:Version}),
124 unity8 (>= ${source:Version}),
119 unity8-fake-env (>= ${source:Version}),
125 unity8-fake-env (>= ${source:Version}),
120 url-dispatcher-tools,
126 url-dispatcher-tools,
121 ${misc:Depends},
127 ${misc:Depends},
122 ${python:Depends},
128 ${python:Depends},
129+ ${python3:Depends},
123 ${shlibs:Depends},
130 ${shlibs:Depends},
124Description: Test package for Unity 8 shell
131Description: Test package for Unity 8 shell
125 Autopilot tests for the unity8 package
132 Autopilot tests for the unity8 package
debian/rules+2−2
@@ -10,7 +10,7 @@ SCOPES_RECOMMENDS := $(shell perl debian/scopes-recommends-generator /usr/share/
10
10
11.PHONY: build
11.PHONY: build
12build %:
12build %:
13− dh $@ --parallel --fail-missing --with python2
13+ dh $@ --parallel --fail-missing --with python2,python3
14
14
15override_dh_auto_clean:
15override_dh_auto_clean:
16 dh_auto_clean
16 dh_auto_clean
@@ -28,7 +28,7 @@ override_dh_auto_build:
28override_dh_install:
28override_dh_install:
29 # install autopilot tests
29 # install autopilot tests
30 cd tests/autopilot; \
30 cd tests/autopilot; \
31− set -ex; for python in $(shell pyversions -r); do \
31+ set -ex; for python in $(shell pyversions -r) $(shell py3versions -r); do \
32 $$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \
32 $$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \
33 done; \
33 done; \
34 cd $(CURDIR)
34 cd $(CURDIR)
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp+10
@@ -109,6 +109,7 @@ private:
109DirectionalDragArea::DirectionalDragArea(QQuickItem *parent)
109DirectionalDragArea::DirectionalDragArea(QQuickItem *parent)
110 : QQuickItem(parent)
110 : QQuickItem(parent)
111 , m_status(WaitingForTouch)
111 , m_status(WaitingForTouch)
112+ , m_sceneDistance(0)
112 , m_touchId(-1)
113 , m_touchId(-1)
113 , m_direction(Direction::Rightwards)
114 , m_direction(Direction::Rightwards)
114 , m_wideningAngle(0)
115 , m_wideningAngle(0)
@@ -129,6 +130,8 @@ DirectionalDragArea::DirectionalDragArea(QQuickItem *parent)
129 m_recognitionTimer->setInterval(60);
130 m_recognitionTimer->setInterval(60);
130
131
131 m_velocityCalculator = new AxisVelocityCalculator(this);
132 m_velocityCalculator = new AxisVelocityCalculator(this);
133+
134+ connect(this, &QQuickItem::enabledChanged, this, &DirectionalDragArea::onEnabledChanged);
132}
135}
133
136
134Direction::Type DirectionalDragArea::direction() const
137Direction::Type DirectionalDragArea::direction() const
@@ -528,6 +531,13 @@ void DirectionalDragArea::checkSpeed()
528 m_numSamplesOnLastSpeedCheck = m_velocityCalculator->numSamples();
531 m_numSamplesOnLastSpeedCheck = m_velocityCalculator->numSamples();
529}
532}
530
533
534+void DirectionalDragArea::onEnabledChanged()
535+{
536+ if (!isEnabled() && m_status != WaitingForTouch) {
537+ setStatus(WaitingForTouch);
538+ }
539+}
540+
531void DirectionalDragArea::setStatus(DirectionalDragArea::Status newStatus)
541void DirectionalDragArea::setStatus(DirectionalDragArea::Status newStatus)
532{
542{
533 if (newStatus == m_status)
543 if (newStatus == m_status)
plugins/Ubuntu/Gestures/DirectionalDragArea.h+1
@@ -218,6 +218,7 @@ protected:
218
218
219private Q_SLOTS:
219private Q_SLOTS:
220 void checkSpeed();
220 void checkSpeed();
221+ void onEnabledChanged();
221
222
222private:
223private:
223 void touchEvent_absent(QTouchEvent *event);
224 void touchEvent_absent(QTouchEvent *event);
plugins/Unity/Indicators/qml/MenuItemFactory.qml+1
@@ -22,6 +22,7 @@ import Ubuntu.Settings.Menus 0.1 as Menus
22import QMenuModel 0.1 as QMenuModel
22import QMenuModel 0.1 as QMenuModel
23import Utils 0.1 as Utils
23import Utils 0.1 as Utils
24import Ubuntu.Components.ListItems 0.1 as ListItems
24import Ubuntu.Components.ListItems 0.1 as ListItems
25+import Ubuntu.Components 0.1
25
26
26Item {
27Item {
27 id: menuFactory
28 id: menuFactory
po/ar.po+6−6
@@ -8,7 +8,7 @@ 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: 2014-02-13 18:37+0000\n"
10"POT-Creation-Date: 2014-02-13 18:37+0000\n"
11−"PO-Revision-Date: 2014-02-16 09:56+0000\n"
11+"PO-Revision-Date: 2014-02-21 11:19+0000\n"
12"Last-Translator: Ibrahim Saed <ibraheem5000@gmail.com>\n"
12"Last-Translator: Ibrahim Saed <ibraheem5000@gmail.com>\n"
13"Language-Team: Arabic <ar@li.org>\n"
13"Language-Team: Arabic <ar@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
@@ -16,8 +16,8 @@ msgstr ""
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n % 100 >= "
17"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n % 100 >= "
18"3 && n % 100 <= 10 ? 3 : n % 100 >= 11 && n % 100 <= 99 ? 4 : 5;\n"
18"3 && n % 100 <= 10 ? 3 : n % 100 >= 11 && n % 100 <= 99 ? 4 : 5;\n"
19−"X-Launchpad-Export-Date: 2014-02-19 05:44+0000\n"
19+"X-Launchpad-Export-Date: 2014-02-22 07:40+0000\n"
20−"X-Generator: Launchpad (build 16916)\n"
20+"X-Generator: Launchpad (build 16926)\n"
21
21
22#: plugins/Unity/Launcher/launcheritem.cpp:43
22#: plugins/Unity/Launcher/launcheritem.cpp:43
23#: plugins/Unity/Launcher/launcheritem.cpp:73
23#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -113,11 +113,11 @@ msgstr[5] "%1 تعليق"
113
113
114#: qml/Dash/Previews/PreviewActionCombo.qml:34
114#: qml/Dash/Previews/PreviewActionCombo.qml:34
115msgid "More..."
115msgid "More..."
116−msgstr ""
116+msgstr "المزيد..."
117
117
118#: qml/Dash/Previews/PreviewActionCombo.qml:34
118#: qml/Dash/Previews/PreviewActionCombo.qml:34
119msgid "Less..."
119msgid "Less..."
120−msgstr ""
120+msgstr "أقل..."
121
121
122#: qml/Dash/Previews/PreviewRating.qml:114 qml/Dash/Previews/Reviews.qml:74
122#: qml/Dash/Previews/PreviewRating.qml:114 qml/Dash/Previews/Reviews.qml:74
123msgid "Add a review"
123msgid "Add a review"
@@ -174,7 +174,7 @@ msgstr "عرض كلمة السر"
174
174
175#: qml/Notifications/NotificationMenuItemFactory.qml:103
175#: qml/Notifications/NotificationMenuItemFactory.qml:103
176msgid "Please enter SIM PIN"
176msgid "Please enter SIM PIN"
177−msgstr ""
177+msgstr "من فضلك أدخِل رقم التعريف الشخصي لبطاقة SIM"
178
178
179#: qml/Panel/SearchIndicator.qml:27
179#: qml/Panel/SearchIndicator.qml:27
180msgid "Search"
180msgid "Search"
po/ast.po+11−9
@@ -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: 2014-02-13 18:37+0000\n"
10"POT-Creation-Date: 2014-02-13 18:37+0000\n"
11−"PO-Revision-Date: 2013-12-11 20:45+0000\n"
11+"PO-Revision-Date: 2014-03-01 16:51+0000\n"
12−"Last-Translator: ivarela <ivarela@ubuntu.com>\n"
12+"Last-Translator: Xuacu Saturio <xuacusk8@gmail.com>\n"
13"Language-Team: Asturian <ast@li.org>\n"
13"Language-Team: Asturian <ast@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: 2014-02-19 05:44+0000\n"
18+"X-Launchpad-Export-Date: 2014-03-02 05:30+0000\n"
19−"X-Generator: Launchpad (build 16916)\n"
19+"X-Generator: Launchpad (build 16948)\n"
20
20
21#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:43
22#: plugins/Unity/Launcher/launcheritem.cpp:73
22#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -74,6 +74,8 @@ msgid ""
74"You have now mastered the edge gestures and can start using the "
74"You have now mastered the edge gestures and can start using the "
75"phone<br><br>Tap on the screen to start"
75"phone<br><br>Tap on the screen to start"
76msgstr ""
76msgstr ""
77+"Agora domina los xestos de los bordes y pue principiar a usar el "
78+"teléfonu<br><br>Toque la pantalla pa comenzar"
77
79
78#: qml/Components/PageHeader.qml:340
80#: qml/Components/PageHeader.qml:340
79msgid "Recent searches"
81msgid "Recent searches"
@@ -81,11 +83,11 @@ msgstr "Busques recientes"
81
83
82#: qml/Components/SeeMore.qml:35
84#: qml/Components/SeeMore.qml:35
83msgid "See more"
85msgid "See more"
84−msgstr ""
86+msgstr "Ver más"
85
87
86#: qml/Components/SeeMore.qml:57
88#: qml/Components/SeeMore.qml:57
87msgid "See less"
89msgid "See less"
88−msgstr ""
90+msgstr "Ver menos"
89
91
90#: qml/Dash/Apps/AppPreview.qml:136 qml/Dash/Previews/PreviewRating.qml:70
92#: qml/Dash/Apps/AppPreview.qml:136 qml/Dash/Previews/PreviewRating.qml:70
91msgid "Rate this"
93msgid "Rate this"
@@ -107,11 +109,11 @@ msgstr[1] "%1 reseñes"
107
109
108#: qml/Dash/Previews/PreviewActionCombo.qml:34
110#: qml/Dash/Previews/PreviewActionCombo.qml:34
109msgid "More..."
111msgid "More..."
110−msgstr ""
112+msgstr "Más…"
111
113
112#: qml/Dash/Previews/PreviewActionCombo.qml:34
114#: qml/Dash/Previews/PreviewActionCombo.qml:34
113msgid "Less..."
115msgid "Less..."
114−msgstr ""
116+msgstr "Menos…"
115
117
116#: qml/Dash/Previews/PreviewRating.qml:114 qml/Dash/Previews/Reviews.qml:74
118#: qml/Dash/Previews/PreviewRating.qml:114 qml/Dash/Previews/Reviews.qml:74
117msgid "Add a review"
119msgid "Add a review"
@@ -168,7 +170,7 @@ msgstr "Amosar contraseña"
168
170
169#: qml/Notifications/NotificationMenuItemFactory.qml:103
171#: qml/Notifications/NotificationMenuItemFactory.qml:103
170msgid "Please enter SIM PIN"
172msgid "Please enter SIM PIN"
171−msgstr ""
173+msgstr "Escriba'l PIN de la SIM"
172
174
173#: qml/Panel/SearchIndicator.qml:27
175#: qml/Panel/SearchIndicator.qml:27
174msgid "Search"
176msgid "Search"
po/el.po+10−8
@@ -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: 2014-02-13 18:37+0000\n"
10"POT-Creation-Date: 2014-02-13 18:37+0000\n"
11−"PO-Revision-Date: 2014-01-15 16:34+0000\n"
11+"PO-Revision-Date: 2014-02-26 09:58+0000\n"
12−"Last-Translator: Filippos Kolyvas <Unknown>\n"
12+"Last-Translator: j3lc <x_nikos@yahoo.gr>\n"
13"Language-Team: Greek <el@li.org>\n"
13"Language-Team: Greek <el@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: 2014-02-19 05:44+0000\n"
18+"X-Launchpad-Export-Date: 2014-02-27 06:34+0000\n"
19−"X-Generator: Launchpad (build 16916)\n"
19+"X-Generator: Launchpad (build 16935)\n"
20
20
21#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:43
22#: plugins/Unity/Launcher/launcheritem.cpp:73
22#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -74,6 +74,8 @@ msgid ""
74"You have now mastered the edge gestures and can start using the "
74"You have now mastered the edge gestures and can start using the "
75"phone<br><br>Tap on the screen to start"
75"phone<br><br>Tap on the screen to start"
76msgstr ""
76msgstr ""
77+"Πλέον γνωρίζετε τις χειρονομίες από τα άκρα και μπορείτε να ξεκινήσετε να "
78+"χρησιμοποιείτε το τηλέφωνο<br><br>Αγγίξτε την οθόνη για να ξεκινήσετε"
77
79
78#: qml/Components/PageHeader.qml:340
80#: qml/Components/PageHeader.qml:340
79msgid "Recent searches"
81msgid "Recent searches"
@@ -81,11 +83,11 @@ msgstr "Πρόσφατες αναζητήσεις"
81
83
82#: qml/Components/SeeMore.qml:35
84#: qml/Components/SeeMore.qml:35
83msgid "See more"
85msgid "See more"
84−msgstr ""
86+msgstr "Περρισότερα"
85
87
86#: qml/Components/SeeMore.qml:57
88#: qml/Components/SeeMore.qml:57
87msgid "See less"
89msgid "See less"
88−msgstr ""
90+msgstr "Λιγότερα"
89
91
90#: qml/Dash/Apps/AppPreview.qml:136 qml/Dash/Previews/PreviewRating.qml:70
92#: qml/Dash/Apps/AppPreview.qml:136 qml/Dash/Previews/PreviewRating.qml:70
91msgid "Rate this"
93msgid "Rate this"
@@ -152,7 +154,7 @@ msgstr "Πληκτρολογήστε ή πείτε μια εντολή"
152
154
153#: qml/Hud/Hud.qml:84
155#: qml/Hud/Hud.qml:84
154msgid "Loading. Please Wait..."
156msgid "Loading. Please Wait..."
155−msgstr "Γίνεται φόρτωση, παρακαλώ περιμένετε..."
157+msgstr "Γίνεται φόρτωση. Παρακαλώ περιμένετε..."
156
158
157#: qml/Hud/Hud.qml:89
159#: qml/Hud/Hud.qml:89
158msgid "Speak Now..."
160msgid "Speak Now..."
@@ -168,7 +170,7 @@ msgstr "Εμφάνιση κωδικού"
168
170
169#: qml/Notifications/NotificationMenuItemFactory.qml:103
171#: qml/Notifications/NotificationMenuItemFactory.qml:103
170msgid "Please enter SIM PIN"
172msgid "Please enter SIM PIN"
171−msgstr ""
173+msgstr "Παρακαλώ εισάγετε το PIN της κάρτας SIM"
172
174
173#: qml/Panel/SearchIndicator.qml:27
175#: qml/Panel/SearchIndicator.qml:27
174msgid "Search"
176msgid "Search"
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: 2014-02-13 18:37+0000\n"
10"POT-Creation-Date: 2014-02-13 18:37+0000\n"
11−"PO-Revision-Date: 2014-02-14 13:28+0000\n"
11+"PO-Revision-Date: 2014-02-21 19:36+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: 2014-02-19 05:44+0000\n"
18+"X-Launchpad-Export-Date: 2014-02-22 07:40+0000\n"
19−"X-Generator: Launchpad (build 16916)\n"
19+"X-Generator: Launchpad (build 16926)\n"
20
20
21#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:43
22#: plugins/Unity/Launcher/launcheritem.cpp:73
22#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -105,7 +105,7 @@ msgstr[1] "%1 arvostelua"
105
105
106#: qml/Dash/Previews/PreviewActionCombo.qml:34
106#: qml/Dash/Previews/PreviewActionCombo.qml:34
107msgid "More..."
107msgid "More..."
108−msgstr ""
108+msgstr "Lisää..."
109
109
110#: qml/Dash/Previews/PreviewActionCombo.qml:34
110#: qml/Dash/Previews/PreviewActionCombo.qml:34
111msgid "Less..."
111msgid "Less..."
po/km.po+5−5
@@ -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: 2014-02-13 18:37+0000\n"
10"POT-Creation-Date: 2014-02-13 18:37+0000\n"
11−"PO-Revision-Date: 2014-02-12 07:06+0000\n"
11+"PO-Revision-Date: 2014-03-04 02:32+0000\n"
12"Last-Translator: Khoem Sokhem <khoemsokhem@khmeros.info>\n"
12"Last-Translator: Khoem Sokhem <khoemsokhem@khmeros.info>\n"
13"Language-Team: Khmer <km@li.org>\n"
13"Language-Team: Khmer <km@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=1; plural=0;\n"
17"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2014-02-19 05:44+0000\n"
18+"X-Launchpad-Export-Date: 2014-03-04 08:33+0000\n"
19−"X-Generator: Launchpad (build 16916)\n"
19+"X-Generator: Launchpad (build 16948)\n"
20
20
21#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:43
22#: plugins/Unity/Launcher/launcheritem.cpp:73
22#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -108,11 +108,11 @@ msgstr[0] "ពិនិត្យ​មើល %1"
108
108
109#: qml/Dash/Previews/PreviewActionCombo.qml:34
109#: qml/Dash/Previews/PreviewActionCombo.qml:34
110msgid "More..."
110msgid "More..."
111−msgstr ""
111+msgstr "ច្រើនជាង​..."
112
112
113#: qml/Dash/Previews/PreviewActionCombo.qml:34
113#: qml/Dash/Previews/PreviewActionCombo.qml:34
114msgid "Less..."
114msgid "Less..."
115−msgstr ""
115+msgstr "តិច​ជាង..."
116
116
117#: qml/Dash/Previews/PreviewRating.qml:114 qml/Dash/Previews/Reviews.qml:74
117#: qml/Dash/Previews/PreviewRating.qml:114 qml/Dash/Previews/Reviews.qml:74
118msgid "Add a review"
118msgid "Add a review"
po/sl.po+10−8
@@ -8,7 +8,7 @@ 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: 2014-02-13 18:37+0000\n"
10"POT-Creation-Date: 2014-02-13 18:37+0000\n"
11−"PO-Revision-Date: 2013-11-30 08:20+0000\n"
11+"PO-Revision-Date: 2014-02-21 16:38+0000\n"
12"Last-Translator: Damir Jerovšek <Unknown>\n"
12"Last-Translator: Damir Jerovšek <Unknown>\n"
13"Language-Team: Slovenian <sl@li.org>\n"
13"Language-Team: Slovenian <sl@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
@@ -16,8 +16,8 @@ msgstr ""
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || "
17"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || "
18"n%100==4 ? 3 : 0);\n"
18"n%100==4 ? 3 : 0);\n"
19−"X-Launchpad-Export-Date: 2014-02-19 05:44+0000\n"
19+"X-Launchpad-Export-Date: 2014-02-22 07:40+0000\n"
20−"X-Generator: Launchpad (build 16916)\n"
20+"X-Generator: Launchpad (build 16926)\n"
21
21
22#: plugins/Unity/Launcher/launcheritem.cpp:43
22#: plugins/Unity/Launcher/launcheritem.cpp:43
23#: plugins/Unity/Launcher/launcheritem.cpp:73
23#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -75,6 +75,8 @@ msgid ""
75"You have now mastered the edge gestures and can start using the "
75"You have now mastered the edge gestures and can start using the "
76"phone<br><br>Tap on the screen to start"
76"phone<br><br>Tap on the screen to start"
77msgstr ""
77msgstr ""
78+"Sedaj, ko ste osvojili poteze robov, lahko začnete uporabljati "
79+"telefon<br><br>Tapnite na zaslon za začetek"
78
80
79#: qml/Components/PageHeader.qml:340
81#: qml/Components/PageHeader.qml:340
80msgid "Recent searches"
82msgid "Recent searches"
@@ -82,11 +84,11 @@ msgstr "Nedavna iskanja"
82
84
83#: qml/Components/SeeMore.qml:35
85#: qml/Components/SeeMore.qml:35
84msgid "See more"
86msgid "See more"
85−msgstr ""
87+msgstr "Pokaži več"
86
88
87#: qml/Components/SeeMore.qml:57
89#: qml/Components/SeeMore.qml:57
88msgid "See less"
90msgid "See less"
89−msgstr ""
91+msgstr "Pokaži manj"
90
92
91#: qml/Dash/Apps/AppPreview.qml:136 qml/Dash/Previews/PreviewRating.qml:70
93#: qml/Dash/Apps/AppPreview.qml:136 qml/Dash/Previews/PreviewRating.qml:70
92msgid "Rate this"
94msgid "Rate this"
@@ -110,11 +112,11 @@ msgstr[3] "%1 ocene"
110
112
111#: qml/Dash/Previews/PreviewActionCombo.qml:34
113#: qml/Dash/Previews/PreviewActionCombo.qml:34
112msgid "More..."
114msgid "More..."
113−msgstr ""
115+msgstr "Več ..."
114
116
115#: qml/Dash/Previews/PreviewActionCombo.qml:34
117#: qml/Dash/Previews/PreviewActionCombo.qml:34
116msgid "Less..."
118msgid "Less..."
117−msgstr ""
119+msgstr "Manj ..."
118
120
119#: qml/Dash/Previews/PreviewRating.qml:114 qml/Dash/Previews/Reviews.qml:74
121#: qml/Dash/Previews/PreviewRating.qml:114 qml/Dash/Previews/Reviews.qml:74
120msgid "Add a review"
122msgid "Add a review"
@@ -171,7 +173,7 @@ msgstr "Pokaži geslo"
171
173
172#: qml/Notifications/NotificationMenuItemFactory.qml:103
174#: qml/Notifications/NotificationMenuItemFactory.qml:103
173msgid "Please enter SIM PIN"
175msgid "Please enter SIM PIN"
174−msgstr ""
176+msgstr "Vnesite PIN kartice SIM"
175
177
176#: qml/Panel/SearchIndicator.qml:27
178#: qml/Panel/SearchIndicator.qml:27
177msgid "Search"
179msgid "Search"
qml/Dash/Dash.qml−1
@@ -29,7 +29,6 @@ Showable {
29 property ListModel searchHistory: SearchHistoryModel {}
29 property ListModel searchHistory: SearchHistoryModel {}
30 property bool searchable: !dashContent.previewOpen && !scopeItem.previewOpen
30 property bool searchable: !dashContent.previewOpen && !scopeItem.previewOpen
31
31
32− property alias contentProgress: dashContent.contentProgress
33 property string showScopeOnLoaded: "clickscope"
32 property string showScopeOnLoaded: "clickscope"
34 property real contentScale: 1.0
33 property real contentScale: 1.0
35
34
qml/Dash/DashContent.qml−8
@@ -24,7 +24,6 @@ Item {
24
24
25 property var model: null
25 property var model: null
26 property var scopes: null
26 property var scopes: null
27− property real contentProgress: Math.max(0, Math.min(dashContentList.contentX / (dashContentList.contentWidth - dashContentList.width), units.dp(1)))
28 property alias currentIndex: dashContentList.currentIndex
27 property alias currentIndex: dashContentList.currentIndex
29 property alias previewOpen: previewListView.open
28 property alias previewOpen: previewListView.open
30
29
@@ -33,8 +32,6 @@ Item {
33
32
34 signal movementStarted()
33 signal movementStarted()
35 signal movementEnded()
34 signal movementEnded()
36− signal contentFlickStarted()
37− signal contentEndReached()
38 signal scopeLoaded(string scopeId)
35 signal scopeLoaded(string scopeId)
39 signal positionedAtBeginning()
36 signal positionedAtBeginning()
40 signal gotoScope(string scopeId)
37 signal gotoScope(string scopeId)
@@ -160,11 +157,6 @@ Item {
160 dashContent.positionedAtBeginning.connect(item.positionedAtBeginning)
157 dashContent.positionedAtBeginning.connect(item.positionedAtBeginning)
161 dashContent.scopeLoaded(item.scope.id)
158 dashContent.scopeLoaded(item.scope.id)
162 }
159 }
163− Connections {
164− target: item
165− ignoreUnknownSignals: true
166− onEndReached: contentEndReached()
167− }
168 Connections {
160 Connections {
169 target: isCurrent ? scope : null
161 target: isCurrent ? scope : null
170 onGotoScope: {
162 onGotoScope: {
qml/Dash/GenericScopeView.qml−4
@@ -32,7 +32,6 @@ FocusScope {
32 property PageHeader pageHeader: null
32 property PageHeader pageHeader: null
33 property Item previewListView: null
33 property Item previewListView: null
34
34
35− signal endReached
36 signal movementStarted
35 signal movementStarted
37 signal positionedAtBeginning
36 signal positionedAtBeginning
38
37
@@ -117,9 +116,6 @@ FocusScope {
117 model: scopeView.categories
116 model: scopeView.categories
118 forceNoClip: previewListView.open
117 forceNoClip: previewListView.open
119
118
120− onAtYEndChanged: if (atYEnd) endReached()
121− onMovingChanged: if (moving && atYEnd) endReached()
122−
123 property string expandedCategoryId: ""
119 property string expandedCategoryId: ""
124
120
125 onContentYChanged: pageHeader.positionRealHeader();
121 onContentYChanged: pageHeader.positionRealHeader();
qml/Dash/Previews/PreviewRatingDisplay.qmlnew file+101
@@ -0,0 +1,101 @@
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+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+import "../../Components"
20+
21+/*! \brief Preview widget for rating display.
22+
23+ The widget can show a rating widget and a field showing a comment.
24+ The icons used in the rating widget can be customised with
25+ widgetData["rating-icon-empty"], widgetData["rating-icon-full"]
26+ and widgetData["rating-icon-half"].
27+
28+ This widget shows reviews contained in widgetData["reviews"], each of which should be of the form:
29+
30+ \code{.json}
31+ {
32+ "rating": null,
33+ "review": null,
34+ "author": null
35+ }
36+ \endcode
37+ */
38+
39+PreviewWidget {
40+ id: root
41+ height: childrenRect.height
42+
43+ Column {
44+ anchors { left: parent.left; right: parent.right; }
45+ visible: reviewsRepeater.count > 0
46+
47+ Repeater {
48+ id: reviewsRepeater
49+ objectName: "reviewsRepeater"
50+ model: root.widgetData["reviews"]
51+
52+ delegate: Column {
53+ id: reviewItem
54+ objectName: "reviewItem" + index
55+ anchors { left: parent.left; right: parent.right;}
56+ spacing: units.gu(1)
57+
58+ Rating {
59+ id: rating
60+ objectName: "rating"
61+ size: 5
62+ value: modelData["rating"] || -1
63+ visible: value >= 0
64+
65+ property var urlIconEmpty: widgetData["rating-icon-empty"]
66+ property var urlIconFull: widgetData["rating-icon-full"]
67+ property var urlIconHalf: widgetData["rating-icon-half"]
68+ }
69+
70+ Label {
71+ id: authorLabel
72+ objectName: "authorLabel"
73+ anchors { left: parent.left; right: parent.right }
74+ color: Theme.palette.selected.backgroundText
75+ opacity: .8
76+ text: modelData["author"] || ""
77+ visible: text !== ""
78+ wrapMode: Text.Wrap
79+ }
80+
81+ Label {
82+ id: reviewLabel
83+ objectName: "reviewLabel"
84+ anchors { left: parent.left; right: parent.right }
85+ color: Theme.palette.selected.backgroundText
86+ opacity: .8
87+ text: modelData["review"] || ""
88+ visible: text !== ""
89+ wrapMode: Text.Wrap
90+ }
91+
92+ Item {
93+ id: spacing
94+ anchors { left: parent.left; right: parent.right }
95+ height: units.gu(2)
96+ visible: rating.visible || authorLabel.visible || reviewLabel.visible
97+ }
98+ }
99+ }
100+ }
101+}
qml/Dash/Previews/PreviewRating.qml → qml/Dash/Previews/PreviewRatingInput.qmlrenamed

The content is the same.

qml/Dash/Previews/PreviewWidgetFactory.qml+2−1
@@ -48,7 +48,8 @@ Loader {
48 case "header": return "PreviewHeader.qml";
48 case "header": return "PreviewHeader.qml";
49 case "image": return "PreviewZoomableImage.qml";
49 case "image": return "PreviewZoomableImage.qml";
50 case "progress": return "PreviewProgress.qml";
50 case "progress": return "PreviewProgress.qml";
51− case "rating-input": return "PreviewRating.qml";
51+ case "rating-input": return "PreviewRatingInput.qml";
52+ case "reviews": return "PreviewRatingDisplay.qml";
52 case "text": return "PreviewTextSummary.qml";
53 case "text": return "PreviewTextSummary.qml";
53 case "video": return "PreviewVideoPlayback.qml";
54 case "video": return "PreviewVideoPlayback.qml";
54 default: return "";
55 default: return "";
qml/Panel/IndicatorItem.qml+13−21
@@ -19,37 +19,29 @@ import Ubuntu.Components 0.1
19import Unity.Indicators 0.1 as Indicators
19import Unity.Indicators 0.1 as Indicators
20import "../Components"
20import "../Components"
21
21
22−Item {
22+Loader {
23− id: indicatorItem
23+ id: root
24
24
25− property alias widgetSource: loader.source
25+ property alias widgetSource: root.source
26 property bool dimmed: false
26 property bool dimmed: false
27 property var indicatorProperties: undefined
27 property var indicatorProperties: undefined
28− property bool indicatorVisible: loader.item ? loader.item.enabled : false
28+ property bool indicatorVisible: item ? item.enabled : false
29 property string identifier
29 property string identifier
30
30
31 opacity: dimmed ? 0.4 : 1
31 opacity: dimmed ? 0.4 : 1
32 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.BriskDuration } }
32 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.BriskDuration } }
33
33
34− width: loader.item ? loader.item.width : 0
35−
36− Loader {
37− id: loader
38−
39− onLoaded: {
34+ onLoaded: {
40− item.height = Qt.binding(function() { return indicatorItem.height; });
41−
42− for(var pName in indicatorProperties) {
35+ for(var pName in indicatorProperties) {
43− if (item.hasOwnProperty(pName)) {
36+ if (item.hasOwnProperty(pName)) {
44− item[pName] = indicatorProperties[pName];
37+ item[pName] = indicatorProperties[pName];
45− }
46 }
38 }
47 }
39 }
40+ }
48
41
49− Binding {
42+ Binding {
50− target: loader.item
43+ target: item
51− property: "objectName"
44+ property: "objectName"
52− value: identifier + "-widget"
45+ value: identifier + "-widget"
53− }
54 }
46 }
55}
47}
qml/Panel/Indicators.qml+1−1
@@ -32,7 +32,7 @@ Showable {
32 property alias overFlowWidth: indicatorRow.overFlowWidth
32 property alias overFlowWidth: indicatorRow.overFlowWidth
33 property alias showAll: indicatorRow.showAll
33 property alias showAll: indicatorRow.showAll
34 // TODO: This should be sourced by device type (eg "desktop", "tablet", "phone"...)
34 // TODO: This should be sourced by device type (eg "desktop", "tablet", "phone"...)
35− property string profile: "phone"
35+ property string profile: indicatorProfile
36
36
37 readonly property real hintValue: panelHeight + menuContent.headerHeight
37 readonly property real hintValue: panelHeight + menuContent.headerHeight
38 readonly property int lockThreshold: openedHeight / 2
38 readonly property int lockThreshold: openedHeight / 2
src/main.cpp+6
@@ -59,6 +59,11 @@ int startShell(int argc, const char** argv, void* server)
59 application = new QGuiApplication(argc, (char**)argv);
59 application = new QGuiApplication(argc, (char**)argv);
60 }
60 }
61
61
62+ QString indicatorProfile = qgetenv("UNITY_INDICATOR_PROFILE");
63+ if (indicatorProfile.isEmpty()) {
64+ indicatorProfile = "phone";
65+ }
66+
62 resolveIconTheme();
67 resolveIconTheme();
63
68
64 QStringList args = application->arguments();
69 QStringList args = application->arguments();
@@ -88,6 +93,7 @@ int startShell(int argc, const char** argv, void* server)
88 view->setTitle("Qml Phone Shell");
93 view->setTitle("Qml Phone Shell");
89 view->engine()->setBaseUrl(QUrl::fromLocalFile(::qmlDirectory()));
94 view->engine()->setBaseUrl(QUrl::fromLocalFile(::qmlDirectory()));
90 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
95 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
96+ view->rootContext()->setContextProperty("indicatorProfile", indicatorProfile);
91 if (args.contains(QLatin1String("-frameless"))) {
97 if (args.contains(QLatin1String("-frameless"))) {
92 view->setFlags(Qt::FramelessWindowHint);
98 view->setFlags(Qt::FramelessWindowHint);
93 }
99 }
tests/autopilot/unity8/__init__.py+5−2
@@ -82,7 +82,10 @@ def get_binary_path(binary="unity8"):
82 )
82 )
83 if not os.path.exists(binary_path):
83 if not os.path.exists(binary_path):
84 try:
84 try:
85− binary_path = subprocess.check_output(['which', binary]).strip()
85+ binary_path = subprocess.check_output(
86+ ['which', binary],
87+ universal_newlines=True,
88+ ).strip()
86 except subprocess.CalledProcessError as e:
89 except subprocess.CalledProcessError as e:
87 raise RuntimeError("Unable to locate %s binary: %r" % (binary, e))
90 raise RuntimeError("Unable to locate %s binary: %r" % (binary, e))
88 return binary_path
91 return binary_path
@@ -128,7 +131,7 @@ def _get_xdg_upstart_env():
128 "get-env",
131 "get-env",
129 "--global",
132 "--global",
130 "XDG_DATA_DIRS"
133 "XDG_DATA_DIRS"
131− ]).rstrip()
134+ ], universal_newlines=True).rstrip()
132 except subprocess.CalledProcessError:
135 except subprocess.CalledProcessError:
133 return None
136 return None
134
137
tests/autopilot/unity8/process_helpers.py+1−1
@@ -142,7 +142,7 @@ def _get_unity_status():
142 '/sbin/initctl',
142 '/sbin/initctl',
143 'status',
143 'status',
144 'unity8'
144 'unity8'
145− ])
145+ ], universal_newlines=True)
146 except subprocess.CalledProcessError as e:
146 except subprocess.CalledProcessError as e:
147 raise CannotAccessUnity("Unable to get unity's status: %s" % str(e))
147 raise CannotAccessUnity("Unable to get unity's status: %s" % str(e))
148
148
tests/autopilot/unity8/shell/emulators/create_interactive_notification.py+2−1
@@ -1,4 +1,5 @@
1#!/usr/bin/env python
1#!/usr/bin/env python
2+from __future__ import print_function
2
3
3# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
4# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
4#
5#
@@ -25,7 +26,7 @@ import signal
25
26
26
27
27def action_callback(notification, action_id, data):
28def action_callback(notification, action_id, data):
28− print action_id
29+ print(action_id)
29
30
30
31
31def quit_callback(notification):
32def quit_callback(notification):
tests/autopilot/unity8/shell/tests/__init__.py+12−13
@@ -85,12 +85,12 @@ class UnityTestCase(AutopilotTestCase):
85 @classmethod
85 @classmethod
86 def setUpClass(cls):
86 def setUpClass(cls):
87 try:
87 try:
88− output = subprocess.check_output([
88+ output = subprocess.check_output(
89− "/sbin/initctl",
89+ ["/sbin/initctl", "status", "unity8"],
90− "status",
91− "unity8"
92− ], stderr=subprocess.STDOUT)
90+ stderr=subprocess.STDOUT,
91+ universal_newlines=True,
92+ )
93− except subprocess.CalledProcessError, e:
93+ except subprocess.CalledProcessError as e:
94 sys.stderr.write(
94 sys.stderr.write(
95 "Error: `initctl status unity8` failed, most probably the "
95 "Error: `initctl status unity8` failed, most probably the "
96 "unity8 session could not be found:\n\n"
96 "unity8 session could not be found:\n\n"
@@ -218,12 +218,11 @@ class UnityTestCase(AutopilotTestCase):
218 def _patch_environment(self, key, value):
218 def _patch_environment(self, key, value):
219 """Wrapper for patching env for upstart environment."""
219 """Wrapper for patching env for upstart environment."""
220 try:
220 try:
221− current_value = subprocess.check_output([
221+ current_value = subprocess.check_output(
222− "/sbin/initctl",
222+ ["/sbin/initctl", "get-env", "--global", key],
223− "get-env",
224− "--global",
225− key
226− ], stderr=subprocess.STDOUT).rstrip()
223+ stderr=subprocess.STDOUT,
224+ universal_newlines=True,
225+ ).rstrip()
227 except subprocess.CalledProcessError:
226 except subprocess.CalledProcessError:
228 current_value = None
227 current_value = None
229
228
@@ -305,7 +304,7 @@ class UnityTestCase(AutopilotTestCase):
305
304
306 binary_arg = "BINARY=%s" % binary_path
305 binary_arg = "BINARY=%s" % binary_path
307 extra_args = "ARGS=%s" % " ".join(args)
306 extra_args = "ARGS=%s" % " ".join(args)
308− env_args = ["%s=%s" % (k, v) for k, v in self._environment.iteritems()]
307+ env_args = ["%s=%s" % (k, v) for k, v in self._environment.items()]
309 all_args = [binary_arg, extra_args] + env_args
308 all_args = [binary_arg, extra_args] + env_args
310
309
311 self.addCleanup(self._cleanup_launching_upstart_unity)
310 self.addCleanup(self._cleanup_launching_upstart_unity)
tests/autopilot/unity8/shell/tests/test_emulators.py+4−1
@@ -27,7 +27,10 @@ don't break them for those external projects.
27
27
28"""
28"""
29
29
30+try:
31+ from unittest import mock
32+except ImportError:
30−import mock
33+ import mock
31
34
32from testtools.matchers import Contains, HasLength
35from testtools.matchers import Contains, HasLength
33
36
tests/autopilot/unity8/shell/tests/test_lock_screen.py+18−3
@@ -26,12 +26,18 @@ from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
26
26
27from autopilot.matchers import Eventually
27from autopilot.matchers import Eventually
28from autopilot.platform import model
28from autopilot.platform import model
29+import sys
29from testtools import skipUnless
30from testtools import skipUnless
30from testtools.matchers import Equals
31from testtools.matchers import Equals
31import logging
32import logging
32
33
33logger = logging.getLogger(__name__)
34logger = logging.getLogger(__name__)
34
35
36+# py2 compatible alias for py3
37+if sys.version >= '3':
38+ basestring = str
39+
40+
35class TestLockscreen(UnityTestCase):
41class TestLockscreen(UnityTestCase):
36
42
37 """Tests for the lock screen."""
43 """Tests for the lock screen."""
@@ -125,7 +131,10 @@ class TestLockscreen(UnityTestCase):
125 """
131 """
126
132
127 if not isinstance(code, basestring):
133 if not isinstance(code, basestring):
134+ raise TypeError(
128− raise TypeError("'code' parameter must be a string.")
135+ "'code' parameter must be a string, not %r."
136+ % type(passphrase)
137+ )
129 for num in code:
138 for num in code:
130 if not num.isdigit():
139 if not num.isdigit():
131 raise ValueError(
140 raise ValueError(
@@ -142,7 +151,10 @@ class TestLockscreen(UnityTestCase):
142
151
143 """
152 """
144 if not isinstance(passphrase, basestring):
153 if not isinstance(passphrase, basestring):
154+ raise TypeError(
145− raise TypeError("'passphrase' parameter must be a string.")
155+ "'passphrase' parameter must be a string, not %r."
156+ % type(passphrase)
157+ )
146
158
147 pinentryField = self.main_window.get_pinentryField()
159 pinentryField = self.main_window.get_pinentryField()
148 self.touch.tap_object(pinentryField)
160 self.touch.tap_object(pinentryField)
@@ -161,7 +173,10 @@ class TestLockscreen(UnityTestCase):
161
173
162 """
174 """
163 if not isinstance(passphrase, basestring):
175 if not isinstance(passphrase, basestring):
176+ raise TypeError(
164− raise TypeError("'passphrase' parameter must be a string.")
177+ "'passphrase' parameter must be a string, not %r."
178+ % type(passphrase)
179+ )
165
180
166 prompt = self.main_window.get_greeter().get_prompt()
181 prompt = self.main_window.get_greeter().get_prompt()
167 self.touch.tap_object(prompt)
182 self.touch.tap_object(prompt)
tests/autopilot/unity8/shell/tests/test_notifications.py+8−1
@@ -33,9 +33,15 @@ import os
33import logging
33import logging
34import signal
34import signal
35import subprocess
35import subprocess
36+import sys
36
37
37logger = logging.getLogger(__name__)
38logger = logging.getLogger(__name__)
38
39
40+# from __future__ import range
41+# (python3's range, is same as python2's xrange)
42+if sys.version_info < (3,):
43+ range = xrange
44+
39
45
40class NotificationsBase(UnityTestCase):
46class NotificationsBase(UnityTestCase):
41 """Base class for all notification tests that provides helper methods."""
47 """Base class for all notification tests that provides helper methods."""
@@ -261,6 +267,7 @@ class InteractiveNotificationBase(NotificationsBase):
261 stdout=subprocess.PIPE,
267 stdout=subprocess.PIPE,
262 stderr=subprocess.PIPE,
268 stderr=subprocess.PIPE,
263 close_fds=True,
269 close_fds=True,
270+ universal_newlines=True,
264 )
271 )
265
272
266 self.addCleanup(self._tidy_up_script_process)
273 self.addCleanup(self._tidy_up_script_process)
@@ -298,7 +305,7 @@ class InteractiveNotificationBase(NotificationsBase):
298 if self._notify_proc is None:
305 if self._notify_proc is None:
299 raise AssertionError("No interactive notification was created.")
306 raise AssertionError("No interactive notification was created.")
300
307
301− for i in xrange(timeout):
308+ for i in range(timeout):
302 self._notify_proc.poll()
309 self._notify_proc.poll()
303 if self._notify_proc.returncode is not None:
310 if self._notify_proc.returncode is not None:
304 output = self._notify_proc.communicate()
311 output = self._notify_proc.communicate()
tests/autopilot/unity8/shell/tests/test_upstart.py+6−1
@@ -36,6 +36,11 @@ import logging
36
36
37logger = logging.getLogger(__name__)
37logger = logging.getLogger(__name__)
38
38
39+# from __future__ import range
40+# (python3's range, is same as python2's xrange)
41+import sys
42+if sys.version_info < (3,):
43+ range = xrange
39
44
40class UpstartIntegrationTests(UnityTestCase):
45class UpstartIntegrationTests(UnityTestCase):
41
46
@@ -52,7 +57,7 @@ class UpstartIntegrationTests(UnityTestCase):
52 self.process = subprocess.Popen([get_binary_path()] + self.unity_geometry_args)
57 self.process = subprocess.Popen([get_binary_path()] + self.unity_geometry_args)
53 def ensure_stopped():
58 def ensure_stopped():
54 self.process.terminate()
59 self.process.terminate()
55− for i in xrange(10):
60+ for i in range(10):
56 try:
61 try:
57 self._get_status()
62 self._get_status()
58 except OSError:
63 except OSError:
tests/mocks/Unity/Indicators/CMakeLists.txt+1
@@ -16,6 +16,7 @@ set(IndicatorsFakeQml_SOURCES
16 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/menucontentactivator.cpp
16 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/menucontentactivator.cpp
17 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/unitymenumodelstack.cpp
17 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/unitymenumodelstack.cpp
18 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/visibleindicatorsmodel.cpp
18 ${CMAKE_SOURCE_DIR}/plugins/Unity/Indicators/visibleindicatorsmodel.cpp
19+ fakeindicatorsmodel.cpp
19)
20)
20
21
21set(IndicatorsFakeQml_RESOURCES
22set(IndicatorsFakeQml_RESOURCES
tests/mocks/Unity/Indicators/IndicatorsModel.qml+3−5
@@ -17,12 +17,10 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Unity.Indicators 0.1 as Indicators
18import Unity.Indicators 0.1 as Indicators
19
19
20−ListModel {
20+Indicators.FakeIndicatorsModel {
21
21
22− property var indicatorData : undefined
23−
24− function load() {
22+ function load(profile) {
25− clear();
23+ unload();
26
24
27 append({ "identifier": "indicator-fake1",
25 append({ "identifier": "indicator-fake1",
28 "position": 0,
26 "position": 0,
tests/mocks/Unity/Indicators/fakeindicatorsmodel.cppnew file+116
@@ -0,0 +1,116 @@
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 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+ * Authors:
17+ * Nick Dedekind <nick.dedekind@canonical.com>
18+ */
19+
20+#include "fakeindicatorsmodel.h"
21+#include "indicators.h"
22+
23+FakeIndicatorsModel::FakeIndicatorsModel(QObject *parent)
24+ : QAbstractListModel(parent)
25+{
26+ QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
27+ QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
28+ QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));
29+}
30+
31+/*! \internal */
32+FakeIndicatorsModel::~FakeIndicatorsModel()
33+{
34+ unload();
35+}
36+
37+int FakeIndicatorsModel::count() const
38+{
39+ return rowCount();
40+}
41+
42+void FakeIndicatorsModel::load(const QString&)
43+{
44+}
45+
46+void FakeIndicatorsModel::unload()
47+{
48+ beginResetModel();
49+
50+ qDeleteAll(m_indicators);
51+ m_indicators.clear();
52+
53+ endResetModel();
54+}
55+
56+
57+void FakeIndicatorsModel::append(const QVariantMap& row)
58+{
59+ Indicator* new_row = new QHash<int, QVariant>();
60+ for (auto iter = row.begin(); iter != row.end(); ++iter )
61+ {
62+ int key = roleNames().key(iter.key().toUtf8(), -1);
63+ if (key != -1) {
64+ new_row->insert(key, iter.value());
65+ }
66+ }
67+
68+ beginInsertRows(QModelIndex(), m_indicators.count(), m_indicators.count());
69+
70+ m_indicators.append(new_row);
71+
72+ endInsertRows();
73+}
74+
75+QHash<int, QByteArray> FakeIndicatorsModel::roleNames() const
76+{
77+ static QHash<int, QByteArray> roles;
78+ if (roles.isEmpty())
79+ {
80+ roles[IndicatorsModelRole::Identifier] = "identifier";
81+ roles[IndicatorsModelRole::Position] = "position";
82+ roles[IndicatorsModelRole::WidgetSource] = "widgetSource";
83+ roles[IndicatorsModelRole::PageSource] = "pageSource";
84+ roles[IndicatorsModelRole::IndicatorProperties] = "indicatorProperties";
85+ }
86+ return roles;
87+}
88+
89+int FakeIndicatorsModel::columnCount(const QModelIndex &) const
90+{
91+ return 1;
92+}
93+
94+Q_INVOKABLE QVariant FakeIndicatorsModel::data(int row, int role) const
95+{
96+ return data(index(row, 0), role);
97+}
98+
99+QVariant FakeIndicatorsModel::data(const QModelIndex &index, int role) const
100+{
101+ if (!index.isValid() || index.row() >= m_indicators.size())
102+ return QVariant();
103+
104+ Indicator* indicator = m_indicators[index.row()];
105+ return indicator->value(role, QVariant());
106+}
107+
108+QModelIndex FakeIndicatorsModel::parent(const QModelIndex&) const
109+{
110+ return QModelIndex();
111+}
112+
113+int FakeIndicatorsModel::rowCount(const QModelIndex&) const
114+{
115+ return m_indicators.count();
116+}
tests/mocks/Unity/Indicators/fakeindicatorsmodel.hnew file+59
@@ -0,0 +1,59 @@
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 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+ * Authors:
17+ * Nick Dedekind <nick.dedekind@canonical.com>
18+ */
19+
20+#ifndef FAKE_INDICATORSMODEL_H
21+#define FAKE_INDICATORSMODEL_H
22+
23+#include <QAbstractListModel>
24+
25+class FakeIndicatorsModel : public QAbstractListModel
26+{
27+ Q_OBJECT
28+ Q_ENUMS(Roles)
29+ Q_PROPERTY(int count READ count NOTIFY countChanged)
30+public:
31+
32+ FakeIndicatorsModel(QObject *parent=0);
33+ ~FakeIndicatorsModel();
34+
35+ Q_INVOKABLE void load(const QString& profile);
36+ Q_INVOKABLE void unload();
37+
38+ Q_INVOKABLE void append(const QVariantMap& row);
39+
40+ Q_INVOKABLE QVariant data(int row, int role) const;
41+
42+ /* QAbstractItemModel */
43+ QHash<int, QByteArray> roleNames() const;
44+ int columnCount(const QModelIndex &parent = QModelIndex()) const;
45+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
46+ QModelIndex parent (const QModelIndex &index) const;
47+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
48+
49+Q_SIGNALS:
50+ void countChanged();
51+
52+private:
53+ int count() const;
54+
55+ typedef QHash<int, QVariant> Indicator;
56+ QList<Indicator*> m_indicators;
57+};
58+
59+#endif // FAKE_INDICATORSMODEL_H
tests/mocks/Unity/Indicators/fakeplugin.cpp+6
@@ -23,6 +23,7 @@
23#include "fakeplugin.h"
23#include "fakeplugin.h"
24
24
25// local
25// local
26+#include "fakeindicatorsmodel.h"
26#include "indicators.h"
27#include "indicators.h"
27#include "menucontentactivator.h"
28#include "menucontentactivator.h"
28#include "unitymenumodelstack.h"
29#include "unitymenumodelstack.h"
@@ -32,10 +33,15 @@ void IndicatorsFakePlugin::registerTypes(const char * uri)
32{
33{
33 Q_INIT_RESOURCE(indicators_fake);
34 Q_INIT_RESOURCE(indicators_fake);
34
35
36+ // internal
37+ qmlRegisterType<FakeIndicatorsModel>(uri, 0, 1, "FakeIndicatorsModel");
38+
39+ // external
35 qmlRegisterType<MenuContentActivator>(uri, 0, 1, "MenuContentActivator");
40 qmlRegisterType<MenuContentActivator>(uri, 0, 1, "MenuContentActivator");
36 qmlRegisterType<UnityMenuModelStack>(uri, 0, 1, "UnityMenuModelStack");
41 qmlRegisterType<UnityMenuModelStack>(uri, 0, 1, "UnityMenuModelStack");
37 qmlRegisterType<VisibleIndicatorsModel>(uri, 0, 1, "VisibleIndicatorsModel");
42 qmlRegisterType<VisibleIndicatorsModel>(uri, 0, 1, "VisibleIndicatorsModel");
38
43
44+ // external uncreatables
39 qmlRegisterUncreatableType<MenuContentState>(uri, 0, 1, "MenuContentState", "Can't create MenuContentState class");
45 qmlRegisterUncreatableType<MenuContentState>(uri, 0, 1, "MenuContentState", "Can't create MenuContentState class");
40 qmlRegisterUncreatableType<ActionState>(uri, 0, 1, "ActionState", "Can't create ActionState class");
46 qmlRegisterUncreatableType<ActionState>(uri, 0, 1, "ActionState", "Can't create ActionState class");
41 qmlRegisterUncreatableType<NetworkActionState>(uri, 0, 1, "NetworkActionState", "Can't create NetworkActionState class");
47 qmlRegisterUncreatableType<NetworkActionState>(uri, 0, 1, "NetworkActionState", "Can't create NetworkActionState class");
tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp+46
@@ -86,6 +86,7 @@ private Q_SLOTS:
86 void rotated();
86 void rotated();
87 void sceneDistance();
87 void sceneDistance();
88 void sceneDistance_data();
88 void sceneDistance_data();
89+ void disabledWhileDragging();
89
90
90private:
91private:
91 void passTime(qint64 timeSpan);
92 void passTime(qint64 timeSpan);
@@ -795,6 +796,51 @@ void tst_DirectionalDragArea::sceneDistance_data()
795 QTest::newRow("rotated by 90 degrees") << 90. << QPointF(0., 1.);
796 QTest::newRow("rotated by 90 degrees") << 90. << QPointF(0., 1.);
796}
797}
797
798
799+/*
800+ Regression test for https://bugs.launchpad.net/unity8/+bug/1276122
801+
802+ The bug:
803+ If setting "enabled: false" while the DirectionalDragArea's (DDA) dragging
804+ property is true, the DDA stays in that state and doesn't recover any more.
805+*/
806+void tst_DirectionalDragArea::disabledWhileDragging()
807+{
808+ DirectionalDragArea *edgeDragArea =
809+ m_view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
810+ Q_ASSERT(edgeDragArea != 0);
811+ edgeDragArea->setRecognitionTimer(fakeTimer);
812+ edgeDragArea->setTimeSource(fakeTimeSource);
813+
814+ QPointF touchPoint = calculateInitialTouchPos(edgeDragArea);
815+
816+ qreal desiredDragDistance = edgeDragArea->distanceThreshold()*2.0f;
817+ QPointF dragDirectionVector(1., 0.); // horizontal positive
818+
819+ qreal movementStepDistance = edgeDragArea->distanceThreshold() * 0.1f;
820+ QPointF touchMovement = dragDirectionVector * movementStepDistance;
821+ int totalMovementSteps = qCeil(desiredDragDistance / movementStepDistance);
822+ int movementTimeStepMs = (edgeDragArea->compositionTime() * 1.5f) / totalMovementSteps;
823+
824+ QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
825+
826+ for (int i = 0; i < totalMovementSteps; ++i) {
827+ touchPoint += touchMovement;
828+ passTime(movementTimeStepMs);
829+ QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
830+ }
831+
832+ QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Recognized);
833+ QCOMPARE(edgeDragArea->dragging(), true);
834+
835+ // disable the dragArea while it's being dragged.
836+ edgeDragArea->setEnabled(false);
837+
838+ QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::WaitingForTouch);
839+ QCOMPARE(edgeDragArea->dragging(), false);
840+
841+ QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
842+}
843+
798QTEST_MAIN(tst_DirectionalDragArea)
844QTEST_MAIN(tst_DirectionalDragArea)
799
845
800#include "tst_DirectionalDragArea.moc"
846#include "tst_DirectionalDragArea.moc"
tests/qmltests/CMakeLists.txt+2−1
@@ -52,7 +52,8 @@ add_qml_test(Dash/Previews PreviewAudioPlayback IMPORT_PATHS ${qmltest_DEFAULT_I
52add_qml_test(Dash/Previews PreviewHeader IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
52add_qml_test(Dash/Previews PreviewHeader IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
53add_qml_test(Dash/Previews PreviewImageGallery IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
53add_qml_test(Dash/Previews PreviewImageGallery IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
54add_qml_test(Dash/Previews PreviewProgress IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
54add_qml_test(Dash/Previews PreviewProgress IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
55+add_qml_test(Dash/Previews PreviewRatingDisplay IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
55−add_qml_test(Dash/Previews PreviewRating IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
56+add_qml_test(Dash/Previews PreviewRatingInput IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
56add_qml_test(Dash/Previews PreviewTextSummary IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
57add_qml_test(Dash/Previews PreviewTextSummary IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
57add_qml_test(Dash/Previews PreviewVideoPlayback IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
58add_qml_test(Dash/Previews PreviewVideoPlayback IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
58add_qml_test(Dash/Previews PreviewWidgetFactory IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
59add_qml_test(Dash/Previews PreviewWidgetFactory IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qmlnew file+112
@@ -0,0 +1,112 @@
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 reviewsModel0: {
30+ "reviews": [ ]
31+ }
32+
33+ property var reviewsModel1: {
34+ "reviews": [ { author: "Some dude", rating: 4.5, review: "Very cool app" },
35+ { author: "Yet Another dude", rating: 5, review: "Very cool app" }, ]
36+ }
37+
38+ property var reviewsModel2: {
39+ "reviews": [ { author: "Some dude", rating: 4.5, review: "Very cool app" },
40+ { author: "Another dude", rating: 3, review: "Average app. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh." },
41+ { author: "Yet Another dude", rating: 5, review: "Very cool app" }, ]
42+ }
43+
44+ property var reviewsModelMixed: {
45+ "reviews": [ { author: "Some dude", review: "Very cool app" },
46+ { author: "" },
47+ { rating: 3, review: "Average app. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh." },
48+ { author: "Yet Another dude", rating: 5 }, ]
49+ }
50+
51+ PreviewRatingDisplay {
52+ id: previewRatingDisplay
53+ anchors.left: parent.left
54+ anchors.right: parent.right
55+ widgetData: reviewsModelMixed
56+ }
57+
58+ UT.UnityTestCase {
59+ name: "PreviewRatingDisplayTest"
60+ when: windowShown
61+
62+ function test_reviews_data() {
63+ return [
64+ {tag: "0 reviews", reviewsModel: reviewsModel0},
65+ {tag: "1 review", reviewsModel: reviewsModel1},
66+ {tag: "3 reviews", reviewsModel: reviewsModel2},
67+ {tag: "3 mixed reviews", reviewsModel: reviewsModelMixed}
68+ ];
69+ }
70+
71+ function test_reviews(data) {
72+ previewRatingDisplay.widgetData = data.reviewsModel;
73+
74+ var reviewsRepeater = findChild(previewRatingDisplay, "reviewsRepeater");
75+ compare(reviewsRepeater.count, data.reviewsModel["reviews"].length);
76+
77+ for (var i = 0; i < data.reviewsModel["reviews"].length; ++i) {
78+ var reviewItem = findChild(previewRatingDisplay, "reviewItem" + i);
79+
80+ var rating = findChild(reviewItem, "rating");
81+ if (data.reviewsModel["reviews"][i]["rating"] >= 0) {
82+ compare(rating.visible, true);
83+ compare(rating.value, data.reviewsModel["reviews"][i]["rating"]);
84+ } else {
85+ compare(rating.visible, false);
86+ }
87+
88+ var authorLabel = findChild(reviewItem, "authorLabel");
89+ if (data.reviewsModel["reviews"][i]["author"] &&
90+ data.reviewsModel["reviews"][i]["author"] !== "") {
91+ compare(authorLabel.visible, true);
92+ compare(authorLabel.text, data.reviewsModel["reviews"][i]["author"]);
93+ } else {
94+ compare(authorLabel.visible, false);
95+ }
96+
97+ var reviewLabel = findChild(reviewItem, "reviewLabel");
98+ if (data.reviewsModel["reviews"][i]["review"] &&
99+ data.reviewsModel["reviews"][i]["review"] !== "") {
100+ compare(reviewLabel.visible, true);
101+ compare(reviewLabel.text, data.reviewsModel["reviews"][i]["review"]);
102+ } else {
103+ compare(reviewLabel.visible, false);
104+ }
105+
106+ if (!rating.visible && !authorLabel.visible && !reviewLabel.visible) {
107+ verify(reviewItem.height === 0);
108+ }
109+ }
110+ }
111+ }
112+}
tests/qmltests/Dash/Previews/tst_PreviewRating.qml → tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qmlrenamed+15−15
@@ -43,12 +43,12 @@ Rectangle {
43
43
44 property var widgetDataNewLabels: { "visible": "both", "required": "both", "rating-label": "TestRatingLabel", "review-label": "TestReviewLabel", "submit-label": "TestSubmitLabel" }
44 property var widgetDataNewLabels: { "visible": "both", "required": "both", "rating-label": "TestRatingLabel", "review-label": "TestReviewLabel", "submit-label": "TestSubmitLabel" }
45
45
46− PreviewRating {
46+ PreviewRatingInput {
47− id: previewRating
47+ id: previewRatingInput
48 anchors.left: parent.left
48 anchors.left: parent.left
49 anchors.right: parent.right
49 anchors.right: parent.right
50 widgetData: widgetDataBoth
50 widgetData: widgetDataBoth
51− widgetId: "previewRating"
51+ widgetId: "previewRatingInput"
52 }
52 }
53
53
54 SignalSpy {
54 SignalSpy {
@@ -57,12 +57,12 @@ Rectangle {
57 }
57 }
58
58
59 UT.UnityTestCase {
59 UT.UnityTestCase {
60− name: "PreviewRatingTest"
60+ name: "PreviewRatingInputTest"
61 when: windowShown
61 when: windowShown
62
62
63− property var rating: findChild(previewRating, "rating")
63+ property var rating: findChild(previewRatingInput, "rating")
64− property var reviewTextArea: findChild(previewRating, "reviewTextArea")
64+ property var reviewTextArea: findChild(previewRatingInput, "reviewTextArea")
65− property var submitButton: findChild(previewRating, "submitButton")
65+ property var submitButton: findChild(previewRatingInput, "submitButton")
66
66
67 function init() {
67 function init() {
68 rating.value = -1;
68 rating.value = -1;
@@ -70,10 +70,10 @@ Rectangle {
70 }
70 }
71
71
72 function test_labels() {
72 function test_labels() {
73− var ratingLabel = findChild(previewRating, "ratingLabel");
73+ var ratingLabel = findChild(previewRatingInput, "ratingLabel");
74− var reviewLabel = findChild(previewRating, "reviewLabel");
74+ var reviewLabel = findChild(previewRatingInput, "reviewLabel");
75
75
76− previewRating.widgetData = widgetDataNewLabels;
76+ previewRatingInput.widgetData = widgetDataNewLabels;
77 compare(ratingLabel.text, widgetDataNewLabels["rating-label"]);
77 compare(ratingLabel.text, widgetDataNewLabels["rating-label"]);
78 compare(reviewLabel.text, widgetDataNewLabels["review-label"]);
78 compare(reviewLabel.text, widgetDataNewLabels["review-label"]);
79 compare(submitButton.text, widgetDataNewLabels["submit-label"]);
79 compare(submitButton.text, widgetDataNewLabels["submit-label"]);
@@ -106,9 +106,9 @@ Rectangle {
106
106
107 function test_submit_and_visibility(data) {
107 function test_submit_and_visibility(data) {
108 spy.clear();
108 spy.clear();
109− spy.target = previewRating;
109+ spy.target = previewRatingInput;
110
110
111− previewRating.widgetData = data.widgetData;
111+ previewRatingInput.widgetData = data.widgetData;
112
112
113 if (data.widgetData["visible"] !== "review") {
113 if (data.widgetData["visible"] !== "review") {
114 verify(rating.visible === true);
114 verify(rating.visible === true);
@@ -161,9 +161,9 @@ Rectangle {
161
161
162 function test_triggered(data) {
162 function test_triggered(data) {
163 spy.clear();
163 spy.clear();
164− spy.target = previewRating;
164+ spy.target = previewRatingInput;
165
165
166− previewRating.widgetData = data.widgetData;
166+ previewRatingInput.widgetData = data.widgetData;
167
167
168 if (data.inputRating > 0) rating.value = data.inputRating;
168 if (data.inputRating > 0) rating.value = data.inputRating;
169 if (data.inputText !== "") {
169 if (data.inputText !== "") {
@@ -173,7 +173,7 @@ Rectangle {
173
173
174 compare(spy.count, 1);
174 compare(spy.count, 1);
175 var args = spy.signalArguments[0];
175 var args = spy.signalArguments[0];
176− compare(args[0], previewRating.widgetId);
176+ compare(args[0], previewRatingInput.widgetId);
177 compare(args[1], data.widgetData["required"]);
177 compare(args[1], data.widgetData["required"]);
178 compare(args[2]["rating"], data.triggeredData["rating"]);
178 compare(args[2]["rating"], data.triggeredData["rating"]);
179 compare(args[2]["review"], data.triggeredData["review"]);
179 compare(args[2]["review"], data.triggeredData["review"]);
tests/qmltests/Dash/Previews/tst_PreviewWidgetFactory.qml+2−1
@@ -81,7 +81,8 @@ Rectangle {
81 { tag: "Header", type: "header", source: "PreviewHeader.qml" },
81 { tag: "Header", type: "header", source: "PreviewHeader.qml" },
82 { tag: "Image", type: "image", source: "PreviewZoomableImage.qml" },
82 { tag: "Image", type: "image", source: "PreviewZoomableImage.qml" },
83 { tag: "Progress", type: "progress", source: "PreviewProgress.qml" },
83 { tag: "Progress", type: "progress", source: "PreviewProgress.qml" },
84− { tag: "Rating Input", type: "rating-input", source: "PreviewRating.qml" },
84+ { tag: "Rating Input", type: "rating-input", source: "PreviewRatingInput.qml" },
85+ { tag: "Rating Display", type: "reviews", source: "PreviewRatingDisplay.qml" },
85 { tag: "Text", type: "text", source: "PreviewTextSummary.qml" },
86 { tag: "Text", type: "text", source: "PreviewTextSummary.qml" },
86 { tag: "Video", type: "video", source: "PreviewVideoPlayback.qml" },
87 { tag: "Video", type: "video", source: "PreviewVideoPlayback.qml" },
87 ];
88 ];
tests/qmltests/Dash/qml/FakeScopeView.qml−5
@@ -25,11 +25,6 @@ GenericScopeView {
25 property alias backColor : back.color
25 property alias backColor : back.color
26 property var categoryView: null
26 property var categoryView: null
27
27
28− onEndReached: {
29− if (scope != undefined && shell != undefined && shell.scopeStatus != undefined) {
30− shell.scopeStatus[scope.id].endReached++;
31− }
32− }
33 onMovementStarted: {
28 onMovementStarted: {
34 if (shell != undefined && shell.scopeStatus != undefined) {
29 if (shell != undefined && shell.scopeStatus != undefined) {
35 shell.scopeStatus[scope.id].movementStarted++;
30 shell.scopeStatus[scope.id].movementStarted++;
tests/qmltests/Dash/tst_DashContent.qml+14−35
@@ -95,25 +95,19 @@ Item {
95 signalName: "movementStarted"
95 signalName: "movementStarted"
96 }
96 }
97
97
98− SignalSpy {
99− id: contentEndReachedSpy
100− target: dashContent
101− signalName: "contentEndReached"
102− }
103−
104 UT.UnityTestCase {
98 UT.UnityTestCase {
105 name: "DashContent"
99 name: "DashContent"
106 when: scopesModel.loaded
100 when: scopesModel.loaded
107
101
108 function init() {
102 function init() {
109 scopesModel.clear();
103 scopesModel.clear();
104+ scopeLoadedSpy.clear();
110 scopesModel.load();
105 scopesModel.load();
106+ tryCompare(scopeLoadedSpy, "count", 4);
111 }
107 }
112
108
113 function cleanup() {
109 function cleanup() {
114− scopeLoadedSpy.clear();
115 movementStartedSpy.clear();
110 movementStartedSpy.clear();
116− contentEndReachedSpy.clear();
117 clear_scope_status();
111 clear_scope_status();
118 dashContent.visible = true;
112 dashContent.visible = true;
119
113
@@ -122,17 +116,18 @@ Item {
122 scopesModel.clear();
116 scopesModel.clear();
123 // wait for dash to empty scopes.
117 // wait for dash to empty scopes.
124 tryCompare(dashContentList, "count", 0);
118 tryCompare(dashContentList, "count", 0);
125− // this is the default state for empty model
126− dashContentList.currentIndex = -1;
127 }
119 }
128
120
129 function test_current_index() {
121 function test_current_index() {
130 var dashContentList = findChild(dashContent, "dashContentList");
122 var dashContentList = findChild(dashContent, "dashContentList");
131 verify(dashContentList != undefined)
123 verify(dashContentList != undefined)
132
124
125+ scopesModel.clear();
133 compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
126 compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
134− compare(dashContentList.currentIndex, -1, "DashContent's currentIndex should be -1 while there have been no items in the model");
127+ tryCompare(dashContentList, "currentIndex", -1);
135
128
129+ scopeLoadedSpy.clear();
130+ scopesModel.load();
136 tryCompare(scopeLoadedSpy, "count", 4);
131 tryCompare(scopeLoadedSpy, "count", 4);
137
132
138 verify(dashContentList.currentIndex >= 0);
133 verify(dashContentList.currentIndex >= 0);
@@ -142,10 +137,13 @@ Item {
142 var dashContentList = findChild(dashContent, "dashContentList");
137 var dashContentList = findChild(dashContent, "dashContentList");
143 verify(dashContentList != undefined)
138 verify(dashContentList != undefined)
144
139
140+ scopesModel.clear();
145− compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
141+ compare(dashContentList.count, 0, "DashContent should have 0 items after clearing");
146 // pretend we're running after a model reset
142 // pretend we're running after a model reset
147 dashContentList.currentIndex = 27;
143 dashContentList.currentIndex = 27;
148
144
145+ scopeLoadedSpy.clear();
146+ scopesModel.load();
149 tryCompare(scopeLoadedSpy, "count", 4);
147 tryCompare(scopeLoadedSpy, "count", 4);
150
148
151 verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < 5);
149 verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < 5);
@@ -157,8 +155,6 @@ Item {
157 var dashContentList = findChild(dashContent, "dashContentList");
155 var dashContentList = findChild(dashContent, "dashContentList");
158 verify(dashContentList != undefined)
156 verify(dashContentList != undefined)
159
157
160− tryCompare(scopeLoadedSpy, "count", 4);
161−
162 dashContentList.movementStarted();
158 dashContentList.movementStarted();
163
159
164 compare(movementStartedSpy.count, 1, "DashContent should have emitted movementStarted signal when content list did.");
160 compare(movementStartedSpy.count, 1, "DashContent should have emitted movementStarted signal when content list did.");
@@ -171,8 +167,6 @@ Item {
171 function test_positioned_at_beginning_signal() {
167 function test_positioned_at_beginning_signal() {
172 dashContent.setCurrentScopeAtIndex(3, true, false);
168 dashContent.setCurrentScopeAtIndex(3, true, false);
173
169
174− tryCompare(scopeLoadedSpy, "count", 4);
175−
176 dashContent.positionedAtBeginning();
170 dashContent.positionedAtBeginning();
177 compare(scopeStatus["MockScope1"].positionedAtBeginning, 1, "MockScope1 should have emitted positionedAtBeginning signal when DashContent did.");
171 compare(scopeStatus["MockScope1"].positionedAtBeginning, 1, "MockScope1 should have emitted positionedAtBeginning signal when DashContent did.");
178 compare(scopeStatus["MockScope2"].positionedAtBeginning, 1, "MockScope2 should have emitted positionedAtBeginning signal when DashContent did.");
172 compare(scopeStatus["MockScope2"].positionedAtBeginning, 1, "MockScope2 should have emitted positionedAtBeginning signal when DashContent did.");
@@ -180,30 +174,17 @@ Item {
180 compare(scopeStatus["MockScope5"].positionedAtBeginning, 1, "MockScope5 should have emitted positionedAtBeginning signal when DashContent did.");
174 compare(scopeStatus["MockScope5"].positionedAtBeginning, 1, "MockScope5 should have emitted positionedAtBeginning signal when DashContent did.");
181 }
175 }
182
176
183− function test_scope_loaded() {
184− tryCompare(scopeLoadedSpy, "count", 4);
185− }
186−
187− function test_content_end_reached() {
188− var dashContentList = findChild(dashContent, "dashContentList");
189− verify(dashContentList != undefined);
190−
191− tryCompare(scopeLoadedSpy, "count", 4);
192− dashContent.setCurrentScopeAtIndex(0, true, false);
193− dashContentList.currentItem.item.endReached();
194−
195− compare(contentEndReachedSpy.count, 1);
196− }
197−
198 // This tests that setting the current scope index will end up at the correct index even if
177 // This tests that setting the current scope index will end up at the correct index even if
199 // the scopes are loaded asynchrounsly.
178 // the scopes are loaded asynchrounsly.
200 function test_set_current_scope_index_async() {
179 function test_set_current_scope_index_async() {
180+ scopesModel.clear();
201 verify(scopesModel.loaded == false);
181 verify(scopesModel.loaded == false);
202
182
203− // next index is 1 if current is -1, otherwise it's current + 1
183+ tryCompare(dashContent, "currentIndex", -1);
204− var next_index = ((dashContent.currentIndex == -1 ? 0 : dashContent.currentIndex) + 1) % 5
184+ var next_index = 1
205
185
206 dashContent.setCurrentScopeAtIndex(next_index, true, false);
186 dashContent.setCurrentScopeAtIndex(next_index, true, false);
187+ scopesModel.load();
207 tryCompare(dashContent, "currentIndex", next_index);
188 tryCompare(dashContent, "currentIndex", next_index);
208 verify(scopesModel.loaded == true);
189 verify(scopesModel.loaded == true);
209
190
@@ -252,8 +233,6 @@ Item {
252 function test_is_active(data) {
233 function test_is_active(data) {
253 var dashContentList = findChild(dashContent, "dashContentList");
234 var dashContentList = findChild(dashContent, "dashContentList");
254
235
255− tryCompare(scopeLoadedSpy, "count", 4);
256−
257 dashContent.setCurrentScopeAtIndex(data.select, true, false);
236 dashContent.setCurrentScopeAtIndex(data.select, true, false);
258 dashContent.visible = data.visible;
237 dashContent.visible = data.visible;
259
238
tests/qmltests/Panel/tst_IndicatorRow.qml+3−3
@@ -70,13 +70,13 @@ Item {
70 function test_set_current_item() {
70 function test_set_current_item() {
71 init_test();
71 init_test();
72 indicatorRow.setCurrentItemIndex(0);
72 indicatorRow.setCurrentItemIndex(0);
73− compare(indicatorRow.indicatorsModel.get(indicatorRow.currentItemIndex).identifier, "indicator-fake1", "Incorrect item at position 0");
73+ compare(indicatorRow.indicatorsModel.data(indicatorRow.currentItemIndex, Indicators.IndicatorsModelRole.Identifier), "indicator-fake1", "Incorrect item at position 0");
74
74
75 indicatorRow.setCurrentItemIndex(1);
75 indicatorRow.setCurrentItemIndex(1);
76− compare(indicatorRow.indicatorsModel.get(indicatorRow.currentItemIndex).identifier, "indicator-fake2", "Incorrect item at position 1");
76+ compare(indicatorRow.indicatorsModel.data(indicatorRow.currentItemIndex, Indicators.IndicatorsModelRole.Identifier), "indicator-fake2", "Incorrect item at position 1");
77
77
78 indicatorRow.setCurrentItemIndex(2);
78 indicatorRow.setCurrentItemIndex(2);
79− compare(indicatorRow.indicatorsModel.get(indicatorRow.currentItemIndex).identifier, "indicator-fake3", "Incorrect item at position 2");
79+ compare(indicatorRow.indicatorsModel.data(indicatorRow.currentItemIndex, Indicators.IndicatorsModelRole.Identifier), "indicator-fake3", "Incorrect item at position 2");
80 }
80 }
81
81
82 function test_highlight_data() {
82 function test_highlight_data() {
tests/qmltests/Panel/tst_MenuContent.qml+1−1
@@ -133,7 +133,7 @@ Item {
133 var menuIndex = i%menuCount;
133 var menuIndex = i%menuCount;
134
134
135 activate_content(menuIndex);
135 activate_content(menuIndex);
136− testTabObjectName = indicatorsModel.get(menuIndex).identifier;
136+ testTabObjectName = indicatorsModel.data(menuIndex, Indicators.IndicatorsModelRole.Identifier);
137 compare(tabs.selectedTabIndex, menuIndex, "Current tab index does not match selected tab index");
137 compare(tabs.selectedTabIndex, menuIndex, "Current tab index does not match selected tab index");
138 tryCompareFunction(selected_tab_equals_test_tab, true);
138 tryCompareFunction(selected_tab_equals_test_tab, true);
139 }
139 }