@@ -17,6 +17,7 @@ DccObject {
1717 property var item: null
1818 property var airplaneItem: null
1919 property var config: null
20+ property bool isAirplane: false
2021 property string interfaceName: " "
2122
2223 function setItem (netItem ) {
@@ -87,22 +88,28 @@ DccObject {
8788 page: devCheck
8889 Component {
8990 id: devCheck
90- D .Switch {
91- checked: item .isEnabled
92- enabled: item .enabledable
93- onClicked: {
94- if (checked) {
95- if (config[" connection" ][" uuid" ] === " {00000000-0000-0000-0000-000000000000}" ) {
96- dccData .exec (NetManager .SetConnectInfo , item .id , config)
91+ Item {
92+ implicitHeight: switchControl .implicitHeight
93+ implicitWidth: switchControl .implicitWidth
94+ D .Switch {
95+ id: switchControl
96+ anchors .fill : parent
97+ checked: item .isEnabled
98+ enabled: item .enabledable && ! isAirplane
99+ onClicked: {
100+ if (checked) {
101+ if (config[" connection" ][" uuid" ] === " {00000000-0000-0000-0000-000000000000}" ) {
102+ dccData .exec (NetManager .SetConnectInfo , item .id , config)
103+ } else {
104+ dccData .exec (NetManager .Connect , item .id , {
105+ " uuid" : config[" connection" ][" uuid" ]
106+ })
107+ }
97108 } else {
98- dccData .exec (NetManager .Connect , item .id , {
109+ dccData .exec (NetManager .Disconnect , item .id , {
99110 " uuid" : config[" connection" ][" uuid" ]
100111 })
101112 }
102- } else {
103- dccData .exec (NetManager .Disconnect , item .id , {
104- " uuid" : config[" connection" ][" uuid" ]
105- })
106113 }
107114 }
108115 }
@@ -132,6 +139,7 @@ DccObject {
132139 name: " hotspotTitle"
133140 parentName: root .name + " /menu"
134141 weight: 20
142+ visible: ! isAirplane
135143 displayName: qsTr (" My Hotspot" )
136144 pageType: DccObject .Item
137145 page: RowLayout {
@@ -342,6 +350,7 @@ DccObject {
342350 name: " hotspotConfig"
343351 parentName: root .name + " /menu"
344352 weight: 30
353+ visible: ! isAirplane
345354 pageType: DccObject .Item
346355 page: DccGroupView {}
347356 DccObject {
@@ -413,13 +422,15 @@ DccObject {
413422 DccTitleObject {
414423 name: " shareTitle"
415424 parentName: root .name + " /menu"
425+ visible: ! isAirplane
416426 weight: 40
417427 displayName: qsTr (" Shared Settings" )
418428 }
419429 DccObject {
420430 id: shareConfig
421431 name: " shareConfig"
422432 parentName: root .name + " /menu"
433+ visible: ! isAirplane
423434 weight: 50
424435 pageType: DccObject .Item
425436 page: DccGroupView {}
@@ -487,7 +498,7 @@ DccObject {
487498 DccObject {
488499 name: " airplaneTips"
489500 parentName: root .name + " /menu"
490- visible: root . airplaneItem && root . airplaneItem . isEnabled && root . airplaneItem . enabledable
501+ visible: isAirplane
491502 displayName: qsTr (" If you want to use the personal hotspot, disable Airplane Mode first and then enable the wireless network adapter." )
492503 weight: 70
493504 pageType: DccObject .Item
0 commit comments