on xenial help sign in
More lens -> scope renaming.
baac7edPawel Stolowski
Dash/Dash.qml+2−2
@@ -49,7 +49,7 @@ Showable {
49 SortFilterProxyModel {
49 SortFilterProxyModel {
50 id: filteredLenses
50 id: filteredLenses
51 model: Scopes {
51 model: Scopes {
52− id: lenses
52+ id: scopes
53 }
53 }
54 dynamicSortFilter: true
54 dynamicSortFilter: true
55
55
@@ -61,7 +61,7 @@ Showable {
61 id: dashContent
61 id: dashContent
62 anchors.fill: parent
62 anchors.fill: parent
63 model: filteredLenses
63 model: filteredLenses
64− lenses: lenses
64+ scopes: scopes
65 onMovementStarted: dashbar.startNavigation()
65 onMovementStarted: dashbar.startNavigation()
66 onMovementEnded: dashbar.stopNavigation()
66 onMovementEnded: dashbar.stopNavigation()
67 onContentFlickStarted: dashbar.finishNavigation()
67 onContentFlickStarted: dashbar.finishNavigation()
Dash/DashApps.qml+1−1
@@ -86,7 +86,7 @@ LensView {
86 dynamicSortFilter: true
86 dynamicSortFilter: true
87 filterRole: 2 // this is the category id for each result
87 filterRole: 2 // this is the category id for each result
88 filterRegExp: /^3$/ // only proxy items that are category 3 - Installed
88 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
90 }
90 }
91
91
92 property var categoryModels: {
92 property var categoryModels: {
Dash/DashContent.qml+10−12
@@ -24,7 +24,7 @@ Item {
24 height: units.gu(71)
24 height: units.gu(71)
25
25
26 property var model: null
26 property var model: null
27− property var lenses: null
27+ property var scopes: null
28 property real contentProgress: Math.max(0, Math.min(dashContentList.contentX / (dashContentList.contentWidth - dashContentList.width), units.dp(1)))
28 property real contentProgress: Math.max(0, Math.min(dashContentList.contentX / (dashContentList.contentWidth - dashContentList.width), units.dp(1)))
29 property alias currentIndex: dashContentList.currentIndex
29 property alias currentIndex: dashContentList.currentIndex
30
30
@@ -36,13 +36,13 @@ Item {
36 signal lensLoaded(string lensId)
36 signal lensLoaded(string lensId)
37 signal positionedAtBeginning()
37 signal positionedAtBeginning()
38
38
39− // If we set the current lens index before the lenses have been added,
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 lenses
40+ // then we need to wait until the loaded signals gets emitted from the scopes
41 property var set_current_index: undefined
41 property var set_current_index: undefined
42 Connections {
42 Connections {
43− target: lenses
43+ target: scopes
44 onLoadedChanged: {
44 onLoadedChanged: {
45− if (lenses.loaded && set_current_index != undefined) {
45+ if (scopes.loaded && set_current_index != undefined) {
46 setCurrentLensAtIndex(set_current_index[0], set_current_index[1], set_current_index[2]);
46 setCurrentLensAtIndex(set_current_index[0], set_current_index[1], set_current_index[2]);
47 set_current_index = undefined;
47 set_current_index = undefined;
48 }
48 }
@@ -57,8 +57,8 @@ Item {
57 dashContentList.highlightMoveDuration = 0
57 dashContentList.highlightMoveDuration = 0
58 }
58 }
59
59
60− // if the lenses haven't loaded yet, then wait until they are.
60+ // if the scopes haven't loaded yet, then wait until they are.
61− if (!lenses.loaded) {
61+ if (!scopes.loaded) {
62 set_current_index = [ index, animate, reset ]
62 set_current_index = [ index, animate, reset ]
63 return;
63 return;
64 }
64 }
@@ -79,12 +79,10 @@ Item {
79 }
79 }
80 }
80 }
81
81
82− /* FIXME: applications.lens and home.lens are effectively disabled for now */
83 property var lensDelegateMapping: {"mockmusic.scope": "DashMusic.qml",
82 property var lensDelegateMapping: {"mockmusic.scope": "DashMusic.qml",
84− "applications.lens": "DashApps.qml",
83+ "applications.scope": "DashApps.qml",
85− "home.lens": "DashHome.qml",
84+ "home.scope": "DashHome.qml",
86 "mockvideos.scope": "DashVideos.qml",
85 "mockvideos.scope": "DashVideos.qml",
87− "people.lens": "DashPeople.qml",
88 }
86 }
89 property string genericLens: "GenericLensView.qml"
87 property string genericLens: "GenericLensView.qml"
90
88
@@ -92,7 +90,7 @@ Item {
92 id: dashContentList
90 id: dashContentList
93 objectName: "dashContentList"
91 objectName: "dashContentList"
94
92
95− interactive: dashContent.lenses.loaded
93+ interactive: dashContent.scopes.loaded
96
94
97 anchors.fill: parent
95 anchors.fill: parent
98 model: dashContent.model
96 model: dashContent.model
Dash/DashHome.qml+10−27
@@ -34,20 +34,12 @@ LensView {
34 id: categoryListModel
34 id: categoryListModel
35 // specifies page's content categories, type of delegate and model used in each category
35 // specifies page's content categories, type of delegate and model used in each category
36 ListElement { category: "Frequent Apps"; component: "AppsGrid"; modelName: "AppsModel" }
36 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" }
39 ListElement { category: "Recent Music"; component: "MusicGrid"; modelName: "MusicModel" }
37 ListElement { category: "Recent Music"; component: "MusicGrid"; modelName: "MusicModel" }
40 ListElement { category: "Videos Popular Online"; component: "VideosGrid"; modelName: "VideosModel" }
38 ListElement { category: "Videos Popular Online"; component: "VideosGrid"; modelName: "VideosModel" }
41 function getCategory(category1) {
39 function getCategory(category1) {
42 if (category1 === "Frequent Apps") {
40 if (category1 === "Frequent Apps") {
43 return i18n.tr("Frequent Apps");
41 return i18n.tr("Frequent Apps");
44 }
42 }
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− }
51 if (category1 === "Recent Music") {
43 if (category1 === "Recent Music") {
52 return i18n.tr("Recent Music");
44 return i18n.tr("Recent Music");
53 }
45 }
@@ -90,33 +82,24 @@ LensView {
90 }
82 }
91
83
92 Component.onCompleted: {
84 Component.onCompleted: {
93− var lens = dashContent.lenses.get("people.lens")
85+ var scope = dashContent.scopes.get("mockmusic.scope")
94− if (lens) {
86+ if (scope) {
95− favouritesFilter.model = dashContent.lenses.get("people.lens").results
87+ musicFilter.model = dashContent.scopes.get("mockmusic.scope").results
96− recentFilter.model = dashContent.lenses.get("people.lens").results
97 }
88 }
98− lens = dashContent.lenses.get("mockmusic.lens")
89+ scope = dashContent.scopes.get("mockvideos.scope")
99− if (lens) {
90+ if (scope) {
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
91+ videosFilter.model = dashContent.scopes.get("mockvideos.scope").results
105 }
92 }
106 }
93 }
107
94
108 Connections {
95 Connections {
109 target: dashContent
96 target: dashContent
110 onLensLoaded: switch (lensId) {
97 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":
98+ case "mockmusic.scope":
116− musicFilter.model = dashContent.lenses.get("mockmusic.lens").results
99+ musicFilter.model = dashContent.scopes.get("mockmusic.scope").results
117 break;
100 break;
118− case "mockvideos.lens":
101+ case "mockvideos.scope":
119− videosFilter.model = dashContent.lenses.get("mockvideos.lens").results
102+ videosFilter.model = dashContent.scopes.get("mockvideos.scope").results
120 break;
103 break;
121 }
104 }
122 }
105 }
plugins/Unity/scopes.cpp+6
@@ -109,6 +109,11 @@ void Scopes::onScopeAdded(const unity::dash::Scope::Ptr& scope, int position)
109 Q_EMIT loadedChanged(m_loaded);
109 Q_EMIT loadedChanged(m_loaded);
110}
110}
111
111
112+void Scopes::onScopesLoaded()
113+{
114+ qWarning() << "Scopes Loaded!!!";
115+}
116+
112void Scopes::onScopeRemoved(const unity::dash::Scope::Ptr& scope)
117void Scopes::onScopeRemoved(const unity::dash::Scope::Ptr& scope)
113{
118{
114 //TODO
119 //TODO
@@ -127,6 +132,7 @@ void Scopes::onScopePropertyChanged()
127
132
128void Scopes::addUnityScope(const unity::dash::Scope::Ptr& unity_scope)
133void Scopes::addUnityScope(const unity::dash::Scope::Ptr& unity_scope)
129{
134{
135+ qDebug() << "Scope added:" << QString::fromStdString(unity_scope->id);
130 Scope* scope = new Scope(this);
136 Scope* scope = new Scope(this);
131 scope->setUnityScope(unity_scope);
137 scope->setUnityScope(unity_scope);
132 /* DOCME */
138 /* DOCME */
plugins/Unity/scopes.h+1
@@ -72,6 +72,7 @@ Q_SIGNALS:
72 void loadedChanged(bool loaded);
72 void loadedChanged(bool loaded);
73
73
74private Q_SLOTS:
74private Q_SLOTS:
75+ void onScopesLoaded();
75 void onScopeAdded(const unity::dash::Scope::Ptr& scope, int position);
76 void onScopeAdded(const unity::dash::Scope::Ptr& scope, int position);
76 void onScopeRemoved(const unity::dash::Scope::Ptr& scope);
77 void onScopeRemoved(const unity::dash::Scope::Ptr& scope);
77 void onScopesReordered(const unity::dash::Scopes::ScopeList& scopes);
78 void onScopesReordered(const unity::dash::Scopes::ScopeList& scopes);
tests/qmltests/Dash/tst_DashContent.qml+1−1
@@ -45,7 +45,7 @@ Item {
45 anchors.fill: parent
45 anchors.fill: parent
46
46
47 model: lensesModel
47 model: lensesModel
48− lenses : lensesModel
48+ scopes : lensesModel
49
49
50 lensDelegateMapping: { "MockLens3" : "../tests/qmltests/Dash/qml/fake_lensView3.qml",
50 lensDelegateMapping: { "MockLens3" : "../tests/qmltests/Dash/qml/fake_lensView3.qml",
51 "MockLens2" : "../tests/qmltests/Dash/qml/fake_lensView2.qml",
51 "MockLens2" : "../tests/qmltests/Dash/qml/fake_lensView2.qml",
tests/qmltests/Dash/tst_GenericLensView.qml+3−3
@@ -27,7 +27,7 @@ Item {
27 height: units.gu(80)
27 height: units.gu(80)
28
28
29 Lenses {
29 Lenses {
30− id: lenses
30+ id: scopes
31 }
31 }
32
32
33 GenericLensView {
33 GenericLensView {
@@ -36,10 +36,10 @@ Item {
36
36
37 UT.UnityTestCase {
37 UT.UnityTestCase {
38 name: "GenericLensView"
38 name: "GenericLensView"
39− when: lenses.loaded
39+ when: scopes.loaded
40
40
41 function init() {
41 function init() {
42− genericLensView.lens = lenses.get(0)
42+ genericLensView.lens = scopes.get(0)
43 }
43 }
44
44
45 function test_isCurrent() {
45 function test_isCurrent() {
tests/qmltests/Dash/tst_LensView.qml+2−2
@@ -26,7 +26,7 @@ Item {
26 height: units.gu(80)
26 height: units.gu(80)
27
27
28 Lenses {
28 Lenses {
29− id: lenses
29+ id: scopes
30 }
30 }
31
31
32 LensView {
32 LensView {
@@ -35,7 +35,7 @@ Item {
35
35
36 TestCase {
36 TestCase {
37 name: "LensView"
37 name: "LensView"
38− when: lenses.loaded
38+ when: scopes.loaded
39
39
40 function init() {
40 function init() {
41 lensView.lens = lenses.get(0)
41 lensView.lens = lenses.get(0)