Page MenuHomePhorge

D182.1732499575.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D182.1732499575.diff

diff --git a/src/contents/ui/KazvIOMenu.qml b/src/contents/ui/KazvIOMenu.qml
--- a/src/contents/ui/KazvIOMenu.qml
+++ b/src/contents/ui/KazvIOMenu.qml
@@ -19,6 +19,8 @@
required property var jobId
required property bool isUpload
+ property var progress: kazvIOJob ? kazvIOJob.progress : 0
+
visible: kazvIOJob ? true : false
onKazvIOJobChanged: {
@@ -81,7 +83,12 @@
id: progressBar
objectName: 'progressBar'
Layout.fillWidth: true
- value: kazvIOJob ? kazvIOJob.progress : 0
+ value: progress
+ }
+ Label {
+ id: progressLabel
+ objectName: 'progressText'
+ text: l10n.get("kazv-io-progress", { progress: Math.floor(progress * 100) })
}
Kirigami.Action {
id: pauseAction
diff --git a/src/l10n/cmn-Hans/100-ui.ftl b/src/l10n/cmn-Hans/100-ui.ftl
--- a/src/l10n/cmn-Hans/100-ui.ftl
+++ b/src/l10n/cmn-Hans/100-ui.ftl
@@ -263,6 +263,7 @@
kazv-io-pause = 暂停
kazv-io-resume = 继续
kazv-io-cancel = 取消
+kazv-io-progress = { $progress }/100
create-room-page-title = 创建房间
create-room-page-visibility-prompt = 房间可见性:
diff --git a/src/l10n/en/100-ui.ftl b/src/l10n/en/100-ui.ftl
--- a/src/l10n/en/100-ui.ftl
+++ b/src/l10n/en/100-ui.ftl
@@ -285,6 +285,7 @@
kazv-io-pause = Pause
kazv-io-resume = Resume
kazv-io-cancel = Cancel
+kazv-io-progress = { $progress }/100
create-room-page-title = Create room
create-room-page-type-prompt = Room type:
diff --git a/src/tests/quick-tests/tst_KazvIOMenu.qml b/src/tests/quick-tests/tst_KazvIOMenu.qml
--- a/src/tests/quick-tests/tst_KazvIOMenu.qml
+++ b/src/tests/quick-tests/tst_KazvIOMenu.qml
@@ -64,9 +64,14 @@
function test_progress() {
progressBar.kazvIOJob = kazvIOJob;
const progress = findChild(progressBar, 'progressBar');
+ const progressText = findChild(progressBar, 'progressText');
compare(progress.value, kazvIOJob.progress);
+ compare(progressText.text, l10n.get("kazv-io-progress", {
+ progress: Math.floor(kazvIOJob.progress * 100)}));
kazvIOJob.progress = Math.random();
compare(progress.value, kazvIOJob.progress);
+ compare(progressText.text, l10n.get("kazv-io-progress", {
+ progress: Math.floor(kazvIOJob.progress * 100)}));
}
function test_progressBarNullJob() {

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 5:52 PM (8 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39907
Default Alt Text
D182.1732499575.diff (2 KB)

Event Timeline