Skip to content
Merged
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
6 changes: 5 additions & 1 deletion src/dcc-update-plugin/operation/updatedatastructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,11 @@ inline QString transferDeliveryConfigToLastoreDeliveryConfig(const QString& deli
LastoreUpgradeSpeedLimitConfig lastoreDeliveryConfig;
lastoreDeliveryConfig.isOnlineSpeedLimit = UpgradeSpeedLimitConfig::fromJson(deliveryConfig.toUtf8()).ifInOnlineLimit();
lastoreDeliveryConfig.speedLimitEnabled = UpgradeSpeedLimitConfig::fromJson(deliveryConfig.toUtf8()).shouldLimitRate();
lastoreDeliveryConfig.limitSpeed = QString::number(UpgradeSpeedLimitConfig::fromJson(deliveryConfig.toUtf8()).currentRate);
if (lastoreDeliveryConfig.isOnlineSpeedLimit) {
lastoreDeliveryConfig.limitSpeed = QString::number(UpgradeSpeedLimitConfig::fromJson(deliveryConfig.toUtf8()).currentRate);
} else {
lastoreDeliveryConfig.limitSpeed = QString::number(UpgradeSpeedLimitConfig::fromJson(deliveryConfig.toUtf8()).limitRate);
}
return lastoreDeliveryConfig.toJson();
}

