on xenial help sign in
Initial wiring of primaryNavigationTag
726809cAlbert Astals Cid
qml/Dash/GenericScopeView.qml+1
@@ -626,6 +626,7 @@ FocusScope {
626 settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
626 settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
627 favoriteEnabled: scopeView.scope && scopeView.scope.id !== "clickscope"
627 favoriteEnabled: scopeView.scope && scopeView.scope.id !== "clickscope"
628 favorite: scopeView.scope && scopeView.scope.favorite
628 favorite: scopeView.scope && scopeView.scope.favorite
629+ navigationTag: scopeView.scope && scopeView.scope.primaryNavigationTag
629 scopeStyle: scopeView.scopeStyle
630 scopeStyle: scopeView.scopeStyle
630 paginationCount: scopeView.paginationCount
631 paginationCount: scopeView.paginationCount
631 paginationIndex: scopeView.paginationIndex
632 paginationIndex: scopeView.paginationIndex
qml/Dash/PageHeader.qml+5
@@ -31,6 +31,7 @@ Item {
31 property bool backIsClose: false
31 property bool backIsClose: false
32 property string title
32 property string title
33 property var extraPanel
33 property var extraPanel
34+ property string navigationTag
34
35
35 property bool storeEntryEnabled: false
36 property bool storeEntryEnabled: false
36 property bool searchEntryEnabled: false
37 property bool searchEntryEnabled: false
@@ -197,6 +198,10 @@ Item {
197 rightMargin: units.gu(1)
198 rightMargin: units.gu(1)
198 }
199 }
199
200
201+ primaryItem: Label {
202+ text: root.navigationTag
203+ }
204+
200 secondaryItem: AbstractButton {
205 secondaryItem: AbstractButton {
201 height: searchTextField.height
206 height: searchTextField.height
202 width: height
207 width: height
tests/mocks/Unity/fake_scope.cpp+5−2
@@ -285,6 +285,7 @@ void Scope::setNavigationState(const QString &navigationId)
285{
285{
286 m_currentNavigationId = navigationId;
286 m_currentNavigationId = navigationId;
287 Q_EMIT currentNavigationIdChanged();
287 Q_EMIT currentNavigationIdChanged();
288+ Q_EMIT primaryNavigationTagChanged();
288}
289}
289
290
290unity::shell::scopes::FilterBaseInterface* Scope::primaryNavigationFilter() const
291unity::shell::scopes::FilterBaseInterface* Scope::primaryNavigationFilter() const
@@ -299,8 +300,10 @@ unity::shell::scopes::FiltersInterface* Scope::filters() const
299
300
300QString Scope::primaryNavigationTag() const
301QString Scope::primaryNavigationTag() const
301{
302{
302− // TODO
303+ if (m_currentNavigationId == "root")
303− return QString();
304+ return QString();
305+ else
306+ return const_cast<Scope*>(this)->getNavigation(m_currentNavigationId)->label();
304}
307}
305
308
306int Scope::activeFiltersCount() const
309int Scope::activeFiltersCount() const