Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dcc-network/operation/dccnetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ DccNetwork::DccNetwork(QObject *parent)
, m_manager(nullptr)
{
qRegisterMetaType<QList<QVariantMap>>("NMVariantMapList");
qmlRegisterType<NetType>("org.deepin.dcc.network", 1, 0, "NetType");
qmlRegisterType<NetType>("org.deepin.dcc.network", 1, 0, "netType");
qmlRegisterType<NetItemModel>("org.deepin.dcc.network", 1, 0, "NetItemModel");
qmlRegisterType<NetManager>("org.deepin.dcc.network", 1, 0, "NetManager");
init();
Expand Down
32 changes: 16 additions & 16 deletions dcc-network/qml/DeviceStatusItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ RowLayout {

function getStatusName(status) {
switch (status) {
case NetType.DS_Disabled:
case netType.DS_Disabled:
return qsTr("Off")
case NetType.DS_Connected:
case NetType.DS_ConnectNoInternet:
case netType.DS_Connected:
case netType.DS_ConnectNoInternet:
return qsTr("Connected")
case NetType.DS_IpConflicted:
case netType.DS_IpConflicted:
return qsTr("IP conflict")
case NetType.DS_Connecting:
case netType.DS_Connecting:
return qsTr("Connecting")
case NetType.DS_ObtainingIP:
case netType.DS_ObtainingIP:
return qsTr("Obtaining address")
case NetType.DS_Authenticating:
case netType.DS_Authenticating:
return qsTr("Authenticating")
case NetType.DS_ObtainIpFailed:
case NetType.DS_ConnectFailed:
case NetType.DS_Unknown:
case NetType.DS_Enabled:
case NetType.DS_NoCable:
case NetType.DS_Disconnected:
case netType.DS_ObtainIpFailed:
case netType.DS_ConnectFailed:
case netType.DS_Unknown:
case netType.DS_Enabled:
case netType.DS_NoCable:
case netType.DS_Disconnected:
default:
return qsTr("Disconnected")
}
Expand All @@ -44,12 +44,12 @@ RowLayout {
text: {
if (connectedNameVisible) {
switch (netItem.status) {
case NetType.DS_Connected:
case NetType.DS_ConnectNoInternet:
case netType.DS_Connected:
case netType.DS_ConnectNoInternet:
var childrenItem = [netItem]
while (childrenItem.length > 0) {
var childItem = childrenItem.pop()
if (childItem.status === NetType.CS_Connected) {
if (childItem.status === netType.CS_Connected) {
return childItem.name
}
for (let i in childItem.children) {
Expand Down
16 changes: 8 additions & 8 deletions dcc-network/qml/NetworkMain.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ DccObject {
delegate: DelegateChooser {
role: "type"
DelegateChoice {
roleValue: NetType.WiredDeviceItem
roleValue: netType.WiredDeviceItem
delegate: PageWiredDevice {
netItem: model.item
}
}
DelegateChoice {
roleValue: NetType.WirelessDeviceItem
roleValue: netType.WirelessDeviceItem
delegate: PageWirelessDevice {
netItem: model.item
}
}
DelegateChoice {
roleValue: NetType.VPNControlItem
roleValue: netType.VPNControlItem
delegate: PageVPN {
name: "networkVpn"
parentName: "network"
Expand All @@ -75,7 +75,7 @@ DccObject {
}
}
DelegateChoice {
roleValue: NetType.DSLControlItem
roleValue: netType.DSLControlItem
delegate: PageDSL {
name: "dsl"
parentName: "network"
Expand All @@ -84,7 +84,7 @@ DccObject {
}
}
DelegateChoice {
roleValue: NetType.HotspotControlItem
roleValue: netType.HotspotControlItem
delegate: PageHotspot {
name: "personalHotspot"
parentName: "network"
Expand All @@ -94,7 +94,7 @@ DccObject {
}
}
DelegateChoice {
roleValue: NetType.SystemProxyControlItem
roleValue: netType.SystemProxyControlItem
delegate: PageSystemProxy {
name: "systemProxy"
parentName: "network"
Expand All @@ -103,7 +103,7 @@ DccObject {
}
}
DelegateChoice {
roleValue: NetType.AppProxyControlItem
roleValue: netType.AppProxyControlItem
delegate: PageAppProxy {
name: "applicationProxy"
parentName: "network"
Expand All @@ -112,7 +112,7 @@ DccObject {
}
}
DelegateChoice {
roleValue: NetType.DetailsItem
roleValue: netType.DetailsItem
delegate: PageDetails {
name: "networkDetails"
parentName: "network"
Expand Down
16 changes: 8 additions & 8 deletions dcc-network/qml/PageDSL.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ DccObject {
Layout.fillWidth: true
content: RowLayout {
BusyIndicator {
running: model.item.status === NetType.CS_Connecting
running: model.item.status === netType.CS_Connecting
visible: running
}
DccCheckIcon {
visible: model.item.status === NetType.CS_Connected && !itemDelegate.hovered
visible: model.item.status === netType.CS_Connected && !itemDelegate.hovered
}
NetButton {
implicitHeight: implicitContentHeight - 4
topInset: -4
bottomInset: -4
visible: model.item.status !== NetType.CS_Connecting && itemDelegate.hovered
text: model.item.status === NetType.CS_Connected ? qsTr("Disconnect") : qsTr("Connect")
visible: model.item.status !== netType.CS_Connecting && itemDelegate.hovered
text: model.item.status === netType.CS_Connected ? qsTr("Disconnect") : qsTr("Connect")
Layout.alignment: Qt.AlignCenter
onClicked: {
dccData.exec(model.item.status === NetType.CS_Connected ? NetManager.Disconnect : NetManager.ConnectOrInfo, model.item.id, {})
dccData.exec(model.item.status === netType.CS_Connected ? NetManager.Disconnect : NetManager.ConnectOrInfo, model.item.id, {})
}
}
D.IconLabel {
Expand All @@ -84,7 +84,7 @@ DccObject {
}
}
onDoubleClicked: {
if (model.item.status === NetType.CS_UnConnected) {
if (model.item.status === netType.CS_UnConnected) {
dccData.exec(NetManager.ConnectOrInfo, model.item.id, {})
}
}
Expand All @@ -100,7 +100,7 @@ DccObject {
name: "dslSettings"
parentName: root.name + "/body/networkList"
onFinished: DccApp.showPage(root)
type: NetType.WiredItem
type: netType.WiredItem
Connections {
target: dccData
function onRequest(cmd, id, param) {
Expand All @@ -111,7 +111,7 @@ DccObject {
while (items.length !== 0) {
let tmpItem = items[0]
if (tmpItem.id === id) {
if (tmpItem.itemType === NetType.DSLControlItem) {
if (tmpItem.itemType === netType.DSLControlItem) {
dslSettings.displayName = qsTr("Add PPPoE connection")
} else {
dslSettings.displayName = tmpItem.name
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/qml/PageDSLSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DccObject {
id: root
property var config: null
property var netItem: null
property int type: NetType.WiredItem
property int type: netType.WiredItem
property bool modified: false
signal finished
readonly property string parentUrl: parentName + "/" + name
Expand Down
2 changes: 1 addition & 1 deletion dcc-network/qml/PageSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DccObject {
id: root
property var config: null
property var netItem: null
property int type: NetType.WiredItem
property int type: netType.WiredItem
property bool modified: false
readonly property string parentUrl: parentName + "/" + name
signal finished
Expand Down
38 changes: 19 additions & 19 deletions dcc-network/qml/PageSystemProxy.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.deepin.dcc.network 1.0
DccObject {
id: root
property var netItem: null
property int method: NetType.None
property int method: netType.None
property bool autoUrlAlert: false
property int inputItem: 0

Expand Down Expand Up @@ -69,13 +69,13 @@ DccObject {
backgroundType: DccObject.Normal
pageType: DccObject.Editor
page: D.Switch {
checked: root.method !== NetType.None
checked: root.method !== netType.None
enabled: netItem.enabledable
onClicked: {
if (checked) {
root.method = netItem.lastMethod
} else {
root.method = NetType.None
root.method = netType.None
dccData.exec(NetManager.SetConnectInfo, netItem.id, {
"method": method
})
Expand All @@ -97,7 +97,7 @@ DccObject {
displayName: qsTr("Proxy Type")
weight: 20
backgroundType: DccObject.Normal
visible: method !== NetType.None
visible: method !== netType.None
pageType: DccObject.Editor
page: ComboBox {
flat: true
Expand All @@ -108,10 +108,10 @@ DccObject {
method = currentValue
}
model: [{
"value": NetType.Auto,
"value": netType.Auto,
"text": qsTr("Auto")
}, {
"value": NetType.Manual,
"value": netType.Manual,
"text": qsTr("Manual")
}]
Component.onCompleted: {
Expand All @@ -134,7 +134,7 @@ DccObject {
weight: 30
backgroundType: DccObject.Normal
pageType: DccObject.Editor
visible: method === NetType.Auto
visible: method === netType.Auto
page: D.LineEdit {
topInset: 4
bottomInset: 4
Expand Down Expand Up @@ -166,7 +166,7 @@ DccObject {
name: "http"
parentName: root.name + "/menu/body"
displayName: qsTr("HTTP Proxy")
visible: method === NetType.Manual
visible: method === netType.Manual
weight: 40
config: root.netItem.manualProxy.http
onHasUrlChanged: {
Expand All @@ -182,7 +182,7 @@ DccObject {
name: "https"
parentName: root.name + "/menu/body"
displayName: qsTr("HTTPS Proxy")
visible: method === NetType.Manual
visible: method === netType.Manual
weight: 50
config: root.netItem.manualProxy.https
onHasUrlChanged: {
Expand All @@ -198,7 +198,7 @@ DccObject {
name: "ftp"
parentName: root.name + "/menu/body"
displayName: qsTr("FTP Proxy")
visible: method === NetType.Manual
visible: method === netType.Manual
weight: 60
config: root.netItem.manualProxy.ftp
onHasUrlChanged: {
Expand All @@ -214,7 +214,7 @@ DccObject {
name: "socks"
parentName: root.name + "/menu/body"
displayName: qsTr("SOCKS Proxy")
visible: method === NetType.Manual
visible: method === netType.Manual
weight: 70
config: root.netItem.manualProxy.socks
onHasUrlChanged: {
Expand All @@ -231,7 +231,7 @@ DccObject {

name: "ignoreHosts"
parentName: root.name + "/menu/body"
visible: method === NetType.Manual
visible: method === netType.Manual
weight: 80
pageType: DccObject.Item
page: TextArea {
Expand Down Expand Up @@ -264,7 +264,7 @@ DccObject {
DccObject {
name: "spacer"
parentName: root.name + "/menu/footer"
visible: method !== NetType.None
visible: method !== netType.None
weight: 20
pageType: DccObject.Item
page: Item {
Expand All @@ -274,7 +274,7 @@ DccObject {
DccObject {
name: "cancel"
parentName: root.name + "/menu/footer"
visible: method !== NetType.None
visible: method !== netType.None
displayName: qsTr("Cancel")
weight: 30
pageType: DccObject.Item
Expand All @@ -295,7 +295,7 @@ DccObject {
name: "Save"
parentName: root.name + "/menu/footer"
displayName: qsTr("Save")
visible: method !== NetType.None
visible: method !== netType.None
weight: 40
pageType: DccObject.Item
page: Button {
Expand All @@ -306,7 +306,7 @@ DccObject {
leftPadding: 0
rightPadding: 0
spacing: 0
enabled: (method === NetType.Auto && (inputItem & 0xf0)) || (method === NetType.Manual && (inputItem & 0x0f))
enabled: (method === netType.Auto && (inputItem & 0xf0)) || (method === netType.Manual && (inputItem & 0x0f))
text: dccObj.displayName
Layout.alignment: Qt.AlignRight
function printfObj(obj) {
Expand All @@ -329,9 +329,9 @@ DccObject {
console.log("ignoreHosts.config:", ignoreHosts.config)
let config = {}
switch (method) {
case NetType.None:
case netType.None:
break
case NetType.Auto:
case netType.Auto:
autoUrlAlert = false
if (autoUrl.config.length === 0) {
autoUrlAlert = true
Expand All @@ -340,7 +340,7 @@ DccObject {

config["autoUrl"] = autoUrl.config
break
case NetType.Manual:
case netType.Manual:
if (!http.checkInput() || !https.checkInput() || !ftp.checkInput() || !socks.checkInput()) {
return
}
Expand Down
Loading
Loading