@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013, 2014 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@ Item {
3636 signal contentEndReached()
3737 signal scopeLoaded(string scopeId)
3838 signal positionedAtBeginning()
39+ signal gotoScope(string scopeId)
40+ signal openScope(var scope)
3941
4042 // If we set the current scope index before the scopes have been added,
4143 // then we need to wait until the loaded signals gets emitted from the scopes
@@ -80,6 +82,10 @@ Item {
8082 }
8183 }
8284
85+ function closeScope(scope) {
86+ dashContentList.currentItem.theScope.closeScope(scope)
87+ }
88+
8389 Item {
8490 id: dashContentListHolder
8591 anchors.fill: parent
@@ -136,8 +142,8 @@ Item {
136142 onLoaded: {
137143 item.scope = Qt.binding(function() { return scope })
138144 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
139− item.tabBarHeight = pageHeader.implicitHeight;
140− item.pageHeader = pageHeader;
145+ item.tabBarHeight = dashPageHeader.implicitHeight;
146+ item.pageHeader = dashPageHeader;
141147 item.openEffect = openEffect;
142148 item.previewListView = previewListView;
143149 dashContentList.movementStarted.connect(item.movementStarted)
@@ -149,13 +155,23 @@ Item {
149155 ignoreUnknownSignals: true
150156 onEndReached: contentEndReached()
151157 }
158+ Connections {
159+ target: isCurrent ? scope : null
160+ onGotoScope: {
161+ // Note here scopeId is the signal parameter and not the loader property
162+ dashContent.gotoScope(scopeId);
163+ }
164+ onOpenScope: {
165+ dashContent.openScope(scope);
166+ }
167+ }
152168
153169 Component.onDestruction: active = false
154170 }
155171 }
156172
157173 PageHeader {
158− id: pageHeader
174+ id: dashPageHeader
159175 objectName: "pageHeader"
160176 width: parent.width
161177 searchEntryEnabled: true
@@ -218,6 +234,7 @@ Item {
218234 openEffect: openEffect
219235 categoryView: dashContentList.currentItem ? dashContentList.currentItem.categoryView : null
220236 scope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null
237+ pageHeader: dashPageHeader
221238 anchors.fill: parent
222239 }
223240}