Merge lp:~cimi/unity8/scope-settings into lp:unity8
- scope-settings
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~cimi/unity8/scope-settings |
Merge into: | lp:unity8 |
Diff against target: |
4142 lines (+2536/-286) 48 files modified
data/unity8-dash.conf (+1/-1) plugins/Dash/CardCreator.js (+3/-2) plugins/Dash/ScopeStyle.qml (+3/-2) plugins/Dash/listviewwithpageheader.cpp (+10/-2) plugins/Dash/listviewwithpageheader.h (+3/-0) po/hu.po (+69/-33) po/sl.po (+67/-31) po/unity8.pot (+80/-44) qml/Components/PageHeader.qml (+13/-1) qml/Components/ResponsiveGridView.qml (+3/-3) qml/Dash/CardCarousel.qml (+2/-2) qml/Dash/CardGrid.qml (+13/-2) qml/Dash/CardVerticalJournal.qml (+1/-1) qml/Dash/Dash.qml (+171/-13) qml/Dash/DashBackground.qml (+24/-0) qml/Dash/DashContent.qml (+10/-4) qml/Dash/DashRenderer.qml (+3/-1) qml/Dash/GenericScopeView.qml (+168/-64) qml/Dash/PreviewListView.qml (+4/-2) qml/Dash/ScopeSettings/ScopeSetting.qml (+36/-0) qml/Dash/ScopeSettings/ScopeSettingLabel.qml (+51/-0) qml/Dash/ScopeSettings/ScopeSettingList.qml (+37/-0) qml/Dash/ScopeSettings/ScopeSettingNumber.qml (+52/-0) qml/Dash/ScopeSettings/ScopeSettingSwitch.qml (+48/-0) qml/Dash/ScopeSettings/ScopeSettingWidgetFactory.qml (+55/-0) qml/Dash/ScopeSettings/ScopeSettings.qml (+35/-0) qml/Dash/ScopeSettingsPage.qml (+54/-0) qml/Dash/ScopesOverview.qml (+533/-0) qml/Dash/ScopesOverviewAll.qml (+54/-0) qml/Dash/ScopesOverviewFavorites.qml (+73/-0) qml/Dash/ScopesOverviewTab.qml (+74/-0) tests/autopilot/unity8/shell/tests/test_emulators.py (+1/-1) tests/mocks/Unity/CMakeLists.txt (+1/-0) tests/mocks/Unity/fake_resultsmodel.cpp (+2/-1) tests/mocks/Unity/fake_scope.cpp (+17/-5) tests/mocks/Unity/fake_scope.h (+6/-3) tests/mocks/Unity/fake_scopes.cpp (+46/-7) tests/mocks/Unity/fake_scopes.h (+8/-1) tests/mocks/Unity/fake_scopesoverview.cpp (+281/-0) tests/mocks/Unity/fake_scopesoverview.h (+104/-0) tests/plugins/Dash/cardcreator/2.res (+2/-2) tests/plugins/Dash/cardcreator/5.res (+8/-6) tests/plugins/Dash/cardcreator/7.res (+4/-4) tests/plugins/Dash/tst_ScopeStyle.qml (+1/-1) tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingSwitch.qml (+33/-0) tests/qmltests/Dash/tst_Dash.qml (+229/-7) tests/qmltests/Dash/tst_DashContent.qml (+7/-6) tests/qmltests/Dash/tst_GenericScopeView.qml (+36/-34) |
To merge this branch: | bzr merge lp:~cimi/unity8/scope-settings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Unity Team | Pending | ||
Review via email: mp+229995@code.launchpad.net |
Commit message
WIP but let's jenkins build the packages
Description of the change
WIP but let's jenkins build the packages
PS Jenkins bot (ps-jenkins) wrote : | # |
- 1112. By Andrea Cimitan
-
Merged dash overview
- 1113. By Andrea Cimitan
-
Remerged
- 1114. By Andrea Cimitan
-
Whitespaces
- 1115. By Andrea Cimitan
-
Add small tests
- 1116. By Andrea Cimitan
-
Added more tests
- 1117. By Andrea Cimitan
-
Merge trunk
- 1118. By Andrea Cimitan
-
Added fake settings
- 1119. By Andrea Cimitan
-
Moar fixes
- 1120. By Andrea Cimitan
-
Added tests for settings open close
- 1121. By Andrea Cimitan
-
Update ScopeSettingBoolean
- 1122. By Andrea Cimitan
-
Merge el trunko
- 1123. By Andrea Cimitan
-
Force focus properly
- 1124. By Andrea Cimitan
-
Merged horizontal list
- 1125. By Andrea Cimitan
-
Fix issue with initial count for preview
- 1126. By Andrea Cimitan
-
Should not feature overview in settings page
- 1127. By Andrea Cimitan
-
Workaround test
- 1128. By Andrea Cimitan
-
Properly fix tests
- 1129. By Andrea Cimitan
-
Better the string test too
- 1130. By Andrea Cimitan
-
Fix issue with preview in scope overview
- 1131. By Andrea Cimitan
-
[ CI bot ]
* Resync trunk
[ Michał Sawicz ]
* Fix dash overview test and prevent crash in mock ApplicationInfo's
d'tor. tryCompareFunction didn't work because .item threw.
[ Michael Terry ]
* Bring dialer to front on incoming call even when device is locked
(LP: #1354532)
[ CI bot ]
* Resync trunk
[ Michał Sawicz ]
* Use palette's baseText for text colour in dash.
* Update qmltypes definitions
* Move PageHeader out of qml/Components into qml/Dash
* Reshuffle and update dependencies
* Fix cardtool test and make card creator output debugging info on
errors.
* Support previews for scopes in overview and hook up preview
processing to activity indicator.
* Fix notifications indicator title
* Fix horizontal list activation and add test for it.
[ Ying-Chun Liu ]
* Add button colors and i18n for power off dialog. (LP: #1354506)
[ Mirco Müller ]
* Force plain-text rendering for summary- and body-text. (LP:
#1335787) - 1132. By Andrea Cimitan
-
More stuff addressed
- 1133. By Andrea Cimitan
-
Fixed tests
- 1134. By Andrea Cimitan
-
[ CI bot ]
* Resync trunk
[ Nick Dedekind ]
* Fixed CachedUnityMenuModel destruction unhinging indicators. (LP:
#1328646)
[ Mirco Müller ]
* Temporarily disable any opacity-animation for notifications to
unblock the train due to LP: 1354406. (LP: #1354406) - 1135. By Andrea Cimitan
-
Removed previewShown and settingsShown properties
- 1136. By Andrea Cimitan
-
More changes requested
- 1137. By Andrea Cimitan
-
More fixes
- 1138. By Andrea Cimitan
-
More changes, still doesn't work
- 1139. By Andrea Cimitan
-
More changes to review
- 1140. By Andrea Cimitan
-
Fix tests with refactor
- 1141. By Andrea Cimitan
-
Another thing addressed
- 1142. By Andrea Cimitan
-
Changes according to review
- 1143. By Andrea Cimitan
-
merged trunk
- 1144. By Andrea Cimitan
-
More changes
- 1145. By Andrea Cimitan
-
Fixed tests
- 1146. By Andrea Cimitan
-
Test initialValue
- 1147. By Andrea Cimitan
-
Other approach to test
- 1148. By Andrea Cimitan
-
New approach to test
- 1149. By Andrea Cimitan
Unmerged revisions
Preview Diff
1 | === modified file 'data/unity8-dash.conf' | |||
2 | --- data/unity8-dash.conf 2014-07-29 11:35:10 +0000 | |||
3 | +++ data/unity8-dash.conf 2014-08-08 20:44:52 +0000 | |||
4 | @@ -13,7 +13,7 @@ | |||
5 | 13 | pre-start script | 13 | pre-start script |
6 | 14 | if [ -z "$UNITY_SCOPES_LIST" ]; then | 14 | if [ -z "$UNITY_SCOPES_LIST" ]; then |
7 | 15 | # FIXME: remove once we have this in dconf | 15 | # FIXME: remove once we have this in dconf |
9 | 16 | initctl set-env UNITY_SCOPES_LIST="scopes;clickscope;musicaggregator;videoaggregator" | 16 | initctl set-env UNITY_SCOPES_LIST="clickscope;musicaggregator;videoaggregator" |
10 | 17 | fi | 17 | fi |
11 | 18 | 18 | ||
12 | 19 | initctl emit scope-ui-starting | 19 | initctl emit scope-ui-starting |
13 | 20 | 20 | ||
14 | === modified file 'plugins/Dash/CardCreator.js' | |||
15 | --- plugins/Dash/CardCreator.js 2014-08-06 19:39:39 +0000 | |||
16 | +++ plugins/Dash/CardCreator.js 2014-08-08 20:44:52 +0000 | |||
17 | @@ -108,6 +108,7 @@ | |||
18 | 108 | sourceComponent: ShaderEffect { \n\ | 108 | sourceComponent: ShaderEffect { \n\ |
19 | 109 | id: overlay; \n\ | 109 | id: overlay; \n\ |
20 | 110 | height: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2); \n\ | 110 | height: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2); \n\ |
21 | 111 | property real luminance: 0.2126 * overlayColor.r + 0.7152 * overlayColor.g + 0.0722 * overlayColor.b; \n\ | ||
22 | 111 | property color overlayColor: cardData && cardData["overlayColor"] || "#99000000"; \n\ | 112 | property color overlayColor: cardData && cardData["overlayColor"] || "#99000000"; \n\ |
23 | 112 | property var source: ShaderEffectSource { \n\ | 113 | property var source: ShaderEffectSource { \n\ |
24 | 113 | id: shaderSource; \n\ | 114 | id: shaderSource; \n\ |
25 | @@ -446,13 +447,13 @@ | |||
26 | 446 | mascotCode = kMascotImageCode.arg(anchors).arg(mascotImageVisible); | 447 | mascotCode = kMascotImageCode.arg(anchors).arg(mascotImageVisible); |
27 | 447 | } | 448 | } |
28 | 448 | 449 | ||
30 | 449 | var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey")'; | 450 | var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey")'; |
31 | 450 | 451 | ||
32 | 451 | var titleSubtitleCode = ""; | 452 | var titleSubtitleCode = ""; |
33 | 452 | if (hasTitle) { | 453 | if (hasTitle) { |
34 | 453 | var color; | 454 | var color; |
35 | 454 | if (headerAsOverlay) { | 455 | if (headerAsOverlay) { |
37 | 455 | color = '"white"'; | 456 | color = 'overlayLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey")'; |
38 | 456 | } else if (hasSummary) { | 457 | } else if (hasSummary) { |
39 | 457 | color = 'summary.color'; | 458 | color = 'summary.color'; |
40 | 458 | } else if (hasBackground) { | 459 | } else if (hasBackground) { |
41 | 459 | 460 | ||
42 | === modified file 'plugins/Dash/ScopeStyle.qml' | |||
43 | --- plugins/Dash/ScopeStyle.qml 2014-07-25 11:42:06 +0000 | |||
44 | +++ plugins/Dash/ScopeStyle.qml 2014-08-08 20:44:52 +0000 | |||
45 | @@ -49,9 +49,10 @@ | |||
46 | 49 | 49 | ||
47 | 50 | /*! \brief Luminance threshold for switching between fore and background color | 50 | /*! \brief Luminance threshold for switching between fore and background color |
48 | 51 | 51 | ||
50 | 52 | \note If background colour is not fully opaque, it's not taken into account. | 52 | \note If background colour is not fully opaque, the defaultLightLuminance it's taken into account instead of it. |
51 | 53 | */ | 53 | */ |
53 | 54 | readonly property real threshold: background.a !== 1.0 ? foregroundLuminance : (foregroundLuminance + backgroundLuminance) / 2 | 54 | readonly property real threshold: background.a !== 1.0 ? (foregroundLuminance + d.defaultLightLuminance) / 2 |
54 | 55 | : (foregroundLuminance + backgroundLuminance) / 2 | ||
55 | 55 | 56 | ||
56 | 56 | /*! \brief The lighter of foreground and background colors | 57 | /*! \brief The lighter of foreground and background colors |
57 | 57 | 58 | ||
58 | 58 | 59 | ||
59 | === modified file 'plugins/Dash/listviewwithpageheader.cpp' | |||
60 | --- plugins/Dash/listviewwithpageheader.cpp 2014-07-25 10:47:08 +0000 | |||
61 | +++ plugins/Dash/listviewwithpageheader.cpp 2014-08-08 20:44:52 +0000 | |||
62 | @@ -330,6 +330,11 @@ | |||
63 | 330 | return m_topSectionItem ? m_topSectionItem->height() : 0; | 330 | return m_topSectionItem ? m_topSectionItem->height() : 0; |
64 | 331 | } | 331 | } |
65 | 332 | 332 | ||
66 | 333 | qreal ListViewWithPageHeader::headerItemShownHeight() const | ||
67 | 334 | { | ||
68 | 335 | return m_headerItemShownHeight; | ||
69 | 336 | } | ||
70 | 337 | |||
71 | 333 | void ListViewWithPageHeader::positionAtBeginning() | 338 | void ListViewWithPageHeader::positionAtBeginning() |
72 | 334 | { | 339 | { |
73 | 335 | if (m_delegateModel->count() <= 0) | 340 | if (m_delegateModel->count() <= 0) |
74 | @@ -396,6 +401,7 @@ | |||
75 | 396 | firstItem->setY(firstItem->y() - m_headerItemShownHeight); | 401 | firstItem->setY(firstItem->y() - m_headerItemShownHeight); |
76 | 397 | layout(); | 402 | layout(); |
77 | 398 | } | 403 | } |
78 | 404 | Q_EMIT headerItemShownHeightChanged(); | ||
79 | 399 | } | 405 | } |
80 | 400 | m_contentYAnimation->setTo(to); | 406 | m_contentYAnimation->setTo(to); |
81 | 401 | contentYAnimationType = ContentYAnimationShowHeader; | 407 | contentYAnimationType = ContentYAnimationShowHeader; |
82 | @@ -544,6 +550,7 @@ | |||
83 | 544 | m_headerItem->setY(-m_minYExtent); | 550 | m_headerItem->setY(-m_minYExtent); |
84 | 545 | } | 551 | } |
85 | 546 | } | 552 | } |
86 | 553 | Q_EMIT headerItemShownHeightChanged(); | ||
87 | 547 | } else { | 554 | } else { |
88 | 548 | // Stick the header item to the top when dragging down | 555 | // Stick the header item to the top when dragging down |
89 | 549 | m_headerItem->setY(contentY()); | 556 | m_headerItem->setY(contentY()); |
90 | @@ -822,8 +829,8 @@ | |||
91 | 822 | ListItem *nextItem = itemAtIndex(modelIndex + 1); | 829 | ListItem *nextItem = itemAtIndex(modelIndex + 1); |
92 | 823 | if (nextItem) { | 830 | if (nextItem) { |
93 | 824 | listItem->setY(nextItem->y() - listItem->height()); | 831 | listItem->setY(nextItem->y() - listItem->height()); |
96 | 825 | } else if (modelIndex == 0 && m_headerItem) { | 832 | } else if (modelIndex == 0) { |
97 | 826 | listItem->setY(m_headerItem->height()); | 833 | listItem->setY(m_headerItem ? m_headerItem->height() : 0); |
98 | 827 | } else if (!m_visibleItems.isEmpty()) { | 834 | } else if (!m_visibleItems.isEmpty()) { |
99 | 828 | lostItem = true; | 835 | lostItem = true; |
100 | 829 | } | 836 | } |
101 | @@ -1096,6 +1103,7 @@ | |||
102 | 1096 | m_headerItemShownHeight = qBound(static_cast<qreal>(0.), m_headerItemShownHeight, newHeaderHeight); | 1103 | m_headerItemShownHeight = qBound(static_cast<qreal>(0.), m_headerItemShownHeight, newHeaderHeight); |
103 | 1097 | updateClipItem(); | 1104 | updateClipItem(); |
104 | 1098 | adjustMinYExtent(); | 1105 | adjustMinYExtent(); |
105 | 1106 | Q_EMIT headerItemShownHeightChanged(); | ||
106 | 1099 | } else { | 1107 | } else { |
107 | 1100 | if (oldHeaderY + oldHeaderHeight > contentY()) { | 1108 | if (oldHeaderY + oldHeaderHeight > contentY()) { |
108 | 1101 | // If the header is shown because its position | 1109 | // If the header is shown because its position |
109 | 1102 | 1110 | ||
110 | === modified file 'plugins/Dash/listviewwithpageheader.h' | |||
111 | --- plugins/Dash/listviewwithpageheader.h 2014-06-12 14:08:54 +0000 | |||
112 | +++ plugins/Dash/listviewwithpageheader.h 2014-08-08 20:44:52 +0000 | |||
113 | @@ -53,6 +53,7 @@ | |||
114 | 53 | Q_PROPERTY(QString sectionProperty READ sectionProperty WRITE setSectionProperty NOTIFY sectionPropertyChanged) | 53 | Q_PROPERTY(QString sectionProperty READ sectionProperty WRITE setSectionProperty NOTIFY sectionPropertyChanged) |
115 | 54 | Q_PROPERTY(bool forceNoClip READ forceNoClip WRITE setForceNoClip NOTIFY forceNoClipChanged) | 54 | Q_PROPERTY(bool forceNoClip READ forceNoClip WRITE setForceNoClip NOTIFY forceNoClipChanged) |
116 | 55 | Q_PROPERTY(int stickyHeaderHeight READ stickyHeaderHeight NOTIFY stickyHeaderHeightChanged) | 55 | Q_PROPERTY(int stickyHeaderHeight READ stickyHeaderHeight NOTIFY stickyHeaderHeightChanged) |
117 | 56 | Q_PROPERTY(qreal headerItemShownHeight READ headerItemShownHeight NOTIFY headerItemShownHeightChanged) | ||
118 | 56 | 57 | ||
119 | 57 | friend class ListViewWithPageHeaderTest; | 58 | friend class ListViewWithPageHeaderTest; |
120 | 58 | friend class ListViewWithPageHeaderTestSection; | 59 | friend class ListViewWithPageHeaderTestSection; |
121 | @@ -81,6 +82,7 @@ | |||
122 | 81 | void setForceNoClip(bool noClip); | 82 | void setForceNoClip(bool noClip); |
123 | 82 | 83 | ||
124 | 83 | int stickyHeaderHeight() const; | 84 | int stickyHeaderHeight() const; |
125 | 85 | qreal headerItemShownHeight() const; | ||
126 | 84 | 86 | ||
127 | 85 | Q_INVOKABLE void positionAtBeginning(); | 87 | Q_INVOKABLE void positionAtBeginning(); |
128 | 86 | Q_INVOKABLE void showHeader(); | 88 | Q_INVOKABLE void showHeader(); |
129 | @@ -100,6 +102,7 @@ | |||
130 | 100 | void sectionPropertyChanged(); | 102 | void sectionPropertyChanged(); |
131 | 101 | void forceNoClipChanged(); | 103 | void forceNoClipChanged(); |
132 | 102 | void stickyHeaderHeightChanged(); | 104 | void stickyHeaderHeightChanged(); |
133 | 105 | void headerItemShownHeightChanged(); | ||
134 | 103 | 106 | ||
135 | 104 | protected: | 107 | protected: |
136 | 105 | void componentComplete() override; | 108 | void componentComplete() override; |
137 | 106 | 109 | ||
138 | === modified file 'po/hu.po' | |||
139 | --- po/hu.po 2014-08-08 07:07:33 +0000 | |||
140 | +++ po/hu.po 2014-08-08 20:44:52 +0000 | |||
141 | @@ -6,11 +6,12 @@ | |||
142 | 6 | msgid "" | 6 | msgid "" |
143 | 7 | msgstr "" | 7 | msgstr "" |
144 | 8 | "Project-Id-Version: unity\n" | 8 | "Project-Id-Version: unity\n" |
147 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
148 | 10 | "POT-Creation-Date: 2014-07-11 14:59+0200\n" | 10 | "POT-Creation-Date: 2014-08-05 19:54+0200\n" |
149 | 11 | "PO-Revision-Date: 2014-08-06 07:41+0000\n" | 11 | "PO-Revision-Date: 2014-08-06 07:41+0000\n" |
150 | 12 | "Last-Translator: Richard Somlói <ricsipontaz@gmail.com>\n" | 12 | "Last-Translator: Richard Somlói <ricsipontaz@gmail.com>\n" |
151 | 13 | "Language-Team: Hungarian <hu@li.org>\n" | 13 | "Language-Team: Hungarian <hu@li.org>\n" |
152 | 14 | "Language: hu\n" | ||
153 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
154 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
155 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
156 | @@ -26,70 +27,86 @@ | |||
157 | 26 | msgid "Unpin shortcut" | 27 | msgid "Unpin shortcut" |
158 | 27 | msgstr "Indító feloldása" | 28 | msgstr "Indító feloldása" |
159 | 28 | 29 | ||
160 | 30 | #: qml/Components/Dialogs.qml:142 | ||
161 | 31 | msgid "Are you sure you would like to turn power off?" | ||
162 | 32 | msgstr "" | ||
163 | 33 | |||
164 | 34 | #: qml/Components/Dialogs.qml:144 | ||
165 | 35 | msgid "Power off" | ||
166 | 36 | msgstr "" | ||
167 | 37 | |||
168 | 38 | #: qml/Components/Dialogs.qml:153 | ||
169 | 39 | msgid "Restart" | ||
170 | 40 | msgstr "" | ||
171 | 41 | |||
172 | 42 | #: qml/Components/Dialogs.qml:162 | ||
173 | 43 | msgid "Cancel" | ||
174 | 44 | msgstr "" | ||
175 | 45 | |||
176 | 29 | #: qml/Components/EdgeDemoOverlay.qml:151 | 46 | #: qml/Components/EdgeDemoOverlay.qml:151 |
177 | 30 | msgid "Skip intro" | 47 | msgid "Skip intro" |
178 | 31 | msgstr "A bemutató kihagyása" | 48 | msgstr "A bemutató kihagyása" |
179 | 32 | 49 | ||
181 | 33 | #: qml/Components/EdgeDemo.qml:113 | 50 | #: qml/Components/EdgeDemo.qml:112 |
182 | 34 | msgid "Right edge" | 51 | msgid "Right edge" |
183 | 35 | msgstr "Jobb szél" | 52 | msgstr "Jobb szél" |
184 | 36 | 53 | ||
186 | 37 | #: qml/Components/EdgeDemo.qml:114 | 54 | #: qml/Components/EdgeDemo.qml:113 |
187 | 38 | msgid "Try swiping from the right edge to unlock the phone" | 55 | msgid "Try swiping from the right edge to unlock the phone" |
188 | 39 | msgstr "A telefon feloldásához csúsztassa ujját a jobb szélről" | 56 | msgstr "A telefon feloldásához csúsztassa ujját a jobb szélről" |
189 | 40 | 57 | ||
191 | 41 | #: qml/Components/EdgeDemo.qml:145 | 58 | #: qml/Components/EdgeDemo.qml:144 |
192 | 42 | msgid "Top edge" | 59 | msgid "Top edge" |
193 | 43 | msgstr "Felső szél" | 60 | msgstr "Felső szél" |
194 | 44 | 61 | ||
196 | 45 | #: qml/Components/EdgeDemo.qml:146 | 62 | #: qml/Components/EdgeDemo.qml:145 |
197 | 46 | msgid "Try swiping from the top edge to access the indicators" | 63 | msgid "Try swiping from the top edge to access the indicators" |
198 | 47 | msgstr "Az állapotmenük eléréséhez csúsztassa ujját a felső szélről" | 64 | msgstr "Az állapotmenük eléréséhez csúsztassa ujját a felső szélről" |
199 | 48 | 65 | ||
201 | 49 | #: qml/Components/EdgeDemo.qml:171 | 66 | #: qml/Components/EdgeDemo.qml:170 |
202 | 50 | msgid "Close" | 67 | msgid "Close" |
203 | 51 | msgstr "Bezárás" | 68 | msgstr "Bezárás" |
204 | 52 | 69 | ||
206 | 53 | #: qml/Components/EdgeDemo.qml:172 | 70 | #: qml/Components/EdgeDemo.qml:171 |
207 | 54 | msgid "Swipe up again to close the settings screen" | 71 | msgid "Swipe up again to close the settings screen" |
208 | 55 | msgstr "A beállítások bezárásához csúsztassa ujját újra felfelé" | 72 | msgstr "A beállítások bezárásához csúsztassa ujját újra felfelé" |
209 | 56 | 73 | ||
211 | 57 | #: qml/Components/EdgeDemo.qml:199 | 74 | #: qml/Components/EdgeDemo.qml:198 |
212 | 58 | msgid "Left edge" | 75 | msgid "Left edge" |
213 | 59 | msgstr "Bal szél" | 76 | msgstr "Bal szél" |
214 | 60 | 77 | ||
216 | 61 | #: qml/Components/EdgeDemo.qml:200 | 78 | #: qml/Components/EdgeDemo.qml:199 |
217 | 62 | msgid "Swipe from the left to reveal the launcher for quick access to apps" | 79 | msgid "Swipe from the left to reveal the launcher for quick access to apps" |
218 | 63 | msgstr "" | 80 | msgstr "" |
219 | 64 | "Csúsztassa ujját a bal szélről az indítón található alkalmazások gyors " | 81 | "Csúsztassa ujját a bal szélről az indítón található alkalmazások gyors " |
220 | 65 | "eléréséhez" | 82 | "eléréséhez" |
221 | 66 | 83 | ||
223 | 67 | #: qml/Components/EdgeDemo.qml:227 | 84 | #: qml/Components/EdgeDemo.qml:226 |
224 | 68 | msgid "Well done" | 85 | msgid "Well done" |
225 | 69 | msgstr "Rendben" | 86 | msgstr "Rendben" |
226 | 70 | 87 | ||
228 | 71 | #: qml/Components/EdgeDemo.qml:228 | 88 | #: qml/Components/EdgeDemo.qml:227 |
229 | 72 | msgid "" | 89 | msgid "" |
230 | 73 | "You have now mastered the edge gestures and can start using the " | 90 | "You have now mastered the edge gestures and can start using the " |
231 | 74 | "phone<br><br>Tap on the screen to start" | 91 | "phone<br><br>Tap on the screen to start" |
232 | 75 | msgstr "" | 92 | msgstr "" |
235 | 76 | "Elsajátította a gesztusokat, és megkezdheti a telefon " | 93 | "Elsajátította a gesztusokat, és megkezdheti a telefon használatát." |
236 | 77 | "használatát.<br><br>Koppintson a képernyőre a kezdéshez." | 94 | "<br><br>Koppintson a képernyőre a kezdéshez." |
237 | 78 | 95 | ||
239 | 79 | #: qml/Components/Lockscreen.qml:214 | 96 | #: qml/Components/Lockscreen.qml:220 |
240 | 80 | msgid "Emergency Call" | 97 | msgid "Emergency Call" |
241 | 81 | msgstr "Vészhívás" | 98 | msgstr "Vészhívás" |
242 | 82 | 99 | ||
244 | 83 | #: qml/Components/Lockscreen.qml:231 | 100 | #: qml/Components/Lockscreen.qml:243 |
245 | 84 | msgid "OK" | 101 | msgid "OK" |
246 | 85 | msgstr "Ok" | 102 | msgstr "Ok" |
247 | 86 | 103 | ||
249 | 87 | #: qml/Components/PassphraseLockscreen.qml:60 | 104 | #: qml/Components/PassphraseLockscreen.qml:62 |
250 | 88 | #, qt-format | 105 | #, qt-format |
251 | 89 | msgid "Hello %1" | 106 | msgid "Hello %1" |
252 | 90 | msgstr "Üdv %1" | 107 | msgstr "Üdv %1" |
253 | 91 | 108 | ||
255 | 92 | #: qml/Components/PassphraseLockscreen.qml:60 | 109 | #: qml/Components/PassphraseLockscreen.qml:62 |
256 | 93 | msgid "Hello" | 110 | msgid "Hello" |
257 | 94 | msgstr "Üdvözöljük" | 111 | msgstr "Üdvözöljük" |
258 | 95 | 112 | ||
259 | @@ -105,15 +122,11 @@ | |||
260 | 105 | msgid "See more" | 122 | msgid "See more" |
261 | 106 | msgstr "Több" | 123 | msgstr "Több" |
262 | 107 | 124 | ||
264 | 108 | #: qml/Components/SeeMore.qml:58 qml/Dash/GenericScopeView.qml:330 | 125 | #: qml/Components/SeeMore.qml:58 qml/Dash/GenericScopeView.qml:354 |
265 | 109 | msgid "See less" | 126 | msgid "See less" |
266 | 110 | msgstr "Kevesebb" | 127 | msgstr "Kevesebb" |
267 | 111 | 128 | ||
273 | 112 | #: qml/Dash/DashApps.qml:37 | 129 | #: qml/Dash/GenericScopeView.qml:354 |
269 | 113 | msgid "Recent" | ||
270 | 114 | msgstr "Legutóbbi" | ||
271 | 115 | |||
272 | 116 | #: qml/Dash/GenericScopeView.qml:330 | ||
274 | 117 | msgid "See all" | 130 | msgid "See all" |
275 | 118 | msgstr "Összes megtekintése" | 131 | msgstr "Összes megtekintése" |
276 | 119 | 132 | ||
277 | @@ -137,6 +150,26 @@ | |||
278 | 137 | msgid "Send" | 150 | msgid "Send" |
279 | 138 | msgstr "Küldés" | 151 | msgstr "Küldés" |
280 | 139 | 152 | ||
281 | 153 | #: qml/Dash/ScopesOverview.qml:187 | ||
282 | 154 | msgid "Manage Dash" | ||
283 | 155 | msgstr "" | ||
284 | 156 | |||
285 | 157 | #: qml/Dash/ScopesOverview.qml:392 | ||
286 | 158 | msgid "Done" | ||
287 | 159 | msgstr "" | ||
288 | 160 | |||
289 | 161 | #: qml/Dash/ScopesOverview.qml:418 | ||
290 | 162 | msgid "Store" | ||
291 | 163 | msgstr "" | ||
292 | 164 | |||
293 | 165 | #: qml/Dash/ScopesOverviewTab.qml:36 | ||
294 | 166 | msgid "Favorites" | ||
295 | 167 | msgstr "" | ||
296 | 168 | |||
297 | 169 | #: qml/Dash/ScopesOverviewTab.qml:54 | ||
298 | 170 | msgid "All" | ||
299 | 171 | msgstr "" | ||
300 | 172 | |||
301 | 140 | #: qml/Greeter/Greeter.qml:157 | 173 | #: qml/Greeter/Greeter.qml:157 |
302 | 141 | msgid "Swipe to unlock" | 174 | msgid "Swipe to unlock" |
303 | 142 | msgstr "Csúsztasson a feloldáshoz" | 175 | msgstr "Csúsztasson a feloldáshoz" |
304 | @@ -161,11 +194,11 @@ | |||
305 | 161 | msgid "Speaking..." | 194 | msgid "Speaking..." |
306 | 162 | msgstr "Beszéd…" | 195 | msgstr "Beszéd…" |
307 | 163 | 196 | ||
309 | 164 | #: qml/Notifications/NotificationMenuItemFactory.qml:91 | 197 | #: qml/Notifications/NotificationMenuItemFactory.qml:97 |
310 | 165 | msgid "Show password" | 198 | msgid "Show password" |
311 | 166 | msgstr "Jelszó megjelenítése" | 199 | msgstr "Jelszó megjelenítése" |
312 | 167 | 200 | ||
314 | 168 | #: qml/Notifications/NotificationMenuItemFactory.qml:103 | 201 | #: qml/Notifications/NotificationMenuItemFactory.qml:112 |
315 | 169 | msgid "Please enter SIM PIN" | 202 | msgid "Please enter SIM PIN" |
316 | 170 | msgstr "Adja meg a SIM PIN kódját" | 203 | msgstr "Adja meg a SIM PIN kódját" |
317 | 171 | 204 | ||
318 | @@ -177,27 +210,27 @@ | |||
319 | 177 | msgid "Conference" | 210 | msgid "Conference" |
320 | 178 | msgstr "Konferencia" | 211 | msgstr "Konferencia" |
321 | 179 | 212 | ||
323 | 180 | #: qml/Panel/Indicators/MenuItemFactory.qml:583 | 213 | #: qml/Panel/Indicators/MenuItemFactory.qml:577 |
324 | 181 | msgid "In queue…" | 214 | msgid "In queue…" |
325 | 182 | msgstr "Sorban…" | 215 | msgstr "Sorban…" |
326 | 183 | 216 | ||
328 | 184 | #: qml/Panel/Indicators/MenuItemFactory.qml:587 | 217 | #: qml/Panel/Indicators/MenuItemFactory.qml:581 |
329 | 185 | msgid "Downloading" | 218 | msgid "Downloading" |
330 | 186 | msgstr "Letöltés" | 219 | msgstr "Letöltés" |
331 | 187 | 220 | ||
333 | 188 | #: qml/Panel/Indicators/MenuItemFactory.qml:589 | 221 | #: qml/Panel/Indicators/MenuItemFactory.qml:583 |
334 | 189 | msgid "Paused, tap to resume" | 222 | msgid "Paused, tap to resume" |
335 | 190 | msgstr "Szüneteltetve, koppintson a folytatáshoz" | 223 | msgstr "Szüneteltetve, koppintson a folytatáshoz" |
336 | 191 | 224 | ||
338 | 192 | #: qml/Panel/Indicators/MenuItemFactory.qml:591 | 225 | #: qml/Panel/Indicators/MenuItemFactory.qml:585 |
339 | 193 | msgid "Canceled" | 226 | msgid "Canceled" |
340 | 194 | msgstr "Megszakítva" | 227 | msgstr "Megszakítva" |
341 | 195 | 228 | ||
343 | 196 | #: qml/Panel/Indicators/MenuItemFactory.qml:593 | 229 | #: qml/Panel/Indicators/MenuItemFactory.qml:587 |
344 | 197 | msgid "Finished" | 230 | msgid "Finished" |
345 | 198 | msgstr "Befejeződött" | 231 | msgstr "Befejeződött" |
346 | 199 | 232 | ||
348 | 200 | #: qml/Panel/Indicators/MenuItemFactory.qml:595 | 233 | #: qml/Panel/Indicators/MenuItemFactory.qml:589 |
349 | 201 | msgid "Failed, tap to retry" | 234 | msgid "Failed, tap to retry" |
350 | 202 | msgstr "Sikertelen, koppintson az újrapróbáláshoz" | 235 | msgstr "Sikertelen, koppintson az újrapróbáláshoz" |
351 | 203 | 236 | ||
352 | @@ -205,7 +238,10 @@ | |||
353 | 205 | msgid "Search" | 238 | msgid "Search" |
354 | 206 | msgstr "Keresés" | 239 | msgstr "Keresés" |
355 | 207 | 240 | ||
357 | 208 | #: qml/Shell.qml:359 | 241 | #: qml/Shell.qml:256 |
358 | 209 | #, qt-format | 242 | #, qt-format |
359 | 210 | msgid "Please enter %1" | 243 | msgid "Please enter %1" |
360 | 211 | msgstr "Adja meg a következőt: %1" | 244 | msgstr "Adja meg a következőt: %1" |
361 | 245 | |||
362 | 246 | #~ msgid "Recent" | ||
363 | 247 | #~ msgstr "Legutóbbi" | ||
364 | 212 | 248 | ||
365 | === modified file 'po/sl.po' | |||
366 | --- po/sl.po 2014-08-08 07:07:33 +0000 | |||
367 | +++ po/sl.po 2014-08-08 20:44:52 +0000 | |||
368 | @@ -6,11 +6,12 @@ | |||
369 | 6 | msgid "" | 6 | msgid "" |
370 | 7 | msgstr "" | 7 | msgstr "" |
371 | 8 | "Project-Id-Version: unity\n" | 8 | "Project-Id-Version: unity\n" |
374 | 9 | "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" | 9 | "Report-Msgid-Bugs-To: \n" |
375 | 10 | "POT-Creation-Date: 2014-07-11 14:59+0200\n" | 10 | "POT-Creation-Date: 2014-08-05 19:54+0200\n" |
376 | 11 | "PO-Revision-Date: 2014-08-06 06:11+0000\n" | 11 | "PO-Revision-Date: 2014-08-06 06:11+0000\n" |
377 | 12 | "Last-Translator: Damir Jerovšek <Unknown>\n" | 12 | "Last-Translator: Damir Jerovšek <Unknown>\n" |
378 | 13 | "Language-Team: Slovenian <sl@li.org>\n" | 13 | "Language-Team: Slovenian <sl@li.org>\n" |
379 | 14 | "Language: sl\n" | ||
380 | 14 | "MIME-Version: 1.0\n" | 15 | "MIME-Version: 1.0\n" |
381 | 15 | "Content-Type: text/plain; charset=UTF-8\n" | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
382 | 16 | "Content-Transfer-Encoding: 8bit\n" | 17 | "Content-Transfer-Encoding: 8bit\n" |
383 | @@ -26,49 +27,65 @@ | |||
384 | 26 | msgid "Unpin shortcut" | 27 | msgid "Unpin shortcut" |
385 | 27 | msgstr "Odpni bližnjico" | 28 | msgstr "Odpni bližnjico" |
386 | 28 | 29 | ||
387 | 30 | #: qml/Components/Dialogs.qml:142 | ||
388 | 31 | msgid "Are you sure you would like to turn power off?" | ||
389 | 32 | msgstr "" | ||
390 | 33 | |||
391 | 34 | #: qml/Components/Dialogs.qml:144 | ||
392 | 35 | msgid "Power off" | ||
393 | 36 | msgstr "" | ||
394 | 37 | |||
395 | 38 | #: qml/Components/Dialogs.qml:153 | ||
396 | 39 | msgid "Restart" | ||
397 | 40 | msgstr "" | ||
398 | 41 | |||
399 | 42 | #: qml/Components/Dialogs.qml:162 | ||
400 | 43 | msgid "Cancel" | ||
401 | 44 | msgstr "" | ||
402 | 45 | |||
403 | 29 | #: qml/Components/EdgeDemoOverlay.qml:151 | 46 | #: qml/Components/EdgeDemoOverlay.qml:151 |
404 | 30 | msgid "Skip intro" | 47 | msgid "Skip intro" |
405 | 31 | msgstr "Preskoči uvod" | 48 | msgstr "Preskoči uvod" |
406 | 32 | 49 | ||
408 | 33 | #: qml/Components/EdgeDemo.qml:113 | 50 | #: qml/Components/EdgeDemo.qml:112 |
409 | 34 | msgid "Right edge" | 51 | msgid "Right edge" |
410 | 35 | msgstr "Desni rob" | 52 | msgstr "Desni rob" |
411 | 36 | 53 | ||
413 | 37 | #: qml/Components/EdgeDemo.qml:114 | 54 | #: qml/Components/EdgeDemo.qml:113 |
414 | 38 | msgid "Try swiping from the right edge to unlock the phone" | 55 | msgid "Try swiping from the right edge to unlock the phone" |
415 | 39 | msgstr "Poskusite povleči od desnega roba za odklep telefona" | 56 | msgstr "Poskusite povleči od desnega roba za odklep telefona" |
416 | 40 | 57 | ||
418 | 41 | #: qml/Components/EdgeDemo.qml:145 | 58 | #: qml/Components/EdgeDemo.qml:144 |
419 | 42 | msgid "Top edge" | 59 | msgid "Top edge" |
420 | 43 | msgstr "Zgornji rob" | 60 | msgstr "Zgornji rob" |
421 | 44 | 61 | ||
423 | 45 | #: qml/Components/EdgeDemo.qml:146 | 62 | #: qml/Components/EdgeDemo.qml:145 |
424 | 46 | msgid "Try swiping from the top edge to access the indicators" | 63 | msgid "Try swiping from the top edge to access the indicators" |
425 | 47 | msgstr "Poskusite povleči od zgornjega roba za dostop do kazalnikov" | 64 | msgstr "Poskusite povleči od zgornjega roba za dostop do kazalnikov" |
426 | 48 | 65 | ||
428 | 49 | #: qml/Components/EdgeDemo.qml:171 | 66 | #: qml/Components/EdgeDemo.qml:170 |
429 | 50 | msgid "Close" | 67 | msgid "Close" |
430 | 51 | msgstr "Zapri" | 68 | msgstr "Zapri" |
431 | 52 | 69 | ||
433 | 53 | #: qml/Components/EdgeDemo.qml:172 | 70 | #: qml/Components/EdgeDemo.qml:171 |
434 | 54 | msgid "Swipe up again to close the settings screen" | 71 | msgid "Swipe up again to close the settings screen" |
435 | 55 | msgstr "Povlecite ponovno navzgor za zaprtje zaslona z nastavitvami" | 72 | msgstr "Povlecite ponovno navzgor za zaprtje zaslona z nastavitvami" |
436 | 56 | 73 | ||
438 | 57 | #: qml/Components/EdgeDemo.qml:199 | 74 | #: qml/Components/EdgeDemo.qml:198 |
439 | 58 | msgid "Left edge" | 75 | msgid "Left edge" |
440 | 59 | msgstr "Levi rob" | 76 | msgstr "Levi rob" |
441 | 60 | 77 | ||
443 | 61 | #: qml/Components/EdgeDemo.qml:200 | 78 | #: qml/Components/EdgeDemo.qml:199 |
444 | 62 | msgid "Swipe from the left to reveal the launcher for quick access to apps" | 79 | msgid "Swipe from the left to reveal the launcher for quick access to apps" |
445 | 63 | msgstr "" | 80 | msgstr "" |
446 | 64 | "Poskusite povleči od leve za razkritje zaganjalnika za hiter dostop do " | 81 | "Poskusite povleči od leve za razkritje zaganjalnika za hiter dostop do " |
447 | 65 | "programov" | 82 | "programov" |
448 | 66 | 83 | ||
450 | 67 | #: qml/Components/EdgeDemo.qml:227 | 84 | #: qml/Components/EdgeDemo.qml:226 |
451 | 68 | msgid "Well done" | 85 | msgid "Well done" |
452 | 69 | msgstr "Odlično" | 86 | msgstr "Odlično" |
453 | 70 | 87 | ||
455 | 71 | #: qml/Components/EdgeDemo.qml:228 | 88 | #: qml/Components/EdgeDemo.qml:227 |
456 | 72 | msgid "" | 89 | msgid "" |
457 | 73 | "You have now mastered the edge gestures and can start using the " | 90 | "You have now mastered the edge gestures and can start using the " |
458 | 74 | "phone<br><br>Tap on the screen to start" | 91 | "phone<br><br>Tap on the screen to start" |
459 | @@ -76,20 +93,20 @@ | |||
460 | 76 | "Sedaj, ko ste osvojili poteze robov, lahko začnete uporabljati " | 93 | "Sedaj, ko ste osvojili poteze robov, lahko začnete uporabljati " |
461 | 77 | "telefon<br><br>Tapnite na zaslon za začetek" | 94 | "telefon<br><br>Tapnite na zaslon za začetek" |
462 | 78 | 95 | ||
464 | 79 | #: qml/Components/Lockscreen.qml:214 | 96 | #: qml/Components/Lockscreen.qml:220 |
465 | 80 | msgid "Emergency Call" | 97 | msgid "Emergency Call" |
466 | 81 | msgstr "Klic v sili" | 98 | msgstr "Klic v sili" |
467 | 82 | 99 | ||
469 | 83 | #: qml/Components/Lockscreen.qml:231 | 100 | #: qml/Components/Lockscreen.qml:243 |
470 | 84 | msgid "OK" | 101 | msgid "OK" |
471 | 85 | msgstr "V REDU" | 102 | msgstr "V REDU" |
472 | 86 | 103 | ||
474 | 87 | #: qml/Components/PassphraseLockscreen.qml:60 | 104 | #: qml/Components/PassphraseLockscreen.qml:62 |
475 | 88 | #, qt-format | 105 | #, qt-format |
476 | 89 | msgid "Hello %1" | 106 | msgid "Hello %1" |
477 | 90 | msgstr "Pozdravljeni, %1" | 107 | msgstr "Pozdravljeni, %1" |
478 | 91 | 108 | ||
480 | 92 | #: qml/Components/PassphraseLockscreen.qml:60 | 109 | #: qml/Components/PassphraseLockscreen.qml:62 |
481 | 93 | msgid "Hello" | 110 | msgid "Hello" |
482 | 94 | msgstr "Pozdravljeni" | 111 | msgstr "Pozdravljeni" |
483 | 95 | 112 | ||
484 | @@ -105,15 +122,11 @@ | |||
485 | 105 | msgid "See more" | 122 | msgid "See more" |
486 | 106 | msgstr "Pokaži več" | 123 | msgstr "Pokaži več" |
487 | 107 | 124 | ||
489 | 108 | #: qml/Components/SeeMore.qml:58 qml/Dash/GenericScopeView.qml:330 | 125 | #: qml/Components/SeeMore.qml:58 qml/Dash/GenericScopeView.qml:354 |
490 | 109 | msgid "See less" | 126 | msgid "See less" |
491 | 110 | msgstr "Pokaži manj" | 127 | msgstr "Pokaži manj" |
492 | 111 | 128 | ||
498 | 112 | #: qml/Dash/DashApps.qml:37 | 129 | #: qml/Dash/GenericScopeView.qml:354 |
494 | 113 | msgid "Recent" | ||
495 | 114 | msgstr "Nedavno" | ||
496 | 115 | |||
497 | 116 | #: qml/Dash/GenericScopeView.qml:330 | ||
499 | 117 | msgid "See all" | 130 | msgid "See all" |
500 | 118 | msgstr "Ogled vsega" | 131 | msgstr "Ogled vsega" |
501 | 119 | 132 | ||
502 | @@ -137,6 +150,26 @@ | |||
503 | 137 | msgid "Send" | 150 | msgid "Send" |
504 | 138 | msgstr "Pošlji" | 151 | msgstr "Pošlji" |
505 | 139 | 152 | ||
506 | 153 | #: qml/Dash/ScopesOverview.qml:187 | ||
507 | 154 | msgid "Manage Dash" | ||
508 | 155 | msgstr "" | ||
509 | 156 | |||
510 | 157 | #: qml/Dash/ScopesOverview.qml:392 | ||
511 | 158 | msgid "Done" | ||
512 | 159 | msgstr "" | ||
513 | 160 | |||
514 | 161 | #: qml/Dash/ScopesOverview.qml:418 | ||
515 | 162 | msgid "Store" | ||
516 | 163 | msgstr "" | ||
517 | 164 | |||
518 | 165 | #: qml/Dash/ScopesOverviewTab.qml:36 | ||
519 | 166 | msgid "Favorites" | ||
520 | 167 | msgstr "" | ||
521 | 168 | |||
522 | 169 | #: qml/Dash/ScopesOverviewTab.qml:54 | ||
523 | 170 | msgid "All" | ||
524 | 171 | msgstr "" | ||
525 | 172 | |||
526 | 140 | #: qml/Greeter/Greeter.qml:157 | 173 | #: qml/Greeter/Greeter.qml:157 |
527 | 141 | msgid "Swipe to unlock" | 174 | msgid "Swipe to unlock" |
528 | 142 | msgstr "Podrsajte za odklenitev" | 175 | msgstr "Podrsajte za odklenitev" |
529 | @@ -161,11 +194,11 @@ | |||
530 | 161 | msgid "Speaking..." | 194 | msgid "Speaking..." |
531 | 162 | msgstr "Govorjenje ..." | 195 | msgstr "Govorjenje ..." |
532 | 163 | 196 | ||
534 | 164 | #: qml/Notifications/NotificationMenuItemFactory.qml:91 | 197 | #: qml/Notifications/NotificationMenuItemFactory.qml:97 |
535 | 165 | msgid "Show password" | 198 | msgid "Show password" |
536 | 166 | msgstr "Pokaži geslo" | 199 | msgstr "Pokaži geslo" |
537 | 167 | 200 | ||
539 | 168 | #: qml/Notifications/NotificationMenuItemFactory.qml:103 | 201 | #: qml/Notifications/NotificationMenuItemFactory.qml:112 |
540 | 169 | msgid "Please enter SIM PIN" | 202 | msgid "Please enter SIM PIN" |
541 | 170 | msgstr "Vnesite PIN kartice SIM" | 203 | msgstr "Vnesite PIN kartice SIM" |
542 | 171 | 204 | ||
543 | @@ -177,27 +210,27 @@ | |||
544 | 177 | msgid "Conference" | 210 | msgid "Conference" |
545 | 178 | msgstr "Konferenca" | 211 | msgstr "Konferenca" |
546 | 179 | 212 | ||
548 | 180 | #: qml/Panel/Indicators/MenuItemFactory.qml:583 | 213 | #: qml/Panel/Indicators/MenuItemFactory.qml:577 |
549 | 181 | msgid "In queue…" | 214 | msgid "In queue…" |
550 | 182 | msgstr "V vrsti ..." | 215 | msgstr "V vrsti ..." |
551 | 183 | 216 | ||
553 | 184 | #: qml/Panel/Indicators/MenuItemFactory.qml:587 | 217 | #: qml/Panel/Indicators/MenuItemFactory.qml:581 |
554 | 185 | msgid "Downloading" | 218 | msgid "Downloading" |
555 | 186 | msgstr "Prejemanje" | 219 | msgstr "Prejemanje" |
556 | 187 | 220 | ||
558 | 188 | #: qml/Panel/Indicators/MenuItemFactory.qml:589 | 221 | #: qml/Panel/Indicators/MenuItemFactory.qml:583 |
559 | 189 | msgid "Paused, tap to resume" | 222 | msgid "Paused, tap to resume" |
560 | 190 | msgstr "Premor, tapnite za nadaljevanje" | 223 | msgstr "Premor, tapnite za nadaljevanje" |
561 | 191 | 224 | ||
563 | 192 | #: qml/Panel/Indicators/MenuItemFactory.qml:591 | 225 | #: qml/Panel/Indicators/MenuItemFactory.qml:585 |
564 | 193 | msgid "Canceled" | 226 | msgid "Canceled" |
565 | 194 | msgstr "Preklicano" | 227 | msgstr "Preklicano" |
566 | 195 | 228 | ||
568 | 196 | #: qml/Panel/Indicators/MenuItemFactory.qml:593 | 229 | #: qml/Panel/Indicators/MenuItemFactory.qml:587 |
569 | 197 | msgid "Finished" | 230 | msgid "Finished" |
570 | 198 | msgstr "Končano" | 231 | msgstr "Končano" |
571 | 199 | 232 | ||
573 | 200 | #: qml/Panel/Indicators/MenuItemFactory.qml:595 | 233 | #: qml/Panel/Indicators/MenuItemFactory.qml:589 |
574 | 201 | msgid "Failed, tap to retry" | 234 | msgid "Failed, tap to retry" |
575 | 202 | msgstr "Spodletelo, tapnite za ponovni poskus" | 235 | msgstr "Spodletelo, tapnite za ponovni poskus" |
576 | 203 | 236 | ||
577 | @@ -205,7 +238,10 @@ | |||
578 | 205 | msgid "Search" | 238 | msgid "Search" |
579 | 206 | msgstr "Iskanje" | 239 | msgstr "Iskanje" |
580 | 207 | 240 | ||
582 | 208 | #: qml/Shell.qml:359 | 241 | #: qml/Shell.qml:256 |
583 | 209 | #, qt-format | 242 | #, qt-format |
584 | 210 | msgid "Please enter %1" | 243 | msgid "Please enter %1" |
585 | 211 | msgstr "Vnesite %1" | 244 | msgstr "Vnesite %1" |
586 | 245 | |||
587 | 246 | #~ msgid "Recent" | ||
588 | 247 | #~ msgstr "Nedavno" | ||
589 | 212 | 248 | ||
590 | === modified file 'po/unity8.pot' | |||
591 | --- po/unity8.pot 2014-07-11 14:20:12 +0000 | |||
592 | +++ po/unity8.pot 2014-08-08 20:44:52 +0000 | |||
593 | @@ -8,7 +8,7 @@ | |||
594 | 8 | msgstr "" | 8 | msgstr "" |
595 | 9 | "Project-Id-Version: unity8\n" | 9 | "Project-Id-Version: unity8\n" |
596 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
598 | 11 | "POT-Creation-Date: 2014-07-11 14:59+0200\n" | 11 | "POT-Creation-Date: 2014-08-08 11:17+0200\n" |
599 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
600 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
601 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
602 | @@ -26,66 +26,82 @@ | |||
603 | 26 | msgid "Unpin shortcut" | 26 | msgid "Unpin shortcut" |
604 | 27 | msgstr "" | 27 | msgstr "" |
605 | 28 | 28 | ||
606 | 29 | #: qml/Components/Dialogs.qml:142 | ||
607 | 30 | msgid "Are you sure you would like to turn power off?" | ||
608 | 31 | msgstr "" | ||
609 | 32 | |||
610 | 33 | #: qml/Components/Dialogs.qml:144 | ||
611 | 34 | msgid "Power off" | ||
612 | 35 | msgstr "" | ||
613 | 36 | |||
614 | 37 | #: qml/Components/Dialogs.qml:153 | ||
615 | 38 | msgid "Restart" | ||
616 | 39 | msgstr "" | ||
617 | 40 | |||
618 | 41 | #: qml/Components/Dialogs.qml:162 | ||
619 | 42 | msgid "Cancel" | ||
620 | 43 | msgstr "" | ||
621 | 44 | |||
622 | 29 | #: qml/Components/EdgeDemoOverlay.qml:151 | 45 | #: qml/Components/EdgeDemoOverlay.qml:151 |
623 | 30 | msgid "Skip intro" | 46 | msgid "Skip intro" |
624 | 31 | msgstr "" | 47 | msgstr "" |
625 | 32 | 48 | ||
626 | 49 | #: qml/Components/EdgeDemo.qml:112 | ||
627 | 50 | msgid "Right edge" | ||
628 | 51 | msgstr "" | ||
629 | 52 | |||
630 | 33 | #: qml/Components/EdgeDemo.qml:113 | 53 | #: qml/Components/EdgeDemo.qml:113 |
631 | 34 | msgid "Right edge" | ||
632 | 35 | msgstr "" | ||
633 | 36 | |||
634 | 37 | #: qml/Components/EdgeDemo.qml:114 | ||
635 | 38 | msgid "Try swiping from the right edge to unlock the phone" | 54 | msgid "Try swiping from the right edge to unlock the phone" |
636 | 39 | msgstr "" | 55 | msgstr "" |
637 | 40 | 56 | ||
638 | 57 | #: qml/Components/EdgeDemo.qml:144 | ||
639 | 58 | msgid "Top edge" | ||
640 | 59 | msgstr "" | ||
641 | 60 | |||
642 | 41 | #: qml/Components/EdgeDemo.qml:145 | 61 | #: qml/Components/EdgeDemo.qml:145 |
643 | 42 | msgid "Top edge" | ||
644 | 43 | msgstr "" | ||
645 | 44 | |||
646 | 45 | #: qml/Components/EdgeDemo.qml:146 | ||
647 | 46 | msgid "Try swiping from the top edge to access the indicators" | 62 | msgid "Try swiping from the top edge to access the indicators" |
648 | 47 | msgstr "" | 63 | msgstr "" |
649 | 48 | 64 | ||
650 | 65 | #: qml/Components/EdgeDemo.qml:170 | ||
651 | 66 | msgid "Close" | ||
652 | 67 | msgstr "" | ||
653 | 68 | |||
654 | 49 | #: qml/Components/EdgeDemo.qml:171 | 69 | #: qml/Components/EdgeDemo.qml:171 |
655 | 50 | msgid "Close" | ||
656 | 51 | msgstr "" | ||
657 | 52 | |||
658 | 53 | #: qml/Components/EdgeDemo.qml:172 | ||
659 | 54 | msgid "Swipe up again to close the settings screen" | 70 | msgid "Swipe up again to close the settings screen" |
660 | 55 | msgstr "" | 71 | msgstr "" |
661 | 56 | 72 | ||
662 | 73 | #: qml/Components/EdgeDemo.qml:198 | ||
663 | 74 | msgid "Left edge" | ||
664 | 75 | msgstr "" | ||
665 | 76 | |||
666 | 57 | #: qml/Components/EdgeDemo.qml:199 | 77 | #: qml/Components/EdgeDemo.qml:199 |
667 | 58 | msgid "Left edge" | ||
668 | 59 | msgstr "" | ||
669 | 60 | |||
670 | 61 | #: qml/Components/EdgeDemo.qml:200 | ||
671 | 62 | msgid "Swipe from the left to reveal the launcher for quick access to apps" | 78 | msgid "Swipe from the left to reveal the launcher for quick access to apps" |
672 | 63 | msgstr "" | 79 | msgstr "" |
673 | 64 | 80 | ||
674 | 81 | #: qml/Components/EdgeDemo.qml:226 | ||
675 | 82 | msgid "Well done" | ||
676 | 83 | msgstr "" | ||
677 | 84 | |||
678 | 65 | #: qml/Components/EdgeDemo.qml:227 | 85 | #: qml/Components/EdgeDemo.qml:227 |
679 | 66 | msgid "Well done" | ||
680 | 67 | msgstr "" | ||
681 | 68 | |||
682 | 69 | #: qml/Components/EdgeDemo.qml:228 | ||
683 | 70 | msgid "" | 86 | msgid "" |
684 | 71 | "You have now mastered the edge gestures and can start using the " | 87 | "You have now mastered the edge gestures and can start using the " |
685 | 72 | "phone<br><br>Tap on the screen to start" | 88 | "phone<br><br>Tap on the screen to start" |
686 | 73 | msgstr "" | 89 | msgstr "" |
687 | 74 | 90 | ||
689 | 75 | #: qml/Components/Lockscreen.qml:214 | 91 | #: qml/Components/Lockscreen.qml:220 |
690 | 76 | msgid "Emergency Call" | 92 | msgid "Emergency Call" |
691 | 77 | msgstr "" | 93 | msgstr "" |
692 | 78 | 94 | ||
694 | 79 | #: qml/Components/Lockscreen.qml:231 | 95 | #: qml/Components/Lockscreen.qml:243 |
695 | 80 | msgid "OK" | 96 | msgid "OK" |
696 | 81 | msgstr "" | 97 | msgstr "" |
697 | 82 | 98 | ||
699 | 83 | #: qml/Components/PassphraseLockscreen.qml:60 | 99 | #: qml/Components/PassphraseLockscreen.qml:62 |
700 | 84 | #, qt-format | 100 | #, qt-format |
701 | 85 | msgid "Hello %1" | 101 | msgid "Hello %1" |
702 | 86 | msgstr "" | 102 | msgstr "" |
703 | 87 | 103 | ||
705 | 88 | #: qml/Components/PassphraseLockscreen.qml:60 | 104 | #: qml/Components/PassphraseLockscreen.qml:62 |
706 | 89 | msgid "Hello" | 105 | msgid "Hello" |
707 | 90 | msgstr "" | 106 | msgstr "" |
708 | 91 | 107 | ||
709 | @@ -97,19 +113,11 @@ | |||
710 | 97 | msgid "DONE" | 113 | msgid "DONE" |
711 | 98 | msgstr "" | 114 | msgstr "" |
712 | 99 | 115 | ||
718 | 100 | #: qml/Components/SeeMore.qml:35 | 116 | #: qml/Dash/GenericScopeView.qml:358 |
714 | 101 | msgid "See more" | ||
715 | 102 | msgstr "" | ||
716 | 103 | |||
717 | 104 | #: qml/Components/SeeMore.qml:58 qml/Dash/GenericScopeView.qml:330 | ||
719 | 105 | msgid "See less" | 117 | msgid "See less" |
720 | 106 | msgstr "" | 118 | msgstr "" |
721 | 107 | 119 | ||
727 | 108 | #: qml/Dash/DashApps.qml:37 | 120 | #: qml/Dash/GenericScopeView.qml:358 |
723 | 109 | msgid "Recent" | ||
724 | 110 | msgstr "" | ||
725 | 111 | |||
726 | 112 | #: qml/Dash/GenericScopeView.qml:330 | ||
728 | 113 | msgid "See all" | 121 | msgid "See all" |
729 | 114 | msgstr "" | 122 | msgstr "" |
730 | 115 | 123 | ||
731 | @@ -133,6 +141,26 @@ | |||
732 | 133 | msgid "Send" | 141 | msgid "Send" |
733 | 134 | msgstr "" | 142 | msgstr "" |
734 | 135 | 143 | ||
735 | 144 | #: qml/Dash/ScopesOverview.qml:200 | ||
736 | 145 | msgid "Manage Dash" | ||
737 | 146 | msgstr "" | ||
738 | 147 | |||
739 | 148 | #: qml/Dash/ScopesOverview.qml:405 | ||
740 | 149 | msgid "Done" | ||
741 | 150 | msgstr "" | ||
742 | 151 | |||
743 | 152 | #: qml/Dash/ScopesOverview.qml:431 | ||
744 | 153 | msgid "Store" | ||
745 | 154 | msgstr "" | ||
746 | 155 | |||
747 | 156 | #: qml/Dash/ScopesOverviewTab.qml:36 | ||
748 | 157 | msgid "Favorites" | ||
749 | 158 | msgstr "" | ||
750 | 159 | |||
751 | 160 | #: qml/Dash/ScopesOverviewTab.qml:54 | ||
752 | 161 | msgid "All" | ||
753 | 162 | msgstr "" | ||
754 | 163 | |||
755 | 136 | #: qml/Greeter/Greeter.qml:157 | 164 | #: qml/Greeter/Greeter.qml:157 |
756 | 137 | msgid "Swipe to unlock" | 165 | msgid "Swipe to unlock" |
757 | 138 | msgstr "" | 166 | msgstr "" |
758 | @@ -157,11 +185,11 @@ | |||
759 | 157 | msgid "Speaking..." | 185 | msgid "Speaking..." |
760 | 158 | msgstr "" | 186 | msgstr "" |
761 | 159 | 187 | ||
763 | 160 | #: qml/Notifications/NotificationMenuItemFactory.qml:91 | 188 | #: qml/Notifications/NotificationMenuItemFactory.qml:100 |
764 | 161 | msgid "Show password" | 189 | msgid "Show password" |
765 | 162 | msgstr "" | 190 | msgstr "" |
766 | 163 | 191 | ||
768 | 164 | #: qml/Notifications/NotificationMenuItemFactory.qml:103 | 192 | #: qml/Notifications/NotificationMenuItemFactory.qml:115 |
769 | 165 | msgid "Please enter SIM PIN" | 193 | msgid "Please enter SIM PIN" |
770 | 166 | msgstr "" | 194 | msgstr "" |
771 | 167 | 195 | ||
772 | @@ -173,35 +201,43 @@ | |||
773 | 173 | msgid "Conference" | 201 | msgid "Conference" |
774 | 174 | msgstr "" | 202 | msgstr "" |
775 | 175 | 203 | ||
777 | 176 | #: qml/Panel/Indicators/MenuItemFactory.qml:583 | 204 | #: qml/Panel/Indicators/MenuItemFactory.qml:651 |
778 | 177 | msgid "In queue…" | 205 | msgid "In queue…" |
779 | 178 | msgstr "" | 206 | msgstr "" |
780 | 179 | 207 | ||
782 | 180 | #: qml/Panel/Indicators/MenuItemFactory.qml:587 | 208 | #: qml/Panel/Indicators/MenuItemFactory.qml:655 |
783 | 181 | msgid "Downloading" | 209 | msgid "Downloading" |
784 | 182 | msgstr "" | 210 | msgstr "" |
785 | 183 | 211 | ||
787 | 184 | #: qml/Panel/Indicators/MenuItemFactory.qml:589 | 212 | #: qml/Panel/Indicators/MenuItemFactory.qml:657 |
788 | 185 | msgid "Paused, tap to resume" | 213 | msgid "Paused, tap to resume" |
789 | 186 | msgstr "" | 214 | msgstr "" |
790 | 187 | 215 | ||
792 | 188 | #: qml/Panel/Indicators/MenuItemFactory.qml:591 | 216 | #: qml/Panel/Indicators/MenuItemFactory.qml:659 |
793 | 189 | msgid "Canceled" | 217 | msgid "Canceled" |
794 | 190 | msgstr "" | 218 | msgstr "" |
795 | 191 | 219 | ||
797 | 192 | #: qml/Panel/Indicators/MenuItemFactory.qml:593 | 220 | #: qml/Panel/Indicators/MenuItemFactory.qml:661 |
798 | 193 | msgid "Finished" | 221 | msgid "Finished" |
799 | 194 | msgstr "" | 222 | msgstr "" |
800 | 195 | 223 | ||
802 | 196 | #: qml/Panel/Indicators/MenuItemFactory.qml:595 | 224 | #: qml/Panel/Indicators/MenuItemFactory.qml:663 |
803 | 197 | msgid "Failed, tap to retry" | 225 | msgid "Failed, tap to retry" |
804 | 198 | msgstr "" | 226 | msgstr "" |
805 | 199 | 227 | ||
806 | 228 | #: qml/Panel/Indicators/ModemInfoItem.qml:105 | ||
807 | 229 | msgid "Unlock SIM" | ||
808 | 230 | msgstr "" | ||
809 | 231 | |||
810 | 232 | #: qml/Panel/Indicators/RoamingIndication.qml:27 | ||
811 | 233 | msgid "Roaming" | ||
812 | 234 | msgstr "" | ||
813 | 235 | |||
814 | 200 | #: qml/Panel/SearchIndicator.qml:27 | 236 | #: qml/Panel/SearchIndicator.qml:27 |
815 | 201 | msgid "Search" | 237 | msgid "Search" |
816 | 202 | msgstr "" | 238 | msgstr "" |
817 | 203 | 239 | ||
819 | 204 | #: qml/Shell.qml:359 | 240 | #: qml/Shell.qml:256 |
820 | 205 | #, qt-format | 241 | #, qt-format |
821 | 206 | msgid "Please enter %1" | 242 | msgid "Please enter %1" |
822 | 207 | msgstr "" | 243 | msgstr "" |
823 | 208 | 244 | ||
824 | === modified file 'qml/Components/PageHeader.qml' | |||
825 | --- qml/Components/PageHeader.qml 2014-08-06 19:39:30 +0000 | |||
826 | +++ qml/Components/PageHeader.qml 2014-08-08 20:44:52 +0000 | |||
827 | @@ -24,14 +24,16 @@ | |||
828 | 24 | Item { | 24 | Item { |
829 | 25 | id: root | 25 | id: root |
830 | 26 | objectName: "pageHeader" | 26 | objectName: "pageHeader" |
832 | 27 | implicitHeight: headerContainer.height + units.gu(2) + bottomContainer.height | 27 | implicitHeight: headerContainer.height + bottomContainer.height + (showSignatureLine ? units.gu(2) : 0) |
833 | 28 | 28 | ||
834 | 29 | property bool showBackButton: false | 29 | property bool showBackButton: false |
835 | 30 | property string title | 30 | property string title |
836 | 31 | 31 | ||
837 | 32 | property bool searchEntryEnabled: false | 32 | property bool searchEntryEnabled: false |
838 | 33 | property bool settingsEnabled: false | ||
839 | 33 | property ListModel searchHistory: SearchHistoryModel | 34 | property ListModel searchHistory: SearchHistoryModel |
840 | 34 | property alias searchQuery: searchTextField.text | 35 | property alias searchQuery: searchTextField.text |
841 | 36 | property alias showSignatureLine: bottomBorder.visible | ||
842 | 35 | 37 | ||
843 | 36 | property alias bottomItem: bottomContainer.children | 38 | property alias bottomItem: bottomContainer.children |
844 | 37 | property int paginationCount: 0 | 39 | property int paginationCount: 0 |
845 | @@ -44,6 +46,8 @@ | |||
846 | 44 | 46 | ||
847 | 45 | signal backClicked() | 47 | signal backClicked() |
848 | 46 | 48 | ||
849 | 49 | signal settingsClicked() | ||
850 | 50 | |||
851 | 47 | onScopeStyleChanged: refreshLogo() | 51 | onScopeStyleChanged: refreshLogo() |
852 | 48 | onSearchQueryChanged: { | 52 | onSearchQueryChanged: { |
853 | 49 | // Make sure we are at the search page if the search query changes behind our feet | 53 | // Make sure we are at the search page if the search query changes behind our feet |
854 | @@ -251,12 +255,20 @@ | |||
855 | 251 | 255 | ||
856 | 252 | actions: [ | 256 | actions: [ |
857 | 253 | Action { | 257 | Action { |
858 | 258 | objectName: "search" | ||
859 | 254 | iconName: "search" | 259 | iconName: "search" |
860 | 255 | visible: root.searchEntryEnabled | 260 | visible: root.searchEntryEnabled |
861 | 256 | onTriggered: { | 261 | onTriggered: { |
862 | 257 | headerContainer.showSearch = true; | 262 | headerContainer.showSearch = true; |
863 | 258 | searchTextField.forceActiveFocus(); | 263 | searchTextField.forceActiveFocus(); |
864 | 259 | } | 264 | } |
865 | 265 | }, | ||
866 | 266 | Action { | ||
867 | 267 | iconName: "settings" | ||
868 | 268 | visible: root.settingsEnabled | ||
869 | 269 | onTriggered: { | ||
870 | 270 | root.settingsClicked() | ||
871 | 271 | } | ||
872 | 260 | } | 272 | } |
873 | 261 | ] | 273 | ] |
874 | 262 | } | 274 | } |
875 | 263 | 275 | ||
876 | === modified file 'qml/Components/ResponsiveGridView.qml' | |||
877 | --- qml/Components/ResponsiveGridView.qml 2014-07-11 12:12:50 +0000 | |||
878 | +++ qml/Components/ResponsiveGridView.qml 2014-08-08 20:44:52 +0000 | |||
879 | @@ -34,7 +34,7 @@ | |||
880 | 34 | readonly property int cellWidth: gridView.cellWidth | 34 | readonly property int cellWidth: gridView.cellWidth |
881 | 35 | readonly property int cellHeight: gridView.cellHeight | 35 | readonly property int cellHeight: gridView.cellHeight |
882 | 36 | readonly property int totalContentHeight: { | 36 | readonly property int totalContentHeight: { |
884 | 37 | return contentHeightForRows(Math.ceil(gridView.model.count / columns)) | 37 | return contentHeightForRows(Math.ceil(gridView.model.count / columns), cellHeight) |
885 | 38 | } | 38 | } |
886 | 39 | property alias interactive: gridView.interactive | 39 | property alias interactive: gridView.interactive |
887 | 40 | readonly property alias flicking: gridView.flicking | 40 | readonly property alias flicking: gridView.flicking |
888 | @@ -47,8 +47,8 @@ | |||
889 | 47 | property alias cacheBuffer: gridView.cacheBuffer | 47 | property alias cacheBuffer: gridView.cacheBuffer |
890 | 48 | readonly property alias currentItem: gridView.currentItem | 48 | readonly property alias currentItem: gridView.currentItem |
891 | 49 | 49 | ||
894 | 50 | function contentHeightForRows(rows) { | 50 | function contentHeightForRows(rows, height) { |
895 | 51 | return rows * cellHeight; | 51 | return rows * height |
896 | 52 | } | 52 | } |
897 | 53 | 53 | ||
898 | 54 | GridView { | 54 | GridView { |
899 | 55 | 55 | ||
900 | === removed directory 'qml/Dash/Apps' | |||
901 | === modified file 'qml/Dash/CardCarousel.qml' | |||
902 | --- qml/Dash/CardCarousel.qml 2014-07-11 12:13:08 +0000 | |||
903 | +++ qml/Dash/CardCarousel.qml 2014-08-08 20:44:52 +0000 | |||
904 | @@ -48,8 +48,8 @@ | |||
905 | 48 | 48 | ||
906 | 49 | objectName: "carouselDelegate" + index | 49 | objectName: "carouselDelegate" + index |
907 | 50 | 50 | ||
910 | 51 | function clicked() { cardCarousel.clicked(index, model.result) } | 51 | function clicked() { cardCarousel.clicked(index, model.result, loader.item, model) } |
911 | 52 | function pressAndHold() { cardCarousel.pressAndHold(index, model.result) } | 52 | function pressAndHold() { cardCarousel.pressAndHold(index) } |
912 | 53 | 53 | ||
913 | 54 | sourceComponent: cardTool.cardComponent | 54 | sourceComponent: cardTool.cardComponent |
914 | 55 | onLoaded: { | 55 | onLoaded: { |
915 | 56 | 56 | ||
916 | === modified file 'qml/Dash/CardGrid.qml' | |||
917 | --- qml/Dash/CardGrid.qml 2014-07-18 11:35:47 +0000 | |||
918 | +++ qml/Dash/CardGrid.qml 2014-08-08 20:44:52 +0000 | |||
919 | @@ -26,10 +26,20 @@ | |||
920 | 26 | } | 26 | } |
921 | 27 | 27 | ||
922 | 28 | expandedHeight: grid.totalContentHeight | 28 | expandedHeight: grid.totalContentHeight |
924 | 29 | collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows), expandedHeight) | 29 | collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows, grid.cellHeight), expandedHeight) |
925 | 30 | collapsedItemCount: collapsedRows * grid.columns | 30 | collapsedItemCount: collapsedRows * grid.columns |
926 | 31 | originY: grid.originY | 31 | originY: grid.originY |
927 | 32 | 32 | ||
928 | 33 | function cardPosition(index) { | ||
929 | 34 | var pos = {}; | ||
930 | 35 | var row = Math.floor(index / grid.columns); | ||
931 | 36 | var column = index % grid.columns; | ||
932 | 37 | // Bit sad this is not symmetrical | ||
933 | 38 | pos.x = column * grid.cellWidth + grid.margins; | ||
934 | 39 | pos.y = row * grid.cellHeight; | ||
935 | 40 | return pos; | ||
936 | 41 | } | ||
937 | 42 | |||
938 | 33 | ResponsiveGridView { | 43 | ResponsiveGridView { |
939 | 34 | id: grid | 44 | id: grid |
940 | 35 | anchors.fill: parent | 45 | anchors.fill: parent |
941 | @@ -53,6 +63,7 @@ | |||
942 | 53 | item.objectName = "delegate" + index; | 63 | item.objectName = "delegate" + index; |
943 | 54 | item.width = Qt.binding(function() { return cardTool.cardWidth; }); | 64 | item.width = Qt.binding(function() { return cardTool.cardWidth; }); |
944 | 55 | item.height = Qt.binding(function() { return cardTool.cardHeight; }); | 65 | item.height = Qt.binding(function() { return cardTool.cardHeight; }); |
945 | 66 | item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; }); | ||
946 | 56 | item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; }); | 67 | item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; }); |
947 | 57 | item.cardData = Qt.binding(function() { return model; }); | 68 | item.cardData = Qt.binding(function() { return model; }); |
948 | 58 | item.template = Qt.binding(function() { return cardTool.template; }); | 69 | item.template = Qt.binding(function() { return cardTool.template; }); |
949 | @@ -62,7 +73,7 @@ | |||
950 | 62 | } | 73 | } |
951 | 63 | Connections { | 74 | Connections { |
952 | 64 | target: loader.item | 75 | target: loader.item |
954 | 65 | onClicked: root.clicked(index, result) | 76 | onClicked: root.clicked(index, result, loader.item, model) |
955 | 66 | onPressAndHold: root.pressAndHold(index) | 77 | onPressAndHold: root.pressAndHold(index) |
956 | 67 | } | 78 | } |
957 | 68 | } | 79 | } |
958 | 69 | 80 | ||
959 | === modified file 'qml/Dash/CardVerticalJournal.qml' | |||
960 | --- qml/Dash/CardVerticalJournal.qml 2014-07-22 12:17:34 +0000 | |||
961 | +++ qml/Dash/CardVerticalJournal.qml 2014-08-08 20:44:52 +0000 | |||
962 | @@ -61,7 +61,7 @@ | |||
963 | 61 | } | 61 | } |
964 | 62 | Connections { | 62 | Connections { |
965 | 63 | target: loader.item | 63 | target: loader.item |
967 | 64 | onClicked: root.clicked(index, result) | 64 | onClicked: root.clicked(index, result, loader.item, model) |
968 | 65 | onPressAndHold: root.pressAndHold(index) | 65 | onPressAndHold: root.pressAndHold(index) |
969 | 66 | } | 66 | } |
970 | 67 | } | 67 | } |
971 | 68 | 68 | ||
972 | === modified file 'qml/Dash/Dash.qml' | |||
973 | --- qml/Dash/Dash.qml 2014-08-06 19:39:30 +0000 | |||
974 | +++ qml/Dash/Dash.qml 2014-08-08 20:44:52 +0000 | |||
975 | @@ -16,6 +16,7 @@ | |||
976 | 16 | 16 | ||
977 | 17 | import QtQuick 2.2 | 17 | import QtQuick 2.2 |
978 | 18 | import Ubuntu.Components 0.1 | 18 | import Ubuntu.Components 0.1 |
979 | 19 | import Ubuntu.Gestures 0.1 | ||
980 | 19 | import Unity 0.2 | 20 | import Unity 0.2 |
981 | 20 | import Utils 0.1 | 21 | import Utils 0.1 |
982 | 21 | import Unity.DashCommunicator 0.1 | 22 | import Unity.DashCommunicator 0.1 |
983 | @@ -73,26 +74,104 @@ | |||
984 | 73 | id: scopes | 74 | id: scopes |
985 | 74 | } | 75 | } |
986 | 75 | 76 | ||
988 | 76 | Image { | 77 | QtObject { |
989 | 78 | id: overviewController | ||
990 | 79 | objectName: "overviewController" | ||
991 | 80 | |||
992 | 81 | property alias enableAnimation: progressAnimation.enabled | ||
993 | 82 | property real progress: 0 | ||
994 | 83 | Behavior on progress { | ||
995 | 84 | id: progressAnimation | ||
996 | 85 | UbuntuNumberAnimation { } | ||
997 | 86 | } | ||
998 | 87 | } | ||
999 | 88 | |||
1000 | 89 | ScopesOverview { | ||
1001 | 90 | id: scopesOverview | ||
1002 | 91 | objectName: "scopesOverview" | ||
1003 | 77 | anchors.fill: parent | 92 | anchors.fill: parent |
1008 | 78 | source: parent.width > parent.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png" | 93 | scope: scopes.overviewScope |
1009 | 79 | fillMode: Image.PreserveAspectCrop | 94 | progress: overviewController.progress |
1010 | 80 | horizontalAlignment: Image.AlignRight | 95 | scopeScale: scopeItem.scope ? 0.4 : (1 - overviewController.progress * 0.6) |
1011 | 81 | verticalAlignment: Image.AlignTop | 96 | visible: scopeScale != 1 |
1012 | 97 | currentIndex: dashContent.currentIndex | ||
1013 | 98 | onDone: { | ||
1014 | 99 | if (currentTab == 1) { | ||
1015 | 100 | animateDashFromAll(dashContent.currentScopeId); | ||
1016 | 101 | } | ||
1017 | 102 | hide(); | ||
1018 | 103 | } | ||
1019 | 104 | onFavoriteSelected: { | ||
1020 | 105 | setCurrentScope(scopeId, false, false); | ||
1021 | 106 | dashContentCache.scheduleUpdate(); | ||
1022 | 107 | hide(); | ||
1023 | 108 | } | ||
1024 | 109 | onAllFavoriteSelected: { | ||
1025 | 110 | setCurrentScope(scopeId, false, false); | ||
1026 | 111 | dashContentCache.scheduleUpdate(); | ||
1027 | 112 | animateDashFromAll(dashContent.currentScopeId); | ||
1028 | 113 | hide(); | ||
1029 | 114 | } | ||
1030 | 115 | onSearchSelected: { | ||
1031 | 116 | var scopeIndex = -1; | ||
1032 | 117 | for (var i = 0; i < scopes.count; ++i) { | ||
1033 | 118 | if (scopes.getScope(i).id == scopeId) { | ||
1034 | 119 | scopeIndex = i; | ||
1035 | 120 | break; | ||
1036 | 121 | } | ||
1037 | 122 | } | ||
1038 | 123 | if (scopeIndex >= 0) { | ||
1039 | 124 | // Is a favorite one | ||
1040 | 125 | setCurrentScope(scopeId, false, false); | ||
1041 | 126 | dashContentCache.scheduleUpdate(); | ||
1042 | 127 | showDashFromPos(pos, size); | ||
1043 | 128 | hide(); | ||
1044 | 129 | } else { | ||
1045 | 130 | // Is not a favorite one, activate and get openScope | ||
1046 | 131 | scope.activate(result); | ||
1047 | 132 | } | ||
1048 | 133 | } | ||
1049 | 134 | function hide() { | ||
1050 | 135 | overviewController.enableAnimation = true; | ||
1051 | 136 | overviewController.progress = 0; | ||
1052 | 137 | } | ||
1053 | 138 | onProgressChanged: { | ||
1054 | 139 | if (progress == 0) { | ||
1055 | 140 | currentTab = scopeItem.scope ? 1 : 0; | ||
1056 | 141 | } | ||
1057 | 142 | } | ||
1058 | 143 | } | ||
1059 | 144 | |||
1060 | 145 | ShaderEffectSource { | ||
1061 | 146 | id: dashContentCache | ||
1062 | 147 | parent: scopesOverview.dashItemEater | ||
1063 | 148 | z: 1 | ||
1064 | 149 | sourceItem: dashContent | ||
1065 | 150 | height: sourceItem.height | ||
1066 | 151 | width: sourceItem.width | ||
1067 | 152 | opacity: 1 - overviewController.progress | ||
1068 | 153 | visible: overviewController.progress != 0 && scopeItem.scope === null | ||
1069 | 154 | live: false | ||
1070 | 82 | } | 155 | } |
1071 | 83 | 156 | ||
1072 | 84 | DashContent { | 157 | DashContent { |
1073 | 85 | id: dashContent | 158 | id: dashContent |
1074 | 159 | |||
1075 | 160 | property var scopeThatOpenedScope: null | ||
1076 | 161 | |||
1077 | 86 | objectName: "dashContent" | 162 | objectName: "dashContent" |
1080 | 87 | width: parent.width | 163 | width: dash.width |
1081 | 88 | height: parent.height | 164 | height: dash.height |
1082 | 89 | scopes: scopes | 165 | scopes: scopes |
1084 | 90 | visible: x != -width | 166 | visible: !scopesOverview.showingNonFavoriteScope && x != -width |
1085 | 91 | onGotoScope: { | 167 | onGotoScope: { |
1086 | 92 | dash.setCurrentScope(scopeId, true, false); | 168 | dash.setCurrentScope(scopeId, true, false); |
1087 | 93 | } | 169 | } |
1088 | 94 | onOpenScope: { | 170 | onOpenScope: { |
1089 | 171 | scopeThatOpenedScope = currentScope; | ||
1090 | 95 | scopeItem.scope = scope; | 172 | scopeItem.scope = scope; |
1091 | 173 | scopesOverview.currentTab = 1; | ||
1092 | 174 | scopesOverview.ensureAllScopeVisible(scope.id); | ||
1093 | 96 | x = -width; | 175 | x = -width; |
1094 | 97 | } | 176 | } |
1095 | 98 | onScopeLoaded: { | 177 | onScopeLoaded: { |
1096 | @@ -102,25 +181,63 @@ | |||
1097 | 102 | } | 181 | } |
1098 | 103 | } | 182 | } |
1099 | 104 | scale: dash.contentScale | 183 | scale: dash.contentScale |
1101 | 105 | clip: scale != 1.0 || scopeItem.visible | 184 | clip: scale != 1.0 || scopeItem.visible || overviewController.progress != 0 |
1102 | 106 | Behavior on x { | 185 | Behavior on x { |
1103 | 107 | UbuntuNumberAnimation { | 186 | UbuntuNumberAnimation { |
1104 | 187 | duration: overviewController.progress != 0 ? 0 : UbuntuAnimation.FastDuration | ||
1105 | 108 | onRunningChanged: { | 188 | onRunningChanged: { |
1106 | 109 | if (!running && dashContent.x == 0) { | 189 | if (!running && dashContent.x == 0) { |
1108 | 110 | dashContent.closeScope(scopeItem.scope); | 190 | dashContent.scopeThatOpenedScope.closeScope(scopeItem.scope); |
1109 | 111 | scopeItem.scope = null; | 191 | scopeItem.scope = null; |
1110 | 192 | if (overviewController.progress == 0) { | ||
1111 | 193 | // Set tab to Favorites only if we are not showing the overview | ||
1112 | 194 | scopesOverview.currentTab = 0; | ||
1113 | 195 | } | ||
1114 | 112 | } | 196 | } |
1115 | 113 | } | 197 | } |
1116 | 114 | } | 198 | } |
1117 | 115 | } | 199 | } |
1118 | 200 | |||
1119 | 201 | enabled: overviewController.progress == 0 | ||
1120 | 202 | opacity: enabled ? 1 : 0 | ||
1121 | 203 | } | ||
1122 | 204 | |||
1123 | 205 | DashBackground | ||
1124 | 206 | { | ||
1125 | 207 | anchors.fill: scopeItem | ||
1126 | 208 | visible: scopeItem.visible | ||
1127 | 209 | parent: scopeItem.parent | ||
1128 | 210 | scale: scopeItem.scale | ||
1129 | 211 | opacity: scopeItem.opacity | ||
1130 | 116 | } | 212 | } |
1131 | 117 | 213 | ||
1132 | 118 | GenericScopeView { | 214 | GenericScopeView { |
1133 | 119 | id: scopeItem | 215 | id: scopeItem |
1135 | 120 | anchors.left: dashContent.right | 216 | objectName: "dashTempScopeItem" |
1136 | 217 | |||
1137 | 218 | readonly property real targetOverviewScale: { | ||
1138 | 219 | if (scopesOverview.currentTab == 0) { | ||
1139 | 220 | return 0.4; | ||
1140 | 221 | } else { | ||
1141 | 222 | return scopesOverview.allCardSize.width / scopeItem.width; | ||
1142 | 223 | } | ||
1143 | 224 | } | ||
1144 | 225 | readonly property real overviewProgressScale: (1 - overviewController.progress * (1 - targetOverviewScale)) | ||
1145 | 226 | readonly property var targetOverviewPosition: scope ? scopesOverview.allScopeCardPosition(scope.id) : null | ||
1146 | 227 | readonly property real overviewProgressX: scope && scopesOverview.currentTab == 1 && targetOverviewPosition ? | ||
1147 | 228 | overviewController.progress * (targetOverviewPosition.x - (width - scopesOverview.allCardSize.width) / 2) | ||
1148 | 229 | : 0 | ||
1149 | 230 | readonly property real overviewProgressY: scope && scopesOverview.currentTab == 1 && targetOverviewPosition ? | ||
1150 | 231 | overviewController.progress * (targetOverviewPosition.y - (height - scopesOverview.allCardSize.height) / 2) | ||
1151 | 232 | : 0 | ||
1152 | 233 | |||
1153 | 234 | x: overviewController.progress == 0 ? dashContent.x + width : overviewProgressX | ||
1154 | 235 | y: overviewController.progress == 0 ? dashContent.y : overviewProgressY | ||
1155 | 121 | width: parent.width | 236 | width: parent.width |
1156 | 122 | height: parent.height | 237 | height: parent.height |
1158 | 123 | scale: dash.contentScale | 238 | scale: dash.contentScale * overviewProgressScale |
1159 | 239 | enabled: opacity == 1 | ||
1160 | 240 | opacity: 1 - overviewController.progress | ||
1161 | 124 | clip: scale != 1.0 | 241 | clip: scale != 1.0 |
1162 | 125 | visible: scope != null | 242 | visible: scope != null |
1163 | 126 | hasBackAction: true | 243 | hasBackAction: true |
1164 | @@ -154,7 +271,7 @@ | |||
1165 | 154 | opacity: 0 | 271 | opacity: 0 |
1166 | 155 | visible: opacity > 0 | 272 | visible: opacity > 0 |
1167 | 156 | 273 | ||
1169 | 157 | readonly property bool processing: dashContent.processing || scopeItem.processing | 274 | readonly property bool processing: dashContent.processing || scopeItem.processing || scopesOverview.processing |
1170 | 158 | 275 | ||
1171 | 159 | Behavior on opacity { | 276 | Behavior on opacity { |
1172 | 160 | UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration } | 277 | UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration } |
1173 | @@ -207,4 +324,45 @@ | |||
1174 | 207 | } | 324 | } |
1175 | 208 | } | 325 | } |
1176 | 209 | 326 | ||
1177 | 327 | Image { | ||
1178 | 328 | source: "graphics/overview_hint.png" | ||
1179 | 329 | anchors.horizontalCenter: parent.horizontalCenter | ||
1180 | 330 | opacity: (scopeItem.scope ? scopeItem.pageHeaderTotallyVisible : dashContent.pageHeaderTotallyVisible) && | ||
1181 | 331 | (overviewDragHandle.enabled || overviewController.progress != 0) ? 1 : 0 | ||
1182 | 332 | Behavior on opacity { | ||
1183 | 333 | enabled: overviewController.progress == 0 | ||
1184 | 334 | UbuntuNumberAnimation {} | ||
1185 | 335 | } | ||
1186 | 336 | y: parent.height - height * (1 - overviewController.progress * 4) | ||
1187 | 337 | } | ||
1188 | 338 | |||
1189 | 339 | EdgeDragArea { | ||
1190 | 340 | id: overviewDragHandle | ||
1191 | 341 | objectName: "overviewDragHandle" | ||
1192 | 342 | z: 1 | ||
1193 | 343 | direction: Direction.Upwards | ||
1194 | 344 | enabled: !dashContent.previewShown && | ||
1195 | 345 | dashContent.currentScope && | ||
1196 | 346 | dashContent.currentScope.searchQuery == "" && | ||
1197 | 347 | (overviewController.progress == 0 || dragging) | ||
1198 | 348 | |||
1199 | 349 | readonly property real fullMovement: units.gu(20) | ||
1200 | 350 | |||
1201 | 351 | anchors { left: parent.left; right: parent.right; bottom: parent.bottom } | ||
1202 | 352 | height: units.gu(2) | ||
1203 | 353 | |||
1204 | 354 | onSceneDistanceChanged: { | ||
1205 | 355 | if (overviewController.enableAnimation) { | ||
1206 | 356 | dashContentCache.scheduleUpdate(); | ||
1207 | 357 | } | ||
1208 | 358 | overviewController.enableAnimation = false; | ||
1209 | 359 | overviewController.progress = Math.max(0, Math.min(1, sceneDistance / fullMovement)); | ||
1210 | 360 | } | ||
1211 | 361 | |||
1212 | 362 | onDraggingChanged: { | ||
1213 | 363 | overviewController.enableAnimation = true; | ||
1214 | 364 | overviewController.progress = (overviewController.progress > 0.7) ? 1 : 0; | ||
1215 | 365 | } | ||
1216 | 366 | } | ||
1217 | 367 | |||
1218 | 210 | } | 368 | } |
1219 | 211 | 369 | ||
1220 | === added file 'qml/Dash/DashBackground.qml' | |||
1221 | --- qml/Dash/DashBackground.qml 1970-01-01 00:00:00 +0000 | |||
1222 | +++ qml/Dash/DashBackground.qml 2014-08-08 20:44:52 +0000 | |||
1223 | @@ -0,0 +1,24 @@ | |||
1224 | 1 | /* | ||
1225 | 2 | * Copyright (C) 2013, 2014 Canonical, Ltd. | ||
1226 | 3 | * | ||
1227 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1228 | 5 | * it under the terms of the GNU General Public License as published by | ||
1229 | 6 | * the Free Software Foundation; version 3. | ||
1230 | 7 | * | ||
1231 | 8 | * This program is distributed in the hope that it will be useful, | ||
1232 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1233 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1234 | 11 | * GNU General Public License for more details. | ||
1235 | 12 | * | ||
1236 | 13 | * You should have received a copy of the GNU General Public License | ||
1237 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1238 | 15 | */ | ||
1239 | 16 | |||
1240 | 17 | import QtQuick 2.0 | ||
1241 | 18 | |||
1242 | 19 | Image { | ||
1243 | 20 | source: anchors.fill.width > anchors.fill.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png" | ||
1244 | 21 | fillMode: Image.PreserveAspectCrop | ||
1245 | 22 | horizontalAlignment: Image.AlignRight | ||
1246 | 23 | verticalAlignment: Image.AlignTop | ||
1247 | 24 | } | ||
1248 | 0 | 25 | ||
1249 | === modified file 'qml/Dash/DashContent.qml' | |||
1250 | --- qml/Dash/DashContent.qml 2014-08-06 19:39:30 +0000 | |||
1251 | +++ qml/Dash/DashContent.qml 2014-08-08 20:44:52 +0000 | |||
1252 | @@ -25,8 +25,14 @@ | |||
1253 | 25 | 25 | ||
1254 | 26 | property alias scopes: dashContentList.model | 26 | property alias scopes: dashContentList.model |
1255 | 27 | readonly property alias currentIndex: dashContentList.currentIndex | 27 | readonly property alias currentIndex: dashContentList.currentIndex |
1256 | 28 | readonly property string currentScopeId: dashContentList.currentItem ? dashContentList.currentItem.scopeId : "" | ||
1257 | 29 | readonly property var currentScope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null | ||
1258 | 30 | readonly property bool previewShown: dashContentList.currentItem && dashContentList.currentItem.item ? | ||
1259 | 31 | dashContentList.currentItem.item.previewShown : false | ||
1260 | 28 | readonly property bool processing: dashContentList.currentItem && dashContentList.currentItem.item | 32 | readonly property bool processing: dashContentList.currentItem && dashContentList.currentItem.item |
1261 | 29 | && dashContentList.currentItem.item.processing || false | 33 | && dashContentList.currentItem.item.processing || false |
1262 | 34 | readonly property bool pageHeaderTotallyVisible: dashContentList.currentItem && dashContentList.currentItem.item | ||
1263 | 35 | && dashContentList.currentItem.item.pageHeaderTotallyVisible || false | ||
1264 | 30 | 36 | ||
1265 | 31 | signal scopeLoaded(string scopeId) | 37 | signal scopeLoaded(string scopeId) |
1266 | 32 | signal gotoScope(string scopeId) | 38 | signal gotoScope(string scopeId) |
1267 | @@ -77,15 +83,15 @@ | |||
1268 | 77 | } | 83 | } |
1269 | 78 | } | 84 | } |
1270 | 79 | 85 | ||
1271 | 80 | function closeScope(scope) { | ||
1272 | 81 | dashContentList.currentItem.theScope.closeScope(scope) | ||
1273 | 82 | } | ||
1274 | 83 | |||
1275 | 84 | Item { | 86 | Item { |
1276 | 85 | id: dashContentListHolder | 87 | id: dashContentListHolder |
1277 | 86 | 88 | ||
1278 | 87 | anchors.fill: parent | 89 | anchors.fill: parent |
1279 | 88 | 90 | ||
1280 | 91 | DashBackground { | ||
1281 | 92 | anchors.fill: parent | ||
1282 | 93 | } | ||
1283 | 94 | |||
1284 | 89 | ListView { | 95 | ListView { |
1285 | 90 | id: dashContentList | 96 | id: dashContentList |
1286 | 91 | objectName: "dashContentList" | 97 | objectName: "dashContentList" |
1287 | 92 | 98 | ||
1288 | === modified file 'qml/Dash/DashRenderer.qml' | |||
1289 | --- qml/Dash/DashRenderer.qml 2014-07-22 12:17:34 +0000 | |||
1290 | +++ qml/Dash/DashRenderer.qml 2014-08-08 20:44:52 +0000 | |||
1291 | @@ -41,7 +41,9 @@ | |||
1292 | 41 | /// Emitted when the user clicked on an item | 41 | /// Emitted when the user clicked on an item |
1293 | 42 | /// @param index is the index of the clicked item | 42 | /// @param index is the index of the clicked item |
1294 | 43 | /// @param result result model of the cliked item, used for activation | 43 | /// @param result result model of the cliked item, used for activation |
1296 | 44 | signal clicked(int index, var result) | 44 | /// @param item item that has been clicked |
1297 | 45 | /// @param itemModel model of the item | ||
1298 | 46 | signal clicked(int index, var result, var item, var itemModel) | ||
1299 | 45 | 47 | ||
1300 | 46 | /// Emitted when the user pressed and held on an item | 48 | /// Emitted when the user pressed and held on an item |
1301 | 47 | /// @param index is the index of the held item | 49 | /// @param index is the index of the held item |
1302 | 48 | 50 | ||
1303 | === modified file 'qml/Dash/GenericScopeView.qml' | |||
1304 | --- qml/Dash/GenericScopeView.qml 2014-08-06 19:39:30 +0000 | |||
1305 | +++ qml/Dash/GenericScopeView.qml 2014-08-08 20:44:52 +0000 | |||
1306 | @@ -25,7 +25,7 @@ | |||
1307 | 25 | FocusScope { | 25 | FocusScope { |
1308 | 26 | id: scopeView | 26 | id: scopeView |
1309 | 27 | 27 | ||
1311 | 28 | readonly property alias navigationShown: dashNavigation.showList | 28 | readonly property bool navigationShown: pageHeaderLoader.item ? pageHeaderLoader.item.bottomItem[0].showList : false |
1312 | 29 | property var scope: null | 29 | property var scope: null |
1313 | 30 | property SortFilterProxyModel categories: categoryFilter | 30 | property SortFilterProxyModel categories: categoryFilter |
1314 | 31 | property bool isCurrent: false | 31 | property bool isCurrent: false |
1315 | @@ -33,14 +33,18 @@ | |||
1316 | 33 | property bool hasBackAction: false | 33 | property bool hasBackAction: false |
1317 | 34 | property bool enableHeightBehaviorOnNextCreation: false | 34 | property bool enableHeightBehaviorOnNextCreation: false |
1318 | 35 | property var categoryView: categoryView | 35 | property var categoryView: categoryView |
1321 | 36 | property alias paginationCount: pageHeader.paginationCount | 36 | property bool showPageHeader: true |
1322 | 37 | property alias paginationIndex: pageHeader.paginationIndex | 37 | readonly property alias previewShown: subPageLoader.previewShown |
1323 | 38 | readonly property alias settingsShown: subPageLoader.settingsShown | ||
1324 | 39 | property int paginationCount: 0 | ||
1325 | 40 | property int paginationIndex: 0 | ||
1326 | 41 | property alias pageHeaderTotallyVisible: categoryView.pageHeaderTotallyVisible | ||
1327 | 38 | 42 | ||
1328 | 39 | property var scopeStyle: ScopeStyle { | 43 | property var scopeStyle: ScopeStyle { |
1329 | 40 | style: scope ? scope.customizations : {} | 44 | style: scope ? scope.customizations : {} |
1330 | 41 | } | 45 | } |
1331 | 42 | 46 | ||
1333 | 43 | readonly property bool processing: scope ? scope.searchInProgress || previewListView.processing : false | 47 | readonly property bool processing: scope ? scope.searchInProgress || subPageLoader.processing : false |
1334 | 44 | 48 | ||
1335 | 45 | signal backClicked() | 49 | signal backClicked() |
1336 | 46 | 50 | ||
1337 | @@ -53,13 +57,42 @@ | |||
1338 | 53 | } | 57 | } |
1339 | 54 | 58 | ||
1340 | 55 | function closePreview() { | 59 | function closePreview() { |
1342 | 56 | previewListView.open = false; | 60 | subPageLoader.closeSubPage() |
1343 | 61 | } | ||
1344 | 62 | |||
1345 | 63 | function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount) { | ||
1346 | 64 | if (scope.id === "scopes" || scope.id == "clickscope") { | ||
1347 | 65 | // TODO Technically it is possible that calling activate() will make the scope emit | ||
1348 | 66 | // previewRequested so that we show a preview but there's no scope that does that yet | ||
1349 | 67 | // so it's not implemented | ||
1350 | 68 | scope.activate(result) | ||
1351 | 69 | } else { | ||
1352 | 70 | openPreview(index, resultsModel, limitedCategoryItemCount); | ||
1353 | 71 | } | ||
1354 | 72 | } | ||
1355 | 73 | |||
1356 | 74 | function itemPressedAndHeld(index, resultsModel, limitedCategoryItemCount) { | ||
1357 | 75 | openPreview(index, resultsModel, limitedCategoryItemCount); | ||
1358 | 76 | } | ||
1359 | 77 | |||
1360 | 78 | function openPreview(index, resultsModel, limitedCategoryItemCount) { | ||
1361 | 79 | if (limitedCategoryItemCount > 0) { | ||
1362 | 80 | previewLimitModel.model = resultsModel; | ||
1363 | 81 | previewLimitModel.limit = limitedCategoryItemCount; | ||
1364 | 82 | subPageLoader.model = previewLimitModel; | ||
1365 | 83 | } else { | ||
1366 | 84 | subPageLoader.model = resultsModel; | ||
1367 | 85 | } | ||
1368 | 86 | subPageLoader.currentIndex = -1; | ||
1369 | 87 | subPageLoader.currentIndex = index; | ||
1370 | 88 | subPageLoader.subPage = "preview"; | ||
1371 | 89 | subPageLoader.openSubPage(); | ||
1372 | 57 | } | 90 | } |
1373 | 58 | 91 | ||
1374 | 59 | Binding { | 92 | Binding { |
1375 | 60 | target: scope | 93 | target: scope |
1376 | 61 | property: "isActive" | 94 | property: "isActive" |
1378 | 62 | value: isCurrent && !previewListView.open | 95 | value: isCurrent && !subPageLoader.open |
1379 | 63 | } | 96 | } |
1380 | 64 | 97 | ||
1381 | 65 | SortFilterProxyModel { | 98 | SortFilterProxyModel { |
1382 | @@ -72,28 +105,30 @@ | |||
1383 | 72 | } | 105 | } |
1384 | 73 | 106 | ||
1385 | 74 | onIsCurrentChanged: { | 107 | onIsCurrentChanged: { |
1388 | 75 | pageHeader.resetSearch(); | 108 | if (showPageHeader) { |
1389 | 76 | previewListView.open = false; | 109 | pageHeaderLoader.item.resetSearch(); |
1390 | 110 | } | ||
1391 | 111 | subPageLoader.closeSubPage(); | ||
1392 | 77 | } | 112 | } |
1393 | 78 | 113 | ||
1394 | 79 | Binding { | 114 | Binding { |
1395 | 80 | target: scopeView.scope | 115 | target: scopeView.scope |
1396 | 81 | property: "searchQuery" | 116 | property: "searchQuery" |
1399 | 82 | value: pageHeader.searchQuery | 117 | value: pageHeaderLoader.item ? pageHeaderLoader.item.searchQuery : "" |
1400 | 83 | when: isCurrent | 118 | when: isCurrent && showPageHeader |
1401 | 84 | } | 119 | } |
1402 | 85 | 120 | ||
1403 | 86 | Binding { | 121 | Binding { |
1405 | 87 | target: pageHeader | 122 | target: pageHeaderLoader.item |
1406 | 88 | property: "searchQuery" | 123 | property: "searchQuery" |
1407 | 89 | value: scopeView.scope ? scopeView.scope.searchQuery : "" | 124 | value: scopeView.scope ? scopeView.scope.searchQuery : "" |
1409 | 90 | when: isCurrent | 125 | when: isCurrent && showPageHeader |
1410 | 91 | } | 126 | } |
1411 | 92 | 127 | ||
1412 | 93 | Connections { | 128 | Connections { |
1413 | 94 | target: scopeView.scope | 129 | target: scopeView.scope |
1416 | 95 | onShowDash: previewListView.open = false; | 130 | onShowDash: subPageLoader.closeSubPage() |
1417 | 96 | onHideDash: previewListView.open = false; | 131 | onHideDash: subPageLoader.closeSubPage() |
1418 | 97 | } | 132 | } |
1419 | 98 | 133 | ||
1420 | 99 | Rectangle { | 134 | Rectangle { |
1421 | @@ -106,18 +141,21 @@ | |||
1422 | 106 | id: categoryView | 141 | id: categoryView |
1423 | 107 | objectName: "categoryListView" | 142 | objectName: "categoryListView" |
1424 | 108 | 143 | ||
1426 | 109 | x: previewListView.open ? -width : 0 | 144 | x: subPageLoader.open ? -width : 0 |
1427 | 110 | Behavior on x { UbuntuNumberAnimation { } } | 145 | Behavior on x { UbuntuNumberAnimation { } } |
1428 | 111 | width: parent.width | 146 | width: parent.width |
1429 | 112 | height: parent.height | 147 | height: parent.height |
1430 | 113 | 148 | ||
1431 | 114 | model: scopeView.categories | 149 | model: scopeView.categories |
1433 | 115 | forceNoClip: previewListView.open | 150 | forceNoClip: subPageLoader.open |
1434 | 116 | pixelAligned: true | 151 | pixelAligned: true |
1436 | 117 | interactive: !dashNavigation.showList | 152 | interactive: !navigationShown |
1437 | 118 | 153 | ||
1438 | 119 | property string expandedCategoryId: "" | 154 | property string expandedCategoryId: "" |
1439 | 120 | 155 | ||
1440 | 156 | readonly property bool pageHeaderTotallyVisible: scopeView.showPageHeader && | ||
1441 | 157 | ((headerItemShownHeight == 0 && categoryView.contentY <= categoryView.originY) || (headerItemShownHeight == pageHeaderLoader.item.height)) | ||
1442 | 158 | |||
1443 | 121 | delegate: ListItems.Base { | 159 | delegate: ListItems.Base { |
1444 | 122 | id: baseItem | 160 | id: baseItem |
1445 | 123 | objectName: "dashCategory" + category | 161 | objectName: "dashCategory" + category |
1446 | @@ -223,28 +261,19 @@ | |||
1447 | 223 | Connections { | 261 | Connections { |
1448 | 224 | target: rendererLoader.item | 262 | target: rendererLoader.item |
1449 | 225 | onClicked: { | 263 | onClicked: { |
1462 | 226 | if (scopeView.scope.id === "scopes" || scopeView.scope.id == "clickscope") { | 264 | scopeView.itemClicked(index, result, item, itemModel, target.model, categoryItemCount()); |
1463 | 227 | // TODO Technically it is possible that calling activate() will make the scope emit | 265 | } |
1464 | 228 | // previewRequested so that we show a preview but there's no scope that does that yet | 266 | |
1465 | 229 | // so it's not implemented | 267 | onPressAndHold: { |
1466 | 230 | scopeView.scope.activate(result) | 268 | scopeView.itemPressedAndHeld(index, target.model, categoryItemCount()); |
1467 | 231 | } else { | 269 | } |
1468 | 232 | openPreview(index); | 270 | |
1469 | 233 | } | 271 | function categoryItemCount() { |
1470 | 234 | } | 272 | var categoryItemCount = -1; |
1459 | 235 | onPressAndHold: openPreview(index) | ||
1460 | 236 | |||
1461 | 237 | function openPreview(index) { | ||
1471 | 238 | if (!rendererLoader.expanded && !seeAllLabel.visible && target.collapsedItemCount > 0) { | 273 | if (!rendererLoader.expanded && !seeAllLabel.visible && target.collapsedItemCount > 0) { |
1477 | 239 | previewLimitModel.model = target.model; | 274 | categoryItemCount = target.collapsedItemCount; |
1473 | 240 | previewLimitModel.limit = target.collapsedItemCount; | ||
1474 | 241 | previewListView.model = previewLimitModel; | ||
1475 | 242 | } else { | ||
1476 | 243 | previewListView.model = target.model; | ||
1478 | 244 | } | 275 | } |
1482 | 245 | previewListView.currentIndex = -1; | 276 | return categoryItemCount; |
1480 | 246 | previewListView.currentIndex = index; | ||
1481 | 247 | previewListView.open = true; | ||
1483 | 248 | } | 277 | } |
1484 | 249 | } | 278 | } |
1485 | 250 | Connections { | 279 | Connections { |
1486 | @@ -260,10 +289,10 @@ | |||
1487 | 260 | // If the filter animation will be seen start it, otherwise, just flip the switch | 289 | // If the filter animation will be seen start it, otherwise, just flip the switch |
1488 | 261 | var shrinkingVisible = !shouldExpand && y + item.collapsedHeight + seeAll.height < categoryView.height; | 290 | var shrinkingVisible = !shouldExpand && y + item.collapsedHeight + seeAll.height < categoryView.height; |
1489 | 262 | var growingVisible = shouldExpand && y + height < categoryView.height; | 291 | var growingVisible = shouldExpand && y + height < categoryView.height; |
1491 | 263 | if (!previewListView.open || shouldExpand) { | 292 | if (!subPageLoader.open || shouldExpand) { |
1492 | 264 | var animate = shrinkingVisible || growingVisible; | 293 | var animate = shrinkingVisible || growingVisible; |
1493 | 265 | baseItem.expand(shouldExpand, animate) | 294 | baseItem.expand(shouldExpand, animate) |
1495 | 266 | if (shouldExpand && !previewListView.open) { | 295 | if (shouldExpand && !subPageLoader.open) { |
1496 | 267 | categoryView.maximizeVisibleArea(index, item.expandedHeight + seeAll.height); | 296 | categoryView.maximizeVisibleArea(index, item.expandedHeight + seeAll.height); |
1497 | 268 | } | 297 | } |
1498 | 269 | } | 298 | } |
1499 | @@ -380,26 +409,41 @@ | |||
1500 | 380 | } | 409 | } |
1501 | 381 | } | 410 | } |
1502 | 382 | 411 | ||
1506 | 383 | pageHeader: PageHeader { | 412 | pageHeader: scopeView.showPageHeader ? pageHeaderLoader : null |
1507 | 384 | id: pageHeader | 413 | Loader { |
1508 | 385 | objectName: "scopePageHeader" | 414 | id: pageHeaderLoader |
1509 | 386 | width: parent.width | 415 | width: parent.width |
1523 | 387 | title: scopeView.scope ? scopeView.scope.name : "" | 416 | sourceComponent: scopeView.showPageHeader ? pageHeaderComponent : undefined |
1524 | 388 | showBackButton: scopeView.hasBackAction | 417 | Component { |
1525 | 389 | searchEntryEnabled: true | 418 | id: pageHeaderComponent |
1526 | 390 | scopeStyle: scopeView.scopeStyle | 419 | PageHeader { |
1527 | 391 | 420 | objectName: "scopePageHeader" | |
1528 | 392 | bottomItem: DashNavigation { | 421 | width: parent.width |
1529 | 393 | id: dashNavigation | 422 | title: scopeView.scope ? scopeView.scope.name : "" |
1530 | 394 | scope: scopeView.scope | 423 | showBackButton: scopeView.hasBackAction |
1531 | 395 | width: parent.width <= units.gu(60) ? parent.width : units.gu(40) | 424 | searchEntryEnabled: true |
1532 | 396 | anchors.right: parent.right | 425 | settingsEnabled: scopeView.scope ? scopeView.scope.settings && scopeView.scope.settings.count > 0 : false |
1533 | 397 | windowHeight: scopeView.height | 426 | scopeStyle: scopeView.scopeStyle |
1534 | 398 | windowWidth: scopeView.width | 427 | paginationCount: scopeView.paginationCount |
1535 | 399 | scopeStyle: scopeView.scopeStyle | 428 | paginationIndex: scopeView.paginationIndex |
1536 | 429 | |||
1537 | 430 | bottomItem: DashNavigation { | ||
1538 | 431 | scope: scopeView.scope | ||
1539 | 432 | width: parent.width <= units.gu(60) ? parent.width : units.gu(40) | ||
1540 | 433 | anchors.right: parent.right | ||
1541 | 434 | windowHeight: scopeView.height | ||
1542 | 435 | windowWidth: scopeView.width | ||
1543 | 436 | scopeStyle: scopeView.scopeStyle | ||
1544 | 437 | } | ||
1545 | 438 | |||
1546 | 439 | onBackClicked: scopeView.backClicked() | ||
1547 | 440 | |||
1548 | 441 | onSettingsClicked: { | ||
1549 | 442 | subPageLoader.subPage = "settings"; | ||
1550 | 443 | subPageLoader.openSubPage(); | ||
1551 | 444 | } | ||
1552 | 445 | } | ||
1553 | 400 | } | 446 | } |
1554 | 401 | |||
1555 | 402 | onBackClicked: scopeView.backClicked() | ||
1556 | 403 | } | 447 | } |
1557 | 404 | } | 448 | } |
1558 | 405 | 449 | ||
1559 | @@ -407,19 +451,79 @@ | |||
1560 | 407 | id: previewLimitModel | 451 | id: previewLimitModel |
1561 | 408 | } | 452 | } |
1562 | 409 | 453 | ||
1566 | 410 | PreviewListView { | 454 | Loader { |
1567 | 411 | id: previewListView | 455 | id: subPageLoader |
1568 | 412 | objectName: "previewListView" | 456 | objectName: "subPageLoader" |
1569 | 413 | visible: x != width | 457 | visible: x != width |
1570 | 414 | scope: scopeView.scope | ||
1571 | 415 | scopeStyle: scopeView.scopeStyle | ||
1572 | 416 | width: parent.width | 458 | width: parent.width |
1573 | 417 | height: parent.height | 459 | height: parent.height |
1574 | 418 | anchors.left: categoryView.right | 460 | anchors.left: categoryView.right |
1575 | 419 | 461 | ||
1576 | 462 | property bool open: false | ||
1577 | 463 | property var scope: scopeView.scope | ||
1578 | 464 | property var scopeStyle: scopeView.scopeStyle | ||
1579 | 465 | property int currentIndex: -1 | ||
1580 | 466 | property var model: null | ||
1581 | 467 | |||
1582 | 468 | readonly property bool processing: status === Loader.Ready && item.hasOwnProperty("processing") ? item.processing : false | ||
1583 | 469 | readonly property int count: status === Loader.Ready && item.hasOwnProperty("count") ? item.count : 0 | ||
1584 | 470 | readonly property var currentItem: status === Loader.Ready && item.hasOwnProperty("currentItem") ? item.currentItem : false | ||
1585 | 471 | |||
1586 | 472 | property string subPage: "" | ||
1587 | 473 | readonly property bool previewShown: open && subPage == "preview" | ||
1588 | 474 | readonly property bool settingsShown: open && subPage == "settings" | ||
1589 | 475 | |||
1590 | 476 | function updateBindings() { | ||
1591 | 477 | if (status === Loader.Ready) { | ||
1592 | 478 | item.scope = Qt.binding(function() { return subPageLoader.scope } ) | ||
1593 | 479 | item.scopeStyle = Qt.binding(function() { return subPageLoader.scopeStyle } ) | ||
1594 | 480 | if (item.hasOwnProperty("open")) item.open = Qt.binding(function() { return subPageLoader.open } ) | ||
1595 | 481 | if (item.hasOwnProperty("currentIndex")) item.currentIndex = Qt.binding(function() { return subPageLoader.currentIndex } ) | ||
1596 | 482 | if (item.hasOwnProperty("model")) item.model = Qt.binding(function() { return subPageLoader.model } ) | ||
1597 | 483 | } | ||
1598 | 484 | } | ||
1599 | 485 | |||
1600 | 486 | function updateSource() { | ||
1601 | 487 | switch (subPage) { | ||
1602 | 488 | case "preview": source = "PreviewListView.qml"; break; | ||
1603 | 489 | case "settings": source = "ScopeSettingsPage.qml"; break; | ||
1604 | 490 | default: source = ""; break; | ||
1605 | 491 | } | ||
1606 | 492 | } | ||
1607 | 493 | |||
1608 | 494 | function openSubPage() { | ||
1609 | 495 | // FIXME adding the following check before opening makes more sense to me, | ||
1610 | 496 | // but it doesn't seem to work in qmltestrunner::GenericScopeView::test_previewOpenClose() | ||
1611 | 497 | // if (!visible && status === Loader.Ready), x is different to width. | ||
1612 | 498 | // Let's just check status for now. | ||
1613 | 499 | if (status === Loader.Ready) open = true; | ||
1614 | 500 | } | ||
1615 | 501 | |||
1616 | 502 | function closeSubPage() { | ||
1617 | 503 | open = false; | ||
1618 | 504 | subPage = ""; | ||
1619 | 505 | } | ||
1620 | 506 | |||
1621 | 507 | onSubPageChanged: { | ||
1622 | 508 | // let's update the source only when the loader is not visible | ||
1623 | 509 | if (!visible) updateSource(); | ||
1624 | 510 | } | ||
1625 | 511 | |||
1626 | 512 | onVisibleChanged: { | ||
1627 | 513 | // let's update the source only when the loader is not visible | ||
1628 | 514 | if (!visible) updateSource(); | ||
1629 | 515 | } | ||
1630 | 516 | |||
1631 | 517 | onLoaded: updateBindings() | ||
1632 | 518 | |||
1633 | 420 | onOpenChanged: { | 519 | onOpenChanged: { |
1635 | 421 | pageHeader.unfocus(); | 520 | if (open) updateBindings(); |
1636 | 521 | pageHeaderLoader.item.unfocus(); | ||
1637 | 522 | } | ||
1638 | 523 | |||
1639 | 524 | Connections { | ||
1640 | 525 | target: subPageLoader.item | ||
1641 | 526 | onBackClicked: subPageLoader.closeSubPage() | ||
1642 | 422 | } | 527 | } |
1643 | 423 | } | 528 | } |
1644 | 424 | |||
1645 | 425 | } | 529 | } |
1646 | 426 | 530 | ||
1647 | === modified file 'qml/Dash/PreviewListView.qml' | |||
1648 | --- qml/Dash/PreviewListView.qml 2014-07-30 15:46:44 +0000 | |||
1649 | +++ qml/Dash/PreviewListView.qml 2014-08-08 20:44:52 +0000 | |||
1650 | @@ -35,6 +35,8 @@ | |||
1651 | 35 | readonly property bool processing: currentItem && (!currentItem.previewModel.loaded | 35 | readonly property bool processing: currentItem && (!currentItem.previewModel.loaded |
1652 | 36 | || currentItem.previewModel.processingAction) | 36 | || currentItem.previewModel.processingAction) |
1653 | 37 | 37 | ||
1654 | 38 | signal backClicked() | ||
1655 | 39 | |||
1656 | 38 | PageHeader { | 40 | PageHeader { |
1657 | 39 | id: header | 41 | id: header |
1658 | 40 | objectName: "pageHeader" | 42 | objectName: "pageHeader" |
1659 | @@ -44,7 +46,7 @@ | |||
1660 | 44 | searchEntryEnabled: false | 46 | searchEntryEnabled: false |
1661 | 45 | scopeStyle: root.scopeStyle | 47 | scopeStyle: root.scopeStyle |
1662 | 46 | 48 | ||
1664 | 47 | onBackClicked: root.open = false | 49 | onBackClicked: root.backClicked() |
1665 | 48 | } | 50 | } |
1666 | 49 | 51 | ||
1667 | 50 | ListView { | 52 | ListView { |
1668 | @@ -108,7 +110,7 @@ | |||
1669 | 108 | anchors { | 110 | anchors { |
1670 | 109 | left: parent.left | 111 | left: parent.left |
1671 | 110 | right: parent.right | 112 | right: parent.right |
1673 | 111 | top: pageHeader.bottom | 113 | top: header.bottom |
1674 | 112 | bottom: parent.bottom | 114 | bottom: parent.bottom |
1675 | 113 | } | 115 | } |
1676 | 114 | 116 | ||
1677 | 115 | 117 | ||
1678 | === added directory 'qml/Dash/ScopeSettings' | |||
1679 | === added file 'qml/Dash/ScopeSettings/ScopeSetting.qml' | |||
1680 | --- qml/Dash/ScopeSettings/ScopeSetting.qml 1970-01-01 00:00:00 +0000 | |||
1681 | +++ qml/Dash/ScopeSettings/ScopeSetting.qml 2014-08-08 20:44:52 +0000 | |||
1682 | @@ -0,0 +1,36 @@ | |||
1683 | 1 | /* | ||
1684 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
1685 | 3 | * | ||
1686 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1687 | 5 | * it under the terms of the GNU General Public License as published by | ||
1688 | 6 | * the Free Software Foundation; version 3. | ||
1689 | 7 | * | ||
1690 | 8 | * This program is distributed in the hope that it will be useful, | ||
1691 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1692 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1693 | 11 | * GNU General Public License for more details. | ||
1694 | 12 | * | ||
1695 | 13 | * You should have received a copy of the GNU General Public License | ||
1696 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1697 | 15 | */ | ||
1698 | 16 | |||
1699 | 17 | import QtQuick 2.2 | ||
1700 | 18 | import Ubuntu.Components 1.1 | ||
1701 | 19 | |||
1702 | 20 | /*! Interface for settings widgets. */ | ||
1703 | 21 | |||
1704 | 22 | Item { | ||
1705 | 23 | //! The ScopeStyle component. | ||
1706 | 24 | property var scopeStyle: null | ||
1707 | 25 | |||
1708 | 26 | //! Variable used to contain widget's data | ||
1709 | 27 | property var widgetData: null | ||
1710 | 28 | |||
1711 | 29 | readonly property real __margins: units.gu(2) | ||
1712 | 30 | |||
1713 | 31 | /*! \brief This signal should be emitted when a setting action was triggered. | ||
1714 | 32 | * | ||
1715 | 33 | * \param new value | ||
1716 | 34 | */ | ||
1717 | 35 | signal triggered(var value) | ||
1718 | 36 | } | ||
1719 | 0 | 37 | ||
1720 | === added file 'qml/Dash/ScopeSettings/ScopeSettingLabel.qml' | |||
1721 | --- qml/Dash/ScopeSettings/ScopeSettingLabel.qml 1970-01-01 00:00:00 +0000 | |||
1722 | +++ qml/Dash/ScopeSettings/ScopeSettingLabel.qml 2014-08-08 20:44:52 +0000 | |||
1723 | @@ -0,0 +1,51 @@ | |||
1724 | 1 | /* | ||
1725 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
1726 | 3 | * | ||
1727 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1728 | 5 | * it under the terms of the GNU General Public License as published by | ||
1729 | 6 | * the Free Software Foundation; version 3. | ||
1730 | 7 | * | ||
1731 | 8 | * This program is distributed in the hope that it will be useful, | ||
1732 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1733 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1734 | 11 | * GNU General Public License for more details. | ||
1735 | 12 | * | ||
1736 | 13 | * You should have received a copy of the GNU General Public License | ||
1737 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1738 | 15 | */ | ||
1739 | 16 | |||
1740 | 17 | import QtQuick 2.2 | ||
1741 | 18 | import Ubuntu.Components 1.1 | ||
1742 | 19 | |||
1743 | 20 | ScopeSetting { | ||
1744 | 21 | id: root | ||
1745 | 22 | implicitHeight: units.gu(6) | ||
1746 | 23 | |||
1747 | 24 | Label { | ||
1748 | 25 | anchors { | ||
1749 | 26 | left: parent.left | ||
1750 | 27 | leftMargin: __margins | ||
1751 | 28 | right: control.left | ||
1752 | 29 | rightMargin: units.gu(1) | ||
1753 | 30 | verticalCenter: parent.verticalCenter | ||
1754 | 31 | } | ||
1755 | 32 | text: widgetData.displayName | ||
1756 | 33 | elide: Text.ElideMiddle | ||
1757 | 34 | color: scopeStyle ? scopeStyle.foreground : "grey" | ||
1758 | 35 | } | ||
1759 | 36 | |||
1760 | 37 | TextField { | ||
1761 | 38 | id: control | ||
1762 | 39 | anchors { | ||
1763 | 40 | right: parent.right | ||
1764 | 41 | rightMargin: __margins | ||
1765 | 42 | verticalCenter: parent.verticalCenter | ||
1766 | 43 | } | ||
1767 | 44 | text: widgetData.value | ||
1768 | 45 | |||
1769 | 46 | onTriggered: root.triggered(text) | ||
1770 | 47 | onActiveFocusChanged: { | ||
1771 | 48 | if (!activeFocus) root.triggered(text); | ||
1772 | 49 | } | ||
1773 | 50 | } | ||
1774 | 51 | } | ||
1775 | 0 | 52 | ||
1776 | === added file 'qml/Dash/ScopeSettings/ScopeSettingList.qml' | |||
1777 | --- qml/Dash/ScopeSettings/ScopeSettingList.qml 1970-01-01 00:00:00 +0000 | |||
1778 | +++ qml/Dash/ScopeSettings/ScopeSettingList.qml 2014-08-08 20:44:52 +0000 | |||
1779 | @@ -0,0 +1,37 @@ | |||
1780 | 1 | /* | ||
1781 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
1782 | 3 | * | ||
1783 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1784 | 5 | * it under the terms of the GNU General Public License as published by | ||
1785 | 6 | * the Free Software Foundation; version 3. | ||
1786 | 7 | * | ||
1787 | 8 | * This program is distributed in the hope that it will be useful, | ||
1788 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1789 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1790 | 11 | * GNU General Public License for more details. | ||
1791 | 12 | * | ||
1792 | 13 | * You should have received a copy of the GNU General Public License | ||
1793 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1794 | 15 | */ | ||
1795 | 16 | |||
1796 | 17 | import QtQuick 2.2 | ||
1797 | 18 | import Ubuntu.Components 1.1 | ||
1798 | 19 | |||
1799 | 20 | ScopeSetting { | ||
1800 | 21 | id: root | ||
1801 | 22 | implicitHeight: optionSelector.implicitHeight | ||
1802 | 23 | |||
1803 | 24 | OptionSelector { | ||
1804 | 25 | id: optionSelector | ||
1805 | 26 | anchors { | ||
1806 | 27 | left: parent.left | ||
1807 | 28 | right: parent.right | ||
1808 | 29 | top: parent.top | ||
1809 | 30 | margins: __margins | ||
1810 | 31 | } | ||
1811 | 32 | text: widgetData.displayName | ||
1812 | 33 | model: widgetData.properties["values"] | ||
1813 | 34 | |||
1814 | 35 | onSelectedIndexChanged: root.triggered(selectedIndex) | ||
1815 | 36 | } | ||
1816 | 37 | } | ||
1817 | 0 | 38 | ||
1818 | === added file 'qml/Dash/ScopeSettings/ScopeSettingNumber.qml' | |||
1819 | --- qml/Dash/ScopeSettings/ScopeSettingNumber.qml 1970-01-01 00:00:00 +0000 | |||
1820 | +++ qml/Dash/ScopeSettings/ScopeSettingNumber.qml 2014-08-08 20:44:52 +0000 | |||
1821 | @@ -0,0 +1,52 @@ | |||
1822 | 1 | /* | ||
1823 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
1824 | 3 | * | ||
1825 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1826 | 5 | * it under the terms of the GNU General Public License as published by | ||
1827 | 6 | * the Free Software Foundation; version 3. | ||
1828 | 7 | * | ||
1829 | 8 | * This program is distributed in the hope that it will be useful, | ||
1830 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1831 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1832 | 11 | * GNU General Public License for more details. | ||
1833 | 12 | * | ||
1834 | 13 | * You should have received a copy of the GNU General Public License | ||
1835 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1836 | 15 | */ | ||
1837 | 16 | |||
1838 | 17 | import QtQuick 2.2 | ||
1839 | 18 | import Ubuntu.Components 1.1 | ||
1840 | 19 | |||
1841 | 20 | ScopeSetting { | ||
1842 | 21 | id: root | ||
1843 | 22 | implicitHeight: units.gu(6) | ||
1844 | 23 | |||
1845 | 24 | Label { | ||
1846 | 25 | anchors { | ||
1847 | 26 | left: parent.left | ||
1848 | 27 | leftMargin: __margins | ||
1849 | 28 | right: control.left | ||
1850 | 29 | rightMargin: units.gu(1) | ||
1851 | 30 | verticalCenter: parent.verticalCenter | ||
1852 | 31 | } | ||
1853 | 32 | text: widgetData.displayName | ||
1854 | 33 | elide: Text.ElideMiddle | ||
1855 | 34 | color: scopeStyle ? scopeStyle.foreground : "grey" | ||
1856 | 35 | } | ||
1857 | 36 | |||
1858 | 37 | TextField { | ||
1859 | 38 | id: control | ||
1860 | 39 | anchors { | ||
1861 | 40 | right: parent.right | ||
1862 | 41 | rightMargin: __margins | ||
1863 | 42 | verticalCenter: parent.verticalCenter | ||
1864 | 43 | } | ||
1865 | 44 | text: widgetData.value | ||
1866 | 45 | validator: DoubleValidator {} | ||
1867 | 46 | |||
1868 | 47 | onTriggered: root.triggered(text) | ||
1869 | 48 | onActiveFocusChanged: { | ||
1870 | 49 | if (!activeFocus) root.triggered(text); | ||
1871 | 50 | } | ||
1872 | 51 | } | ||
1873 | 52 | } | ||
1874 | 0 | 53 | ||
1875 | === added file 'qml/Dash/ScopeSettings/ScopeSettingSwitch.qml' | |||
1876 | --- qml/Dash/ScopeSettings/ScopeSettingSwitch.qml 1970-01-01 00:00:00 +0000 | |||
1877 | +++ qml/Dash/ScopeSettings/ScopeSettingSwitch.qml 2014-08-08 20:44:52 +0000 | |||
1878 | @@ -0,0 +1,48 @@ | |||
1879 | 1 | /* | ||
1880 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
1881 | 3 | * | ||
1882 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1883 | 5 | * it under the terms of the GNU General Public License as published by | ||
1884 | 6 | * the Free Software Foundation; version 3. | ||
1885 | 7 | * | ||
1886 | 8 | * This program is distributed in the hope that it will be useful, | ||
1887 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1888 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1889 | 11 | * GNU General Public License for more details. | ||
1890 | 12 | * | ||
1891 | 13 | * You should have received a copy of the GNU General Public License | ||
1892 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1893 | 15 | */ | ||
1894 | 16 | |||
1895 | 17 | import QtQuick 2.2 | ||
1896 | 18 | import Ubuntu.Components 1.1 | ||
1897 | 19 | |||
1898 | 20 | ScopeSetting { | ||
1899 | 21 | id: root | ||
1900 | 22 | implicitHeight: units.gu(6) | ||
1901 | 23 | |||
1902 | 24 | Label { | ||
1903 | 25 | anchors { | ||
1904 | 26 | left: parent.left | ||
1905 | 27 | leftMargin: __margins | ||
1906 | 28 | right: control.left | ||
1907 | 29 | rightMargin: units.gu(1) | ||
1908 | 30 | verticalCenter: parent.verticalCenter | ||
1909 | 31 | } | ||
1910 | 32 | text: widgetData.displayName | ||
1911 | 33 | elide: Text.ElideMiddle | ||
1912 | 34 | color: scopeStyle ? scopeStyle.foreground : "grey" | ||
1913 | 35 | } | ||
1914 | 36 | |||
1915 | 37 | Switch { | ||
1916 | 38 | id: control | ||
1917 | 39 | anchors { | ||
1918 | 40 | right: parent.right | ||
1919 | 41 | rightMargin: __margins | ||
1920 | 42 | verticalCenter: parent.verticalCenter | ||
1921 | 43 | } | ||
1922 | 44 | checked: widgetData.value | ||
1923 | 45 | |||
1924 | 46 | onTriggered: root.triggered(checked) | ||
1925 | 47 | } | ||
1926 | 48 | } | ||
1927 | 0 | 49 | ||
1928 | === added file 'qml/Dash/ScopeSettings/ScopeSettingWidgetFactory.qml' | |||
1929 | --- qml/Dash/ScopeSettings/ScopeSettingWidgetFactory.qml 1970-01-01 00:00:00 +0000 | |||
1930 | +++ qml/Dash/ScopeSettings/ScopeSettingWidgetFactory.qml 2014-08-08 20:44:52 +0000 | |||
1931 | @@ -0,0 +1,55 @@ | |||
1932 | 1 | /* | ||
1933 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
1934 | 3 | * | ||
1935 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1936 | 5 | * it under the terms of the GNU General Public License as published by | ||
1937 | 6 | * the Free Software Foundation; version 3. | ||
1938 | 7 | * | ||
1939 | 8 | * This program is distributed in the hope that it will be useful, | ||
1940 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1941 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1942 | 11 | * GNU General Public License for more details. | ||
1943 | 12 | * | ||
1944 | 13 | * You should have received a copy of the GNU General Public License | ||
1945 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1946 | 15 | */ | ||
1947 | 16 | |||
1948 | 17 | import QtQuick 2.2 | ||
1949 | 18 | |||
1950 | 19 | //! \brief This component loads the widgets based on type. | ||
1951 | 20 | |||
1952 | 21 | Loader { | ||
1953 | 22 | id: root | ||
1954 | 23 | |||
1955 | 24 | //! The ScopeStyle component. | ||
1956 | 25 | property var scopeStyle: null | ||
1957 | 26 | |||
1958 | 27 | //! Variable used to contain widget's data | ||
1959 | 28 | property var widgetData: null | ||
1960 | 29 | |||
1961 | 30 | //! Triggered signal forwarded from the widgets. | ||
1962 | 31 | signal triggered(var value) | ||
1963 | 32 | |||
1964 | 33 | source: widgetSource | ||
1965 | 34 | |||
1966 | 35 | //! \cond private | ||
1967 | 36 | property url widgetSource: { | ||
1968 | 37 | switch (widgetData.type) { | ||
1969 | 38 | case "boolean": return "ScopeSettingSwitch.qml"; | ||
1970 | 39 | case "list": return "ScopeSettingSwitch.qml"; | ||
1971 | 40 | case "number": return "ScopeSettingNumber.qml"; | ||
1972 | 41 | case "string": return "ScopeSettingLabel.qml"; | ||
1973 | 42 | default: return ""; | ||
1974 | 43 | } | ||
1975 | 44 | } | ||
1976 | 45 | //! \endcond | ||
1977 | 46 | |||
1978 | 47 | onLoaded: { | ||
1979 | 48 | item.widgetData = Qt.binding(function() { return root.widgetData } ) | ||
1980 | 49 | } | ||
1981 | 50 | |||
1982 | 51 | Connections { | ||
1983 | 52 | target: root.item | ||
1984 | 53 | onTriggered: root.triggered(value) | ||
1985 | 54 | } | ||
1986 | 55 | } | ||
1987 | 0 | 56 | ||
1988 | === added file 'qml/Dash/ScopeSettings/ScopeSettings.qml' | |||
1989 | --- qml/Dash/ScopeSettings/ScopeSettings.qml 1970-01-01 00:00:00 +0000 | |||
1990 | +++ qml/Dash/ScopeSettings/ScopeSettings.qml 2014-08-08 20:44:52 +0000 | |||
1991 | @@ -0,0 +1,35 @@ | |||
1992 | 1 | /* | ||
1993 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
1994 | 3 | * | ||
1995 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1996 | 5 | * it under the terms of the GNU General Public License as published by | ||
1997 | 6 | * the Free Software Foundation; version 3. | ||
1998 | 7 | * | ||
1999 | 8 | * This program is distributed in the hope that it will be useful, | ||
2000 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2001 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2002 | 11 | * GNU General Public License for more details. | ||
2003 | 12 | * | ||
2004 | 13 | * You should have received a copy of the GNU General Public License | ||
2005 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2006 | 15 | */ | ||
2007 | 16 | |||
2008 | 17 | import QtQuick 2.2 | ||
2009 | 18 | import Ubuntu.Components 1.1 | ||
2010 | 19 | |||
2011 | 20 | ListView { | ||
2012 | 21 | //! The ScopeStyle component. | ||
2013 | 22 | property var scopeStyle: null | ||
2014 | 23 | |||
2015 | 24 | orientation: ListView.Vertical | ||
2016 | 25 | |||
2017 | 26 | delegate: ScopeSettingWidgetFactory { | ||
2018 | 27 | objectName: "scopeSettingItem" + index | ||
2019 | 28 | width: root.width | ||
2020 | 29 | widgetData: model | ||
2021 | 30 | scopeStyle: root.scopeStyle | ||
2022 | 31 | |||
2023 | 32 | onTriggered: model.value = value; | ||
2024 | 33 | } | ||
2025 | 34 | } | ||
2026 | 35 | |||
2027 | 0 | 36 | ||
2028 | === added file 'qml/Dash/ScopeSettingsPage.qml' | |||
2029 | --- qml/Dash/ScopeSettingsPage.qml 1970-01-01 00:00:00 +0000 | |||
2030 | +++ qml/Dash/ScopeSettingsPage.qml 2014-08-08 20:44:52 +0000 | |||
2031 | @@ -0,0 +1,54 @@ | |||
2032 | 1 | /* | ||
2033 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
2034 | 3 | * | ||
2035 | 4 | * This program is free software; you can redistribute it and/or modify | ||
2036 | 5 | * it under the terms of the GNU General Public License as published by | ||
2037 | 6 | * the Free Software Foundation; version 3. | ||
2038 | 7 | * | ||
2039 | 8 | * This program is distributed in the hope that it will be useful, | ||
2040 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2041 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2042 | 11 | * GNU General Public License for more details. | ||
2043 | 12 | * | ||
2044 | 13 | * You should have received a copy of the GNU General Public License | ||
2045 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2046 | 15 | */ | ||
2047 | 16 | |||
2048 | 17 | import QtQuick 2.2 | ||
2049 | 18 | import Ubuntu.Components 1.1 | ||
2050 | 19 | import Unity 0.2 | ||
2051 | 20 | import "../Components" | ||
2052 | 21 | import "ScopeSettings" | ||
2053 | 22 | |||
2054 | 23 | Item { | ||
2055 | 24 | id: root | ||
2056 | 25 | |||
2057 | 26 | property var scope: null | ||
2058 | 27 | property var scopeStyle: null | ||
2059 | 28 | |||
2060 | 29 | signal backClicked() | ||
2061 | 30 | |||
2062 | 31 | PageHeader { | ||
2063 | 32 | id: header | ||
2064 | 33 | objectName: "pageHeader" | ||
2065 | 34 | width: parent.width | ||
2066 | 35 | title: scope ? scope.name : "" | ||
2067 | 36 | showBackButton: true | ||
2068 | 37 | searchEntryEnabled: false | ||
2069 | 38 | scopeStyle: root.scopeStyle || undefined | ||
2070 | 39 | |||
2071 | 40 | onBackClicked: root.backClicked() | ||
2072 | 41 | } | ||
2073 | 42 | |||
2074 | 43 | ScopeSettings { | ||
2075 | 44 | id: scopeSettings | ||
2076 | 45 | objectName: "scopeSettings" | ||
2077 | 46 | anchors { | ||
2078 | 47 | top: header.bottom | ||
2079 | 48 | bottom: parent.bottom | ||
2080 | 49 | left: parent.left | ||
2081 | 50 | right: parent.right | ||
2082 | 51 | } | ||
2083 | 52 | model: root.scope ? root.scope.settings : null | ||
2084 | 53 | } | ||
2085 | 54 | } | ||
2086 | 0 | 55 | ||
2087 | === added file 'qml/Dash/ScopesOverview.qml' | |||
2088 | --- qml/Dash/ScopesOverview.qml 1970-01-01 00:00:00 +0000 | |||
2089 | +++ qml/Dash/ScopesOverview.qml 2014-08-08 20:44:52 +0000 | |||
2090 | @@ -0,0 +1,533 @@ | |||
2091 | 1 | /* | ||
2092 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
2093 | 3 | * | ||
2094 | 4 | * This program is free software; you can redistribute it and/or modify | ||
2095 | 5 | * it under the terms of the GNU General Public License as published by | ||
2096 | 6 | * the Free Software Foundation; version 3. | ||
2097 | 7 | * | ||
2098 | 8 | * This program is distributed in the hope that it will be useful, | ||
2099 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2100 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2101 | 11 | * GNU General Public License for more details. | ||
2102 | 12 | * | ||
2103 | 13 | * You should have received a copy of the GNU General Public License | ||
2104 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2105 | 15 | */ | ||
2106 | 16 | |||
2107 | 17 | import QtQuick 2.0 | ||
2108 | 18 | import Dash 0.1 | ||
2109 | 19 | import Ubuntu.Components 0.1 | ||
2110 | 20 | import "../Components" | ||
2111 | 21 | |||
2112 | 22 | Item { | ||
2113 | 23 | id: root | ||
2114 | 24 | |||
2115 | 25 | // Properties set by parent | ||
2116 | 26 | property real progress: 0 | ||
2117 | 27 | property var scope: null | ||
2118 | 28 | property int currentIndex: 0 | ||
2119 | 29 | property real scopeScale: 1 | ||
2120 | 30 | |||
2121 | 31 | // Properties set and used by parent | ||
2122 | 32 | property alias currentTab: tabBar.currentTab | ||
2123 | 33 | |||
2124 | 34 | // Properties used by parent | ||
2125 | 35 | readonly property bool processing: searchResultsViewer.processing || tempScopeItem.processing | ||
2126 | 36 | property bool growingDashFromPos: false | ||
2127 | 37 | readonly property bool searching: scope && scope.searchQuery == "" | ||
2128 | 38 | readonly property bool showingNonFavoriteScope: tempScopeItem.scope != null | ||
2129 | 39 | readonly property var dashItemEater: { | ||
2130 | 40 | if (!forceXYScalerEater && tabBar.currentTab == 0 && middleItems.count > 0) { | ||
2131 | 41 | var loaderItem = middleItems.itemAt(0).item; | ||
2132 | 42 | return loaderItem && loaderItem.currentItem ? loaderItem.currentItem : null; | ||
2133 | 43 | } | ||
2134 | 44 | return scopesOverviewXYScaler; | ||
2135 | 45 | } | ||
2136 | 46 | readonly property size allCardSize: { | ||
2137 | 47 | if (middleItems.count > 1) { | ||
2138 | 48 | var loaderItem = middleItems.itemAt(1).item; | ||
2139 | 49 | if (loaderItem) { | ||
2140 | 50 | var cardTool = loaderItem.cardTool; | ||
2141 | 51 | return Qt.size(cardTool.cardWidth, cardTool.cardHeight); | ||
2142 | 52 | } | ||
2143 | 53 | } | ||
2144 | 54 | return Qt.size(0, 0); | ||
2145 | 55 | } | ||
2146 | 56 | |||
2147 | 57 | // Internal properties | ||
2148 | 58 | property bool forceXYScalerEater: false | ||
2149 | 59 | |||
2150 | 60 | signal done() | ||
2151 | 61 | signal favoriteSelected(var scopeId) | ||
2152 | 62 | signal allFavoriteSelected(var scopeId) | ||
2153 | 63 | signal searchSelected(var scopeId, var result, var pos, var size) | ||
2154 | 64 | |||
2155 | 65 | Connections { | ||
2156 | 66 | target: scope | ||
2157 | 67 | onOpenScope: { | ||
2158 | 68 | var itemPos = scopesOverviewXYScaler.restorePosition; | ||
2159 | 69 | var itemSize = scopesOverviewXYScaler.restoreSize; | ||
2160 | 70 | scopesOverviewXYScaler.scale = itemSize.width / scopesOverviewXYScaler.width; | ||
2161 | 71 | if (itemPos) { | ||
2162 | 72 | scopesOverviewXYScaler.x = itemPos.x -(scopesOverviewXYScaler.width - scopesOverviewXYScaler.width * scopesOverviewXYScaler.scale) / 2; | ||
2163 | 73 | scopesOverviewXYScaler.y = itemPos.y -(scopesOverviewXYScaler.height - scopesOverviewXYScaler.height * scopesOverviewXYScaler.scale) / 2; | ||
2164 | 74 | } else { | ||
2165 | 75 | scopesOverviewXYScaler.x = 0; | ||
2166 | 76 | scopesOverviewXYScaler.y = 0; | ||
2167 | 77 | } | ||
2168 | 78 | scopesOverviewXYScaler.opacity = 0; | ||
2169 | 79 | tempScopeItem.scope = scope; | ||
2170 | 80 | middleItems.overrideOpacity = 0; | ||
2171 | 81 | scopesOverviewXYScaler.scale = 1; | ||
2172 | 82 | scopesOverviewXYScaler.x = 0; | ||
2173 | 83 | scopesOverviewXYScaler.y = 0; | ||
2174 | 84 | scopesOverviewXYScaler.opacity = 1; | ||
2175 | 85 | } | ||
2176 | 86 | onGotoScope: { | ||
2177 | 87 | if (tabBar.currentTab == 0) { | ||
2178 | 88 | root.favoriteSelected(scopeId); | ||
2179 | 89 | } else { | ||
2180 | 90 | root.allFavoriteSelected(scopeId); | ||
2181 | 91 | } | ||
2182 | 92 | } | ||
2183 | 93 | } | ||
2184 | 94 | |||
2185 | 95 | Binding { | ||
2186 | 96 | target: scope | ||
2187 | 97 | property: "isActive" | ||
2188 | 98 | value: progress === 1 | ||
2189 | 99 | } | ||
2190 | 100 | |||
2191 | 101 | function animateDashFromAll(scopeId) { | ||
2192 | 102 | var currentScopePos = allScopeCardPosition(scopeId); | ||
2193 | 103 | if (currentScopePos) { | ||
2194 | 104 | showDashFromPos(currentScopePos, allCardSize); | ||
2195 | 105 | } else { | ||
2196 | 106 | console.log("Warning: Could not find Dash OverView All card position for scope", dashContent.currentScopeId); | ||
2197 | 107 | } | ||
2198 | 108 | } | ||
2199 | 109 | |||
2200 | 110 | function showDashFromPos(itemPos, itemSize) { | ||
2201 | 111 | scopesOverviewXYScaler.scale = itemSize.width / scopesOverviewXYScaler.width; | ||
2202 | 112 | scopesOverviewXYScaler.x = itemPos.x -(scopesOverviewXYScaler.width - scopesOverviewXYScaler.width * scopesOverviewXYScaler.scale) / 2; | ||
2203 | 113 | scopesOverviewXYScaler.y = itemPos.y -(scopesOverviewXYScaler.height - scopesOverviewXYScaler.height * scopesOverviewXYScaler.scale) / 2; | ||
2204 | 114 | scopesOverviewXYScaler.opacity = 0; | ||
2205 | 115 | root.growingDashFromPos = true; | ||
2206 | 116 | scopesOverviewXYScaler.scale = 1; | ||
2207 | 117 | scopesOverviewXYScaler.x = 0; | ||
2208 | 118 | scopesOverviewXYScaler.y = 0; | ||
2209 | 119 | scopesOverviewXYScaler.opacity = 1; | ||
2210 | 120 | } | ||
2211 | 121 | |||
2212 | 122 | function allScopeCardPosition(scopeId) { | ||
2213 | 123 | if (middleItems.count > 1) { | ||
2214 | 124 | var loaderItem = middleItems.itemAt(1).item; | ||
2215 | 125 | if (loaderItem) { | ||
2216 | 126 | var pos = loaderItem.scopeCardPosition(scopeId); | ||
2217 | 127 | return loaderItem.mapToItem(null, pos.x, pos.y); | ||
2218 | 128 | } | ||
2219 | 129 | } | ||
2220 | 130 | } | ||
2221 | 131 | |||
2222 | 132 | function ensureAllScopeVisible(scopeId) { | ||
2223 | 133 | if (middleItems.count > 1) { | ||
2224 | 134 | var loaderItem = middleItems.itemAt(1).item; | ||
2225 | 135 | if (loaderItem) { | ||
2226 | 136 | var pos = loaderItem.scopeCardPosition(scopeId); | ||
2227 | 137 | loaderItem.contentY = Math.min(pos.y, loaderItem.contentHeight - loaderItem.height); | ||
2228 | 138 | } | ||
2229 | 139 | } | ||
2230 | 140 | } | ||
2231 | 141 | |||
2232 | 142 | onProgressChanged: { | ||
2233 | 143 | if (progress == 0) { | ||
2234 | 144 | pageHeader.resetSearch(); | ||
2235 | 145 | pageHeader.unfocus(); // Shouldn't the previous call do this too? | ||
2236 | 146 | } | ||
2237 | 147 | } | ||
2238 | 148 | |||
2239 | 149 | ScopeStyle { | ||
2240 | 150 | id: overviewScopeStyle | ||
2241 | 151 | style: { "foreground-color" : "white", "background-color" : "transparent" } | ||
2242 | 152 | } | ||
2243 | 153 | |||
2244 | 154 | DashBackground { | ||
2245 | 155 | anchors.fill: parent | ||
2246 | 156 | source: "graphics/dark_background.jpg" | ||
2247 | 157 | } | ||
2248 | 158 | |||
2249 | 159 | Connections { | ||
2250 | 160 | target: pageHeader | ||
2251 | 161 | onSearchQueryChanged: { | ||
2252 | 162 | // Need this in order, otherwise something gets unhappy in rendering | ||
2253 | 163 | // of the overlay in carousels because the parent of the dash dies for | ||
2254 | 164 | // a moment, this way we make sure it's reparented first | ||
2255 | 165 | // by forceXYScalerEater making dashItemEater return scopesOverviewXYScaler | ||
2256 | 166 | // before we kill the previous parent by scope.searchQuery | ||
2257 | 167 | root.forceXYScalerEater = true; | ||
2258 | 168 | root.scope.searchQuery = pageHeader.searchQuery; | ||
2259 | 169 | root.forceXYScalerEater = false; | ||
2260 | 170 | } | ||
2261 | 171 | } | ||
2262 | 172 | |||
2263 | 173 | Binding { | ||
2264 | 174 | target: pageHeader | ||
2265 | 175 | property: "searchQuery" | ||
2266 | 176 | value: scope ? scope.searchQuery : "" | ||
2267 | 177 | } | ||
2268 | 178 | |||
2269 | 179 | Item { | ||
2270 | 180 | id: scopesOverviewContent | ||
2271 | 181 | x: previewListView.open ? -width : 0 | ||
2272 | 182 | Behavior on x { UbuntuNumberAnimation { } } | ||
2273 | 183 | width: parent.width | ||
2274 | 184 | height: parent.height | ||
2275 | 185 | |||
2276 | 186 | PageHeader { | ||
2277 | 187 | id: pageHeader | ||
2278 | 188 | objectName: "scopesOverviewPageHeader" | ||
2279 | 189 | |||
2280 | 190 | readonly property real yDisplacement: pageHeader.height + tabBar.height + tabBar.anchors.margins | ||
2281 | 191 | |||
2282 | 192 | y: { | ||
2283 | 193 | if (root.progress < 0.5) { | ||
2284 | 194 | return -yDisplacement; | ||
2285 | 195 | } else { | ||
2286 | 196 | return -yDisplacement + (root.progress - 0.5) * yDisplacement * 2; | ||
2287 | 197 | } | ||
2288 | 198 | } | ||
2289 | 199 | width: parent.width | ||
2290 | 200 | clip: true | ||
2291 | 201 | title: i18n.tr("Manage Dash") | ||
2292 | 202 | scopeStyle: overviewScopeStyle | ||
2293 | 203 | showSignatureLine: false | ||
2294 | 204 | searchEntryEnabled: true | ||
2295 | 205 | } | ||
2296 | 206 | |||
2297 | 207 | ScopesOverviewTab { | ||
2298 | 208 | id: tabBar | ||
2299 | 209 | anchors { | ||
2300 | 210 | left: parent.left | ||
2301 | 211 | right: parent.right | ||
2302 | 212 | top: pageHeader.bottom | ||
2303 | 213 | margins: units.gu(2) | ||
2304 | 214 | } | ||
2305 | 215 | height: units.gu(4) | ||
2306 | 216 | |||
2307 | 217 | enabled: opacity == 1 | ||
2308 | 218 | opacity: !scope || scope.searchQuery == "" ? 1 : 0 | ||
2309 | 219 | Behavior on opacity { UbuntuNumberAnimation { } } | ||
2310 | 220 | } | ||
2311 | 221 | |||
2312 | 222 | Repeater { | ||
2313 | 223 | id: middleItems | ||
2314 | 224 | objectName: "scopesOverviewRepeater" | ||
2315 | 225 | property real overrideOpacity: -1 | ||
2316 | 226 | model: scope && scope.searchQuery == "" ? scope.categories : null | ||
2317 | 227 | delegate: Loader { | ||
2318 | 228 | id: loader | ||
2319 | 229 | objectName: "scopesOverviewRepeaterChild" + index | ||
2320 | 230 | |||
2321 | 231 | height: { | ||
2322 | 232 | if (index == 0) { | ||
2323 | 233 | return root.height; | ||
2324 | 234 | } else { | ||
2325 | 235 | return root.height - pageHeader.height - tabBar.height - tabBar.anchors.margins - units.gu(2); | ||
2326 | 236 | } | ||
2327 | 237 | } | ||
2328 | 238 | width: { | ||
2329 | 239 | if (index == 0) { | ||
2330 | 240 | return root.width / scopeScale; | ||
2331 | 241 | } else { | ||
2332 | 242 | return root.width; | ||
2333 | 243 | } | ||
2334 | 244 | } | ||
2335 | 245 | x: { | ||
2336 | 246 | if (index == 0) { | ||
2337 | 247 | return (root.width - width) / 2; | ||
2338 | 248 | } else { | ||
2339 | 249 | return 0; | ||
2340 | 250 | } | ||
2341 | 251 | } | ||
2342 | 252 | anchors { | ||
2343 | 253 | bottom: scopesOverviewContent.bottom | ||
2344 | 254 | } | ||
2345 | 255 | |||
2346 | 256 | scale: index == 0 ? scopeScale : 1 | ||
2347 | 257 | |||
2348 | 258 | opacity: { | ||
2349 | 259 | if (middleItems.overrideOpacity >= 0) | ||
2350 | 260 | return middleItems.overrideOpacity; | ||
2351 | 261 | |||
2352 | 262 | if (tabBar.currentTab != index) | ||
2353 | 263 | return 0; | ||
2354 | 264 | |||
2355 | 265 | return index == 0 ? 1 : root.progress; | ||
2356 | 266 | } | ||
2357 | 267 | Behavior on opacity { | ||
2358 | 268 | enabled: root.progress == 1 | ||
2359 | 269 | UbuntuNumberAnimation { } | ||
2360 | 270 | } | ||
2361 | 271 | enabled: opacity == 1 | ||
2362 | 272 | |||
2363 | 273 | clip: index == 1 | ||
2364 | 274 | |||
2365 | 275 | CardTool { | ||
2366 | 276 | id: cardTool | ||
2367 | 277 | objectName: "cardTool" | ||
2368 | 278 | count: results.count | ||
2369 | 279 | template: model.renderer | ||
2370 | 280 | components: model.components | ||
2371 | 281 | viewWidth: parent.width | ||
2372 | 282 | } | ||
2373 | 283 | |||
2374 | 284 | source: { | ||
2375 | 285 | if (index == 0 && categoryId == "favorites") return "ScopesOverviewFavorites.qml"; | ||
2376 | 286 | else if (index == 1 && categoryId == "all") return "ScopesOverviewAll.qml"; | ||
2377 | 287 | else return ""; | ||
2378 | 288 | } | ||
2379 | 289 | |||
2380 | 290 | onLoaded: { | ||
2381 | 291 | item.model = Qt.binding(function() { return results; }); | ||
2382 | 292 | item.cardTool = cardTool; | ||
2383 | 293 | if (index == 0) { | ||
2384 | 294 | item.scopeWidth = Qt.binding(function() { return root.width; }); | ||
2385 | 295 | item.scopeHeight = Qt.binding(function() { return root.height; }); | ||
2386 | 296 | item.appliedScale = Qt.binding(function() { return loader.scale }); | ||
2387 | 297 | item.currentIndex = Qt.binding(function() { return root.currentIndex }); | ||
2388 | 298 | } else if (index == 1) { | ||
2389 | 299 | item.extraHeight = bottomBar.height; | ||
2390 | 300 | } | ||
2391 | 301 | } | ||
2392 | 302 | |||
2393 | 303 | Connections { | ||
2394 | 304 | target: loader.item | ||
2395 | 305 | onClicked: { | ||
2396 | 306 | pageHeader.unfocus(); | ||
2397 | 307 | if (tabBar.currentTab == 0) { | ||
2398 | 308 | root.favoriteSelected(itemModel.scopeId); | ||
2399 | 309 | } else { | ||
2400 | 310 | var favoriteScopesItem = middleItems.itemAt(0).item; | ||
2401 | 311 | var scopeIndex = favoriteScopesItem.model.scopeIndex(itemModel.scopeId); | ||
2402 | 312 | if (scopeIndex >= 0) { | ||
2403 | 313 | root.allFavoriteSelected(itemModel.scopeId); | ||
2404 | 314 | } else { | ||
2405 | 315 | // Will result in an openScope from root.scope | ||
2406 | 316 | scopesOverviewXYScaler.restorePosition = item.mapToItem(null, 0, 0); | ||
2407 | 317 | scopesOverviewXYScaler.restoreSize = allCardSize; | ||
2408 | 318 | root.scope.activate(result); | ||
2409 | 319 | } | ||
2410 | 320 | } | ||
2411 | 321 | } | ||
2412 | 322 | onPressAndHold: { | ||
2413 | 323 | // Preview can call openScope so make sure restorePosition and restoreSize are set | ||
2414 | 324 | scopesOverviewXYScaler.restorePosition = undefined; | ||
2415 | 325 | scopesOverviewXYScaler.restoreSize = allCardSize; | ||
2416 | 326 | |||
2417 | 327 | previewListView.model = target.model; | ||
2418 | 328 | previewListView.currentIndex = -1; | ||
2419 | 329 | previewListView.currentIndex = index; | ||
2420 | 330 | previewListView.open = true; | ||
2421 | 331 | } | ||
2422 | 332 | } | ||
2423 | 333 | } | ||
2424 | 334 | } | ||
2425 | 335 | |||
2426 | 336 | GenericScopeView { | ||
2427 | 337 | id: searchResultsViewer | ||
2428 | 338 | objectName: "searchResultsViewer" | ||
2429 | 339 | anchors { | ||
2430 | 340 | top: pageHeader.bottom | ||
2431 | 341 | right: parent.right | ||
2432 | 342 | left: parent.left | ||
2433 | 343 | bottom: parent.bottom | ||
2434 | 344 | } | ||
2435 | 345 | scope: root.scope && root.scope.searchQuery != "" ? root.scope : null | ||
2436 | 346 | scopeStyle: overviewScopeStyle | ||
2437 | 347 | enabled: opacity == 1 | ||
2438 | 348 | showPageHeader: false | ||
2439 | 349 | clip: true | ||
2440 | 350 | opacity: searchResultsViewer.scope ? 1 : 0 | ||
2441 | 351 | isCurrent: true | ||
2442 | 352 | Behavior on opacity { UbuntuNumberAnimation { } } | ||
2443 | 353 | |||
2444 | 354 | function itemClicked(index, result, item, itemModel, resultsModel, limitedCategoryItemCount) { | ||
2445 | 355 | pageHeader.unfocus(); | ||
2446 | 356 | pageHeader.closePopup(); | ||
2447 | 357 | if (itemModel.scopeId) { | ||
2448 | 358 | // This can end up in openScope so save restorePosition and restoreSize | ||
2449 | 359 | scopesOverviewXYScaler.restorePosition = item.mapToItem(null, 0, 0); | ||
2450 | 360 | scopesOverviewXYScaler.restoreSize = Qt.size(item.width, item.height); | ||
2451 | 361 | root.searchSelected(itemModel.scopeId, result, item.mapToItem(null, 0, 0), Qt.size(item.width, item.height)); | ||
2452 | 362 | } else { | ||
2453 | 363 | // Not a scope, just activate it | ||
2454 | 364 | searchResultsViewer.scope.activate(result); | ||
2455 | 365 | } | ||
2456 | 366 | } | ||
2457 | 367 | |||
2458 | 368 | function itemPressedAndHeld(index, resultsModel, limitedCategoryItemCount) { | ||
2459 | 369 | // Do nothing | ||
2460 | 370 | } | ||
2461 | 371 | } | ||
2462 | 372 | |||
2463 | 373 | Rectangle { | ||
2464 | 374 | id: bottomBar | ||
2465 | 375 | color: "black" | ||
2466 | 376 | height: units.gu(8) | ||
2467 | 377 | width: parent.width | ||
2468 | 378 | enabled: opacity == 1 | ||
2469 | 379 | opacity: scope && scope.searchQuery == "" ? 1 : 0 | ||
2470 | 380 | Behavior on opacity { UbuntuNumberAnimation { } } | ||
2471 | 381 | y: { | ||
2472 | 382 | if (root.progress < 0.5) { | ||
2473 | 383 | return parent.height; | ||
2474 | 384 | } else { | ||
2475 | 385 | return parent.height - (root.progress - 0.5) * height * 2; | ||
2476 | 386 | } | ||
2477 | 387 | } | ||
2478 | 388 | |||
2479 | 389 | AbstractButton { | ||
2480 | 390 | objectName: "scopesOverviewDoneButton" | ||
2481 | 391 | width: Math.max(label.width + units.gu(2), units.gu(10)) | ||
2482 | 392 | height: units.gu(4) | ||
2483 | 393 | anchors { | ||
2484 | 394 | left: parent.left | ||
2485 | 395 | leftMargin: units.gu(2) | ||
2486 | 396 | verticalCenter: parent.verticalCenter | ||
2487 | 397 | } | ||
2488 | 398 | Rectangle { | ||
2489 | 399 | anchors.fill: parent | ||
2490 | 400 | border.color: "white" | ||
2491 | 401 | border.width: units.dp(1) | ||
2492 | 402 | radius: units.dp(10) | ||
2493 | 403 | color: parent.pressed ? "gray" : "transparent" | ||
2494 | 404 | } | ||
2495 | 405 | Label { | ||
2496 | 406 | id: label | ||
2497 | 407 | anchors.centerIn: parent | ||
2498 | 408 | text: i18n.tr("Done") | ||
2499 | 409 | color: parent.pressed ? "black" : "white" | ||
2500 | 410 | } | ||
2501 | 411 | onClicked: root.done(); | ||
2502 | 412 | } | ||
2503 | 413 | |||
2504 | 414 | AbstractButton { | ||
2505 | 415 | objectName: "scopesOverviewStoreButton" | ||
2506 | 416 | width: Math.max(storeLabel.width, units.gu(10)) | ||
2507 | 417 | height: units.gu(4) | ||
2508 | 418 | anchors { | ||
2509 | 419 | right: parent.right | ||
2510 | 420 | verticalCenter: parent.verticalCenter | ||
2511 | 421 | } | ||
2512 | 422 | Icon { | ||
2513 | 423 | id: storeImage | ||
2514 | 424 | name: "ubuntu-store-symbolic" | ||
2515 | 425 | color: "white" | ||
2516 | 426 | anchors.horizontalCenter: parent.horizontalCenter | ||
2517 | 427 | width: units.gu(2) | ||
2518 | 428 | height: units.gu(2) | ||
2519 | 429 | } | ||
2520 | 430 | Label { | ||
2521 | 431 | id: storeLabel | ||
2522 | 432 | anchors.horizontalCenter: parent.horizontalCenter | ||
2523 | 433 | anchors.top: storeImage.bottom | ||
2524 | 434 | text: i18n.tr("Store") | ||
2525 | 435 | color: "white" | ||
2526 | 436 | } | ||
2527 | 437 | onClicked: { | ||
2528 | 438 | // Just zoom from the middle | ||
2529 | 439 | scopesOverviewXYScaler.restorePosition = undefined; | ||
2530 | 440 | scopesOverviewXYScaler.restoreSize = allCardSize; | ||
2531 | 441 | scope.performQuery("scope://com.canonical.scopes.clickstore"); | ||
2532 | 442 | } | ||
2533 | 443 | } | ||
2534 | 444 | } | ||
2535 | 445 | } | ||
2536 | 446 | |||
2537 | 447 | PreviewListView { | ||
2538 | 448 | id: previewListView | ||
2539 | 449 | objectName: "scopesOverviewPreviewListView" | ||
2540 | 450 | scope: root.scope | ||
2541 | 451 | scopeStyle: overviewScopeStyle | ||
2542 | 452 | visible: x != width | ||
2543 | 453 | width: parent.width | ||
2544 | 454 | height: parent.height | ||
2545 | 455 | anchors.left: scopesOverviewContent.right | ||
2546 | 456 | } | ||
2547 | 457 | |||
2548 | 458 | |||
2549 | 459 | |||
2550 | 460 | Item { | ||
2551 | 461 | id: scopesOverviewXYScaler | ||
2552 | 462 | width: parent.width | ||
2553 | 463 | height: parent.height | ||
2554 | 464 | |||
2555 | 465 | clip: scale != 1.0 | ||
2556 | 466 | enabled: scale == 1 | ||
2557 | 467 | |||
2558 | 468 | property bool animationsEnabled: root.showingNonFavoriteScope || root.growingDashFromPos | ||
2559 | 469 | |||
2560 | 470 | property var restorePosition | ||
2561 | 471 | property var restoreSize | ||
2562 | 472 | |||
2563 | 473 | Behavior on x { | ||
2564 | 474 | enabled: scopesOverviewXYScaler.animationsEnabled | ||
2565 | 475 | UbuntuNumberAnimation { } | ||
2566 | 476 | } | ||
2567 | 477 | Behavior on y { | ||
2568 | 478 | enabled: scopesOverviewXYScaler.animationsEnabled | ||
2569 | 479 | UbuntuNumberAnimation { } | ||
2570 | 480 | } | ||
2571 | 481 | Behavior on opacity { | ||
2572 | 482 | enabled: scopesOverviewXYScaler.animationsEnabled | ||
2573 | 483 | UbuntuNumberAnimation { } | ||
2574 | 484 | } | ||
2575 | 485 | Behavior on scale { | ||
2576 | 486 | enabled: scopesOverviewXYScaler.animationsEnabled | ||
2577 | 487 | UbuntuNumberAnimation { | ||
2578 | 488 | onRunningChanged: { | ||
2579 | 489 | if (!running) { | ||
2580 | 490 | if (root.showingNonFavoriteScope && scopesOverviewXYScaler.scale != 1) { | ||
2581 | 491 | root.scope.closeScope(tempScopeItem.scope); | ||
2582 | 492 | tempScopeItem.scope = null; | ||
2583 | 493 | } else if (root.growingDashFromPos) { | ||
2584 | 494 | root.growingDashFromPos = false; | ||
2585 | 495 | } | ||
2586 | 496 | } | ||
2587 | 497 | } | ||
2588 | 498 | } | ||
2589 | 499 | } | ||
2590 | 500 | |||
2591 | 501 | DashBackground { | ||
2592 | 502 | anchors.fill: tempScopeItem | ||
2593 | 503 | visible: tempScopeItem.visible | ||
2594 | 504 | parent: tempScopeItem.parent | ||
2595 | 505 | } | ||
2596 | 506 | |||
2597 | 507 | GenericScopeView { | ||
2598 | 508 | id: tempScopeItem | ||
2599 | 509 | objectName: "scopesOverviewTempScopeItem" | ||
2600 | 510 | |||
2601 | 511 | width: parent.width | ||
2602 | 512 | height: parent.height | ||
2603 | 513 | scale: dash.contentScale | ||
2604 | 514 | clip: scale != 1.0 | ||
2605 | 515 | visible: scope != null | ||
2606 | 516 | hasBackAction: true | ||
2607 | 517 | isCurrent: visible | ||
2608 | 518 | onBackClicked: { | ||
2609 | 519 | var v = scopesOverviewXYScaler.restoreSize.width / tempScopeItem.width; | ||
2610 | 520 | scopesOverviewXYScaler.scale = v; | ||
2611 | 521 | if (scopesOverviewXYScaler.restorePosition) { | ||
2612 | 522 | scopesOverviewXYScaler.x = scopesOverviewXYScaler.restorePosition.x -(tempScopeItem.width - tempScopeItem.width * v) / 2; | ||
2613 | 523 | scopesOverviewXYScaler.y = scopesOverviewXYScaler.restorePosition.y -(tempScopeItem.height - tempScopeItem.height * v) / 2; | ||
2614 | 524 | } else { | ||
2615 | 525 | scopesOverviewXYScaler.x = 0; | ||
2616 | 526 | scopesOverviewXYScaler.y = 0; | ||
2617 | 527 | } | ||
2618 | 528 | scopesOverviewXYScaler.opacity = 0; | ||
2619 | 529 | middleItems.overrideOpacity = -1; | ||
2620 | 530 | } | ||
2621 | 531 | } | ||
2622 | 532 | } | ||
2623 | 533 | } | ||
2624 | 0 | 534 | ||
2625 | === added file 'qml/Dash/ScopesOverviewAll.qml' | |||
2626 | --- qml/Dash/ScopesOverviewAll.qml 1970-01-01 00:00:00 +0000 | |||
2627 | +++ qml/Dash/ScopesOverviewAll.qml 2014-08-08 20:44:52 +0000 | |||
2628 | @@ -0,0 +1,54 @@ | |||
2629 | 1 | /* | ||
2630 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
2631 | 3 | * | ||
2632 | 4 | * This program is free software; you can redistribute it and/or modify | ||
2633 | 5 | * it under the terms of the GNU General Public License as published by | ||
2634 | 6 | * the Free Software Foundation; version 3. | ||
2635 | 7 | * | ||
2636 | 8 | * This program is distributed in the hope that it will be useful, | ||
2637 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2638 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2639 | 11 | * GNU General Public License for more details. | ||
2640 | 12 | * | ||
2641 | 13 | * You should have received a copy of the GNU General Public License | ||
2642 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2643 | 15 | */ | ||
2644 | 16 | |||
2645 | 17 | import QtQuick 2.0 | ||
2646 | 18 | import Ubuntu.Components 0.1 | ||
2647 | 19 | |||
2648 | 20 | Flickable { | ||
2649 | 21 | id: root | ||
2650 | 22 | |||
2651 | 23 | property alias model: cardGrid.model | ||
2652 | 24 | property alias cardTool: cardGrid.cardTool | ||
2653 | 25 | |||
2654 | 26 | property real extraHeight: 0 | ||
2655 | 27 | |||
2656 | 28 | signal clicked(int index, var result, var item, var itemModel) | ||
2657 | 29 | signal pressAndHold(int index) | ||
2658 | 30 | |||
2659 | 31 | contentHeight: cardGrid.expandedHeight + extraHeight | ||
2660 | 32 | contentWidth: cardGrid.width | ||
2661 | 33 | flickableDirection: Flickable.VerticalFlick | ||
2662 | 34 | |||
2663 | 35 | function scopeCardPosition(scopeId) { | ||
2664 | 36 | var index = model.scopeIndex(scopeId); | ||
2665 | 37 | var pos = cardGrid.cardPosition(index); | ||
2666 | 38 | pos.y = pos.y - root.contentY; | ||
2667 | 39 | return pos; | ||
2668 | 40 | } | ||
2669 | 41 | |||
2670 | 42 | CardGrid { | ||
2671 | 43 | id: cardGrid | ||
2672 | 44 | width: root.width | ||
2673 | 45 | height: parent.height | ||
2674 | 46 | |||
2675 | 47 | onClicked: { | ||
2676 | 48 | root.clicked(index, result, item, itemModel); | ||
2677 | 49 | } | ||
2678 | 50 | onPressAndHold: { | ||
2679 | 51 | root.pressAndHold(index); | ||
2680 | 52 | } | ||
2681 | 53 | } | ||
2682 | 54 | } | ||
2683 | 0 | 55 | ||
2684 | === added file 'qml/Dash/ScopesOverviewFavorites.qml' | |||
2685 | --- qml/Dash/ScopesOverviewFavorites.qml 1970-01-01 00:00:00 +0000 | |||
2686 | +++ qml/Dash/ScopesOverviewFavorites.qml 2014-08-08 20:44:52 +0000 | |||
2687 | @@ -0,0 +1,73 @@ | |||
2688 | 1 | /* | ||
2689 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
2690 | 3 | * | ||
2691 | 4 | * This program is free software; you can redistribute it and/or modify | ||
2692 | 5 | * it under the terms of the GNU General Public License as published by | ||
2693 | 6 | * the Free Software Foundation; version 3. | ||
2694 | 7 | * | ||
2695 | 8 | * This program is distributed in the hope that it will be useful, | ||
2696 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2697 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2698 | 11 | * GNU General Public License for more details. | ||
2699 | 12 | * | ||
2700 | 13 | * You should have received a copy of the GNU General Public License | ||
2701 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2702 | 15 | */ | ||
2703 | 16 | |||
2704 | 17 | import QtQuick 2.0 | ||
2705 | 18 | |||
2706 | 19 | Flickable { | ||
2707 | 20 | id: root | ||
2708 | 21 | |||
2709 | 22 | signal clicked(int index, var result, var itemModel) | ||
2710 | 23 | signal pressAndHold(int index) | ||
2711 | 24 | |||
2712 | 25 | property var cardTool: null | ||
2713 | 26 | property real scopeHeight: 0 | ||
2714 | 27 | property real scopeWidth: 0 | ||
2715 | 28 | property real appliedScale: 1 | ||
2716 | 29 | property int currentIndex: -1 | ||
2717 | 30 | property var currentItem: currentIndex < repeater.count ? repeater.itemAt(currentIndex) : null | ||
2718 | 31 | |||
2719 | 32 | property alias model: repeater.model | ||
2720 | 33 | |||
2721 | 34 | contentHeight: height | ||
2722 | 35 | contentWidth: repeater.count * root.scopeWidth + units.gu(2) / appliedScale * (repeater.count - 1) | ||
2723 | 36 | |||
2724 | 37 | contentX: { | ||
2725 | 38 | var indexX = currentIndex * scopeWidth + units.gu(2) / appliedScale * currentIndex; | ||
2726 | 39 | var newContentX = indexX - (width - scopeWidth) / 2; | ||
2727 | 40 | newContentX = Math.min(Math.max(newContentX, 0), contentWidth - width); | ||
2728 | 41 | return newContentX; | ||
2729 | 42 | } | ||
2730 | 43 | |||
2731 | 44 | Repeater { | ||
2732 | 45 | id: repeater | ||
2733 | 46 | objectName: "scopesOverviewFavoritesRepeater" | ||
2734 | 47 | |||
2735 | 48 | delegate: Loader { | ||
2736 | 49 | id: loader | ||
2737 | 50 | |||
2738 | 51 | x: index * root.scopeWidth + units.gu(2) / appliedScale * index | ||
2739 | 52 | asynchronous: true | ||
2740 | 53 | |||
2741 | 54 | sourceComponent: cardTool.cardComponent | ||
2742 | 55 | onLoaded: { | ||
2743 | 56 | item.fixedArtShapeSize = Qt.binding(function() { return Qt.size(root.scopeWidth, root.scopeHeight); }); | ||
2744 | 57 | item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight / appliedScale; }); | ||
2745 | 58 | item.fontScale = Qt.binding(function() { return 1 / appliedScale; }); | ||
2746 | 59 | item.height = Qt.binding(function() { return root.scopeHeight; }); | ||
2747 | 60 | item.width = Qt.binding(function() { return root.scopeWidth; }); | ||
2748 | 61 | item.cardData = Qt.binding(function() { return model; }); | ||
2749 | 62 | item.template = Qt.binding(function() { return cardTool.template; }); | ||
2750 | 63 | item.components = Qt.binding(function() { return cardTool.components; }); | ||
2751 | 64 | item.headerAlignment = Qt.binding(function() { return cardTool.headerAlignment; }); | ||
2752 | 65 | } | ||
2753 | 66 | |||
2754 | 67 | Connections { | ||
2755 | 68 | target: loader.item | ||
2756 | 69 | onClicked: root.clicked(index, result, model) | ||
2757 | 70 | } | ||
2758 | 71 | } | ||
2759 | 72 | } | ||
2760 | 73 | } | ||
2761 | 0 | 74 | ||
2762 | === added file 'qml/Dash/ScopesOverviewTab.qml' | |||
2763 | --- qml/Dash/ScopesOverviewTab.qml 1970-01-01 00:00:00 +0000 | |||
2764 | +++ qml/Dash/ScopesOverviewTab.qml 2014-08-08 20:44:52 +0000 | |||
2765 | @@ -0,0 +1,74 @@ | |||
2766 | 1 | /* | ||
2767 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
2768 | 3 | * | ||
2769 | 4 | * This program is free software; you can redistribute it and/or modify | ||
2770 | 5 | * it under the terms of the GNU General Public License as published by | ||
2771 | 6 | * the Free Software Foundation; version 3. | ||
2772 | 7 | * | ||
2773 | 8 | * This program is distributed in the hope that it will be useful, | ||
2774 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2775 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2776 | 11 | * GNU General Public License for more details. | ||
2777 | 12 | * | ||
2778 | 13 | * You should have received a copy of the GNU General Public License | ||
2779 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2780 | 15 | */ | ||
2781 | 16 | |||
2782 | 17 | import QtQuick 2.3 | ||
2783 | 18 | import Ubuntu.Components 0.1 | ||
2784 | 19 | |||
2785 | 20 | Item { | ||
2786 | 21 | id: root | ||
2787 | 22 | |||
2788 | 23 | property int currentTab: 0 | ||
2789 | 24 | |||
2790 | 25 | AbstractButton { | ||
2791 | 26 | id: tab1 | ||
2792 | 27 | height: parent.height | ||
2793 | 28 | width: parent.width / 2 | ||
2794 | 29 | Rectangle { | ||
2795 | 30 | anchors.fill: parent | ||
2796 | 31 | color: root.currentTab == 0 && root.enabled ? "white" : "transparent" | ||
2797 | 32 | radius: units.dp(10) | ||
2798 | 33 | } | ||
2799 | 34 | Label { | ||
2800 | 35 | anchors.centerIn: parent | ||
2801 | 36 | text: i18n.tr("Favorites") | ||
2802 | 37 | color: root.currentTab == 0 && root.enabled ? "black" : "white" | ||
2803 | 38 | } | ||
2804 | 39 | onClicked: root.currentTab = 0 | ||
2805 | 40 | } | ||
2806 | 41 | AbstractButton { | ||
2807 | 42 | id: tab2 | ||
2808 | 43 | objectName: "scopesOverviewAllTabButton" | ||
2809 | 44 | x: width | ||
2810 | 45 | height: parent.height | ||
2811 | 46 | width: parent.width / 2 | ||
2812 | 47 | Rectangle { | ||
2813 | 48 | anchors.fill: parent | ||
2814 | 49 | color: root.currentTab == 1 && root.enabled ? "white" : "transparent" | ||
2815 | 50 | radius: units.dp(10) | ||
2816 | 51 | } | ||
2817 | 52 | Label { | ||
2818 | 53 | anchors.centerIn: parent | ||
2819 | 54 | text: i18n.tr("All") | ||
2820 | 55 | color: root.currentTab == 1 && root.enabled ? "black" : "white" | ||
2821 | 56 | } | ||
2822 | 57 | onClicked: root.currentTab = 1 | ||
2823 | 58 | } | ||
2824 | 59 | Rectangle { | ||
2825 | 60 | id: centerPiece | ||
2826 | 61 | width: root.enabled ? units.dp(10) : units.dp(1) | ||
2827 | 62 | height: parent.height | ||
2828 | 63 | color: "white" | ||
2829 | 64 | x: root.currentTab == 1 ? tab2.x : tab2.x - width | ||
2830 | 65 | } | ||
2831 | 66 | Rectangle { | ||
2832 | 67 | id: border | ||
2833 | 68 | anchors.fill: parent | ||
2834 | 69 | radius: units.dp(10) | ||
2835 | 70 | color: "transparent" | ||
2836 | 71 | border.color: centerPiece.color | ||
2837 | 72 | border.width: units.dp(1) | ||
2838 | 73 | } | ||
2839 | 74 | } | ||
2840 | 0 | 75 | ||
2841 | === added file 'qml/Dash/graphics/dark_background.jpg' | |||
2842 | 1 | Binary files qml/Dash/graphics/dark_background.jpg 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/dark_background.jpg 2014-08-08 20:44:52 +0000 differ | 76 | Binary files qml/Dash/graphics/dark_background.jpg 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/dark_background.jpg 2014-08-08 20:44:52 +0000 differ |
2843 | === added file 'qml/Dash/graphics/overview_hint@27.png' | |||
2844 | 2 | Binary files qml/Dash/graphics/overview_hint@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/overview_hint@27.png 2014-08-08 20:44:52 +0000 differ | 77 | Binary files qml/Dash/graphics/overview_hint@27.png 1970-01-01 00:00:00 +0000 and qml/Dash/graphics/overview_hint@27.png 2014-08-08 20:44:52 +0000 differ |
2845 | === modified file 'tests/autopilot/unity8/shell/tests/test_emulators.py' | |||
2846 | --- tests/autopilot/unity8/shell/tests/test_emulators.py 2014-07-30 20:01:30 +0000 | |||
2847 | +++ tests/autopilot/unity8/shell/tests/test_emulators.py 2014-08-08 20:44:52 +0000 | |||
2848 | @@ -122,7 +122,7 @@ | |||
2849 | 122 | self._assert_scope_is_opened(scope, scope_id) | 122 | self._assert_scope_is_opened(scope, scope_id) |
2850 | 123 | 123 | ||
2851 | 124 | def test_open_generic_scope(self): | 124 | def test_open_generic_scope(self): |
2853 | 125 | scope_id = 'scopes' | 125 | scope_id = 'musicaggregator' |
2854 | 126 | scope = self.dash.open_scope(scope_id) | 126 | scope = self.dash.open_scope(scope_id) |
2855 | 127 | self._assert_scope_is_opened(scope, scope_id) | 127 | self._assert_scope_is_opened(scope, scope_id) |
2856 | 128 | self.assertIsInstance(scope, dash_emulators.GenericScopeView) | 128 | self.assertIsInstance(scope, dash_emulators.GenericScopeView) |
2857 | 129 | 129 | ||
2858 | === modified file 'tests/mocks/Unity/CMakeLists.txt' | |||
2859 | --- tests/mocks/Unity/CMakeLists.txt 2014-08-06 19:38:57 +0000 | |||
2860 | +++ tests/mocks/Unity/CMakeLists.txt 2014-08-08 20:44:52 +0000 | |||
2861 | @@ -22,6 +22,7 @@ | |||
2862 | 22 | set(UnityQML_SOURCES | 22 | set(UnityQML_SOURCES |
2863 | 23 | fake_scope.cpp | 23 | fake_scope.cpp |
2864 | 24 | fake_scopes.cpp | 24 | fake_scopes.cpp |
2865 | 25 | fake_scopesoverview.cpp | ||
2866 | 25 | fake_categories.cpp | 26 | fake_categories.cpp |
2867 | 26 | fake_navigation.cpp | 27 | fake_navigation.cpp |
2868 | 27 | fake_resultsmodel.cpp | 28 | fake_resultsmodel.cpp |
2869 | 28 | 29 | ||
2870 | === modified file 'tests/mocks/Unity/fake_resultsmodel.cpp' | |||
2871 | --- tests/mocks/Unity/fake_resultsmodel.cpp 2014-05-20 10:29:20 +0000 | |||
2872 | +++ tests/mocks/Unity/fake_resultsmodel.cpp 2014-08-08 20:44:52 +0000 | |||
2873 | @@ -58,8 +58,9 @@ | |||
2874 | 58 | case RoleUri: | 58 | case RoleUri: |
2875 | 59 | case RoleCategoryId: | 59 | case RoleCategoryId: |
2876 | 60 | case RoleDndUri: | 60 | case RoleDndUri: |
2877 | 61 | return QString(); | ||
2878 | 61 | case RoleResult: | 62 | case RoleResult: |
2880 | 62 | return QString(); | 63 | return QString("Result.%1.%2").arg(m_categoryId).arg(index.row()); |
2881 | 63 | case RoleTitle: | 64 | case RoleTitle: |
2882 | 64 | return QString("Title.%1.%2").arg(m_categoryId).arg(index.row()); | 65 | return QString("Title.%1.%2").arg(m_categoryId).arg(index.row()); |
2883 | 65 | case RoleArt: | 66 | case RoleArt: |
2884 | 66 | 67 | ||
2885 | === modified file 'tests/mocks/Unity/fake_scope.cpp' | |||
2886 | --- tests/mocks/Unity/fake_scope.cpp 2014-08-06 10:03:55 +0000 | |||
2887 | +++ tests/mocks/Unity/fake_scope.cpp 2014-08-08 20:44:52 +0000 | |||
2888 | @@ -18,14 +18,16 @@ | |||
2889 | 18 | #include <QUrl> | 18 | #include <QUrl> |
2890 | 19 | 19 | ||
2891 | 20 | #include "fake_scope.h" | 20 | #include "fake_scope.h" |
2892 | 21 | |||
2893 | 21 | #include "fake_navigation.h" | 22 | #include "fake_navigation.h" |
2894 | 22 | #include "fake_resultsmodel.h" | 23 | #include "fake_resultsmodel.h" |
2895 | 24 | #include "fake_scopes.h" | ||
2896 | 23 | 25 | ||
2898 | 24 | Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent) | 26 | Scope::Scope(Scopes* parent) : Scope(QString(), QString(), false, parent) |
2899 | 25 | { | 27 | { |
2900 | 26 | } | 28 | } |
2901 | 27 | 29 | ||
2903 | 28 | Scope::Scope(QString const& id, QString const& name, bool favorite, QObject* parent, int categories) | 30 | Scope::Scope(QString const& id, QString const& name, bool favorite, Scopes* parent, int categories) |
2904 | 29 | : unity::shell::scopes::ScopeInterface(parent) | 31 | : unity::shell::scopes::ScopeInterface(parent) |
2905 | 30 | , m_id(id) | 32 | , m_id(id) |
2906 | 31 | , m_name(name) | 33 | , m_name(name) |
2907 | @@ -36,6 +38,7 @@ | |||
2908 | 36 | , m_currentAltNavigationId("altroot") | 38 | , m_currentAltNavigationId("altroot") |
2909 | 37 | , m_previewRendererName("preview-generic") | 39 | , m_previewRendererName("preview-generic") |
2910 | 38 | , m_categories(new Categories(categories, this)) | 40 | , m_categories(new Categories(categories, this)) |
2911 | 41 | , m_openScope(nullptr) | ||
2912 | 39 | { | 42 | { |
2913 | 40 | } | 43 | } |
2914 | 41 | 44 | ||
2915 | @@ -158,7 +161,12 @@ | |||
2916 | 158 | 161 | ||
2917 | 159 | void Scope::activate(QVariant const& result) | 162 | void Scope::activate(QVariant const& result) |
2918 | 160 | { | 163 | { |
2920 | 161 | Q_UNUSED(result); | 164 | qDebug() << "Called activate on scope" << m_id << "with result" << result; |
2921 | 165 | if (result.toString() == "Result.2.2") { | ||
2922 | 166 | Scopes *scopes = dynamic_cast<Scopes*>(parent()); | ||
2923 | 167 | m_openScope = scopes->getScopeFromAll("MockScope9"); | ||
2924 | 168 | Q_EMIT openScope(m_openScope); | ||
2925 | 169 | } | ||
2926 | 162 | } | 170 | } |
2927 | 163 | 171 | ||
2928 | 164 | PreviewStack* Scope::preview(QVariant const& result) | 172 | PreviewStack* Scope::preview(QVariant const& result) |
2929 | @@ -174,9 +182,13 @@ | |||
2930 | 174 | { | 182 | { |
2931 | 175 | } | 183 | } |
2932 | 176 | 184 | ||
2934 | 177 | void Scope::closeScope(unity::shell::scopes::ScopeInterface* /*scope*/) | 185 | void Scope::closeScope(unity::shell::scopes::ScopeInterface* scope) |
2935 | 178 | { | 186 | { |
2937 | 179 | qFatal("Scope::closeScope is not implemented"); | 187 | if (scope != m_openScope) { |
2938 | 188 | qDebug() << scope << m_openScope; | ||
2939 | 189 | qFatal("Scope::closeScope got wrong scope in closeScope"); | ||
2940 | 190 | } | ||
2941 | 191 | m_openScope = nullptr; | ||
2942 | 180 | } | 192 | } |
2943 | 181 | 193 | ||
2944 | 182 | QString Scope::currentNavigationId() const | 194 | QString Scope::currentNavigationId() const |
2945 | 183 | 195 | ||
2946 | === modified file 'tests/mocks/Unity/fake_scope.h' | |||
2947 | --- tests/mocks/Unity/fake_scope.h 2014-08-06 10:03:55 +0000 | |||
2948 | +++ tests/mocks/Unity/fake_scope.h 2014-08-08 20:44:52 +0000 | |||
2949 | @@ -24,13 +24,15 @@ | |||
2950 | 24 | 24 | ||
2951 | 25 | #include <QTimer> | 25 | #include <QTimer> |
2952 | 26 | 26 | ||
2953 | 27 | class Scopes; | ||
2954 | 28 | |||
2955 | 27 | class Scope : public unity::shell::scopes::ScopeInterface | 29 | class Scope : public unity::shell::scopes::ScopeInterface |
2956 | 28 | { | 30 | { |
2957 | 29 | Q_OBJECT | 31 | Q_OBJECT |
2958 | 30 | 32 | ||
2959 | 31 | public: | 33 | public: |
2962 | 32 | Scope(QObject* parent = 0); | 34 | Scope(Scopes* parent = 0); |
2963 | 33 | Scope(QString const& id, QString const& name, bool favorite, QObject* parent = 0, int categories = 20); | 35 | Scope(QString const& id, QString const& name, bool favorite, Scopes* parent = 0, int categories = 20); |
2964 | 34 | 36 | ||
2965 | 35 | /* getters */ | 37 | /* getters */ |
2966 | 36 | QString id() const override; | 38 | QString id() const override; |
2967 | @@ -92,7 +94,8 @@ | |||
2968 | 92 | 94 | ||
2969 | 93 | QString m_previewRendererName; | 95 | QString m_previewRendererName; |
2970 | 94 | 96 | ||
2972 | 95 | Categories* m_categories; | 97 | unity::shell::scopes::CategoriesInterface* m_categories; |
2973 | 98 | unity::shell::scopes::ScopeInterface* m_openScope; | ||
2974 | 96 | }; | 99 | }; |
2975 | 97 | 100 | ||
2976 | 98 | #endif // FAKE_SCOPE_H | 101 | #endif // FAKE_SCOPE_H |
2977 | 99 | 102 | ||
2978 | === modified file 'tests/mocks/Unity/fake_scopes.cpp' | |||
2979 | --- tests/mocks/Unity/fake_scopes.cpp 2014-08-06 19:38:57 +0000 | |||
2980 | +++ tests/mocks/Unity/fake_scopes.cpp 2014-08-08 20:44:52 +0000 | |||
2981 | @@ -18,6 +18,7 @@ | |||
2982 | 18 | 18 | ||
2983 | 19 | // Self | 19 | // Self |
2984 | 20 | #include "fake_scopes.h" | 20 | #include "fake_scopes.h" |
2985 | 21 | #include "fake_scopesoverview.h" | ||
2986 | 21 | 22 | ||
2987 | 22 | // TODO: Implement remaining pieces, like Categories (i.e. LensView now gives warnings) | 23 | // TODO: Implement remaining pieces, like Categories (i.e. LensView now gives warnings) |
2988 | 23 | 24 | ||
2989 | @@ -26,6 +27,7 @@ | |||
2990 | 26 | 27 | ||
2991 | 27 | Scopes::Scopes(QObject *parent) | 28 | Scopes::Scopes(QObject *parent) |
2992 | 28 | : unity::shell::scopes::ScopesInterface(parent) | 29 | : unity::shell::scopes::ScopesInterface(parent) |
2993 | 30 | , m_scopesOverview(nullptr) | ||
2994 | 29 | , m_loaded(false) | 31 | , m_loaded(false) |
2995 | 30 | , timer(this) | 32 | , timer(this) |
2996 | 31 | { | 33 | { |
2997 | @@ -52,10 +54,17 @@ | |||
2998 | 52 | addScope(new Scope("clickscope", "Apps", true, this)); | 54 | addScope(new Scope("clickscope", "Apps", true, this)); |
2999 | 53 | addScope(new Scope("MockScope5", "Videos", true, this)); | 55 | addScope(new Scope("MockScope5", "Videos", true, this)); |
3000 | 54 | addScope(new Scope("SingleCategoryScope", "Single", true, this, 1)); | 56 | addScope(new Scope("SingleCategoryScope", "Single", true, this, 1)); |
3001 | 57 | addScope(new Scope("MockScope4", "MS4", true, this)); | ||
3002 | 58 | addScope(new Scope("MockScope6", "MS6", true, this)); | ||
3003 | 59 | addScope(new Scope("MockScope7", "MS7", false, this)); | ||
3004 | 60 | addScope(new Scope("MockScope8", "MS8", false, this)); | ||
3005 | 61 | addScope(new Scope("MockScope9", "MS9", false, this)); | ||
3006 | 62 | m_scopesOverview = new ScopesOverview(this); | ||
3007 | 55 | 63 | ||
3008 | 56 | if (!m_loaded) { | 64 | if (!m_loaded) { |
3009 | 57 | m_loaded = true; | 65 | m_loaded = true; |
3010 | 58 | Q_EMIT loadedChanged(); | 66 | Q_EMIT loadedChanged(); |
3011 | 67 | Q_EMIT overviewScopeChanged(); | ||
3012 | 59 | } | 68 | } |
3013 | 60 | } | 69 | } |
3014 | 61 | 70 | ||
3015 | @@ -64,10 +73,13 @@ | |||
3016 | 64 | timer.stop(); | 73 | timer.stop(); |
3017 | 65 | if (m_scopes.size() > 0) { | 74 | if (m_scopes.size() > 0) { |
3018 | 66 | beginRemoveRows(QModelIndex(), 0, m_scopes.count()-1); | 75 | beginRemoveRows(QModelIndex(), 0, m_scopes.count()-1); |
3020 | 67 | qDeleteAll(m_scopes); | 76 | qDeleteAll(m_allScopes); |
3021 | 77 | m_allScopes.clear(); | ||
3022 | 68 | m_scopes.clear(); | 78 | m_scopes.clear(); |
3023 | 69 | endRemoveRows(); | 79 | endRemoveRows(); |
3024 | 70 | } | 80 | } |
3025 | 81 | delete m_scopesOverview; | ||
3026 | 82 | m_scopesOverview = nullptr; | ||
3027 | 71 | 83 | ||
3028 | 72 | if (m_loaded) { | 84 | if (m_loaded) { |
3029 | 73 | m_loaded = false; | 85 | m_loaded = false; |
3030 | @@ -113,8 +125,22 @@ | |||
3031 | 113 | return m_scopes[row]; | 125 | return m_scopes[row]; |
3032 | 114 | } | 126 | } |
3033 | 115 | 127 | ||
3036 | 116 | unity::shell::scopes::ScopeInterface* Scopes::getScope(QString const&) const | 128 | unity::shell::scopes::ScopeInterface* Scopes::getScope(QString const &scope_id) const |
3037 | 117 | { | 129 | { |
3038 | 130 | // According to mh3 Scopes::getScope should only return favorite scopes (i.e the ones in the model) | ||
3039 | 131 | for (Scope *scope : m_scopes) { | ||
3040 | 132 | if (scope->id() == scope_id) | ||
3041 | 133 | return scope; | ||
3042 | 134 | } | ||
3043 | 135 | return nullptr; | ||
3044 | 136 | } | ||
3045 | 137 | |||
3046 | 138 | Scope* Scopes::getScopeFromAll(const QString& scope_id) const | ||
3047 | 139 | { | ||
3048 | 140 | for (Scope *scope : m_allScopes) { | ||
3049 | 141 | if (scope->id() == scope_id) | ||
3050 | 142 | return scope; | ||
3051 | 143 | } | ||
3052 | 118 | return nullptr; | 144 | return nullptr; |
3053 | 119 | } | 145 | } |
3054 | 120 | 146 | ||
3055 | @@ -135,13 +161,26 @@ | |||
3056 | 135 | 161 | ||
3057 | 136 | unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const | 162 | unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const |
3058 | 137 | { | 163 | { |
3060 | 138 | return nullptr; | 164 | return m_scopesOverview; |
3061 | 165 | } | ||
3062 | 166 | |||
3063 | 167 | QList<Scope*> Scopes::scopes() const | ||
3064 | 168 | { | ||
3065 | 169 | return m_scopes; | ||
3066 | 170 | } | ||
3067 | 171 | |||
3068 | 172 | QList<Scope*> Scopes::allScopes() const | ||
3069 | 173 | { | ||
3070 | 174 | return m_allScopes; | ||
3071 | 139 | } | 175 | } |
3072 | 140 | 176 | ||
3073 | 141 | void Scopes::addScope(Scope* scope) | 177 | void Scopes::addScope(Scope* scope) |
3074 | 142 | { | 178 | { |
3075 | 143 | int index = rowCount(); | 179 | int index = rowCount(); |
3079 | 144 | beginInsertRows(QModelIndex(), index, index); | 180 | if (scope->favorite()) { |
3080 | 145 | m_scopes.append(scope); | 181 | beginInsertRows(QModelIndex(), index, index); |
3081 | 146 | endInsertRows(); | 182 | m_scopes.append(scope); |
3082 | 183 | endInsertRows(); | ||
3083 | 184 | } | ||
3084 | 185 | m_allScopes.append(scope); | ||
3085 | 147 | } | 186 | } |
3086 | 148 | 187 | ||
3087 | === modified file 'tests/mocks/Unity/fake_scopes.h' | |||
3088 | --- tests/mocks/Unity/fake_scopes.h 2014-08-06 19:38:57 +0000 | |||
3089 | +++ tests/mocks/Unity/fake_scopes.h 2014-08-08 20:44:52 +0000 | |||
3090 | @@ -53,11 +53,18 @@ | |||
3091 | 53 | int count() const override; | 53 | int count() const override; |
3092 | 54 | unity::shell::scopes::ScopeInterface* overviewScope() const override; | 54 | unity::shell::scopes::ScopeInterface* overviewScope() const override; |
3093 | 55 | 55 | ||
3094 | 56 | // This is used as part of implementation of the other C++ code, not API | ||
3095 | 57 | QList<Scope*> scopes() const; | ||
3096 | 58 | QList<Scope*> allScopes() const; | ||
3097 | 59 | Scope* getScopeFromAll(const QString& scope_id) const; | ||
3098 | 60 | |||
3099 | 56 | private Q_SLOTS: | 61 | private Q_SLOTS: |
3100 | 57 | void updateScopes(); | 62 | void updateScopes(); |
3101 | 58 | 63 | ||
3102 | 59 | private: | 64 | private: |
3104 | 60 | QList<Scope*> m_scopes; | 65 | QList<Scope*> m_scopes; // the favorite ones |
3105 | 66 | QList<Scope*> m_allScopes; | ||
3106 | 67 | Scope *m_scopesOverview; | ||
3107 | 61 | bool m_loaded; | 68 | bool m_loaded; |
3108 | 62 | QTimer timer; | 69 | QTimer timer; |
3109 | 63 | }; | 70 | }; |
3110 | 64 | 71 | ||
3111 | === added file 'tests/mocks/Unity/fake_scopesoverview.cpp' | |||
3112 | --- tests/mocks/Unity/fake_scopesoverview.cpp 1970-01-01 00:00:00 +0000 | |||
3113 | +++ tests/mocks/Unity/fake_scopesoverview.cpp 2014-08-08 20:44:52 +0000 | |||
3114 | @@ -0,0 +1,281 @@ | |||
3115 | 1 | /* | ||
3116 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
3117 | 3 | * | ||
3118 | 4 | * This program is free software; you can redistribute it and/or modify | ||
3119 | 5 | * it under the terms of the GNU General Public License as published by | ||
3120 | 6 | * the Free Software Foundation; version 3. | ||
3121 | 7 | * | ||
3122 | 8 | * This program is distributed in the hope that it will be useful, | ||
3123 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3124 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3125 | 11 | * GNU General Public License for more details. | ||
3126 | 12 | * | ||
3127 | 13 | * You should have received a copy of the GNU General Public License | ||
3128 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3129 | 15 | */ | ||
3130 | 16 | |||
3131 | 17 | #include "fake_scopesoverview.h" | ||
3132 | 18 | |||
3133 | 19 | #include "fake_scopes.h" | ||
3134 | 20 | |||
3135 | 21 | #include <paths.h> | ||
3136 | 22 | |||
3137 | 23 | ScopesOverview::ScopesOverview(Scopes* parent) | ||
3138 | 24 | : Scope("scopesOverview", "Scopes Overview", false, parent) | ||
3139 | 25 | { | ||
3140 | 26 | delete m_categories; // delete the usual categories, we're not going to use it | ||
3141 | 27 | m_scopesOverviewCategories = new ScopesOverviewCategories(parent, this); | ||
3142 | 28 | m_searchCategories = new ScopesOverviewSearchCategories(parent, this); | ||
3143 | 29 | m_categories = m_scopesOverviewCategories; | ||
3144 | 30 | } | ||
3145 | 31 | |||
3146 | 32 | void ScopesOverview::setSearchQuery(const QString& search_query) | ||
3147 | 33 | { | ||
3148 | 34 | Scope::setSearchQuery(search_query); | ||
3149 | 35 | |||
3150 | 36 | auto origCategories = m_categories; | ||
3151 | 37 | if (search_query.isEmpty()) m_categories = m_scopesOverviewCategories; | ||
3152 | 38 | else m_categories = m_searchCategories; | ||
3153 | 39 | |||
3154 | 40 | if (m_categories != origCategories) | ||
3155 | 41 | Q_EMIT categoriesChanged(); | ||
3156 | 42 | } | ||
3157 | 43 | |||
3158 | 44 | Q_INVOKABLE void ScopesOverview::activate(QVariant const& result) | ||
3159 | 45 | { | ||
3160 | 46 | Scopes *scopes = dynamic_cast<Scopes*>(parent()); | ||
3161 | 47 | m_openScope = scopes->getScopeFromAll(result.toString()); | ||
3162 | 48 | Q_EMIT openScope(m_openScope); | ||
3163 | 49 | } | ||
3164 | 50 | |||
3165 | 51 | ScopesOverviewCategories::ScopesOverviewCategories(Scopes *scopes, QObject* parent) | ||
3166 | 52 | : unity::shell::scopes::CategoriesInterface(parent) | ||
3167 | 53 | , m_scopes(scopes) | ||
3168 | 54 | { | ||
3169 | 55 | } | ||
3170 | 56 | |||
3171 | 57 | int ScopesOverviewCategories::rowCount(const QModelIndex& /*parent*/) const | ||
3172 | 58 | { | ||
3173 | 59 | return 2; | ||
3174 | 60 | } | ||
3175 | 61 | |||
3176 | 62 | void ScopesOverviewCategories::addSpecialCategory(QString const&, QString const&, QString const&, QString const&, QObject*) | ||
3177 | 63 | { | ||
3178 | 64 | qFatal("Using un-implemented ScopesOverviewCategories::addSpecialCategory"); | ||
3179 | 65 | } | ||
3180 | 66 | |||
3181 | 67 | bool ScopesOverviewCategories::overrideCategoryJson(QString const& /* categoryId */, QString const& /* json */) | ||
3182 | 68 | { | ||
3183 | 69 | qFatal("Using un-implemented ScopesOverviewCategories::overrideCategoryJson"); | ||
3184 | 70 | } | ||
3185 | 71 | |||
3186 | 72 | QVariant | ||
3187 | 73 | ScopesOverviewCategories::data(const QModelIndex& index, int role) const | ||
3188 | 74 | { | ||
3189 | 75 | if (!index.isValid()) { | ||
3190 | 76 | return QVariant(); | ||
3191 | 77 | } | ||
3192 | 78 | |||
3193 | 79 | const QString categoryId = index.row() == 0 ? "favorites" : "all"; | ||
3194 | 80 | |||
3195 | 81 | unity::shell::scopes::ResultsModelInterface *resultsModel = m_resultsModels[index.row()]; | ||
3196 | 82 | if (!resultsModel) { | ||
3197 | 83 | QObject *that = const_cast<ScopesOverviewCategories*>(this); | ||
3198 | 84 | QList<Scope*> scopes = index.row() == 0 ? m_scopes->scopes() : m_scopes->allScopes(); | ||
3199 | 85 | resultsModel = new ScopesOverviewResultsModel(scopes, categoryId, that); | ||
3200 | 86 | m_resultsModels[index.row()] = resultsModel; | ||
3201 | 87 | } | ||
3202 | 88 | switch (role) { | ||
3203 | 89 | case RoleCategoryId: | ||
3204 | 90 | return categoryId; | ||
3205 | 91 | case RoleName: | ||
3206 | 92 | return index.row() == 0 ? "Favorites" : "All"; | ||
3207 | 93 | case RoleIcon: | ||
3208 | 94 | return QVariant(); | ||
3209 | 95 | case RoleRawRendererTemplate: | ||
3210 | 96 | qFatal("Using un-implemented RoleRawRendererTemplate Categories role"); | ||
3211 | 97 | return QVariant(); | ||
3212 | 98 | case RoleRenderer: | ||
3213 | 99 | { | ||
3214 | 100 | QVariantMap map; | ||
3215 | 101 | map["category-layout"] = "grid"; | ||
3216 | 102 | map["card-size"] = "small"; | ||
3217 | 103 | map["overlay"] = true; | ||
3218 | 104 | return map; | ||
3219 | 105 | } | ||
3220 | 106 | case RoleComponents: | ||
3221 | 107 | { | ||
3222 | 108 | QVariantMap map, artMap; | ||
3223 | 109 | artMap["aspect-ratio"] = "0.5"; | ||
3224 | 110 | artMap["field"] = "art"; | ||
3225 | 111 | map["art"] = artMap; | ||
3226 | 112 | map["title"] = "HOLA"; | ||
3227 | 113 | return map; | ||
3228 | 114 | } | ||
3229 | 115 | case RoleResults: | ||
3230 | 116 | return QVariant::fromValue(resultsModel); | ||
3231 | 117 | case RoleCount: | ||
3232 | 118 | return resultsModel->rowCount(); | ||
3233 | 119 | case RoleHeaderLink: | ||
3234 | 120 | return QString(); | ||
3235 | 121 | default: | ||
3236 | 122 | qFatal("Using un-implemented Categories role"); | ||
3237 | 123 | return QVariant(); | ||
3238 | 124 | } | ||
3239 | 125 | } | ||
3240 | 126 | |||
3241 | 127 | |||
3242 | 128 | |||
3243 | 129 | ScopesOverviewSearchCategories::ScopesOverviewSearchCategories(Scopes *scopes, QObject* parent) | ||
3244 | 130 | : unity::shell::scopes::CategoriesInterface(parent) | ||
3245 | 131 | , m_scopes(scopes) | ||
3246 | 132 | { | ||
3247 | 133 | } | ||
3248 | 134 | |||
3249 | 135 | int ScopesOverviewSearchCategories::rowCount(const QModelIndex& /*parent*/) const | ||
3250 | 136 | { | ||
3251 | 137 | return 2; | ||
3252 | 138 | } | ||
3253 | 139 | |||
3254 | 140 | void ScopesOverviewSearchCategories::addSpecialCategory(QString const&, QString const&, QString const&, QString const&, QObject*) | ||
3255 | 141 | { | ||
3256 | 142 | qFatal("Using un-implemented ScopesOverviewSearchCategories::addSpecialCategory"); | ||
3257 | 143 | } | ||
3258 | 144 | |||
3259 | 145 | bool ScopesOverviewSearchCategories::overrideCategoryJson(QString const& /* categoryId */, QString const& /* json */) | ||
3260 | 146 | { | ||
3261 | 147 | qFatal("Using un-implemented ScopesOverviewSearchCategories::overrideCategoryJson"); | ||
3262 | 148 | } | ||
3263 | 149 | |||
3264 | 150 | QVariant | ||
3265 | 151 | ScopesOverviewSearchCategories::data(const QModelIndex& index, int role) const | ||
3266 | 152 | { | ||
3267 | 153 | if (!index.isValid()) { | ||
3268 | 154 | return QVariant(); | ||
3269 | 155 | } | ||
3270 | 156 | |||
3271 | 157 | const QString categoryId = index.row() == 0 ? "searchA" : "searchB"; | ||
3272 | 158 | |||
3273 | 159 | unity::shell::scopes::ResultsModelInterface *resultsModel = m_resultsModels[index.row()]; | ||
3274 | 160 | if (!resultsModel) { | ||
3275 | 161 | QObject *that = const_cast<ScopesOverviewSearchCategories*>(this); | ||
3276 | 162 | QList<Scope *> scopes; | ||
3277 | 163 | if (index.row() == 0) { | ||
3278 | 164 | scopes << m_scopes->getScopeFromAll("clickscope") << nullptr << m_scopes->getScopeFromAll("MockScope2"); | ||
3279 | 165 | } else { | ||
3280 | 166 | scopes << nullptr << m_scopes->getScopeFromAll("MockScope7") << nullptr << m_scopes->getScopeFromAll("MockScope1"); | ||
3281 | 167 | } | ||
3282 | 168 | resultsModel = new ScopesOverviewResultsModel(scopes, categoryId, that); | ||
3283 | 169 | m_resultsModels[index.row()] = resultsModel; | ||
3284 | 170 | } | ||
3285 | 171 | switch (role) { | ||
3286 | 172 | case RoleCategoryId: | ||
3287 | 173 | return categoryId; | ||
3288 | 174 | case RoleName: | ||
3289 | 175 | return index.row() == 0 ? "SearchA" : "SearchB"; | ||
3290 | 176 | case RoleIcon: | ||
3291 | 177 | return QVariant(); | ||
3292 | 178 | case RoleRawRendererTemplate: | ||
3293 | 179 | qFatal("Using un-implemented RoleRawRendererTemplate Categories role"); | ||
3294 | 180 | return QVariant(); | ||
3295 | 181 | case RoleRenderer: | ||
3296 | 182 | { | ||
3297 | 183 | QVariantMap map; | ||
3298 | 184 | map["category-layout"] = "grid"; | ||
3299 | 185 | map["card-size"] = "small"; | ||
3300 | 186 | map["overlay"] = true; | ||
3301 | 187 | return map; | ||
3302 | 188 | } | ||
3303 | 189 | case RoleComponents: | ||
3304 | 190 | { | ||
3305 | 191 | QVariantMap map, artMap; | ||
3306 | 192 | artMap["aspect-ratio"] = "1"; | ||
3307 | 193 | artMap["field"] = "art"; | ||
3308 | 194 | map["art"] = artMap; | ||
3309 | 195 | map["title"] = "HOLA"; | ||
3310 | 196 | return map; | ||
3311 | 197 | } | ||
3312 | 198 | case RoleResults: | ||
3313 | 199 | return QVariant::fromValue(resultsModel); | ||
3314 | 200 | case RoleCount: | ||
3315 | 201 | return resultsModel->rowCount(); | ||
3316 | 202 | case RoleHeaderLink: | ||
3317 | 203 | return QString(); | ||
3318 | 204 | default: | ||
3319 | 205 | qFatal("Using un-implemented Categories role"); | ||
3320 | 206 | return QVariant(); | ||
3321 | 207 | } | ||
3322 | 208 | } | ||
3323 | 209 | |||
3324 | 210 | |||
3325 | 211 | ScopesOverviewResultsModel::ScopesOverviewResultsModel(const QList<Scope *> &scopes, const QString &categoryId, QObject* parent) | ||
3326 | 212 | : unity::shell::scopes::ResultsModelInterface(parent) | ||
3327 | 213 | , m_scopes(scopes) | ||
3328 | 214 | , m_categoryId(categoryId) | ||
3329 | 215 | { | ||
3330 | 216 | } | ||
3331 | 217 | |||
3332 | 218 | QString ScopesOverviewResultsModel::categoryId() const | ||
3333 | 219 | { | ||
3334 | 220 | return m_categoryId; | ||
3335 | 221 | } | ||
3336 | 222 | |||
3337 | 223 | void ScopesOverviewResultsModel::setCategoryId(QString const& /*id*/) | ||
3338 | 224 | { | ||
3339 | 225 | qFatal("Calling un-implemented ScopesOverviewResultsModel::setCategoryId"); | ||
3340 | 226 | } | ||
3341 | 227 | |||
3342 | 228 | int ScopesOverviewResultsModel::scopeIndex(QString const& id) const | ||
3343 | 229 | { | ||
3344 | 230 | const int scopeCount = count(); | ||
3345 | 231 | for (int i = 0; i < scopeCount; ++i) { | ||
3346 | 232 | if (m_scopes[i]->id() == id) | ||
3347 | 233 | return i; | ||
3348 | 234 | } | ||
3349 | 235 | return -1; | ||
3350 | 236 | } | ||
3351 | 237 | |||
3352 | 238 | QHash<int, QByteArray> ScopesOverviewResultsModel::roleNames() const | ||
3353 | 239 | { | ||
3354 | 240 | QHash<int, QByteArray> roles = unity::shell::scopes::ResultsModelInterface::roleNames(); | ||
3355 | 241 | roles[RoleBackground + 1] = "scopeId"; | ||
3356 | 242 | return roles; | ||
3357 | 243 | } | ||
3358 | 244 | |||
3359 | 245 | int ScopesOverviewResultsModel::rowCount(const QModelIndex& parent) const | ||
3360 | 246 | { | ||
3361 | 247 | Q_UNUSED(parent); | ||
3362 | 248 | |||
3363 | 249 | return m_scopes.count(); | ||
3364 | 250 | } | ||
3365 | 251 | |||
3366 | 252 | int ScopesOverviewResultsModel::count() const | ||
3367 | 253 | { | ||
3368 | 254 | return rowCount(); | ||
3369 | 255 | } | ||
3370 | 256 | |||
3371 | 257 | QVariant | ||
3372 | 258 | ScopesOverviewResultsModel::data(const QModelIndex& index, int role) const | ||
3373 | 259 | { | ||
3374 | 260 | unity::shell::scopes::ScopeInterface *scope = m_scopes[index.row()]; | ||
3375 | 261 | switch (role) { | ||
3376 | 262 | case RoleUri: | ||
3377 | 263 | case RoleCategoryId: | ||
3378 | 264 | case RoleDndUri: | ||
3379 | 265 | return QString(); | ||
3380 | 266 | case RoleResult: | ||
3381 | 267 | return scope ? scope->id() : QString("Result.%1.%2").arg(categoryId()).arg(index.row()); | ||
3382 | 268 | case RoleTitle: | ||
3383 | 269 | return scope ? scope->name() : QString("Title.%1.%2").arg(categoryId()).arg(index.row()); | ||
3384 | 270 | case RoleArt: | ||
3385 | 271 | return qmlDirectory() + "graphics/applicationIcons/dash.png"; | ||
3386 | 272 | case RoleMascot: | ||
3387 | 273 | case RoleEmblem: | ||
3388 | 274 | case RoleSummary: | ||
3389 | 275 | case RoleBackground + 1: // scopeId | ||
3390 | 276 | return scope ? scope->id() : nullptr; | ||
3391 | 277 | break; | ||
3392 | 278 | default: | ||
3393 | 279 | return QVariant(); | ||
3394 | 280 | } | ||
3395 | 281 | } | ||
3396 | 0 | 282 | ||
3397 | === added file 'tests/mocks/Unity/fake_scopesoverview.h' | |||
3398 | --- tests/mocks/Unity/fake_scopesoverview.h 1970-01-01 00:00:00 +0000 | |||
3399 | +++ tests/mocks/Unity/fake_scopesoverview.h 2014-08-08 20:44:52 +0000 | |||
3400 | @@ -0,0 +1,104 @@ | |||
3401 | 1 | /* | ||
3402 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
3403 | 3 | * | ||
3404 | 4 | * This program is free software; you can redistribute it and/or modify | ||
3405 | 5 | * it under the terms of the GNU General Public License as published by | ||
3406 | 6 | * the Free Software Foundation; version 3. | ||
3407 | 7 | * | ||
3408 | 8 | * This program is distributed in the hope that it will be useful, | ||
3409 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3410 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3411 | 11 | * GNU General Public License for more details. | ||
3412 | 12 | * | ||
3413 | 13 | * You should have received a copy of the GNU General Public License | ||
3414 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3415 | 15 | */ | ||
3416 | 16 | |||
3417 | 17 | #ifndef FAKE_SCOPESOVERVIEW_H | ||
3418 | 18 | #define FAKE_SCOPESOVERVIEW_H | ||
3419 | 19 | |||
3420 | 20 | #include "fake_scope.h" | ||
3421 | 21 | #include <unity/shell/scopes/ResultsModelInterface.h> | ||
3422 | 22 | |||
3423 | 23 | class Scopes; | ||
3424 | 24 | |||
3425 | 25 | class ScopesOverview : public Scope | ||
3426 | 26 | { | ||
3427 | 27 | Q_OBJECT | ||
3428 | 28 | |||
3429 | 29 | public: | ||
3430 | 30 | ScopesOverview(Scopes* parent = 0); | ||
3431 | 31 | |||
3432 | 32 | void setSearchQuery(const QString& search_query) override; | ||
3433 | 33 | Q_INVOKABLE void activate(QVariant const& result) override; | ||
3434 | 34 | |||
3435 | 35 | private: | ||
3436 | 36 | unity::shell::scopes::CategoriesInterface *m_scopesOverviewCategories; | ||
3437 | 37 | unity::shell::scopes::CategoriesInterface *m_searchCategories; | ||
3438 | 38 | }; | ||
3439 | 39 | |||
3440 | 40 | class ScopesOverviewCategories : public unity::shell::scopes::CategoriesInterface | ||
3441 | 41 | { | ||
3442 | 42 | Q_OBJECT | ||
3443 | 43 | |||
3444 | 44 | public: | ||
3445 | 45 | ScopesOverviewCategories(Scopes *scopes, QObject* parent = 0); | ||
3446 | 46 | |||
3447 | 47 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; | ||
3448 | 48 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||
3449 | 49 | |||
3450 | 50 | Q_INVOKABLE void addSpecialCategory(QString const& categoryId, QString const& name, QString const& icon, QString const& rawTemplate, QObject* countObject) override; | ||
3451 | 51 | Q_INVOKABLE bool overrideCategoryJson(QString const& categoryId, QString const& json) override; | ||
3452 | 52 | |||
3453 | 53 | private: | ||
3454 | 54 | mutable QHash<int, unity::shell::scopes::ResultsModelInterface*> m_resultsModels; | ||
3455 | 55 | |||
3456 | 56 | Scopes *m_scopes; | ||
3457 | 57 | }; | ||
3458 | 58 | |||
3459 | 59 | class ScopesOverviewSearchCategories : public unity::shell::scopes::CategoriesInterface | ||
3460 | 60 | { | ||
3461 | 61 | Q_OBJECT | ||
3462 | 62 | |||
3463 | 63 | public: | ||
3464 | 64 | ScopesOverviewSearchCategories(Scopes *scopes, QObject* parent = 0); | ||
3465 | 65 | |||
3466 | 66 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; | ||
3467 | 67 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||
3468 | 68 | |||
3469 | 69 | Q_INVOKABLE void addSpecialCategory(QString const& categoryId, QString const& name, QString const& icon, QString const& rawTemplate, QObject* countObject) override; | ||
3470 | 70 | Q_INVOKABLE bool overrideCategoryJson(QString const& categoryId, QString const& json) override; | ||
3471 | 71 | |||
3472 | 72 | private: | ||
3473 | 73 | mutable QHash<int, unity::shell::scopes::ResultsModelInterface*> m_resultsModels; | ||
3474 | 74 | |||
3475 | 75 | Scopes *m_scopes; | ||
3476 | 76 | }; | ||
3477 | 77 | |||
3478 | 78 | class ScopesOverviewResultsModel : public unity::shell::scopes::ResultsModelInterface | ||
3479 | 79 | { | ||
3480 | 80 | Q_OBJECT | ||
3481 | 81 | |||
3482 | 82 | public: | ||
3483 | 83 | explicit ScopesOverviewResultsModel(const QList<Scope *> &scopes, const QString &categoryId, QObject* parent = 0); | ||
3484 | 84 | |||
3485 | 85 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||
3486 | 86 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; | ||
3487 | 87 | |||
3488 | 88 | /* getters */ | ||
3489 | 89 | QString categoryId() const override; | ||
3490 | 90 | int count() const override; | ||
3491 | 91 | |||
3492 | 92 | /* setters */ | ||
3493 | 93 | void setCategoryId(QString const& id) override; | ||
3494 | 94 | |||
3495 | 95 | /* Special API */ | ||
3496 | 96 | Q_INVOKABLE int scopeIndex(QString const& id) const; | ||
3497 | 97 | QHash<int, QByteArray> roleNames() const override; | ||
3498 | 98 | |||
3499 | 99 | private: | ||
3500 | 100 | QList<Scope *> m_scopes; | ||
3501 | 101 | QString m_categoryId; | ||
3502 | 102 | }; | ||
3503 | 103 | |||
3504 | 104 | #endif // FAKE_SCOPESOVERVIEW_H | ||
3505 | 0 | 105 | ||
3506 | === modified file 'tests/plugins/Dash/cardcreator/2.res' | |||
3507 | --- tests/plugins/Dash/cardcreator/2.res 2014-07-31 13:33:56 +0000 | |||
3508 | +++ tests/plugins/Dash/cardcreator/2.res 2014-08-08 20:44:52 +0000 | |||
3509 | @@ -89,7 +89,7 @@ | |||
3510 | 89 | wrapMode: Text.Wrap; | 89 | wrapMode: Text.Wrap; |
3511 | 90 | maximumLineCount: 2; | 90 | maximumLineCount: 2; |
3512 | 91 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); | 91 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); |
3514 | 92 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey"); | 92 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey"); |
3515 | 93 | visible: showHeader ; | 93 | visible: showHeader ; |
3516 | 94 | text: root.title; | 94 | text: root.title; |
3517 | 95 | font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal; | 95 | font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal; |
3518 | @@ -104,7 +104,7 @@ | |||
3519 | 104 | elide: Text.ElideRight; | 104 | elide: Text.ElideRight; |
3520 | 105 | fontSize: "small"; | 105 | fontSize: "small"; |
3521 | 106 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); | 106 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); |
3523 | 107 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey"); | 107 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey"); |
3524 | 108 | visible: titleLabel.visible && titleLabel.text; | 108 | visible: titleLabel.visible && titleLabel.text; |
3525 | 109 | text: cardData && cardData["subtitle"] || ""; | 109 | text: cardData && cardData["subtitle"] || ""; |
3526 | 110 | font.weight: Font.Light; | 110 | font.weight: Font.Light; |
3527 | 111 | 111 | ||
3528 | === modified file 'tests/plugins/Dash/cardcreator/5.res' | |||
3529 | --- tests/plugins/Dash/cardcreator/5.res 2014-08-05 22:51:17 +0000 | |||
3530 | +++ tests/plugins/Dash/cardcreator/5.res 2014-08-08 20:44:52 +0000 | |||
3531 | @@ -68,8 +68,9 @@ | |||
3532 | 68 | visible: showHeader && status == Loader.Ready; | 68 | visible: showHeader && status == Loader.Ready; |
3533 | 69 | sourceComponent: ShaderEffect { | 69 | sourceComponent: ShaderEffect { |
3534 | 70 | id: overlay; | 70 | id: overlay; |
3537 | 71 | height: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2); | 71 | height: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2); |
3538 | 72 | opacity: 0.6; | 72 | property real luminance: 0.2126 * overlayColor.r + 0.7152 * overlayColor.g + 0.0722 * overlayColor.b; |
3539 | 73 | property color overlayColor: cardData && cardData["overlayColor"] || "#99000000"; | ||
3540 | 73 | property var source: ShaderEffectSource { | 74 | property var source: ShaderEffectSource { |
3541 | 74 | id: shaderSource; | 75 | id: shaderSource; |
3542 | 75 | sourceItem: artShapeLoader.item; | 76 | sourceItem: artShapeLoader.item; |
3543 | @@ -90,15 +91,16 @@ | |||
3544 | 90 | varying highp vec2 coord; | 91 | varying highp vec2 coord; |
3545 | 91 | uniform sampler2D source; | 92 | uniform sampler2D source; |
3546 | 92 | uniform lowp float qt_Opacity; | 93 | uniform lowp float qt_Opacity; |
3547 | 94 | uniform highp vec4 overlayColor; | ||
3548 | 93 | void main() { | 95 | void main() { |
3549 | 94 | lowp vec4 tex = texture2D(source, coord); | 96 | lowp vec4 tex = texture2D(source, coord); |
3551 | 95 | gl_FragColor = vec4(0, 0, 0, tex.a) * qt_Opacity; | 97 | gl_FragColor = vec4(overlayColor.r, overlayColor.g, overlayColor.b, 1) * qt_Opacity * overlayColor.a * tex.a; |
3552 | 96 | }"; | 98 | }"; |
3553 | 97 | } | 99 | } |
3554 | 98 | } | 100 | } |
3555 | 99 | readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin; | 101 | readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin; |
3556 | 100 | Label { | 102 | Label { |
3558 | 101 | id: titleLabel; | 103 | id: titleLabel; |
3559 | 102 | objectName: "titleLabel"; | 104 | objectName: "titleLabel"; |
3560 | 103 | anchors { left: parent.left; | 105 | anchors { left: parent.left; |
3561 | 104 | leftMargin: units.gu(1); | 106 | leftMargin: units.gu(1); |
3562 | @@ -112,7 +114,7 @@ | |||
3563 | 112 | wrapMode: Text.Wrap; | 114 | wrapMode: Text.Wrap; |
3564 | 113 | maximumLineCount: 2; | 115 | maximumLineCount: 2; |
3565 | 114 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); | 116 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); |
3567 | 115 | color: "white"; | 117 | color: overlayLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey"); |
3568 | 116 | visible: showHeader && overlayLoader.active; | 118 | visible: showHeader && overlayLoader.active; |
3569 | 117 | text: root.title; | 119 | text: root.title; |
3570 | 118 | font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal; | 120 | font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal; |
3571 | @@ -131,7 +133,7 @@ | |||
3572 | 131 | elide: Text.ElideRight; | 133 | elide: Text.ElideRight; |
3573 | 132 | fontSize: "small"; | 134 | fontSize: "small"; |
3574 | 133 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); | 135 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); |
3576 | 134 | color: "white"; | 136 | color: overlayLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey"); |
3577 | 135 | visible: titleLabel.visible && titleLabel.text; | 137 | visible: titleLabel.visible && titleLabel.text; |
3578 | 136 | text: cardData && cardData["subtitle"] || ""; | 138 | text: cardData && cardData["subtitle"] || ""; |
3579 | 137 | font.weight: Font.Light; | 139 | font.weight: Font.Light; |
3580 | 138 | 140 | ||
3581 | === modified file 'tests/plugins/Dash/cardcreator/7.res' | |||
3582 | --- tests/plugins/Dash/cardcreator/7.res 2014-08-05 22:51:17 +0000 | |||
3583 | +++ tests/plugins/Dash/cardcreator/7.res 2014-08-08 20:44:52 +0000 | |||
3584 | @@ -90,7 +90,7 @@ | |||
3585 | 90 | wrapMode: Text.Wrap; | 90 | wrapMode: Text.Wrap; |
3586 | 91 | maximumLineCount: 2; | 91 | maximumLineCount: 2; |
3587 | 92 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); | 92 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); |
3589 | 93 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey"); | 93 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey"); |
3590 | 94 | visible: showHeader ; | 94 | visible: showHeader ; |
3591 | 95 | text: root.title; | 95 | text: root.title; |
3592 | 96 | font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal; | 96 | font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal; |
3593 | @@ -104,7 +104,7 @@ | |||
3594 | 104 | elide: Text.ElideRight; | 104 | elide: Text.ElideRight; |
3595 | 105 | fontSize: "small"; | 105 | fontSize: "small"; |
3596 | 106 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); | 106 | font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); |
3598 | 107 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey"); | 107 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey"); |
3599 | 108 | visible: titleLabel.visible && titleLabel.text; | 108 | visible: titleLabel.visible && titleLabel.text; |
3600 | 109 | text: cardData && cardData["subtitle"] || ""; | 109 | text: cardData && cardData["subtitle"] || ""; |
3601 | 110 | font.weight: Font.Light; | 110 | font.weight: Font.Light; |
3602 | @@ -115,8 +115,8 @@ | |||
3603 | 115 | id: attributesRow; | 115 | id: attributesRow; |
3604 | 116 | objectName: "attributesRow"; | 116 | objectName: "attributesRow"; |
3605 | 117 | anchors { left: parent.left; right: parent.right } | 117 | anchors { left: parent.left; right: parent.right } |
3608 | 118 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey"); | 118 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey"); |
3609 | 119 | model: cardData["attributes"]; | 119 | model: cardData["attributes"]; |
3610 | 120 | } | 120 | } |
3611 | 121 | 121 | ||
3612 | 122 | ] | 122 | ] |
3613 | 123 | 123 | ||
3614 | === modified file 'tests/plugins/Dash/tst_ScopeStyle.qml' | |||
3615 | --- tests/plugins/Dash/tst_ScopeStyle.qml 2014-07-25 11:42:06 +0000 | |||
3616 | +++ tests/plugins/Dash/tst_ScopeStyle.qml 2014-08-08 20:44:52 +0000 | |||
3617 | @@ -101,7 +101,7 @@ | |||
3618 | 101 | 101 | ||
3619 | 102 | function test_threshold_data() { | 102 | function test_threshold_data() { |
3620 | 103 | return [ | 103 | return [ |
3622 | 104 | { tag: "default", index: 0, threshold: 0.5020 }, | 104 | { tag: "default", index: 0, threshold: 0.7510 }, |
3623 | 105 | { tag: "red on black", index: 1, threshold: 0.1063 }, | 105 | { tag: "red on black", index: 1, threshold: 0.1063 }, |
3624 | 106 | { tag: "green on white", index: 2, threshold: 0.6795 }, | 106 | { tag: "green on white", index: 2, threshold: 0.6795 }, |
3625 | 107 | { tag: "blue on darkgrey", index: 3, threshold: 0.3675 }, | 107 | { tag: "blue on darkgrey", index: 3, threshold: 0.3675 }, |
3626 | 108 | 108 | ||
3627 | === added directory 'tests/qmltests/Dash/ScopeSettings' | |||
3628 | === added file 'tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingSwitch.qml' | |||
3629 | --- tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingSwitch.qml 1970-01-01 00:00:00 +0000 | |||
3630 | +++ tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingSwitch.qml 2014-08-08 20:44:52 +0000 | |||
3631 | @@ -0,0 +1,33 @@ | |||
3632 | 1 | /* | ||
3633 | 2 | * Copyright 2014 Canonical Ltd. | ||
3634 | 3 | * | ||
3635 | 4 | * This program is free software; you can redistribute it and/or modify | ||
3636 | 5 | * it under the terms of the GNU General Public License as published by | ||
3637 | 6 | * the Free Software Foundation; version 3. | ||
3638 | 7 | * | ||
3639 | 8 | * This program is distributed in the hope that it will be useful, | ||
3640 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3641 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3642 | 11 | * GNU General Public License for more details. | ||
3643 | 12 | * | ||
3644 | 13 | * You should have received a copy of the GNU General Public License | ||
3645 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3646 | 15 | */ | ||
3647 | 16 | |||
3648 | 17 | import QtQuick 2.0 | ||
3649 | 18 | import QtTest 1.0 | ||
3650 | 19 | import "../../../../qml/Dash/ScopeSettings" | ||
3651 | 20 | import Unity.Test 0.1 as UT | ||
3652 | 21 | |||
3653 | 22 | Rectangle { | ||
3654 | 23 | id: root | ||
3655 | 24 | width: units.gu(60) | ||
3656 | 25 | height: units.gu(80) | ||
3657 | 26 | |||
3658 | 27 | property var widgetData: { | ||
3659 | 28 | "title": "THE TITLE", | ||
3660 | 29 | "subtitle": "Something catchy", | ||
3661 | 30 | "mascot": "../graphics/play_button.png" | ||
3662 | 31 | } | ||
3663 | 32 | |||
3664 | 33 | } | ||
3665 | 0 | 34 | ||
3666 | === modified file 'tests/qmltests/Dash/tst_Dash.qml' | |||
3667 | --- tests/qmltests/Dash/tst_Dash.qml 2014-08-06 14:50:25 +0000 | |||
3668 | +++ tests/qmltests/Dash/tst_Dash.qml 2014-08-08 20:44:52 +0000 | |||
3669 | @@ -20,8 +20,6 @@ | |||
3670 | 20 | import Ubuntu.Components 0.1 | 20 | import Ubuntu.Components 0.1 |
3671 | 21 | import Unity.Test 0.1 as UT | 21 | import Unity.Test 0.1 as UT |
3672 | 22 | 22 | ||
3673 | 23 | // TODO We don't have any tests for the overlay scope functionality. | ||
3674 | 24 | |||
3675 | 25 | Item { | 23 | Item { |
3676 | 26 | id: shell | 24 | id: shell |
3677 | 27 | width: units.gu(40) | 25 | width: units.gu(40) |
3678 | @@ -61,9 +59,9 @@ | |||
3679 | 61 | function get_scope_data() { | 59 | function get_scope_data() { |
3680 | 62 | return [ | 60 | return [ |
3681 | 63 | { tag: "MockScope1", visualIndex: 0 }, | 61 | { tag: "MockScope1", visualIndex: 0 }, |
3685 | 64 | { tag: "MockScope2", visualIndex: 1 }, | 62 | { tag: "MockScope2", visualIndex: -1 }, |
3686 | 65 | { tag: "clickscope", visualIndex: 2 }, | 63 | { tag: "clickscope", visualIndex: 1 }, |
3687 | 66 | { tag: "MockScope5", visualIndex: 3 }, | 64 | { tag: "MockScope5", visualIndex: 2 }, |
3688 | 67 | ] | 65 | ] |
3689 | 68 | } | 66 | } |
3690 | 69 | 67 | ||
3691 | @@ -79,10 +77,234 @@ | |||
3692 | 79 | tryCompare(dashContentList, "count", 0); | 77 | tryCompare(dashContentList, "count", 0); |
3693 | 80 | scopes.load(); | 78 | scopes.load(); |
3694 | 81 | tryCompare(scopes, "loaded", true); | 79 | tryCompare(scopes, "loaded", true); |
3696 | 82 | tryCompare(dashContentList, "count", 5); | 80 | tryCompare(dashContentList, "count", 6); |
3697 | 83 | 81 | ||
3698 | 84 | verify(dashContentList != undefined); | 82 | verify(dashContentList != undefined); |
3700 | 85 | tryCompare(dashContentList, "currentIndex", data.visualIndex); | 83 | if (data.visualIndex == -1) { |
3701 | 84 | tryCompare(dashContentList, "currentIndex", 0); | ||
3702 | 85 | expectFail(data.tag, "non favorite scopes should not be visble in the scopes model"); | ||
3703 | 86 | compare(dashContentList.currentItem.scopeId, data.tag); // this should fail | ||
3704 | 87 | } else { | ||
3705 | 88 | tryCompare(dashContentList, "currentIndex", data.visualIndex); | ||
3706 | 89 | compare(dashContentList.currentItem.scopeId, data.tag); | ||
3707 | 90 | } | ||
3708 | 91 | } | ||
3709 | 92 | |||
3710 | 93 | function test_dash_overview_show_select_same_favorite() { | ||
3711 | 94 | // Wait for stuff to be loaded | ||
3712 | 95 | tryCompare(scopes, "loaded", true); | ||
3713 | 96 | var dashContentList = findChild(dash, "dashContentList"); | ||
3714 | 97 | tryCompare(dashContentList, "count", 6); | ||
3715 | 98 | var mockScope1Loader = findChild(dash, "MockScope1 loader"); | ||
3716 | 99 | tryCompareFunction(function() { return mockScope1Loader.item != null; }, true); | ||
3717 | 100 | |||
3718 | 101 | // Show the overview | ||
3719 | 102 | touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18)); | ||
3720 | 103 | var overviewController = findInvisibleChild(dash, "overviewController"); | ||
3721 | 104 | tryCompare(overviewController, "progress", 1); | ||
3722 | 105 | |||
3723 | 106 | // Make sure tab is where it should | ||
3724 | 107 | var scopesOverview = findChild(dash, "scopesOverview"); | ||
3725 | 108 | compare(scopesOverview.currentTab, 0); | ||
3726 | 109 | |||
3727 | 110 | // Make sure stuff is loaded | ||
3728 | 111 | var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater"); | ||
3729 | 112 | tryCompare(scopesOverviewFavoritesRepeater, "count", 6); | ||
3730 | 113 | tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true); | ||
3731 | 114 | waitForRendering(scopesOverviewFavoritesRepeater.itemAt(0).item); | ||
3732 | 115 | |||
3733 | 116 | // Click in first item | ||
3734 | 117 | mouseClick(scopesOverviewFavoritesRepeater.itemAt(0).item, 0, 0); | ||
3735 | 118 | |||
3736 | 119 | // Make sure animation went back | ||
3737 | 120 | tryCompare(overviewController, "progress", 0); | ||
3738 | 121 | compare(dashContentList.currentIndex, 0); | ||
3739 | 122 | } | ||
3740 | 123 | |||
3741 | 124 | function test_dash_overview_show_select_different_favorite() { | ||
3742 | 125 | // Wait for stuff to be loaded | ||
3743 | 126 | tryCompare(scopes, "loaded", true); | ||
3744 | 127 | var dashContentList = findChild(dash, "dashContentList"); | ||
3745 | 128 | tryCompare(dashContentList, "count", 6); | ||
3746 | 129 | var mockScope1Loader = findChild(dash, "MockScope1 loader"); | ||
3747 | 130 | tryCompareFunction(function() { return mockScope1Loader.item != null; }, true); | ||
3748 | 131 | |||
3749 | 132 | // Show the overview | ||
3750 | 133 | touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18)); | ||
3751 | 134 | var overviewController = findInvisibleChild(dash, "overviewController"); | ||
3752 | 135 | tryCompare(overviewController, "progress", 1); | ||
3753 | 136 | |||
3754 | 137 | // Make sure tab is where it should | ||
3755 | 138 | var scopesOverview = findChild(dash, "scopesOverview"); | ||
3756 | 139 | compare(scopesOverview.currentTab, 0); | ||
3757 | 140 | |||
3758 | 141 | // Make sure stuff is loaded | ||
3759 | 142 | var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater"); | ||
3760 | 143 | tryCompare(scopesOverviewFavoritesRepeater, "count", 6); | ||
3761 | 144 | tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true); | ||
3762 | 145 | waitForRendering(scopesOverviewFavoritesRepeater.itemAt(1).item); | ||
3763 | 146 | |||
3764 | 147 | // Click in first item | ||
3765 | 148 | mouseClick(scopesOverviewFavoritesRepeater.itemAt(1).item, 0, 0); | ||
3766 | 149 | |||
3767 | 150 | // Make sure animation went back | ||
3768 | 151 | tryCompare(overviewController, "progress", 0); | ||
3769 | 152 | compare(dashContentList.currentIndex, 1); | ||
3770 | 153 | } | ||
3771 | 154 | |||
3772 | 155 | function test_dash_overview_all_temp_scope_done_from_all() { | ||
3773 | 156 | // Wait for stuff to be loaded | ||
3774 | 157 | tryCompare(scopes, "loaded", true); | ||
3775 | 158 | var dashContentList = findChild(dash, "dashContentList"); | ||
3776 | 159 | tryCompare(dashContentList, "count", 6); | ||
3777 | 160 | var mockScope1Loader = findChild(dash, "MockScope1 loader"); | ||
3778 | 161 | tryCompareFunction(function() { return mockScope1Loader.item != null; }, true); | ||
3779 | 162 | |||
3780 | 163 | // Show the overview | ||
3781 | 164 | touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18)); | ||
3782 | 165 | var overviewController = findInvisibleChild(dash, "overviewController"); | ||
3783 | 166 | tryCompare(overviewController, "progress", 1); | ||
3784 | 167 | |||
3785 | 168 | // Make sure tab is where it should | ||
3786 | 169 | var scopesOverview = findChild(dash, "scopesOverview"); | ||
3787 | 170 | compare(scopesOverview.currentTab, 0); | ||
3788 | 171 | |||
3789 | 172 | // Make sure stuff is loaded | ||
3790 | 173 | var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater"); | ||
3791 | 174 | tryCompare(scopesOverviewFavoritesRepeater, "count", 6); | ||
3792 | 175 | tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true); | ||
3793 | 176 | waitForRendering(scopesOverviewFavoritesRepeater.itemAt(1).item); | ||
3794 | 177 | |||
3795 | 178 | // Click on the all tab | ||
3796 | 179 | var scopesOverviewAllTabButton = findChild(dash, "scopesOverviewAllTabButton"); | ||
3797 | 180 | mouseClick(scopesOverviewAllTabButton, 0, 0); | ||
3798 | 181 | |||
3799 | 182 | // Wait for all tab to be enabled (animation finish) | ||
3800 | 183 | var scopesOverviewAllView = findChild(dash, "scopesOverviewRepeaterChild1"); | ||
3801 | 184 | tryCompare(scopesOverviewAllView, "enabled", true); | ||
3802 | 185 | |||
3803 | 186 | // Click on a temp scope | ||
3804 | 187 | var tempScopeCard = findChild(scopesOverviewAllView, "delegate1"); | ||
3805 | 188 | mouseClick(tempScopeCard, 0, 0); | ||
3806 | 189 | |||
3807 | 190 | // Check the bottom edge (overview) is disabled from temp scope | ||
3808 | 191 | var overviewDragHandle = findChild(dash, "overviewDragHandle"); | ||
3809 | 192 | compare(overviewDragHandle.enabled, false); | ||
3810 | 193 | |||
3811 | 194 | // Check temp scope is there | ||
3812 | 195 | var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem"); | ||
3813 | 196 | tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope != null; }, true); | ||
3814 | 197 | tryCompare(scopesOverviewTempScopeItem, "enabled", true); | ||
3815 | 198 | |||
3816 | 199 | // Go back | ||
3817 | 200 | var scopesOverviewTempScopeItemHeader = findChild(scopesOverviewTempScopeItem, "scopePageHeader"); | ||
3818 | 201 | var backButton = findChild(findChild(scopesOverviewTempScopeItemHeader, "innerPageHeader"), "backButton"); | ||
3819 | 202 | mouseClick(backButton, 0, 0); | ||
3820 | 203 | |||
3821 | 204 | // Check temp scope is gone | ||
3822 | 205 | var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem"); | ||
3823 | 206 | tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope == null; }, true); | ||
3824 | 207 | tryCompare(scopesOverviewTempScopeItem, "enabled", false); | ||
3825 | 208 | |||
3826 | 209 | // Press on done | ||
3827 | 210 | var scopesOverviewDoneButton = findChild(scopesOverview, "scopesOverviewDoneButton"); | ||
3828 | 211 | mouseClick(scopesOverviewDoneButton, 0, 0); | ||
3829 | 212 | |||
3830 | 213 | // Check the dash overview is gone | ||
3831 | 214 | tryCompare(overviewController, "progress", 0); | ||
3832 | 215 | |||
3833 | 216 | // Original list is still on 0 | ||
3834 | 217 | compare(dashContentList.currentIndex, 0); | ||
3835 | 218 | } | ||
3836 | 219 | |||
3837 | 220 | function test_temp_scope_dash_overview_all_search_temp_scope_favorite_from_all() { | ||
3838 | 221 | // Wait for stuff to be loaded | ||
3839 | 222 | tryCompare(scopes, "loaded", true); | ||
3840 | 223 | var dashContentList = findChild(dash, "dashContentList"); | ||
3841 | 224 | tryCompare(dashContentList, "count", 6); | ||
3842 | 225 | var mockScope1Loader = findChild(dash, "MockScope1 loader"); | ||
3843 | 226 | tryCompareFunction(function() { return mockScope1Loader.item != null; }, true); | ||
3844 | 227 | |||
3845 | 228 | // Swipe right to Apps scope | ||
3846 | 229 | touchFlick(dash, dash.width - 1, units.gu(1), dash.width - units.gu(10), units.gu(1)); | ||
3847 | 230 | tryCompare(dashContentList, "contentX", dashContentList.width); | ||
3848 | 231 | tryCompare(dashContentList, "currentIndex", 1); | ||
3849 | 232 | |||
3850 | 233 | // Click on card that opens temp scope | ||
3851 | 234 | var categoryListView = findChild(dashContentList.currentItem, "categoryListView"); | ||
3852 | 235 | var dashCategory2 = findChild(categoryListView, "dashCategory2"); | ||
3853 | 236 | tryCompareFunction(function() { | ||
3854 | 237 | var d = findChild(dashCategory2, "delegate2"); | ||
3855 | 238 | if (d) return true; | ||
3856 | 239 | categoryListView.contentY += 100; | ||
3857 | 240 | return false; | ||
3858 | 241 | }, true); | ||
3859 | 242 | var card2 = findChild(dashCategory2, "delegate2"); | ||
3860 | 243 | waitForRendering(card2); | ||
3861 | 244 | mouseClick(card2, card2.width / 2, card2.height / 2); | ||
3862 | 245 | |||
3863 | 246 | // Wait for temp scope to be there | ||
3864 | 247 | var dashTempScopeItem = findChild(dash, "dashTempScopeItem"); | ||
3865 | 248 | tryCompare(dashTempScopeItem, "x", 0); | ||
3866 | 249 | |||
3867 | 250 | // Show the overview | ||
3868 | 251 | touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18)); | ||
3869 | 252 | var overviewController = findInvisibleChild(dash, "overviewController"); | ||
3870 | 253 | tryCompare(overviewController, "progress", 1); | ||
3871 | 254 | |||
3872 | 255 | // Make sure tab is where it should | ||
3873 | 256 | var scopesOverview = findChild(dash, "scopesOverview"); | ||
3874 | 257 | compare(scopesOverview.currentTab, 1); | ||
3875 | 258 | |||
3876 | 259 | // Do a search | ||
3877 | 260 | var scopesOverviewPageHeader = findChild(scopesOverview, "scopesOverviewPageHeader"); | ||
3878 | 261 | var searchButton = findChild(scopesOverviewPageHeader, "search_header_button"); | ||
3879 | 262 | mouseClick(searchButton, 0, 0); | ||
3880 | 263 | |||
3881 | 264 | // Type something | ||
3882 | 265 | keyClick(Qt.Key_H); | ||
3883 | 266 | |||
3884 | 267 | // Check results grid is there and the other lists are not | ||
3885 | 268 | var searchResultsViewer = findChild(scopesOverview, "searchResultsViewer"); | ||
3886 | 269 | var scopesOverviewRepeater = findChild(dash, "scopesOverviewRepeater"); | ||
3887 | 270 | tryCompare(searchResultsViewer, "opacity", 1); | ||
3888 | 271 | tryCompare(scopesOverviewRepeater, "count", 0); | ||
3889 | 272 | |||
3890 | 273 | // Click on a temp scope in the search | ||
3891 | 274 | var dashCategorysearchA = findChild(searchResultsViewer, "dashCategorysearchA"); | ||
3892 | 275 | var cardTempScope = findChild(dashCategorysearchA, "delegate2"); | ||
3893 | 276 | waitForRendering(cardTempScope); | ||
3894 | 277 | mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2); | ||
3895 | 278 | |||
3896 | 279 | // Check the bottom edge (overview) is disabled from temp scope | ||
3897 | 280 | var overviewDragHandle = findChild(dash, "overviewDragHandle"); | ||
3898 | 281 | compare(overviewDragHandle.enabled, false); | ||
3899 | 282 | |||
3900 | 283 | // Check temp scope is there | ||
3901 | 284 | var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem"); | ||
3902 | 285 | tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope != null; }, true); | ||
3903 | 286 | tryCompare(scopesOverviewTempScopeItem, "enabled", true); | ||
3904 | 287 | |||
3905 | 288 | // Go back | ||
3906 | 289 | var scopesOverviewTempScopeItemHeader = findChild(scopesOverviewTempScopeItem, "scopePageHeader"); | ||
3907 | 290 | var backButton = findChild(findChild(scopesOverviewTempScopeItemHeader, "innerPageHeader"), "backButton"); | ||
3908 | 291 | mouseClick(backButton, 0, 0); | ||
3909 | 292 | |||
3910 | 293 | // Check temp scope is gone | ||
3911 | 294 | var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem"); | ||
3912 | 295 | tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope == null; }, true); | ||
3913 | 296 | tryCompare(scopesOverviewTempScopeItem, "enabled", false); | ||
3914 | 297 | |||
3915 | 298 | // Press on a favorite | ||
3916 | 299 | var dashCategorysearchB = findChild(searchResultsViewer, "dashCategorysearchB"); | ||
3917 | 300 | var cardFavSearch = findChild(dashCategorysearchB, "delegate3"); | ||
3918 | 301 | mouseClick(cardFavSearch, 0, 0); | ||
3919 | 302 | |||
3920 | 303 | // Check the dash overview is gone | ||
3921 | 304 | tryCompare(overviewController, "progress", 0); | ||
3922 | 305 | |||
3923 | 306 | // Original list went to the favorite | ||
3924 | 307 | compare(dashContentList.currentIndex, 0); | ||
3925 | 86 | } | 308 | } |
3926 | 87 | 309 | ||
3927 | 88 | function test_setCurrentScope() { | 310 | function test_setCurrentScope() { |
3928 | 89 | 311 | ||
3929 | === modified file 'tests/qmltests/Dash/tst_DashContent.qml' | |||
3930 | --- tests/qmltests/Dash/tst_DashContent.qml 2014-08-06 10:16:59 +0000 | |||
3931 | +++ tests/qmltests/Dash/tst_DashContent.qml 2014-08-08 20:44:52 +0000 | |||
3932 | @@ -70,7 +70,7 @@ | |||
3933 | 70 | function loadScopes() { | 70 | function loadScopes() { |
3934 | 71 | scopeLoadedSpy.clear(); | 71 | scopeLoadedSpy.clear(); |
3935 | 72 | scopesModel.load(); | 72 | scopesModel.load(); |
3937 | 73 | tryCompare(scopeLoadedSpy, "count", 4); | 73 | tryCompare(scopeLoadedSpy, "count", 6); |
3938 | 74 | } | 74 | } |
3939 | 75 | 75 | ||
3940 | 76 | function init() { | 76 | function init() { |
3941 | @@ -114,7 +114,8 @@ | |||
3942 | 114 | 114 | ||
3943 | 115 | loadScopes(); | 115 | loadScopes(); |
3944 | 116 | 116 | ||
3946 | 117 | verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < 5); | 117 | compare(dashContentList.count, 6); |
3947 | 118 | verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < dashContentList.count); | ||
3948 | 118 | } | 119 | } |
3949 | 119 | 120 | ||
3950 | 120 | function test_show_header_on_list_movement() { | 121 | function test_show_header_on_list_movement() { |
3951 | @@ -170,7 +171,7 @@ | |||
3952 | 170 | 171 | ||
3953 | 171 | // test greater than scope count. | 172 | // test greater than scope count. |
3954 | 172 | var currentScopeIndex = dashContent.currentIndex; | 173 | var currentScopeIndex = dashContent.currentIndex; |
3956 | 173 | dashContent.setCurrentScopeAtIndex(8, true, false); | 174 | dashContent.setCurrentScopeAtIndex(18, true, false); |
3957 | 174 | compare(dashContent.currentIndex, currentScopeIndex, "Scope should not change if changing to greater index than count"); | 175 | compare(dashContent.currentIndex, currentScopeIndex, "Scope should not change if changing to greater index than count"); |
3958 | 175 | } | 176 | } |
3959 | 176 | 177 | ||
3960 | @@ -189,9 +190,9 @@ | |||
3961 | 189 | function test_scope_mapping_data() { | 190 | function test_scope_mapping_data() { |
3962 | 190 | return [ | 191 | return [ |
3963 | 191 | {tag: "index0", index: 0, objectName: "MockScope1"}, | 192 | {tag: "index0", index: 0, objectName: "MockScope1"}, |
3967 | 192 | {tag: "index1", index: 1, objectName: "MockScope2"}, | 193 | {tag: "index1", index: 1, objectName: "clickscope"}, |
3968 | 193 | {tag: "index2", index: 2, objectName: "clickscope"}, | 194 | {tag: "index2", index: 2, objectName: "MockScope5"}, |
3969 | 194 | {tag: "index3", index: 3, objectName: "MockScope5"} | 195 | {tag: "index3", index: 3, objectName: "SingleCategoryScope"} |
3970 | 195 | ] | 196 | ] |
3971 | 196 | } | 197 | } |
3972 | 197 | 198 | ||
3973 | 198 | 199 | ||
3974 | === modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml' | |||
3975 | --- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-08-06 19:39:30 +0000 | |||
3976 | +++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-08-08 20:44:52 +0000 | |||
3977 | @@ -57,12 +57,12 @@ | |||
3978 | 57 | name: "GenericScopeView" | 57 | name: "GenericScopeView" |
3979 | 58 | when: scopes.loaded && windowShown | 58 | when: scopes.loaded && windowShown |
3980 | 59 | 59 | ||
3982 | 60 | property Item previewListView: findChild(genericScopeView, "previewListView") | 60 | property Item subPageLoader: findChild(genericScopeView, "subPageLoader") |
3983 | 61 | property Item header: findChild(genericScopeView, "scopePageHeader") | 61 | property Item header: findChild(genericScopeView, "scopePageHeader") |
3984 | 62 | 62 | ||
3985 | 63 | function init() { | 63 | function init() { |
3988 | 64 | genericScopeView.scope = scopes.getScope(1) | 64 | genericScopeView.scope = scopes.getScope(2); |
3989 | 65 | shell.width = units.gu(120) | 65 | shell.width = units.gu(120); |
3990 | 66 | genericScopeView.categoryView.positionAtBeginning(); | 66 | genericScopeView.categoryView.positionAtBeginning(); |
3991 | 67 | waitForRendering(genericScopeView.categoryView); | 67 | waitForRendering(genericScopeView.categoryView); |
3992 | 68 | } | 68 | } |
3993 | @@ -78,24 +78,24 @@ | |||
3994 | 78 | tryCompare(genericScopeView.scope, "isActive", false) | 78 | tryCompare(genericScopeView.scope, "isActive", false) |
3995 | 79 | genericScopeView.isCurrent = true | 79 | genericScopeView.isCurrent = true |
3996 | 80 | tryCompare(genericScopeView.scope, "isActive", true) | 80 | tryCompare(genericScopeView.scope, "isActive", true) |
3998 | 81 | testCase.previewListView.open = true | 81 | testCase.subPageLoader.open = true |
3999 | 82 | tryCompare(genericScopeView.scope, "isActive", false) | 82 | tryCompare(genericScopeView.scope, "isActive", false) |
4001 | 83 | testCase.previewListView.open = false | 83 | testCase.subPageLoader.open = false |
4002 | 84 | tryCompare(genericScopeView.scope, "isActive", true) | 84 | tryCompare(genericScopeView.scope, "isActive", true) |
4003 | 85 | genericScopeView.isCurrent = false | 85 | genericScopeView.isCurrent = false |
4004 | 86 | tryCompare(genericScopeView.scope, "isActive", false) | 86 | tryCompare(genericScopeView.scope, "isActive", false) |
4005 | 87 | } | 87 | } |
4006 | 88 | 88 | ||
4007 | 89 | function test_showDash() { | 89 | function test_showDash() { |
4011 | 90 | testCase.previewListView.open = true; | 90 | testCase.subPageLoader.open = true; |
4012 | 91 | scopes.getScope(1).showDash(); | 91 | genericScopeView.scope.showDash(); |
4013 | 92 | tryCompare(testCase.previewListView, "open", false); | 92 | tryCompare(testCase.subPageLoader, "open", false); |
4014 | 93 | } | 93 | } |
4015 | 94 | 94 | ||
4016 | 95 | function test_hideDash() { | 95 | function test_hideDash() { |
4020 | 96 | testCase.previewListView.open = true; | 96 | testCase.subPageLoader.open = true; |
4021 | 97 | scopes.getScope(1).hideDash(); | 97 | genericScopeView.scope.hideDash(); |
4022 | 98 | tryCompare(testCase.previewListView, "open", false); | 98 | tryCompare(testCase.subPageLoader, "open", false); |
4023 | 99 | } | 99 | } |
4024 | 100 | 100 | ||
4025 | 101 | function test_searchQuery() { | 101 | function test_searchQuery() { |
4026 | @@ -111,8 +111,9 @@ | |||
4027 | 111 | 111 | ||
4028 | 112 | function test_changeScope() { | 112 | function test_changeScope() { |
4029 | 113 | genericScopeView.scope.searchQuery = "test" | 113 | genericScopeView.scope.searchQuery = "test" |
4032 | 114 | genericScopeView.scope = scopes.getScope(2) | 114 | var originalScopeId = genericScopeView.scope.id; |
4033 | 115 | genericScopeView.scope = scopes.getScope(1) | 115 | genericScopeView.scope = scopes.getScope(originalScopeId + 1) |
4034 | 116 | genericScopeView.scope = scopes.getScope(originalScopeId) | ||
4035 | 116 | tryCompare(genericScopeView.scope, "searchQuery", "test") | 117 | tryCompare(genericScopeView.scope, "searchQuery", "test") |
4036 | 117 | } | 118 | } |
4037 | 118 | 119 | ||
4038 | @@ -197,7 +198,9 @@ | |||
4039 | 197 | 198 | ||
4040 | 198 | openPreview(4, 0); | 199 | openPreview(4, 0); |
4041 | 199 | 200 | ||
4043 | 200 | compare(testCase.previewListView.count, 12, "There should only be 12 items in preview."); | 201 | compare(testCase.subPageLoader.count, 12, "There should only be 12 items in preview."); |
4044 | 202 | |||
4045 | 203 | closePreview(); | ||
4046 | 201 | } | 204 | } |
4047 | 202 | 205 | ||
4048 | 203 | function test_narrow_delegate_ranges_expand() { | 206 | function test_narrow_delegate_ranges_expand() { |
4049 | @@ -232,7 +235,7 @@ | |||
4050 | 232 | } | 235 | } |
4051 | 233 | 236 | ||
4052 | 234 | function test_single_category_expansion() { | 237 | function test_single_category_expansion() { |
4054 | 235 | genericScopeView.scope = scopes.getScope(4); | 238 | genericScopeView.scope = scopes.getScope(3); |
4055 | 236 | 239 | ||
4056 | 237 | tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true); | 240 | tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true); |
4057 | 238 | var category = findChild(genericScopeView, "dashCategory0") | 241 | var category = findChild(genericScopeView, "dashCategory0") |
4058 | @@ -258,19 +261,19 @@ | |||
4059 | 258 | true); | 261 | true); |
4060 | 259 | var tile = findChild(findChild(genericScopeView, category), "delegate"+delegate); | 262 | var tile = findChild(findChild(genericScopeView, category), "delegate"+delegate); |
4061 | 260 | mouseClick(tile, tile.width / 2, tile.height / 2); | 263 | mouseClick(tile, tile.width / 2, tile.height / 2); |
4064 | 261 | tryCompare(testCase.previewListView, "open", true); | 264 | tryCompare(testCase.subPageLoader, "open", true); |
4065 | 262 | tryCompare(testCase.previewListView, "x", 0); | 265 | tryCompare(testCase.subPageLoader, "x", 0); |
4066 | 263 | } | 266 | } |
4067 | 264 | 267 | ||
4068 | 265 | function closePreview() { | 268 | function closePreview() { |
4070 | 266 | var closePreviewMouseArea = findChild(genericScopeView, "innerPageHeader"); | 269 | var closePreviewMouseArea = findChild(subPageLoader.item, "pageHeader"); |
4071 | 267 | mouseClick(closePreviewMouseArea, units.gu(2), units.gu(2)); | 270 | mouseClick(closePreviewMouseArea, units.gu(2), units.gu(2)); |
4072 | 268 | 271 | ||
4074 | 269 | tryCompare(testCase.previewListView, "open", false); | 272 | tryCompare(testCase.subPageLoader, "open", false); |
4075 | 270 | } | 273 | } |
4076 | 271 | 274 | ||
4077 | 272 | function test_previewOpenClose() { | 275 | function test_previewOpenClose() { |
4079 | 273 | tryCompare(testCase.previewListView, "open", false); | 276 | tryCompare(testCase.subPageLoader, "open", false); |
4080 | 274 | 277 | ||
4081 | 275 | var categoryListView = findChild(genericScopeView, "categoryListView"); | 278 | var categoryListView = findChild(genericScopeView, "categoryListView"); |
4082 | 276 | categoryListView.positionAtBeginning(); | 279 | categoryListView.positionAtBeginning(); |
4083 | @@ -290,15 +293,15 @@ | |||
4084 | 290 | }, | 293 | }, |
4085 | 291 | true); | 294 | true); |
4086 | 292 | 295 | ||
4088 | 293 | tryCompare(testCase.previewListView, "open", false); | 296 | tryCompare(testCase.subPageLoader, "open", false); |
4089 | 294 | 297 | ||
4090 | 295 | var dashCategory1 = findChild(genericScopeView, "dashCategory1"); | 298 | var dashCategory1 = findChild(genericScopeView, "dashCategory1"); |
4091 | 296 | var tile = findChild(dashCategory1, "carouselDelegate1"); | 299 | var tile = findChild(dashCategory1, "carouselDelegate1"); |
4092 | 297 | mouseClick(tile, tile.width / 2, tile.height / 2); | 300 | mouseClick(tile, tile.width / 2, tile.height / 2); |
4093 | 298 | tryCompare(tile, "explicitlyScaled", true); | 301 | tryCompare(tile, "explicitlyScaled", true); |
4094 | 299 | mouseClick(tile, tile.width / 2, tile.height / 2); | 302 | mouseClick(tile, tile.width / 2, tile.height / 2); |
4097 | 300 | tryCompare(testCase.previewListView, "open", true); | 303 | tryCompare(testCase.subPageLoader, "open", true); |
4098 | 301 | tryCompare(testCase.previewListView, "x", 0); | 304 | tryCompare(testCase.subPageLoader, "x", 0); |
4099 | 302 | 305 | ||
4100 | 303 | closePreview(); | 306 | closePreview(); |
4101 | 304 | } | 307 | } |
4102 | @@ -307,21 +310,20 @@ | |||
4103 | 307 | var categoryListView = findChild(genericScopeView, "categoryListView"); | 310 | var categoryListView = findChild(genericScopeView, "categoryListView"); |
4104 | 308 | categoryListView.positionAtBeginning(); | 311 | categoryListView.positionAtBeginning(); |
4105 | 309 | 312 | ||
4108 | 310 | tryCompare(testCase.previewListView, "open", false); | 313 | tryCompare(testCase.subPageLoader, "open", false); |
4107 | 311 | var previewListViewList = findChild(previewListView, "listView"); | ||
4109 | 312 | 314 | ||
4110 | 313 | openPreview(); | 315 | openPreview(); |
4111 | 316 | var previewListViewList = findChild(subPageLoader.item, "listView"); | ||
4112 | 314 | 317 | ||
4113 | 315 | // flick to the next previews | 318 | // flick to the next previews |
4118 | 316 | tryCompare(testCase.previewListView, "count", 15); | 319 | tryCompare(testCase.subPageLoader, "count", 15); |
4119 | 317 | for (var i = 1; i < testCase.previewListView.count; ++i) { | 320 | for (var i = 1; i < testCase.subPageLoader.count; ++i) { |
4120 | 318 | mouseFlick(testCase.previewListView, testCase.previewListView.width - units.gu(1), | 321 | mouseFlick(testCase.subPageLoader.item, testCase.subPageLoader.width - units.gu(1), |
4121 | 319 | testCase.previewListView.height / 2, | 322 | testCase.subPageLoader.height / 2, |
4122 | 320 | units.gu(2), | 323 | units.gu(2), |
4124 | 321 | testCase.previewListView.height / 2); | 324 | testCase.subPageLoader.height / 2); |
4125 | 322 | tryCompare(previewListViewList, "moving", false); | 325 | tryCompare(previewListViewList, "moving", false); |
4128 | 323 | tryCompare(testCase.previewListView.currentItem, "objectName", "preview" + i); | 326 | tryCompare(testCase.subPageLoader.currentItem, "objectName", "preview" + i); |
4127 | 324 | |||
4129 | 325 | } | 327 | } |
4130 | 326 | closePreview(); | 328 | closePreview(); |
4131 | 327 | } | 329 | } |
4132 | @@ -329,8 +331,8 @@ | |||
4133 | 329 | function test_header_style_data() { | 331 | function test_header_style_data() { |
4134 | 330 | return [ | 332 | return [ |
4135 | 331 | { tag: "Default", index: 0, foreground: "grey", background: "", logo: "" }, | 333 | { tag: "Default", index: 0, foreground: "grey", background: "", logo: "" }, |
4138 | 332 | { tag: "Foreground", index: 2, foreground: "yellow", background: "", logo: "" }, | 334 | { tag: "Foreground", index: 1, foreground: "yellow", background: "", logo: "" }, |
4139 | 333 | { tag: "Logo+Background", index: 3, foreground: "grey", background: "gradient:///lightgrey/grey", | 335 | { tag: "Logo+Background", index: 2, foreground: "grey", background: "gradient:///lightgrey/grey", |
4140 | 334 | logo: Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg") }, | 336 | logo: Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg") }, |
4141 | 335 | ]; | 337 | ]; |
4142 | 336 | } | 338 | } |
FAILED: Continuous integration, rev:1111 /code.launchpad .net/~cimi/ unity8/ scope-settings/ +merge/ 229995/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// jenkins. qa.ubuntu. com/job/ unity8- ci/3822/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/3210/ console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- utopic/ 824/console jenkins. qa.ubuntu. com/job/ unity8- utopic- amd64-ci/ 916/console jenkins. qa.ubuntu. com/job/ unity8- utopic- armhf-ci/ 916/console jenkins. qa.ubuntu. com/job/ unity8- utopic- i386-ci/ 916/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/4456/ console
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/3822/ rebuild
http://