on xenial help sign in
Merge trunk
655839dMichal Hruby
Dash/Music/MusicFilterGrid.qml+12−2
@@ -29,19 +29,29 @@ FilterGrid {
29 readonly property int iconWidth: (width / columns) * 0.8
29 readonly property int iconWidth: (width / columns) * 0.8
30 readonly property int iconHeight: iconWidth
30 readonly property int iconHeight: iconWidth
31
31
32− signal clicked(int index)
32+ signal clicked(int index, var delegateItem, real itemY)
33+ signal pressAndHold(int index, var delegateItem, real itemY)
33
34
34 delegate: AlbumTile {
35 delegate: AlbumTile {
36+ id: tile
35 objectName: "delegate" + index
37 objectName: "delegate" + index
36 width: filterGrid.cellWidth
38 width: filterGrid.cellWidth
37 height: filterGrid.cellHeight
39 height: filterGrid.cellHeight
38 iconWidth: filterGrid.iconWidth
40 iconWidth: filterGrid.iconWidth
39 iconHeight: filterGrid.iconHeight
41 iconHeight: filterGrid.iconHeight
42+
40 artist: model.title
43 artist: model.title
41 album: model.comment
44 album: model.comment
42 source: model.icon
45 source: model.icon
46+
43 onClicked: {
47 onClicked: {
48+ var data = { model: model }
44− filterGrid.clicked(index);
49+ filterGrid.clicked(index, data, tile.y)
50+ }
51+
52+ onPressAndHold: {
53+ var data = { model: model }
54+ filterGrid.pressAndHold(index, data, tile.y)
45 }
55 }
46 }
56 }
47}
57}
Panel/MenuContent.qml+12−2
@@ -109,7 +109,7 @@ MainView {
109 source: pageSource
109 source: pageSource
110 asynchronous: true
110 asynchronous: true
111
111
112− property bool contentActive: content.__contentActive
112+ property bool contentActive: content.__contentActive && menuActivator.content[index].active
113
113
114 onContentActiveChanged: {
114 onContentActiveChanged: {
115 if (contentActive && item) {
115 if (contentActive && item) {
@@ -146,6 +146,16 @@ MainView {
146 id: contentReleaseTimer
146 id: contentReleaseTimer
147
147
148 interval: contentReleaseInterval
148 interval: contentReleaseInterval
149+ onTriggered: {
149− onTriggered: content.__contentActive = false
150+ content.__contentActive = false;
151+ menuActivator.clear();
152+ }
153+ }
154+
155+ Indicators.MenuContentActivator {
156+ id: menuActivator
157+ running: content.__contentActive
158+ baseIndex: content.currentMenuIndex
159+ count: indicatorsModel.count
150 }
160 }
151}
161}
debian/changelog+44
@@ -1,3 +1,47 @@
1+unity8 (7.81.3+13.10.20130919.3-0ubuntu1) saucy; urgency=low
2+
3+ [ Michal Hruby ]
4+ * Add support for music grid renderer to GenericScopeView.
5+
6+ [ Nick Dedekind ]
7+ * Fixed the removal of messaging widget due to incompatible action
8+ state. (LP: #1225017)
9+
10+ [ Christopher Lee ]
11+ * Addition of initial autopilot tests for the application lifecycle.
12+
13+ [ Lars Uebernickel ]
14+ * VolumeControl: use action of the new indicator indicator-sound
15+ recently gained an action to increase and decrease the volume. This
16+ patch makes use of that to get rid of a bus round trip (to get the
17+ current volume) and a race (when the volume gets set between
18+ fetching the current volume and setting the new volume). (LP:
19+ #1219057)
20+
21+ [ Michael Terry ]
22+ * When AccountsService.backgroundFile is unset/invalid, have the
23+ greeter fall back to whatever the shell background is.
24+ * Add a tiny SessionBroadcast plugin that listens to unity-greeter-
25+ session-broadcast for the ShowHome signal.
26+
27+ [ Daniel d'Andrada ]
28+ * Remove obsolete, unused graphics.
29+ * Make MouseTouchAdaptor work with multiple QWindows.
30+
31+ [ Michael Zanetti ]
32+ * change how icons are searched a) try to find it the Icon as is b)
33+ prepend with Path if a Path variable is given c) fall back to the
34+ image://theme/ with just the icon name . (LP: #1225186)
35+ * fix an issue with removing a running app from the launcher and
36+ always store pinning to the config.
37+ * collapse any open preview when programmatically switching current
38+ dash index. (LP: #1221137)
39+
40+ [ Ubuntu daily release ]
41+ * Automatic snapshot from revision 333
42+
43+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 19 Sep 2013 15:15:07 +0000
44+
1unity8 (7.81.3+13.10.20130916-0ubuntu1) saucy; urgency=low
45unity8 (7.81.3+13.10.20130916-0ubuntu1) saucy; urgency=low
2
46
3 [ Michael Zanetti ]
47 [ Michael Zanetti ]
plugins/AccountsService/AccountsService.cpp+3−3
@@ -32,7 +32,7 @@ AccountsService::AccountsService(QObject* parent)
32 this, SLOT(maybeChanged(const QString &)));
32 this, SLOT(maybeChanged(const QString &)));
33}
33}
34
34
35−QString AccountsService::getUser()
35+QString AccountsService::user() const
36{
36{
37 return m_user;
37 return m_user;
38}
38}
@@ -46,7 +46,7 @@ void AccountsService::setUser(const QString &user)
46 updateBackgroundFile();
46 updateBackgroundFile();
47}
47}
48
48
49−bool AccountsService::getDemoEdges()
49+bool AccountsService::demoEdges() const
50{
50{
51 return m_demoEdges;
51 return m_demoEdges;
52}
52}
@@ -57,7 +57,7 @@ void AccountsService::setDemoEdges(bool demoEdges)
57 m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges", demoEdges);
57 m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges", demoEdges);
58}
58}
59
59
60−QString AccountsService::getBackgroundFile()
60+QString AccountsService::backgroundFile() const
61{
61{
62 return m_backgroundFile;
62 return m_backgroundFile;
63}
63}
plugins/AccountsService/AccountsService.h+6−6
@@ -28,25 +28,25 @@ class AccountsService: public QObject
28{
28{
29 Q_OBJECT
29 Q_OBJECT
30 Q_PROPERTY (QString user
30 Q_PROPERTY (QString user
31− READ getUser
31+ READ user
32 WRITE setUser
32 WRITE setUser
33 NOTIFY userChanged)
33 NOTIFY userChanged)
34 Q_PROPERTY (bool demoEdges
34 Q_PROPERTY (bool demoEdges
35− READ getDemoEdges
35+ READ demoEdges
36 WRITE setDemoEdges
36 WRITE setDemoEdges
37 NOTIFY demoEdgesChanged)
37 NOTIFY demoEdgesChanged)
38 Q_PROPERTY (QString backgroundFile
38 Q_PROPERTY (QString backgroundFile
39− READ getBackgroundFile
39+ READ backgroundFile
40 NOTIFY backgroundFileChanged)
40 NOTIFY backgroundFileChanged)
41
41
42public:
42public:
43 explicit AccountsService(QObject *parent = 0);
43 explicit AccountsService(QObject *parent = 0);
44
44
45− QString getUser();
45+ QString user() const;
46 void setUser(const QString &user);
46 void setUser(const QString &user);
47− bool getDemoEdges();
47+ bool demoEdges() const;
48 void setDemoEdges(bool demoEdges);
48 void setDemoEdges(bool demoEdges);
49− QString getBackgroundFile();
49+ QString backgroundFile() const;
50
50
51Q_SIGNALS:
51Q_SIGNALS:
52 void userChanged();
52 void userChanged();
plugins/AccountsService/AccountsServiceDBusAdaptor.cpp+15−15
@@ -24,13 +24,13 @@
24
24
25AccountsServiceDBusAdaptor::AccountsServiceDBusAdaptor(QObject* parent)
25AccountsServiceDBusAdaptor::AccountsServiceDBusAdaptor(QObject* parent)
26 : QObject(parent),
26 : QObject(parent),
27− accounts_manager(NULL),
27+ m_accountsManager(NULL),
28− users()
28+ m_users()
29{
29{
30− auto connection = QDBusConnection::SM_BUSNAME();
30+ QDBusConnection connection = QDBusConnection::SM_BUSNAME();
31− auto interface = connection.interface();
31+ QDBusConnectionInterface *interface = connection.interface();
32 interface->startService("org.freedesktop.Accounts");
32 interface->startService("org.freedesktop.Accounts");
33− accounts_manager = new QDBusInterface("org.freedesktop.Accounts",
33+ m_accountsManager = new QDBusInterface("org.freedesktop.Accounts",
34 "/org/freedesktop/Accounts",
34 "/org/freedesktop/Accounts",
35 "org.freedesktop.Accounts",
35 "org.freedesktop.Accounts",
36 connection, this);
36 connection, this);
@@ -38,9 +38,9 @@ AccountsServiceDBusAdaptor::AccountsServiceDBusAdaptor(QObject* parent)
38
38
39QVariant AccountsServiceDBusAdaptor::getUserProperty(const QString &user, const QString &interface, const QString &property)
39QVariant AccountsServiceDBusAdaptor::getUserProperty(const QString &user, const QString &interface, const QString &property)
40{
40{
41− auto iface = getUserInterface(user);
41+ QDBusInterface *iface = getUserInterface(user);
42 if (iface != nullptr && iface->isValid()) {
42 if (iface != nullptr && iface->isValid()) {
43− auto answer = iface->call("Get", interface, property);
43+ QDBusMessage answer = iface->call("Get", interface, property);
44 if (answer.type() == QDBusMessage::ReplyMessage) {
44 if (answer.type() == QDBusMessage::ReplyMessage) {
45 return answer.arguments()[0].value<QDBusVariant>().variant();
45 return answer.arguments()[0].value<QDBusVariant>().variant();
46 }
46 }
@@ -50,7 +50,7 @@ QVariant AccountsServiceDBusAdaptor::getUserProperty(const QString &user, const
50
50
51void AccountsServiceDBusAdaptor::setUserProperty(const QString &user, const QString &interface, const QString &property, const QVariant &value)
51void AccountsServiceDBusAdaptor::setUserProperty(const QString &user, const QString &interface, const QString &property, const QVariant &value)
52{
52{
53− auto iface = getUserInterface(user);
53+ QDBusInterface *iface = getUserInterface(user);
54 if (iface != nullptr && iface->isValid()) {
54 if (iface != nullptr && iface->isValid()) {
55 // The value needs to be carefully wrapped
55 // The value needs to be carefully wrapped
56 iface->call("Set", interface, property, QVariant::fromValue(QDBusVariant(value)));
56 iface->call("Set", interface, property, QVariant::fromValue(QDBusVariant(value)));
@@ -76,7 +76,7 @@ void AccountsServiceDBusAdaptor::maybeChangedSlot()
76QString AccountsServiceDBusAdaptor::getUserForPath(const QString &path)
76QString AccountsServiceDBusAdaptor::getUserForPath(const QString &path)
77{
77{
78 QMap<QString, QDBusInterface *>::const_iterator i;
78 QMap<QString, QDBusInterface *>::const_iterator i;
79− for (i = users.constBegin(); i != users.constEnd(); ++i) {
79+ for (i = m_users.constBegin(); i != m_users.constEnd(); ++i) {
80 if (i.value()->path() == path) {
80 if (i.value()->path() == path) {
81 return i.key();
81 return i.key();
82 }
82 }
@@ -86,16 +86,16 @@ QString AccountsServiceDBusAdaptor::getUserForPath(const QString &path)
86
86
87QDBusInterface *AccountsServiceDBusAdaptor::getUserInterface(const QString &user)
87QDBusInterface *AccountsServiceDBusAdaptor::getUserInterface(const QString &user)
88{
88{
89− auto iface = users.value(user);
89+ QDBusInterface *iface = m_users.value(user);
90− if (iface == nullptr && accounts_manager->isValid()) {
90+ if (iface == nullptr && m_accountsManager->isValid()) {
91− auto answer = accounts_manager->call("FindUserByName", user);
91+ QDBusMessage answer = m_accountsManager->call("FindUserByName", user);
92 if (answer.type() == QDBusMessage::ReplyMessage) {
92 if (answer.type() == QDBusMessage::ReplyMessage) {
93− auto path = answer.arguments()[0].value<QDBusObjectPath>().path();
93+ QString path = answer.arguments()[0].value<QDBusObjectPath>().path();
94
94
95 iface = new QDBusInterface("org.freedesktop.Accounts",
95 iface = new QDBusInterface("org.freedesktop.Accounts",
96 path,
96 path,
97 "org.freedesktop.DBus.Properties",
97 "org.freedesktop.DBus.Properties",
98− accounts_manager->connection(), this);
98+ m_accountsManager->connection(), this);
99
99
100 // With its own pre-defined properties, AccountsService is oddly
100 // With its own pre-defined properties, AccountsService is oddly
101 // close-lipped. It won't send out proper DBus.Properties notices,
101 // close-lipped. It won't send out proper DBus.Properties notices,
@@ -119,7 +119,7 @@ QDBusInterface *AccountsServiceDBusAdaptor::getUserInterface(const QString &user
119 this,
119 this,
120 SLOT(propertiesChangedSlot(QString, QVariantMap, QStringList)));
120 SLOT(propertiesChangedSlot(QString, QVariantMap, QStringList)));
121
121
122− users.insert(user, iface);
122+ m_users.insert(user, iface);
123 }
123 }
124 }
124 }
125 return iface;
125 return iface;
plugins/AccountsService/AccountsServiceDBusAdaptor.h+2−2
@@ -47,8 +47,8 @@ private:
47 QDBusInterface *getUserInterface(const QString &user);
47 QDBusInterface *getUserInterface(const QString &user);
48 QString getUserForPath(const QString &path);
48 QString getUserForPath(const QString &path);
49
49
50− QDBusInterface *accounts_manager;
50+ QDBusInterface *m_accountsManager;
51− QMap<QString, QDBusInterface *> users;
51+ QMap<QString, QDBusInterface *> m_users;
52};
52};
53
53
54#endif
54#endif
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+13
@@ -199,6 +199,7 @@ void ListViewWithPageHeader::setModel(QAbstractItemModel *model)
199 connect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
199 connect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
200#endif
200#endif
201 Q_EMIT modelChanged();
201 Q_EMIT modelChanged();
202+ polish();
202 // TODO?
203 // TODO?
203// Q_EMIT contentHeightChanged();
204// Q_EMIT contentHeightChanged();
204// Q_EMIT contentYChanged();
205// Q_EMIT contentYChanged();
@@ -1006,6 +1007,18 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
1006 }
1007 }
1007 }
1008 }
1008
1009
1010+ Q_FOREACH(const QQuickChangeSet::Change &change, changeSet.changes()) {
1011+// qDebug() << "ListViewWithPageHeader::onModelUpdated Change" << change.index << change.count;
1012+ for (int i = change.index; i < change.count; ++i) {
1013+ ListItem *item = itemAtIndex(i);
1014+ if (item && item->m_sectionItem) {
1015+ QQmlContext *context = QQmlEngine::contextForObject(item->m_sectionItem)->parentContext();
1016+ const QString sectionText = m_delegateModel->stringValue(i, m_sectionProperty);
1017+ context->setContextProperty(QLatin1String("section"), sectionText);
1018+ }
1019+ }
1020+ }
1021+
1009 if (m_firstVisibleIndex != oldFirstVisibleIndex) {
1022 if (m_firstVisibleIndex != oldFirstVisibleIndex) {
1010 adjustMinYExtent();
1023 adjustMinYExtent();
1011 }
1024 }
plugins/ListViewWithPageHeader/listviewwithpageheader.h+1
@@ -63,6 +63,7 @@ class ListViewWithPageHeader : public QQuickFlickable, public QQuickItemChangeLi
63
63
64 friend class ListViewWithPageHeaderTest;
64 friend class ListViewWithPageHeaderTest;
65 friend class ListViewWithPageHeaderTestSection;
65 friend class ListViewWithPageHeaderTestSection;
66+ friend class ListViewWithPageHeaderTestExternalModel;
66
67
67public:
68public:
68 ListViewWithPageHeader();
69 ListViewWithPageHeader();
po/sl.po+29−24
@@ -8,7 +8,7 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2013-08-27 13:36-0400\n"
10"POT-Creation-Date: 2013-08-27 13:36-0400\n"
11−"PO-Revision-Date: 2013-07-02 12:59+0000\n"
11+"PO-Revision-Date: 2013-09-19 19:48+0000\n"
12"Last-Translator: Damir Jerovšek <Unknown>\n"
12"Last-Translator: Damir Jerovšek <Unknown>\n"
13"Language-Team: Slovenian <sl@li.org>\n"
13"Language-Team: Slovenian <sl@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
@@ -16,8 +16,8 @@ msgstr ""
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || "
17"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || "
18"n%100==4 ? 3 : 0);\n"
18"n%100==4 ? 3 : 0);\n"
19−"X-Launchpad-Export-Date: 2013-08-30 05:37+0000\n"
19+"X-Launchpad-Export-Date: 2013-09-20 06:21+0000\n"
20−"X-Generator: Launchpad (build 16750)\n"
20+"X-Generator: Launchpad (build 16765)\n"
21
21
22#: Applications/applications.js:23
22#: Applications/applications.js:23
23msgid "Phone"
23msgid "Phone"
@@ -25,7 +25,7 @@ msgstr "Telefon"
25
25
26#: Applications/applications.js:29
26#: Applications/applications.js:29
27msgid "Camera"
27msgid "Camera"
28−msgstr ""
28+msgstr "Fotoaparat"
29
29
30#: Applications/applications.js:35
30#: Applications/applications.js:35
31msgid "Gallery"
31msgid "Gallery"
@@ -89,47 +89,50 @@ msgstr "YouTube"
89
89
90#: Components/EdgeDemoOverlay.qml:145
90#: Components/EdgeDemoOverlay.qml:145
91msgid "Skip intro"
91msgid "Skip intro"
92−msgstr ""
92+msgstr "Preskoči uvod"
93
93
94#: Components/EdgeDemo.qml:98
94#: Components/EdgeDemo.qml:98
95msgid "Right edge"
95msgid "Right edge"
96−msgstr ""
96+msgstr "Desni rob"
97
97
98#: Components/EdgeDemo.qml:99
98#: Components/EdgeDemo.qml:99
99msgid "Try swiping from the right edge to unlock the phone"
99msgid "Try swiping from the right edge to unlock the phone"
100−msgstr ""
100+msgstr "Poskusite povleči od desnega roba za odklep telefona"
101
101
102#: Components/EdgeDemo.qml:135
102#: Components/EdgeDemo.qml:135
103msgid "Top edge"
103msgid "Top edge"
104−msgstr ""
104+msgstr "Zgornji rob"
105
105
106#: Components/EdgeDemo.qml:136
106#: Components/EdgeDemo.qml:136
107msgid "Try swiping from the top edge to access the indicators"
107msgid "Try swiping from the top edge to access the indicators"
108−msgstr ""
108+msgstr "Poskusite povleči od zgornjega roba za dostop do kazalnikov"
109
109
110#: Components/EdgeDemo.qml:161
110#: Components/EdgeDemo.qml:161
111msgid "Close"
111msgid "Close"
112−msgstr ""
112+msgstr "Zapri"
113
113
114#: Components/EdgeDemo.qml:162
114#: Components/EdgeDemo.qml:162
115msgid "Swipe up again to close the settings screen"
115msgid "Swipe up again to close the settings screen"
116−msgstr ""
116+msgstr "Povlecite ponovno navzgor za zaprtje zaslona z nastavitvami"
117
117
118#: Components/EdgeDemo.qml:189
118#: Components/EdgeDemo.qml:189
119msgid "Left edge"
119msgid "Left edge"
120−msgstr ""
120+msgstr "Levi rob"
121
121
122#: Components/EdgeDemo.qml:190
122#: Components/EdgeDemo.qml:190
123msgid "Swipe from the left to reveal the launcher for quick access to apps"
123msgid "Swipe from the left to reveal the launcher for quick access to apps"
124msgstr ""
124msgstr ""
125+"Poskusite povleči od leve za razkritje zaganjalnika za hiter dostop do "
126+"programov"
125
127
126#: Components/EdgeDemo.qml:217
128#: Components/EdgeDemo.qml:217
127msgid "Well done"
129msgid "Well done"
128−msgstr ""
130+msgstr "Odlično"
129
131
130#: Components/EdgeDemo.qml:218
132#: Components/EdgeDemo.qml:218
131msgid "You have now mastered the edge gestures and can start using the phone"
133msgid "You have now mastered the edge gestures and can start using the phone"
132msgstr ""
134msgstr ""
135+"Zdaj, ko ste osvojili kretnje z robovi, lahko začnete uporabljati telefon"
133
136
134#: Components/PageHeader.qml:298
137#: Components/PageHeader.qml:298
135msgid "Recent searches"
138msgid "Recent searches"
@@ -139,35 +142,37 @@ msgstr "Nedavna iskanja"
139#: Dash/Apps/AppInfo.qml:73
142#: Dash/Apps/AppInfo.qml:73
140#, qt-format
143#, qt-format
141msgid "(%1)"
144msgid "(%1)"
142−msgstr ""
145+msgstr "(%1)"
143
146
144#. TRANSLATORS: Number of persons who wrote reviews for this app
147#. TRANSLATORS: Number of persons who wrote reviews for this app
145#: Dash/Apps/AppInfo.qml:85
148#: Dash/Apps/AppInfo.qml:85
146#, qt-format
149#, qt-format
147msgid "%1 review"
150msgid "%1 review"
148msgid_plural "%1 reviews"
151msgid_plural "%1 reviews"
149−msgstr[0] ""
152+msgstr[0] "%1 ocen"
153+msgstr[1] "%1 ocena"
150−msgstr[1] ""
154+msgstr[2] "%1 oceni"
155+msgstr[3] "%1 ocene"
151
156
152#: Dash/Apps/AppPreview.qml:175
157#: Dash/Apps/AppPreview.qml:175
153msgid "Rate this"
158msgid "Rate this"
154−msgstr ""
159+msgstr "Ocenite"
155
160
156#: Dash/Apps/AppReviews.qml:72
161#: Dash/Apps/AppReviews.qml:72
157msgid "Add a review"
162msgid "Add a review"
158−msgstr ""
163+msgstr "Dodaj oceno"
159
164
160#: Dash/Apps/AppReviews.qml:84
165#: Dash/Apps/AppReviews.qml:84
161msgid "Review"
166msgid "Review"
162−msgstr ""
167+msgstr "Ocena"
163
168
164#: Dash/Apps/AppReviews.qml:118
169#: Dash/Apps/AppReviews.qml:118
165msgid "Send"
170msgid "Send"
166−msgstr ""
171+msgstr "Pošlji"
167
172
168#: Dash/Apps/AppReviews.qml:136
173#: Dash/Apps/AppReviews.qml:136
169msgid "Comments:"
174msgid "Comments:"
170−msgstr ""
175+msgstr "Opombe:"
171
176
172#: Dash/DashMusic.qml:27 Dash/DashVideos.qml:28
177#: Dash/DashMusic.qml:27 Dash/DashVideos.qml:28
173msgid "Featured"
178msgid "Featured"
@@ -211,7 +216,7 @@ msgstr ""
211
216
212#: Greeter/Lockscreen.qml:134
217#: Greeter/Lockscreen.qml:134
213msgid "Emergency Call"
218msgid "Emergency Call"
214−msgstr ""
219+msgstr "Klic v sili"
215
220
216#: Greeter/PassphraseLockscreen.qml:59
221#: Greeter/PassphraseLockscreen.qml:59
217#, qt-format
222#, qt-format
@@ -220,7 +225,7 @@ msgstr "Pozdravljeni, %1"
220
225
221#: Greeter/PassphraseLockscreen.qml:59
226#: Greeter/PassphraseLockscreen.qml:59
222msgid "Hello"
227msgid "Hello"
223−msgstr ""
228+msgstr "Pozdravljeni"
224
229
225#: Hud/HudParametrizedActionsPage.qml:132
230#: Hud/HudParametrizedActionsPage.qml:132
226msgid "Confirm"
231msgid "Confirm"
@@ -253,4 +258,4 @@ msgstr "Nič se ne ujema z vašim iskalnim nizom."
253#: Shell.qml:429
258#: Shell.qml:429
254#, qt-format
259#, qt-format
255msgid "Please enter %1"
260msgid "Please enter %1"
256−msgstr ""
261+msgstr "Vnesite %1"
tests/mocks/AccountsService/AccountsService.cpp+3−3
@@ -24,7 +24,7 @@ AccountsService::AccountsService(QObject* parent)
24{
24{
25}
25}
26
26
27−QString AccountsService::getUser()
27+QString AccountsService::user() const
28{
28{
29 return "testuser";
29 return "testuser";
30}
30}
@@ -34,7 +34,7 @@ void AccountsService::setUser(const QString &user)
34 Q_UNUSED(user)
34 Q_UNUSED(user)
35}
35}
36
36
37−bool AccountsService::getDemoEdges()
37+bool AccountsService::demoEdges() const
38{
38{
39 return false;
39 return false;
40}
40}
@@ -44,7 +44,7 @@ void AccountsService::setDemoEdges(bool demoEdges)
44 Q_UNUSED(demoEdges)
44 Q_UNUSED(demoEdges)
45}
45}
46
46
47−QString AccountsService::getBackgroundFile()
47+QString AccountsService::backgroundFile() const
48{
48{
49 return m_backgroundFile;
49 return m_backgroundFile;
50}
50}
tests/mocks/AccountsService/AccountsService.h+6−6
@@ -28,26 +28,26 @@ class AccountsService: public QObject
28{
28{
29 Q_OBJECT
29 Q_OBJECT
30 Q_PROPERTY (QString user
30 Q_PROPERTY (QString user
31− READ getUser
31+ READ user
32 WRITE setUser
32 WRITE setUser
33 NOTIFY userChanged)
33 NOTIFY userChanged)
34 Q_PROPERTY (bool demoEdges
34 Q_PROPERTY (bool demoEdges
35− READ getDemoEdges
35+ READ demoEdges
36 WRITE setDemoEdges
36 WRITE setDemoEdges
37 NOTIFY demoEdgesChanged)
37 NOTIFY demoEdgesChanged)
38 Q_PROPERTY (QString backgroundFile
38 Q_PROPERTY (QString backgroundFile
39− READ getBackgroundFile
39+ READ backgroundFile
40 WRITE setBackgroundFile // only available in mock
40 WRITE setBackgroundFile // only available in mock
41 NOTIFY backgroundFileChanged)
41 NOTIFY backgroundFileChanged)
42
42
43public:
43public:
44 explicit AccountsService(QObject *parent = 0);
44 explicit AccountsService(QObject *parent = 0);
45
45
46− QString getUser();
46+ QString user() const;
47 void setUser(const QString &user);
47 void setUser(const QString &user);
48− bool getDemoEdges();
48+ bool demoEdges() const;
49 void setDemoEdges(bool demoEdges);
49 void setDemoEdges(bool demoEdges);
50− QString getBackgroundFile();
50+ QString backgroundFile() const;
51 void setBackgroundFile(const QString &backgroundFile);
51 void setBackgroundFile(const QString &backgroundFile);
52
52
53Q_SIGNALS:
53Q_SIGNALS:
tests/plugins/AccountsService/client.cpp+2−2
@@ -50,9 +50,9 @@ private Q_SLOTS:
50 AccountsService session;
50 AccountsService session;
51 session.setUser("testuser");
51 session.setUser("testuser");
52 session.setDemoEdges(true);
52 session.setDemoEdges(true);
53− QCOMPARE(session.getDemoEdges(), true);
53+ QCOMPARE(session.demoEdges(), true);
54 session.setDemoEdges(false);
54 session.setDemoEdges(false);
55− QCOMPARE(session.getDemoEdges(), false);
55+ QCOMPARE(session.demoEdges(), false);
56 }
56 }
57};
57};
58
58
tests/plugins/ListViewWithPageHeader/CMakeLists.txt+6
@@ -32,5 +32,11 @@ qt5_use_modules(listviewwithpageheadertestsectionExec Test Core Qml)
32target_link_libraries(listviewwithpageheadertestsectionExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
32target_link_libraries(listviewwithpageheadertestsectionExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
33add_custom_target(testlistviewwithpageheadersection ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestsectionExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheadersection.xml,xunitxml -o -,txt)
33add_custom_target(testlistviewwithpageheadersection ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestsectionExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheadersection.xml,xunitxml -o -,txt)
34
34
35+add_executable(listviewwithpageheadertestsectionexternalmodelExec listviewwithpageheadertestsectionexternalmodel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/ListViewWithPageHeader/listviewwithpageheader.cpp)
36+qt5_use_modules(listviewwithpageheadertestsectionexternalmodelExec Test Core Qml)
37+target_link_libraries(listviewwithpageheadertestsectionexternalmodelExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
38+add_custom_target(testlistviewwithpageheadersectionexternalmodel ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestsectionexternalmodelExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheadersectionexternalmodel.xml,xunitxml -o -,txt)
39+
35add_dependencies(qmluitests testlistviewwithpageheader)
40add_dependencies(qmluitests testlistviewwithpageheader)
36add_dependencies(qmluitests testlistviewwithpageheadersection)
41add_dependencies(qmluitests testlistviewwithpageheadersection)
42+add_dependencies(qmluitests testlistviewwithpageheadersectionexternalmodel)
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsectionexternalmodel.cppnew file+251
@@ -0,0 +1,251 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "listviewwithpageheader.h"
18+
19+#include <QAbstractItemModel>
20+#include <QQmlEngine>
21+#include <QQuickView>
22+#include <QSignalSpy>
23+#include <QSortFilterProxyModel>
24+#include <QtTestGui>
25+#pragma GCC diagnostic push
26+#pragma GCC diagnostic ignored "-pedantic"
27+#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
28+#include <private/qquicklistmodel_p.h>
29+#else
30+#include <private/qqmllistmodel_p.h>
31+#endif
32+#include <private/qquickanimation_p.h>
33+#include <private/qquickitem_p.h>
34+#pragma GCC diagnostic pop
35+
36+class StringListModel : public QAbstractListModel
37+{
38+public:
39+ StringListModel()
40+ {
41+ list << "A" << "B" << "C" << "D" << "E" << "F" << "G" << "H";
42+ }
43+
44+ int rowCount(const QModelIndex &parent) const
45+ {
46+ if (parent.isValid())
47+ return 0;
48+ else
49+ return list.count();
50+ }
51+
52+ QVariant data(const QModelIndex &index, int role) const
53+ {
54+ if (role == Qt::SizeHintRole) return 50;
55+ else if (role == Qt::DisplayRole) return list[index.row()];
56+ return QVariant();
57+ }
58+
59+ QHash<int, QByteArray> roleNames() const
60+ {
61+ QHash<int, QByteArray> hash;
62+ hash.insert(Qt::DisplayRole, "type");
63+ hash.insert(Qt::SizeHintRole, "size");
64+ return hash;
65+ }
66+
67+ void moveLastToFirst()
68+ {
69+ const int last = list.count() - 1;
70+ beginMoveRows(QModelIndex(), last, last, QModelIndex(), 0);
71+ list.move(last, 0);
72+ endMoveRows();
73+ }
74+
75+ QStringList list;
76+};
77+
78+class ListViewWithPageHeaderTestSection : public QObject
79+{
80+ Q_OBJECT
81+
82+private:
83+ void verifyItem(int visibleIndex, qreal pos, qreal height, bool culled, const QString &sectionHeader, bool sectionHeaderCulled)
84+ {
85+ QTRY_VERIFY(visibleIndex < lvwph->m_visibleItems.count());
86+ QTRY_COMPARE(lvwph->m_visibleItems[visibleIndex]->y(), pos);
87+ QTRY_COMPARE(lvwph->m_visibleItems[visibleIndex]->height(), height);
88+ QCOMPARE(QQuickItemPrivate::get(lvwph->m_visibleItems[visibleIndex]->m_item)->culled, culled);
89+ QCOMPARE(section(lvwph->m_visibleItems[visibleIndex]->m_sectionItem), sectionHeader);
90+ if (!sectionHeader.isNull()) {
91+ QCOMPARE(QQuickItemPrivate::get(lvwph->m_visibleItems[visibleIndex]->m_sectionItem)->culled, sectionHeaderCulled);
92+ QCOMPARE(sectionDelegateIndex(lvwph->m_visibleItems[visibleIndex]->m_sectionItem), lvwph->m_firstVisibleIndex + visibleIndex);
93+ }
94+ }
95+
96+ void changeContentY(qreal change)
97+ {
98+ const qreal dest = lvwph->contentY() + change;
99+ if (dest > lvwph->contentY()) {
100+ const qreal jump = 25;
101+ while (lvwph->contentY() + jump < dest) {
102+ lvwph->setContentY(lvwph->contentY() + jump);
103+ QTest::qWait(1);
104+ }
105+ } else {
106+ const qreal jump = -25;
107+ while (lvwph->contentY() + jump > dest) {
108+ lvwph->setContentY(lvwph->contentY() + jump);
109+ QTest::qWait(1);
110+ }
111+ }
112+ lvwph->setContentY(dest);
113+ QTest::qWait(1);
114+ }
115+
116+ void scrollToTop()
117+ {
118+ const qreal jump = -25;
119+ while (!lvwph->isAtYBeginning()) {
120+ if (lvwph->contentY() + jump > -lvwph->minYExtent()) {
121+ lvwph->setContentY(lvwph->contentY() + jump);
122+ } else {
123+ lvwph->setContentY(lvwph->contentY() - 1);
124+ }
125+ QTest::qWait(1);
126+ }
127+ }
128+
129+ void scrollToBottom()
130+ {
131+ const qreal jump = 25;
132+ while (!lvwph->isAtYEnd()) {
133+ if (lvwph->contentY() + lvwph->height() + jump < lvwph->contentHeight()) {
134+ lvwph->setContentY(lvwph->contentY() + jump);
135+ } else {
136+ lvwph->setContentY(lvwph->contentY() + 1);
137+ }
138+ QTest::qWait(1);
139+ }
140+ }
141+
142+ void verifyInitialTopPosition()
143+ {
144+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 0);
145+ QCOMPARE(lvwph->m_firstVisibleIndex, -1);
146+ QCOMPARE(lvwph->m_minYExtent, 0.);
147+ QCOMPARE(lvwph->m_clipItem->y(), 0.);
148+ QCOMPARE(lvwph->m_clipItem->clip(), false);
149+ QCOMPARE(lvwph->m_headerItem->y(), 0.);
150+ QCOMPARE(lvwph->m_headerItem->height(), 50.);
151+ QCOMPARE(lvwph->contentY(), 0.);
152+ QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
153+ QVERIFY(QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
154+ }
155+
156+ QString section(QQuickItem *item)
157+ {
158+ return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("section")).toString() : QString();
159+ }
160+
161+ int sectionDelegateIndex(QQuickItem *item)
162+ {
163+ return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("delegateIndex")).toInt() : -1;
164+ }
165+
166+private Q_SLOTS:
167+
168+ void initTestCase()
169+ {
170+ }
171+
172+ void init()
173+ {
174+ view = new QQuickView();
175+ view->engine()->addImportPath(BUILT_PLUGINS_DIR);
176+ view->setSource(QUrl::fromLocalFile(LISTVIEWWITHPAGEHEADER_FOLDER "/test_sectionexternalmodel.qml"));
177+ lvwph = dynamic_cast<ListViewWithPageHeader*>(view->rootObject()->findChild<QQuickFlickable*>());
178+ QVERIFY(lvwph);
179+ view->show();
180+ QTest::qWaitForWindowExposed(view);
181+
182+ verifyInitialTopPosition();
183+ }
184+
185+ void cleanup()
186+ {
187+ delete view;
188+ }
189+
190+ void testCreationDeletion()
191+ {
192+ // Nothing, init/cleanup already tests this
193+ }
194+
195+ void testMoveWithProxy()
196+ {
197+ StringListModel m;
198+ QSortFilterProxyModel proxy;
199+ proxy.setSourceModel(&m);
200+
201+ lvwph->setModel(&proxy);
202+
203+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 8);
204+ QCOMPARE(lvwph->m_firstVisibleIndex, 0);
205+ verifyItem(0, 50., 90., false, "A", false);
206+ verifyItem(1, 140., 90., false, "B", false);
207+ verifyItem(2, 230., 90., false, "C", false);
208+ verifyItem(3, 320., 90., false, "D", false);
209+ verifyItem(4, 410., 90., false, "E", false);
210+ verifyItem(5, 500., 90., false, "F", false);
211+ verifyItem(6, 590., 90., true, "G", true);
212+ verifyItem(7, 680., 90., true, "H", true);
213+ QCOMPARE(lvwph->m_minYExtent, 0.);
214+ QCOMPARE(lvwph->m_clipItem->y(), 0.);
215+ QCOMPARE(lvwph->m_clipItem->clip(), false);
216+ QCOMPARE(lvwph->m_headerItem->y(), 0.);
217+ QCOMPARE(lvwph->m_headerItem->height(), 50.);
218+ QCOMPARE(lvwph->contentY(), 0.);
219+ QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
220+ QVERIFY(QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
221+
222+ m.moveLastToFirst();
223+
224+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 8);
225+ QCOMPARE(lvwph->m_firstVisibleIndex, 0);
226+ verifyItem(0, 50., 90., false, "H", false);
227+ verifyItem(1, 140., 90., false, "A", false);
228+ verifyItem(2, 230., 90., false, "B", false);
229+ verifyItem(3, 320., 90., false, "C", false);
230+ verifyItem(4, 410., 90., false, "D", false);
231+ verifyItem(5, 500., 90., false, "E", false);
232+ verifyItem(6, 590., 90., true, "F", true);
233+ verifyItem(7, 680., 90., true, "G", true);
234+ QCOMPARE(lvwph->m_minYExtent, 0.);
235+ QCOMPARE(lvwph->m_clipItem->y(), 0.);
236+ QCOMPARE(lvwph->m_clipItem->clip(), false);
237+ QCOMPARE(lvwph->m_headerItem->y(), 0.);
238+ QCOMPARE(lvwph->m_headerItem->height(), 50.);
239+ QCOMPARE(lvwph->contentY(), 0.);
240+ QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
241+ QVERIFY(QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
242+ }
243+
244+private:
245+ QQuickView *view;
246+ ListViewWithPageHeader *lvwph;
247+};
248+
249+QTEST_MAIN(ListViewWithPageHeaderTestSection)
250+
251+#include "listviewwithpageheadertestsectionexternalmodel.moc"
tests/plugins/ListViewWithPageHeader/test_sectionexternalmodel.qmlnew file+74
@@ -0,0 +1,74 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import ListViewWithPageHeader 0.1
19+
20+Rectangle {
21+ width: 300
22+ height: 542
23+ color: "lightblue"
24+
25+ ListViewWithPageHeader {
26+ id: listView
27+ width: parent.width
28+ anchors.top: parent.top
29+ anchors.bottom: parent.bottom
30+ model: model
31+ delegate: Rectangle {
32+ property bool timerDone: false
33+ width: parent.width - 20
34+ x: 10
35+ color: index % 2 == 0 ? "red" : "blue"
36+ height: timerDone ? size : 350
37+ Text {
38+ text: index
39+ }
40+ Timer {
41+ id: sizeTimer
42+ interval: 10;
43+ onTriggered: {
44+ timerDone = true
45+ }
46+ }
47+ Component.onCompleted: {
48+ sizeTimer.start()
49+ }
50+ }
51+
52+ pageHeader: Rectangle {
53+ color: "transparent"
54+ width: parent.width
55+ height: 50
56+ implicitHeight: 50
57+ Text {
58+ anchors.fill: parent
59+ text: "APPS"
60+ font.pixelSize: 40
61+ }
62+ }
63+
64+ sectionProperty: "type"
65+ sectionDelegate: Component {
66+ Rectangle {
67+ color: "green"
68+ height: 40
69+ Text { text: section; font.pixelSize: 34 }
70+ anchors { left: parent.left; right: parent.right }
71+ }
72+ }
73+ }
74+}