on xenial help sign in
Moved [Message]MenuItemFacotory from Unity.Indicators plugin to qml folder.
c0edd75Nick Dedekind
plugins/Unity/Indicators/CMakeLists.txt+1−4
@@ -51,7 +51,4 @@ target_link_libraries(IndicatorsQml
51
51
52qt5_use_modules(IndicatorsQml Core Qml Quick)
52qt5_use_modules(IndicatorsQml Core Qml Quick)
53
53
54−add_unity8_plugin(Unity.Indicators 0.1 Unity/Indicators
54+add_unity8_plugin(Unity.Indicators 0.1 Unity/Indicators TARGETS IndicatorsQml)
55− SEARCH_PATH qml
56− TARGETS IndicatorsQml
57−)
plugins/Unity/Indicators/qml/CachedUnityMenuModel.qml → plugins/Unity/Indicators/CachedUnityMenuModel.qmlrenamed

The content is the same.

plugins/Unity/Indicators/qml/qmldir → plugins/Unity/Indicators/qmldirrenamed−4
@@ -4,7 +4,3 @@ typeinfo Indicators.qmltypes
4
4
5CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml
5CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml
6IndicatorBase 0.1 IndicatorBase.qml
6IndicatorBase 0.1 IndicatorBase.qml
7−MenuItemFactory 0.1 MenuItemFactory.qml
8−MessageMenuItemFactory 0.1 MessageMenuItemFactory.qml
9−
10−internal RemoveBackground RemoveBackground.qml
qml/Panel/Indicators/DefaultIndicatorPage.qml+2−2
@@ -22,7 +22,7 @@ import QtQuick 2.0
22import Ubuntu.Components 0.1 as Components
22import Ubuntu.Components 0.1 as Components
23import Unity.Indicators 0.1 as Indicators
23import Unity.Indicators 0.1 as Indicators
24
24
25−Indicators.IndicatorBase {
25+IndicatorBase {
26 id: main
26 id: main
27
27
28 //const
28 //const
@@ -174,7 +174,7 @@ Indicators.IndicatorBase {
174 }
174 }
175 }
175 }
176
176
177− Indicators.MenuItemFactory {
177+ MenuItemFactory {
178 id: factory
178 id: factory
179 menuModel: mainMenu.model ? mainMenu.model : null
179 menuModel: mainMenu.model ? mainMenu.model : null
180 }
180 }
qml/Panel/Indicators/DefaultIndicatorWidget.qml+1−2
@@ -20,9 +20,8 @@
20import QtQuick 2.0
20import QtQuick 2.0
21import Ubuntu.Components 0.1
21import Ubuntu.Components 0.1
22import Ubuntu.Settings.Components 0.1
22import Ubuntu.Settings.Components 0.1
23−import Unity.Indicators 0.1 as Indicators
24
23
25−Indicators.IndicatorBase {
24+IndicatorBase {
26 id: indicatorWidget
25 id: indicatorWidget
27
26
28 property int iconSize: units.gu(2)
27 property int iconSize: units.gu(2)
plugins/Unity/Indicators/qml/IndicatorBase.qml → qml/Panel/Indicators/IndicatorBase.qmlrenamed+2−3
@@ -18,8 +18,7 @@
18 */
18 */
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21−import QMenuModel 0.1 as QMenuModel
22−import Unity.Indicators 0.1 as Indicators
21+import Unity.Indicators 0.1
23
22
24Item {
23Item {
25 id: indicatorItem
24 id: indicatorItem
@@ -43,7 +42,7 @@ Item {
43 menuObjectPath: indicatorItem.deviceMenuObjectPath
42 menuObjectPath: indicatorItem.deviceMenuObjectPath
44 }
43 }
45
44
46− property var rootActionState: Indicators.RootActionState {
45+ property RootActionState rootActionState: RootActionState {
47 menu: menuModel
46 menu: menuModel
48 onUpdated: indicatorItem.rootActionStateChanged()
47 onUpdated: indicatorItem.rootActionStateChanged()
49 }
48 }
qml/Panel/Indicators/IndicatorDelegate.qml+1−2
@@ -18,9 +18,8 @@
18 */
18 */
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21−import Unity.Indicators 0.1 as Indicators
22
21
23−Indicators.IndicatorBase {
22+IndicatorBase {
24 enabled: false
23 enabled: false
25
24
26 onRootActionStateChanged: {
25 onRootActionStateChanged: {
plugins/Unity/Indicators/qml/MenuItemFactory.qml → qml/Panel/Indicators/MenuItemFactory.qmlrenamed

The content is the same.

plugins/Unity/Indicators/qml/MessageMenuItemFactory.qml → qml/Panel/Indicators/MessageMenuItemFactory.qmlrenamed

The content is the same.

plugins/Unity/Indicators/qml/RemoveBackground.qml → qml/Panel/Indicators/RemoveBackground.qmlrenamed

The content is the same.

tests/mocks/Unity/Indicators/IndicatorBase.qmldeleted−38
@@ -1,38 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import QMenuModel 0.1
22−
23−Item {
24− id: indicatorBase
25−
26− //const
27− property string busName
28− property string actionsObjectPath
29− property string menuObjectPath
30− property string rootMenuType: "com.canonical.indicator.root"
31− property string deviceMenuObjectPath: menuObjectPath
32−
33− property var menuModel: UnityMenuModel {}
34−
35− property RootActionState rootActionState: RootActionState {
36− onUpdated: indicatorBase.rootActionStateChanged()
37− }
38−}
tests/mocks/Unity/Indicators/MenuItemFactory.qmldeleted−38
@@ -1,38 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import Ubuntu.Components.ListItems 0.1 as ListItem
22−
23−Item {
24− id: menuFactory
25−
26− property var menuModel: null
27−
28− Component {
29− id: standardMenu;
30− ListItem.Standard {
31− objectName: "standardMenu"
32− }
33− }
34−
35− function load(modelData) {
36− return standardMenu;
37− }
38−}
tests/mocks/Unity/Indicators/qmldir−2
@@ -3,8 +3,6 @@ plugin IndicatorsFakeQml
3typeinfo Indicators.qmltypes
3typeinfo Indicators.qmltypes
4
4
5CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml
5CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml
6−IndicatorBase 0.1 IndicatorBase.qml
7IndicatorsModel 0.1 IndicatorsModel.qml
6IndicatorsModel 0.1 IndicatorsModel.qml
8FakeMenuPage 0.1 FakeMenuPage.qml
7FakeMenuPage 0.1 FakeMenuPage.qml
9−MenuItemFactory 0.1 MenuItemFactory.qml
10RootActionState 0.1 RootActionState.qml
8RootActionState 0.1 RootActionState.qml
tests/qmltests/Panel/Indicators/tst_DefaultIndicatorPage.qml+1
@@ -31,6 +31,7 @@ Item {
31 anchors.fill: parent
31 anchors.fill: parent
32 contentActive: true
32 contentActive: true
33
33
34+ menuModel: UnityMenuModel {}
34 busName: "test"
35 busName: "test"
35 actionsObjectPath: "test"
36 actionsObjectPath: "test"
36 menuObjectPath: "test"
37 menuObjectPath: "test"
tests/qmltests/Panel/Indicators/tst_DefaultIndicatorWidget.qml+1
@@ -33,6 +33,7 @@ Item {
33 top: parent.top
33 top: parent.top
34 }
34 }
35
35
36+ menuModel: UnityMenuModel {}
36 busName: "test"
37 busName: "test"
37 actionsObjectPath: "test"
38 actionsObjectPath: "test"
38 deviceMenuObjectPath: "test"
39 deviceMenuObjectPath: "test"
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+3−2
@@ -18,15 +18,16 @@ import QtQuick 2.0
18import QtTest 1.0
18import QtTest 1.0
19import Unity.Test 0.1 as UT
19import Unity.Test 0.1 as UT
20import QMenuModel 0.1
20import QMenuModel 0.1
21−import Unity.Indicators 0.1 as Indicators
22import Utils 0.1 as Utils
21import Utils 0.1 as Utils
22+import "../../../../qml/Panel/Indicators"
23+
23
24
24Item {
25Item {
25 id: testView
26 id: testView
26 width: units.gu(40)
27 width: units.gu(40)
27 height: units.gu(70)
28 height: units.gu(70)
28
29
29− Indicators.MenuItemFactory {
30+ MenuItemFactory {
30 id: factory
31 id: factory
31 menuModel: UnityMenuModel {}
32 menuModel: UnityMenuModel {}
32 }
33 }
tests/qmltests/Panel/Indicators/tst_MessageMenuItemFactory.qml+2−2
@@ -18,15 +18,15 @@ import QtQuick 2.0
18import QtTest 1.0
18import QtTest 1.0
19import Unity.Test 0.1 as UT
19import Unity.Test 0.1 as UT
20import QMenuModel 0.1
20import QMenuModel 0.1
21−import Unity.Indicators 0.1 as Indicators
22import Utils 0.1 as Utils
21import Utils 0.1 as Utils
22+import "../../../../qml/Panel/Indicators"
23
23
24Item {
24Item {
25 id: testView
25 id: testView
26 width: units.gu(40)
26 width: units.gu(40)
27 height: units.gu(70)
27 height: units.gu(70)
28
28
29− Indicators.MessageMenuItemFactory {
29+ MessageMenuItemFactory {
30 id: factory
30 id: factory
31 menuModel: UnityMenuModel {}
31 menuModel: UnityMenuModel {}
32 menuIndex: 0
32 menuIndex: 0