on xenial help sign in
More renaming.
commite12ee10e011f3fba62056a2fb82713aa80defdc4 authorPawel Stolowski <pawel.stolowski@canonical.com> dateWed 12 Jun 2013, 14:52 (13 years ago) parentd83cab9
15 files changed+73−73
Dash/Dash.qml+16−16 Dash/DashApps.qml+4−4 Dash/DashBar.qml+3−3 Dash/DashContent.qml+14−14 Dash/DashHome.qml+3−3 Dash/DashMusic.qml+6−6 Dash/DashPeople.qml+6−6 Dash/DashVideos.qml+6−6 Dash/GenericLensView.qml → Dash/GenericScopeView.qml+5−5 Dash/People/PeopleFilterGrid.qml+1−1 Dash/People/PeoplePreview.qml+2−2 Dash/LensView.qml → Dash/ScopeView.qml+4−4 plugins/Unity/scopes.cpp+1−1 plugins/Unity/scopes.h+1−1 tests/autopilot/unity8/tests/testcases.py+1−1
Dash/Dash.qml+16−16
@@ -24,30 +24,30 @@ Showable {
2424 id: dash
2525
2626 property alias contentProgress: dashContent.contentProgress
27− property string showLensOnLoaded: "home.scope"
27+ property string showScopeOnLoaded: "home.scope"
2828 property real contentScale: 1.0
2929
3030 width: units.gu(40)
3131 height: units.gu(71)
3232
33− function setCurrentLens(lensId, animate, reset) {
34− var lensIndex = filteredLenses.findFirst(Scopes.RoleId, lensId)
33+ function setCurrentScope(scopeId, animate, reset) {
34+ var scopeIndex = filteredScopes.findFirst(Scopes.RoleId, scopeId)
3535
36− if (lensIndex == -1) {
37− console.warn("No match for lens with id: %1".arg(lensId))
36+ if (scopeIndex == -1) {
37+ console.warn("No match for scope with id: %1".arg(scopeId))
3838 return
3939 }
4040
41− if (lensIndex == dashContent.currentIndex && !reset) {
42− // the lens is already the current one
41+ if (scopeIndex == dashContent.currentIndex && !reset) {
42+ // the scope is already the current one
4343 return
4444 }
4545
46− dashContent.setCurrentLensAtIndex(lensIndex, animate, reset)
46+ dashContent.setCurrentScopeAtIndex(scopeIndex, animate, reset)
4747 }
4848
4949 SortFilterProxyModel {
50− id: filteredLenses
50+ id: filteredScopes
5151 model: Scopes {
5252 id: scopes
5353 }
@@ -60,17 +60,17 @@ Showable {
6060 DashContent {
6161 id: dashContent
6262 anchors.fill: parent
63− model: filteredLenses
63+ model: filteredScopes
6464 scopes: scopes
6565 onMovementStarted: dashbar.startNavigation()
6666 onMovementEnded: dashbar.stopNavigation()
6767 onContentFlickStarted: dashbar.finishNavigation()
6868 onContentEndReached: dashbar.finishNavigation()
6969 onPreviewShown: dashbar.finishNavigation()
70− onLensLoaded: {
71− if (lensId == dash.showLensOnLoaded) {
72− dash.setCurrentLens(lensId, false, false)
73− dash.showLensOnLoaded = ""
70+ onScopeLoaded: {
71+ if (scopeId == dash.showScopeOnLoaded) {
72+ dash.setCurrentScope(scopeId, false, false)
73+ dash.showScopeOnLoaded = ""
7474 }
7575 }
7676 scale: dash.contentScale
@@ -82,9 +82,9 @@ Showable {
8282 anchors.bottom: parent.bottom
8383 anchors.left: parent.left
8484 anchors.right: parent.right
85− model: filteredLenses
85+ model: filteredScopes
8686 currentIndex: dashContent.currentIndex
87− onItemSelected: dashContent.setCurrentLensAtIndex(index, true, false)
87+ onItemSelected: dashContent.setCurrentScopeAtIndex(index, true, false)
8888 opacity: dash.contentScale == 1.0 ? 1.0 : 0.0
8989 Behavior on opacity { NumberAnimation { easing.type: Easing.OutQuad; duration: 150 } }
9090 }
Dash/DashApps.qml+4−4
@@ -21,8 +21,8 @@ import "../Components"
2121import "../Components/ListItems"
2222import "Apps"
2323
24−LensView {
25− id: lensView
24+ScopeView {
25+ id: scopeView
2626
2727 // FIXME: a way to aggregate these models would be ideal
2828 property var mainStageApplicationsModel: shell.applicationManager.mainStageApplications
@@ -40,7 +40,7 @@ LensView {
4040 }
4141
4242 Binding {
43− target: lensView.lens
43+ target: scopeView.scope
4444 property: "searchQuery"
4545 value: pageHeader.searchQuery
4646 }
@@ -177,7 +177,7 @@ LensView {
177177 width: categoryView.width
178178 text: i18n.tr("Apps")
179179 searchEntryEnabled: true
180− searchHistory: lensView.searchHistory
180+ searchHistory: scopeView.searchHistory
181181 }
182182 }
183183}
Dash/DashBar.qml+3−3
@@ -97,10 +97,10 @@ Item {
9797
9898 Image {
9999 anchors.centerIn: parent
100− /* FIXME: should be 'source: lens.iconHint' but the
101− lenses do not contain the right icons yet
100+ /* FIXME: should be 'source: scope.iconHint' but the
101+ scopes do not contain the right icons yet
102102 */
103− source: "graphics/lensIcons/%1.png".arg(lens.name)
103+ source: "graphics/lensIcons/%1.png".arg(scope.name)
104104 height: iconSize
105105 width: iconSize
106106 // opacity: index == currentIndex ? 1 : 1 // same opacity for now
Dash/DashContent.qml+14−14
@@ -33,23 +33,23 @@ Item {
3333 signal contentFlickStarted()
3434 signal contentEndReached()
3535 signal previewShown()
36− signal lensLoaded(string lensId)
36+ signal scopeLoaded(string scopeId)
3737 signal positionedAtBeginning()
3838
39− // If we set the current lens index before the scopes have been added,
39+ // If we set the current scope index before the scopes have been added,
4040 // then we need to wait until the loaded signals gets emitted from the scopes
4141 property var set_current_index: undefined
4242 Connections {
4343 target: scopes
4444 onLoadedChanged: {
4545 if (scopes.loaded && set_current_index != undefined) {
46− setCurrentLensAtIndex(set_current_index[0], set_current_index[1], set_current_index[2]);
46+ setCurrentScopeAtIndex(set_current_index[0], set_current_index[1], set_current_index[2]);
4747 set_current_index = undefined;
4848 }
4949 }
5050 }
5151
52− function setCurrentLensAtIndex(index, animate, reset) {
52+ function setCurrentScopeAtIndex(index, animate, reset) {
5353 var storedMoveDuration = dashContentList.highlightMoveDuration
5454 var storedMoveSpeed = dashContentList.highlightMoveVelocity
5555 if (!animate) {
@@ -79,12 +79,12 @@ Item {
7979 }
8080 }
8181
82− property var lensDelegateMapping: {"mockmusicmaster.scope": "DashMusic.qml",
82+ property var scopeDelegateMapping: {"mockmusicmaster.scope": "DashMusic.qml",
8383 "applications.scope": "DashApps.qml",
8484 "home.scope": "DashHome.qml",
8585 "mockvideosmaster.scope": "DashVideos.qml",
8686 }
87− property string genericLens: "GenericLensView.qml"
87+ property string genericScope: "GenericScopeView.qml"
8888
8989 ListView {
9090 id: dashContentList
@@ -102,7 +102,7 @@ Item {
102102 highlightMoveDuration: 250
103103 highlightRangeMode: ListView.StrictlyEnforceRange
104104 /* FIXME: workaround rendering issue due to use of ShaderEffectSource in
105− UbuntuShape. While switching from the home lens to the People lens the
105+ UbuntuShape. While switching from the home scope to the People scope the
106106 rendering would block midway.
107107 */
108108 cacheBuffer: 2147483647
@@ -112,7 +112,7 @@ Item {
112112 // If the number of items is less than the current index, then need to reset to another item.
113113 onCountChanged: {
114114 if (currentIndex >= count)
115− dashContent.setCurrentLensAtIndex(count-1, true, true)
115+ dashContent.setCurrentScopeAtIndex(count-1, true, true)
116116 }
117117
118118 delegate:
@@ -121,20 +121,20 @@ Item {
121121 height: ListView.view.height
122122 asynchronous: true
123123 source: {
124− var customLens = lensDelegateMapping[lens.id]
125− if (customLens) {
126− return customLens
124+ var customScope = scopeDelegateMapping[scope.id]
125+ if (customScope) {
126+ return customScope
127127 } else {
128− return genericLens
128+ return genericScope
129129 }
130130 }
131131 onLoaded: {
132− item.lens = Qt.binding(function() { return lens })
132+ item.scope = Qt.binding(function() { return scope })
133133 item.isCurrent = Qt.binding(function() { return ListView.isCurrentItem })
134134 item.searchHistory = Qt.binding(function() { return shell.searchHistory })
135135 dashContentList.movementStarted.connect(item.movementStarted)
136136 dashContent.positionedAtBeginning.connect(item.positionedAtBeginning)
137− dashContent.lensLoaded(item.lens.id)
137+ dashContent.scopeLoaded(item.scope.id)
138138 }
139139 Connections {
140140 target: item
Dash/DashHome.qml+3−3
@@ -25,7 +25,7 @@ import "Video"
2525import "Music"
2626import "People"
2727
28−LensView {
28+ScopeView {
2929 id: root
3030
3131 onMovementStarted: listView.showHeader()
@@ -94,7 +94,7 @@ LensView {
9494
9595 Connections {
9696 target: dashContent
97− onLensLoaded: switch (lensId) {
97+ onScopeLoaded: switch (scopeId) {
9898 case "mockmusicmaster.scope":
9999 musicFilter.model = dashContent.scopes.get("mockmusicmaster.scope").results
100100 break;
@@ -154,7 +154,7 @@ LensView {
154154 onLoaded: {
155155 item.model = categoryModels[modelName]
156156
157− //FIXME: workaround for lack of previews for videos in Home lens.
157+ //FIXME: workaround for lack of previews for videos in Home scope.
158158 //Need to connect to the clicked() signal here and act upon it here instead.
159159 if (component === "VideosGrid") {
160160 function playVideo(index, data) {
Dash/DashMusic.qml+6−6
@@ -20,8 +20,8 @@ import "../Components"
2020import "../Components/ListItems" as ListItems
2121import "Music"
2222
23−LensView {
24− id: lensView
23+ScopeView {
24+ id: scopeView
2525
2626 property var categoryNames: [
2727 i18n.tr("Featured"),
@@ -37,7 +37,7 @@ LensView {
3737 onMovementStarted: categoryView.showHeader()
3838
3939 Binding {
40− target: lensView.lens
40+ target: scopeView.scope
4141 property: "searchQuery"
4242 value: pageHeader.searchQuery
4343 }
@@ -67,7 +67,7 @@ LensView {
6767 ListViewWithPageHeader {
6868 id: categoryView
6969 anchors.fill: parent
70− model: lensView.categories
70+ model: scopeView.categories
7171
7272 onAtYEndChanged: if (atYEnd) endReached()
7373 onMovingChanged: if (moving && atYEnd) endReached()
@@ -80,7 +80,7 @@ LensView {
8080
8181 Loader {
8282 anchors { top: parent.top; left: parent.left; right: parent.right }
83− sourceComponent: lensView.getRenderer(base.categoryId)
83+ sourceComponent: scopeView.getRenderer(base.categoryId)
8484 onLoaded: {
8585 item.model = results
8686 }
@@ -98,7 +98,7 @@ LensView {
9898 width: categoryView.width
9999 text: i18n.tr("Music")
100100 searchEntryEnabled: true
101− searchHistory: lensView.searchHistory
101+ searchHistory: scopeView.searchHistory
102102 }
103103 }
104104}
Dash/DashPeople.qml+6−6
@@ -23,8 +23,8 @@ import "../Components"
2323import "../Components/ListItems" as ListItems
2424import "People"
2525
26−LensView {
27− id: lensView
26+ScopeView {
27+ id: scopeView
2828 property alias previewShown: previewLoader.onScreen
2929
3030 property var categoryNames: [
@@ -41,7 +41,7 @@ LensView {
4141 onMovementStarted: categoryView.showHeader()
4242
4343 Binding {
44− target: lensView.lens
44+ target: scopeView.scope
4545 property: "searchQuery"
4646 value: pageHeader.searchQuery
4747 }
@@ -89,7 +89,7 @@ LensView {
8989 ListViewWithPageHeader {
9090 id: categoryView
9191 anchors.fill: parent
92− model: lensView.categories
92+ model: scopeView.categories
9393 onAtYEndChanged: if (atYEnd) endReached()
9494 onMovingChanged: if (moving && atYEnd) endReached()
9595 clipListView: !previewLoader.onScreen
@@ -122,7 +122,7 @@ LensView {
122122 width: categoryView.width
123123 text: i18n.tr("People")
124124 searchEntryEnabled: true
125− searchHistory: lensView.searchHistory
125+ searchHistory: scopeView.searchHistory
126126 }
127127 }
128128
@@ -210,7 +210,7 @@ LensView {
210210
211211 PeoplePreviewData {
212212 id: previewData
213− lens: lensView.lens
213+ scope: scopeView.scope
214214 property Data model
215215
216216 onError: previewLoader.open = false
Dash/DashVideos.qml+6−6
@@ -20,8 +20,8 @@ import "../Components"
2020import "../Components/ListItems" as ListItems
2121import "Video"
2222
23−LensView {
24− id: lensView
23+ScopeView {
24+ id: scopeView
2525 property alias previewShown: previewLoader.onScreen
2626
2727 property var categoryNames: [
@@ -38,7 +38,7 @@ LensView {
3838 onMovementStarted: categoryView.showHeader()
3939
4040 Binding {
41− target: lensView.lens
41+ target: scopeView.scope
4242 property: "searchQuery"
4343 value: pageHeader.searchQuery
4444 }
@@ -100,7 +100,7 @@ LensView {
100100 ListViewWithPageHeader {
101101 id: categoryView
102102 anchors.fill: parent
103− model: lensView.categories
103+ model: scopeView.categories
104104 clipListView: !previewLoader.onScreen
105105
106106 onAtYEndChanged: if (atYEnd) endReached()
@@ -115,7 +115,7 @@ LensView {
115115 Loader {
116116 id: loader
117117 anchors { top: parent.top; left: parent.left; right: parent.right }
118− sourceComponent: lensView.getRenderer(base.categoryId)
118+ sourceComponent: scopeView.getRenderer(base.categoryId)
119119 onLoaded: {
120120 item.model = results
121121 }
@@ -154,7 +154,7 @@ LensView {
154154 width: categoryView.width
155155 text: i18n.tr("Videos")
156156 searchEntryEnabled: true
157− searchHistory: lensView.searchHistory
157+ searchHistory: scopeView.searchHistory
158158 }
159159 }
160160
Dash/GenericLensView.qml → Dash/GenericScopeView.qmlrenamed+5−5
@@ -20,8 +20,8 @@ import "../Components"
2020import "../Components/ListItems" as ListItems
2121import "../Components/IconUtil.js" as IconUtil
2222
23−LensView {
24− id: lensView
23+ScopeView {
24+ id: scopeView
2525
2626 onIsCurrentChanged: {
2727 pageHeader.resetSearch();
@@ -30,7 +30,7 @@ LensView {
3030 onMovementStarted: categoryView.showHeader()
3131
3232 Binding {
33− target: lensView.lens
33+ target: scopeView.scope
3434 property: "searchQuery"
3535 value: pageHeader.searchQuery
3636 }
@@ -46,7 +46,7 @@ LensView {
4646 ListViewWithPageHeader {
4747 id: categoryView
4848 anchors.fill: parent
49− model: lensView.categories
49+ model: scopeView.categories
5050 onAtYEndChanged: if (atYEnd) endReached()
5151 onMovingChanged: if (moving && atYEnd) endReached()
5252
@@ -89,7 +89,7 @@ LensView {
8989 id: pageHeader
9090 objectName: "pageHeader"
9191 width: categoryView.width
92− text: lensView.lens.name
92+ text: scopeView.scope.name
9393 searchEntryEnabled: true
9494 }
9595 }
Dash/People/PeopleFilterGrid.qml+1−1
@@ -54,7 +54,7 @@ FilterGrid {
5454 // - FilterGrid is "height: childrenRect.height" so all delegates are always loaded
5555 // TODO: Optimize this by:
5656 // - not loading all delegates all the time and remove layer.enabled and/or
57− // - destroy whole lens when not visible/needed to free the GPU memory
57+ // - destroy whole scope when not visible/needed to free the GPU memory
5858 layer.enabled: true
5959
6060 dataModel: data
Dash/People/PeoplePreview.qml+2−2
@@ -47,7 +47,7 @@ DashPreview {
4747 visible: preview.model != undefined && preview.model.status != undefined
4848 model: preview.model
4949 property int index: 1
50− // FIXME that should trigger the action on the lens/scope, when there's support
50+ // FIXME that should trigger the action on the scope, when there's support
5151 onClicked: shell.activateApplication("/usr/share/applications/%1-webapp.desktop".arg(model.statusService), "--homepage=%1".arg(model.statusPostUri))
5252 }
5353
@@ -69,7 +69,7 @@ DashPreview {
6969 delegate: Phone {
7070 objectName: "phoneField" + index
7171 model: preview.model
72− // FIXME these should trigger actions on the lens/scope, when there's support
72+ // FIXME these should trigger actions on the scope, when there's support
7373 onPhoneClicked: shell.activateApplication("/usr/share/applications/phone-app.desktop", "call://%1".arg(number.replace(/[^\d\+]/g, "")))
7474 onTextClicked: shell.activateApplication("/usr/share/applications/phone-app.desktop", "message://%1".arg(number.replace(/[^\d\+]/g, "")))
7575 }
Dash/LensView.qml → Dash/ScopeView.qmlrenamed+4−4
@@ -19,7 +19,7 @@ import Utils 0.1
1919import Unity 0.1
2020
2121FocusScope {
22− property Scope lens
22+ property Scope scope
2323 property SortFilterProxyModel categories: categoryFilter
2424 property bool isCurrent
2525 property ListModel searchHistory
@@ -29,17 +29,17 @@ FocusScope {
2929 signal positionedAtBeginning
3030
3131 // FIXME delay the search so that daemons have time to settle
32− onLensChanged: timer.restart()
32+ onScopeChanged: timer.restart()
3333
3434 Timer {
3535 id: timer
3636 interval: 2000
37− onTriggered: lens.searchQuery = ""
37+ onTriggered: scope.searchQuery = ""
3838 }
3939
4040 SortFilterProxyModel {
4141 id: categoryFilter
42− model: lens.categories
42+ model: scope.categories
4343 dynamicSortFilter: true
4444 filterRole: Categories.RoleCount
4545 filterRegExp: /^0$/
plugins/Unity/scopes.cpp+1−1
@@ -33,7 +33,7 @@ Scopes::Scopes(QObject *parent)
3333 , m_unityScopes(std::make_shared<unity::dash::GSettingsScopes>())
3434 , m_loaded(false)
3535{
36− m_roles[Scopes::RoleLens] = "lens";
36+ m_roles[Scopes::RoleLens] = "scope";
3737 m_roles[Scopes::RoleId] = "id";
3838 m_roles[Scopes::RoleVisible] = "visible";
3939
plugins/Unity/scopes.h+1−1
@@ -61,7 +61,7 @@ public:
6161 Q_INVOKABLE int rowCount(const QModelIndex& parent = QModelIndex()) const;
6262
6363 Q_INVOKABLE QVariant get(int row) const;
64− Q_INVOKABLE QVariant get(const QString& lens_id) const;
64+ Q_INVOKABLE QVariant get(const QString& scope_id) const;
6565
6666 QHash<int, QByteArray> roleNames() const;
6767
tests/autopilot/unity8/tests/testcases.py+1−1
@@ -73,7 +73,7 @@ class TestShell(ShellTestCase, TestShellHelpers):
7373 super(TestShell, self).setUp("%sx%s" % (self.app_width / divisor, self.app_height / divisor), "%s" % (self.grid_unit_px / divisor))
7474
7575 dash = self.main_window.get_dash()
76− self.assertThat(dash.showLensOnLoaded, Eventually(Equals(""), timeout=30))
76+ self.assertThat(dash.showScopeOnLoaded, Eventually(Equals(""), timeout=30))
7777
7878 def test_show_hud(self):
7979 hud = self.main_window.get_hud()