on xenial help sign in
More lens -> scope renaming.
commitbaac7ed5e3aa93c869962bd7660ca538a5ddf637 authorPawel Stolowski <pawel.stolowski@canonical.com> dateTue 11 Jun 2013, 14:05 (13 years ago) parent509bd33
9 files changed+36−48
Dash/Dash.qml+2−2 Dash/DashApps.qml+1−1 Dash/DashContent.qml+10−12 Dash/DashHome.qml+10−27 plugins/Unity/scopes.cpp+6 plugins/Unity/scopes.h+1 tests/qmltests/Dash/tst_DashContent.qml+1−1 tests/qmltests/Dash/tst_GenericLensView.qml+3−3 tests/qmltests/Dash/tst_LensView.qml+2−2
Dash/Dash.qml+2−2
@@ -49,7 +49,7 @@ Showable {
4949 SortFilterProxyModel {
5050 id: filteredLenses
5151 model: Scopes {
52− id: lenses
52+ id: scopes
5353 }
5454 dynamicSortFilter: true
5555
@@ -61,7 +61,7 @@ Showable {
6161 id: dashContent
6262 anchors.fill: parent
6363 model: filteredLenses
64− lenses: lenses
64+ scopes: scopes
6565 onMovementStarted: dashbar.startNavigation()
6666 onMovementEnded: dashbar.stopNavigation()
6767 onContentFlickStarted: dashbar.finishNavigation()
Dash/DashApps.qml+1−1
@@ -86,7 +86,7 @@ LensView {
8686 dynamicSortFilter: true
8787 filterRole: 2 // this is the category id for each result
8888 filterRegExp: /^3$/ // only proxy items that are category 3 - Installed
89− model: dashContent.lenses.get("applications.lens").results
89+ model: dashContent.scopes.get("applications.scope").results
9090 }
9191
9292 property var categoryModels: {
Dash/DashContent.qml+10−12
@@ -24,7 +24,7 @@ Item {
2424 height: units.gu(71)
2525
2626 property var model: null
27− property var lenses: null
27+ property var scopes: null
2828 property real contentProgress: Math.max(0, Math.min(dashContentList.contentX / (dashContentList.contentWidth - dashContentList.width), units.dp(1)))
2929 property alias currentIndex: dashContentList.currentIndex
3030
@@ -36,13 +36,13 @@ Item {
3636 signal lensLoaded(string lensId)
3737 signal positionedAtBeginning()
3838
39− // If we set the current lens index before the lenses have been added,
40− // then we need to wait until the loaded signals gets emitted from the lenses
39+ // If we set the current lens index before the scopes have been added,
40+ // then we need to wait until the loaded signals gets emitted from the scopes
4141 property var set_current_index: undefined
4242 Connections {
43− target: lenses
43+ target: scopes
4444 onLoadedChanged: {
45− if (lenses.loaded && set_current_index != undefined) {
45+ if (scopes.loaded && set_current_index != undefined) {
4646 setCurrentLensAtIndex(set_current_index[0], set_current_index[1], set_current_index[2]);
4747 set_current_index = undefined;
4848 }
@@ -57,8 +57,8 @@ Item {
5757 dashContentList.highlightMoveDuration = 0
5858 }
5959
60− // if the lenses haven't loaded yet, then wait until they are.
61− if (!lenses.loaded) {
60+ // if the scopes haven't loaded yet, then wait until they are.
61+ if (!scopes.loaded) {
6262 set_current_index = [ index, animate, reset ]
6363 return;
6464 }
@@ -79,12 +79,10 @@ Item {
7979 }
8080 }
8181
82− /* FIXME: applications.lens and home.lens are effectively disabled for now */
8382 property var lensDelegateMapping: {"mockmusic.scope": "DashMusic.qml",
84− "applications.lens": "DashApps.qml",
85− "home.lens": "DashHome.qml",
83+ "applications.scope": "DashApps.qml",
84+ "home.scope": "DashHome.qml",
8685 "mockvideos.scope": "DashVideos.qml",
87− "people.lens": "DashPeople.qml",
8886 }
8987 property string genericLens: "GenericLensView.qml"
9088
@@ -92,7 +90,7 @@ Item {
9290 id: dashContentList
9391 objectName: "dashContentList"
9492
95− interactive: dashContent.lenses.loaded
93+ interactive: dashContent.scopes.loaded
9694
9795 anchors.fill: parent
9896 model: dashContent.model
Dash/DashHome.qml+10−27
@@ -34,20 +34,12 @@ LensView {
3434 id: categoryListModel
3535 // specifies page's content categories, type of delegate and model used in each category
3636 ListElement { category: "Frequent Apps"; component: "AppsGrid"; modelName: "AppsModel" }
37− ListElement { category: "Favourite People"; component: "PeopleCarousel"; modelName: "FavouriteModel" }
38− ListElement { category: "People Recently in Touch"; component: "PeopleGrid"; modelName: "RecentModel" }
3937 ListElement { category: "Recent Music"; component: "MusicGrid"; modelName: "MusicModel" }
4038 ListElement { category: "Videos Popular Online"; component: "VideosGrid"; modelName: "VideosModel" }
4139 function getCategory(category1) {
4240 if (category1 === "Frequent Apps") {
4341 return i18n.tr("Frequent Apps");
4442 }
45− if (category1 === "Favourite People") {
46− return i18n.tr("Favourite People");
47− }
48− if (category1 === "People Recently in Touch") {
49− return i18n.tr("People Recently in Touch");
50− }
5143 if (category1 === "Recent Music") {
5244 return i18n.tr("Recent Music");
5345 }
@@ -90,33 +82,24 @@ LensView {
9082 }
9183
9284 Component.onCompleted: {
93− var lens = dashContent.lenses.get("people.lens")
94− if (lens) {
95− favouritesFilter.model = dashContent.lenses.get("people.lens").results
96− recentFilter.model = dashContent.lenses.get("people.lens").results
85+ var scope = dashContent.scopes.get("mockmusic.scope")
86+ if (scope) {
87+ musicFilter.model = dashContent.scopes.get("mockmusic.scope").results
9788 }
98− lens = dashContent.lenses.get("mockmusic.lens")
99− if (lens) {
100− musicFilter.model = dashContent.lenses.get("mockmusic.lens").results
101− }
102− lens = dashContent.lenses.get("mockvideos.lens")
103− if (lens) {
104− videosFilter.model = dashContent.lenses.get("mockvideos.lens").results
89+ scope = dashContent.scopes.get("mockvideos.scope")
90+ if (scope) {
91+ videosFilter.model = dashContent.scopes.get("mockvideos.scope").results
10592 }
10693 }
10794
10895 Connections {
10996 target: dashContent
11097 onLensLoaded: switch (lensId) {
111− case "people.lens":
112− favouritesFilter.model = dashContent.lenses.get("people.lens").results
113− recentFilter.model = dashContent.lenses.get("people.lens").results
114− break;
115− case "mockmusic.lens":
116− musicFilter.model = dashContent.lenses.get("mockmusic.lens").results
98+ case "mockmusic.scope":
99+ musicFilter.model = dashContent.scopes.get("mockmusic.scope").results
117100 break;
118− case "mockvideos.lens":
119− videosFilter.model = dashContent.lenses.get("mockvideos.lens").results
101+ case "mockvideos.scope":
102+ videosFilter.model = dashContent.scopes.get("mockvideos.scope").results
120103 break;
121104 }
122105 }
plugins/Unity/scopes.cpp+6
@@ -109,6 +109,11 @@ void Scopes::onScopeAdded(const unity::dash::Scope::Ptr& scope, int position)
109109 Q_EMIT loadedChanged(m_loaded);
110110}
111111
112+void Scopes::onScopesLoaded()
113+{
114+ qWarning() << "Scopes Loaded!!!";
115+}
116+
112117void Scopes::onScopeRemoved(const unity::dash::Scope::Ptr& scope)
113118{
114119 //TODO
@@ -127,6 +132,7 @@ void Scopes::onScopePropertyChanged()
127132
128133void Scopes::addUnityScope(const unity::dash::Scope::Ptr& unity_scope)
129134{
135+ qDebug() << "Scope added:" << QString::fromStdString(unity_scope->id);
130136 Scope* scope = new Scope(this);
131137 scope->setUnityScope(unity_scope);
132138 /* DOCME */
plugins/Unity/scopes.h+1
@@ -72,6 +72,7 @@ Q_SIGNALS:
7272 void loadedChanged(bool loaded);
7373
7474private Q_SLOTS:
75+ void onScopesLoaded();
7576 void onScopeAdded(const unity::dash::Scope::Ptr& scope, int position);
7677 void onScopeRemoved(const unity::dash::Scope::Ptr& scope);
7778 void onScopesReordered(const unity::dash::Scopes::ScopeList& scopes);
tests/qmltests/Dash/tst_DashContent.qml+1−1
@@ -45,7 +45,7 @@ Item {
4545 anchors.fill: parent
4646
4747 model: lensesModel
48− lenses : lensesModel
48+ scopes : lensesModel
4949
5050 lensDelegateMapping: { "MockLens3" : "../tests/qmltests/Dash/qml/fake_lensView3.qml",
5151 "MockLens2" : "../tests/qmltests/Dash/qml/fake_lensView2.qml",
tests/qmltests/Dash/tst_GenericLensView.qml+3−3
@@ -27,7 +27,7 @@ Item {
2727 height: units.gu(80)
2828
2929 Lenses {
30− id: lenses
30+ id: scopes
3131 }
3232
3333 GenericLensView {
@@ -36,10 +36,10 @@ Item {
3636
3737 UT.UnityTestCase {
3838 name: "GenericLensView"
39− when: lenses.loaded
39+ when: scopes.loaded
4040
4141 function init() {
42− genericLensView.lens = lenses.get(0)
42+ genericLensView.lens = scopes.get(0)
4343 }
4444
4545 function test_isCurrent() {
tests/qmltests/Dash/tst_LensView.qml+2−2
@@ -26,7 +26,7 @@ Item {
2626 height: units.gu(80)
2727
2828 Lenses {
29− id: lenses
29+ id: scopes
3030 }
3131
3232 LensView {
@@ -35,7 +35,7 @@ Item {
3535
3636 TestCase {
3737 name: "LensView"
38− when: lenses.loaded
38+ when: scopes.loaded
3939
4040 function init() {
4141 lensView.lens = lenses.get(0)