Expand Down
37 changes: 21 additions & 16 deletions src/dcc-update-plugin/qml/UpdateSetting.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import org.deepin.dcc.update 1.0
DccObject {
id: root
property bool syncingUpgradeDeliverySwitch: false
property bool pendingUpgradeDeliveryEnabled: dccData.model().upgradeDeliveryEnable

FontMetrics {
id: fm
Expand All @@ -34,7 +33,7 @@ DccObject {
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
text: qsTr("Failed to change Upgrade Delivery setting")
text: qsTr("Failed to change Delivery Optimization setting")
}

Item {
Expand All @@ -48,12 +47,15 @@ DccObject {
spacing: 10

ButtonWithToolTip {
text: qsTr("OK")
text: qsTr("Cancel")
Layout.fillWidth: true
focus: upgradeDeliverySetConfigFailedDialog.visible
onClicked: {
upgradeDeliverySetConfigFailedDialog.close()
}
Keys.onEscapePressed: {
upgradeDeliverySetConfigFailedDialog.close()
}
}

component ButtonWithToolTip: D.Button {
Expand Down Expand Up @@ -103,8 +105,7 @@ DccObject {
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
text: root.pendingUpgradeDeliveryEnabled ? qsTr("Update Delivery Optimization service exception. Failed to enable.")
: qsTr("Update Delivery Optimization service exception. Failed to disable.")
text: qsTr("Update Delivery Optimization service exception")
}

Item {
Expand All @@ -123,12 +124,15 @@ DccObject {
focus: upgradeDeliverySetEnableFailedDialog.visible
onClicked: {
upgradeDeliverySetEnableFailedDialog.close()
dccData.work().setUpgradeDeliveryEnabled(root.pendingUpgradeDeliveryEnabled, true)
dccData.work().setUpgradeDeliveryEnabled(!dccData.model().upgradeDeliveryEnable, true)
}
Keys.onEscapePressed: {
upgradeDeliverySetEnableFailedDialog.close()
}
}

EnableFailedDialogButton {
text: qsTr("OK")
text: qsTr("Cancel")
Layout.fillWidth: true
onClicked: {
upgradeDeliverySetEnableFailedDialog.close()
Expand Down Expand Up @@ -173,6 +177,7 @@ DccObject {
parentName: "updateSettingsPage"
displayName: qsTr("Update Type")
weight: 10
visible: !dccData.model().isPrivateUpdate
}

DccObject {
Expand All @@ -181,6 +186,7 @@ DccObject {
parentName: "updateSettingsPage"
weight: 20
pageType: DccObject.Item
visible: !dccData.model().isPrivateUpdate
page: DccGroupView {
height: implicitHeight + 10
spacing: 0
Expand Down Expand Up @@ -245,15 +251,15 @@ DccObject {

DccObject {
id: advancedSetting
property bool showDetails: false
property bool showDetails: dccData.model().isPrivateUpdate
name: "advancedSettingTitle"
parentName: "updateSettingsPage"
displayName: qsTr("Advanced Settings")
weight: 30
pageType: DccObject.Item
page: RowLayout {
Component.onDestruction: {
advancedSetting.showDetails = false
advancedSetting.showDetails = false || dccData.model().isPrivateUpdate
}
DccLabel {
property D.Palette textColor: D.Palette {
Expand Down Expand Up @@ -335,10 +341,10 @@ DccObject {
DccObject {
name: "upgradeDeliverySwitch"
parentName: "upgradeDeliveryGrp"
displayName: qsTr("Upgrade Delivery")
displayName: qsTr("Delivery Optimization")
description: qsTr("When enabled, your device may share previously downloaded system updates with other devices on your local network.When you turn it off, cached files from update delivery will be cleared during the next restart.")
weight: 10
enabled: !dccData.model().updateProhibited
enabled: !dccData.model().isPrivateUpdate
pageType: DccObject.Editor
page: D.Switch {
id: upgradeDeliverySwitch
Expand All @@ -347,7 +353,6 @@ DccObject {
if (root.syncingUpgradeDeliverySwitch) {
return
}
root.pendingUpgradeDeliveryEnabled = checked
dccData.work().setUpgradeDeliveryEnabled(checked)
}
Connections {
Expand All @@ -365,7 +370,7 @@ DccObject {
id: upgradeDeliveryUploadLimitSetting
name: "upgradeDeliveryUploadLimitSetting"
parentName: "upgradeDeliveryGrp"
displayName: qsTr("Upgrade Delivery Upload Limit Setting")
displayName: qsTr("Delivery Optimization-Upload throttling")
visible: dccData.model().upgradeDeliveryEnable
weight: 20
enabled: !dccData.model().upgradeUploadSpeedIsOnline
Expand Down Expand Up @@ -465,9 +470,9 @@ DccObject {
id: upgradeDeliveryDownloadLimitSetting
name: "upgradeDeliveryDownloadLimitSetting"
parentName: "upgradeDeliveryGrp"
displayName: qsTr("Upgrade Delivery Download Limit Setting")
displayName: qsTr("Delivery Optimization-Limit Speed")
visible: dccData.model().upgradeDeliveryEnable
weight: 20
weight: 30
enabled: !dccData.model().upgradeDownloadSpeedIsOnline
pageType: DccObject.Item
Connections {
Expand Down Expand Up @@ -566,7 +571,7 @@ DccObject {
id: downloadLimitGrp
name: "downloadLimitGrp"
parentName: "advancedSettingGroup"
weight: 40
weight: 50
enabled: !dccData.model().downloadIsOnlineSpeedLimit
pageType: DccObject.Item
page: DccGroupView {
Expand Down
32 changes: 32 additions & 0 deletions src/dcc-update-plugin/translations/update_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,22 @@
<source>Delivers updates for additional repository sources</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delivery Optimization</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>When enabled, your device may share previously downloaded system updates with other devices on your local network.When you turn it off, cached files from update delivery will be cleared during the next restart.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delivery Optimization-Limit Speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delivery Optimization-Upload throttling</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Limit Speed</source>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -494,6 +510,22 @@
<source>Only numbers between 10-999999 are allowed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to change Delivery Optimization setting</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Update Delivery Optimization service exception</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Join the internal testing channel to get deepin latest updates.</source>
<translation type="unfinished"></translation>
Expand Down
36 changes: 36 additions & 0 deletions src/dcc-update-plugin/translations/update_en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,22 @@
<source>Delivers updates for additional repository sources</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delivery Optimization</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>When enabled, your device may share previously downloaded system updates with other devices on your local network.When you turn it off, cached files from update delivery will be cleared during the next restart.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delivery Optimization-Limit Speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delivery Optimization-Upload throttling</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Limit Speed</source>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -490,6 +506,26 @@
<source>Only numbers between 1-99999 are allowed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Only numbers between 10-999999 are allowed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to change Delivery Optimization setting</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Update Delivery Optimization service exception</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Join the internal testing channel to get deepin latest updates.</source>
<translation type="unfinished"></translation>
Expand Down
24 changes: 10 additions & 14 deletions src/dcc-update-plugin/translations/update_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,20 +443,20 @@
<translation>提供额外添加的仓库源更新内容</translation>
</message>
<message>
<source>Upgrade Delivery</source>
<source>Delivery Optimization</source>
<translation>传递优化</translation>
</message>
<message>
<source>When enabled, your device may share previously downloaded system updates with other devices on your local network.When you turn it off, cached files from update delivery will be cleared during the next restart.</source>
<translation>开启此功能,你的设备可能会将以前下载的部分系统更新发送到本地网络的设备上。关闭此功能后,将在重启时清除传递优化时缓存的文件</translation>
</message>
<message>
<source>Upgrade Delivery Download Limit Setting</source>
<translation>下载限速</translation>
<source>Delivery Optimization-Limit Speed</source>
<translation>传递优化-下载限速</translation>
</message>
<message>
<source>Upgrade Delivery Upload Limit Setting</source>
<translation>上传限速</translation>
<source>Delivery Optimization-Upload throttling</source>
<translation>传递优化-上传限速</translation>
</message>
<message>
<source>Limit Speed</source>
Expand Down Expand Up @@ -531,24 +531,20 @@
<translation>只允许输入10-999999</translation>
</message>
<message>
<source>Failed to change Upgrade Delivery setting</source>
<source>Failed to change Delivery Optimization setting</source>
<translation>更新传递优化服务异常</translation>
</message>
<message>
<source>Update Delivery Optimization service exception. Failed to enable.</source>
<translation>更新传递优化服务异常,开启失败</translation>
</message>
<message>
<source>Update Delivery Optimization service exception. Failed to disable.</source>
<translation>更新传递优化服务异常,关闭失败</translation>
<source>Update Delivery Optimization service exception</source>
<translation>更新传递优化服务异常</translation>
</message>
<message>
<source>Retry</source>
<translation>再试一次</translation>
</message>
<message>
<source>OK</source>
<translation>确定</translation>
<source>Cancel</source>
<translation>取消</translation>
</message>
<message>
<source>Join the internal testing channel to get deepin latest updates.</source>
Expand Down
24 changes: 10 additions & 14 deletions src/dcc-update-plugin/translations/update_zh_HK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,20 +443,20 @@
<translation>提供額外添加的倉庫源更新內容</translation>
</message>
<message>
<source>Upgrade Delivery</source>
<source>Delivery Optimization</source>
<translation>傳遞優化</translation>
</message>
<message>
<source>When enabled, your device may share previously downloaded system updates with other devices on your local network.When you turn it off, cached files from update delivery will be cleared during the next restart.</source>
<translation>開啟此功能,你的裝置可能會將以前下載的部分系統更新傳送到本地網絡的裝置上。關閉此功能後,將在重新啟動時清除更新傳遞時快取的檔案</translation>
</message>
<message>
<source>Upgrade Delivery Download Limit Setting</source>
<translation>下載限速</translation>
<source>Delivery Optimization-Limit Speed</source>
<translation>傳遞優化-下載限速</translation>
</message>
<message>
<source>Upgrade Delivery Upload Limit Setting</source>
<translation>上傳限速</translation>
<source>Delivery Optimization-Upload throttling</source>
<translation>傳遞優化-上傳限速</translation>
</message>
<message>
<source>Limit Speed</source>
Expand Down Expand Up @@ -527,24 +527,20 @@
<translation>只允許輸入1-99999</translation>
</message>
<message>
<source>Failed to change Upgrade Delivery setting</source>
<source>Failed to change Delivery Optimization setting</source>
<translation>更新傳遞優化服務異常</translation>
</message>
<message>
<source>Update Delivery Optimization service exception. Failed to enable.</source>
<translation>更新傳遞優化服務異常,開啓失敗</translation>
</message>
<message>
<source>Update Delivery Optimization service exception. Failed to disable.</source>
<translation>更新傳遞優化服務異常,關閉失敗</translation>
<source>Update Delivery Optimization service exception</source>
<translation>更新傳遞優化服務異常</translation>
</message>
<message>
<source>Retry</source>
<translation>再試一次</translation>
</message>
<message>
<source>OK</source>
<translation>確定</translation>
<source>Cancel</source>
<translation>取消</translation>
</message>
<message>
<source>Join the internal testing channel to get deepin latest updates.</source>
Expand Down
Loading
Loading