on xenial help sign in
more review fixes
commitc0252302c5f18ea9b38ddba183436faa5aa7bf34 authorNick Dedekind <nicholas.dedekind@gmail.com> dateMon 17 Jun 2013, 11:41 (13 years ago) parentd4bcf25
9 files changed+49−42
Panel/Indicators/DefaultIndicatorWidget.qml+1 Panel/Indicators/NetworkIndicatorWidget.qml+9−10 Panel/Indicators/client/IndicatorsList.qml+2−3 Panel/MenuContent.qml+7−14 Panel/Menus/Overview/OverviewGrid.qml+9−12 debian/control+3−3 modules/Unity/Indicators/indicators.h+15 modules/Unity/Indicators/plugin.cpp+1 modules/Unity/Indicators/qml/IndicatorWidget.qml+2
Panel/Indicators/DefaultIndicatorWidget.qml+1
@@ -39,6 +39,7 @@ Indicators.IndicatorWidget {
3939 }
4040 spacing: units.gu(0.5)
4141
42+ // FIXME : Should us Ubuntu.Icon . results in low res images
4243 Image {
4344 id: itemImage
4445 objectName: "itemImage"
Panel/Indicators/NetworkIndicatorWidget.qml+9−10
@@ -27,8 +27,9 @@ Indicators.IndicatorWidget {
2727 width: networkIcon.width + units.gu(1)
2828
2929 property int signalStrength: 0
30− property int connectionState: 0
30+ property int connectionState: Indicators.ConnectionState.Initial
3131
32+ // FIXME : Should us Ubuntu.Icon . results in low res images
3233 Image {
3334 id: networkIcon
3435 objectName: "itemImage"
@@ -36,15 +37,13 @@ Indicators.IndicatorWidget {
3637 visible: source != ""
3738 height: indicatorWidget.iconSize
3839 width: indicatorWidget.iconSize
39− anchors {
40− verticalCenter: parent.verticalCenter
41− horizontalCenter: parent.horizontalCenter
42− }
40+ anchors.centerIn: parent
4341 }
4442
4543 function parseRootElement(type, data) {
46− if (type == "com.canonical.indicator.root.network")
44+ if (type == "com.canonical.indicator.root.network") {
4745 return true;
46+ }
4847 return false;
4948 }
5049
@@ -77,22 +76,22 @@ Indicators.IndicatorWidget {
7776 states: [
7877 State {
7978 name: "unknown"
80− when: connectionState > 3 || connectionState < 1
79+ when: connectionState > Indicators.ConnectionState.Deactivating || connectionState < Indicators.ConnectionState.Activating
8180 PropertyChanges { target: activation_animation; running: false }
8281 },
8382 State {
8483 name: "activating"
85− when: connectionState == 1
84+ when: connectionState == Indicators.ConnectionState.Activating
8685 PropertyChanges { target: activation_animation; running: true }
8786 },
8887 State {
8988 name: "activated"
90− when: connectionState == 2
89+ when: connectionState == Indicators.ConnectionState.Activated
9190 PropertyChanges { target: activation_animation; running: false }
9291 },
9392 State {
9493 name: "deactivating"
95− when: connectionState == 3
94+ when: connectionState == Indicators.ConnectionState.Deactivating
9695 PropertyChanges { target: activation_animation; running: true }
9796 }
9897 ]
Panel/Indicators/client/IndicatorsList.qml+2−3
@@ -41,7 +41,6 @@ Page {
4141 delegate: Indicators.Menu {
4242 anchors.left: parent.left
4343 anchors.right: parent.right
44− height: implicitHeight
4544 progression: isValid
4645 objectName: identifier
4746
@@ -54,8 +53,8 @@ Page {
5453
5554 onClicked: {
5655 if (progression) {
57− var page = Qt.createComponent("IndicatorsPage.qml");
58− pages.push(page.createObject(pages), {"indicatorProperties" : model.indicatorProperties, "pageSource" : model.pageSource});
56+ var new_page = Qt.createComponent("IndicatorsPage.qml");
57+ page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties, "pageSource" : model.pageSource});
5958 }
6059 }
6160 }
Panel/MenuContent.qml+7−14
@@ -104,22 +104,15 @@ Rectangle {
104104 }
105105 asynchronous: true
106106
107− onStatusChanged: {
108− if (status == Loader.Ready) {
109− for(var pName in indicatorProperties) {
110− if (item.hasOwnProperty(pName)) {
111− item[pName] = indicatorProperties[pName]
112− }
113− }
114− if (contentActive && menus.visible) {
115− item.start()
107+ onLoaded: {
108+ for(var pName in indicatorProperties) {
109+ if (item.hasOwnProperty(pName)) {
110+ item[pName] = indicatorProperties[pName]
116111 }
117112 }
118− }
119−
120− // FIXME: QTBUG-30632 - asynchronous loader crashes when changing index quickly.
121− Component.onDestruction: {
122− active = false;
113+ if (contentActive && menus.visible) {
114+ item.start()
115+ }
123116 }
124117
125118 // Need to use a binding because the handle height changes.
Panel/Menus/Overview/OverviewGrid.qml+9−12
@@ -65,18 +65,15 @@ Item {
6565 id: loader
6666 source: widgetSource
6767
68− onStatusChanged: {
69− item.width = units.gu(5)
70− item.height = units.gu(5)
71−
72− item.x = Qt.binding(function() { return indicatorButton.width/2 - item.width/2; })
73− item.y = Qt.binding(function() { return indicatorButton.height/2 - item.height/2 - units.gu(1); })
74−
75− if (status == Loader.Ready) {
76− for(var pName in indicatorProperties) {
77− if (item.hasOwnProperty(pName)) {
78− item[pName] = indicatorProperties[pName]
79− }
68+ width: units.gu(5)
69+ height: units.gu(5)
70+ anchors.centerIn: parent
71+ anchors.verticalCenterOffset: -units.gu(1)
72+
73+ onLoaded: {
74+ for(var pName in indicatorProperties) {
75+ if (item.hasOwnProperty(pName)) {
76+ item[pName] = indicatorProperties[pName]
8077 }
8178 }
8279 }
debian/control+3−3
@@ -58,11 +58,11 @@ Description: transitional dummy package
5858
5959Package: indicators-client
6060Architecture: amd64 armhf i386
61−Depends: ${shlibs:Depends},
62− ${misc:Depends},
61+Depends: qmenumodel-qml,
6362 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
64− qmenumodel-qml,
6563 unity8 (= ${source:Version}),
64+ ${misc:Depends},
65+ ${shlibs:Depends},
6666Description: Indicators and system settings client application
6767 This package contains the client application for indicators and system
6868 settings.
modules/Unity/Indicators/indicators.h+15
@@ -34,4 +34,19 @@ public:
3434 ActionState(QObject*parent=0):QObject(parent) {}
3535};
3636
37+class ConnectionState : public QObject
38+{
39+ Q_OBJECT
40+public:
41+ Q_ENUMS(ConnectionStates)
42+ enum ConnectionStates {
43+ Initial = 0x00,
44+ Activating = 0x01,
45+ Activated = 0x02,
46+ Deactivating = 0x03,
47+ };
48+
49+ ConnectionState(QObject*parent=0):QObject(parent) {}
50+};
51+
3752#endif // INDICATORS_H
modules/Unity/Indicators/plugin.cpp+1
@@ -36,4 +36,5 @@ void IndicatorsPlugin::registerTypes(const char *uri)
3636 qmlRegisterType<FlatMenuProxyModel>(uri, 0, 1, "FlatMenuProxyModel");
3737 qmlRegisterType<IndicatorsModel>(uri, 0, 1, "IndicatorsModel");
3838 qmlRegisterUncreatableType<ActionState>(uri, 0, 1, "ActionState", "Can't create ActionState class");
39+ qmlRegisterUncreatableType<ConnectionState>(uri, 0, 1, "ConnectionState", "Can't create ConnectionState class");
3940}
modules/Unity/Indicators/qml/IndicatorWidget.qml+2
@@ -25,6 +25,8 @@ import Unity.Indicators 0.1 as Indicators
2525
2626IndicatorBase {
2727 id: indicatorWidget
28+
29+// enabled: false // FIXME : should be enabled when we have desktop indicators
2830 property var action: undefined
2931 property bool started: (busType != 0) && (busName != "") && (deviceMenuObjectPath != "")
3032 property int iconSize: height - units.gu(0.5)