Skip to content
Snippets Groups Projects
Commit e700d816 authored by Page Magnier-Slimani's avatar Page Magnier-Slimani Committed by François-Simon Fauteux-Chapleau
Browse files

downloadprogressbar: fix the implementation

Implement a timer to refresh the download progress bar periodically.

GitLab: #1809
Change-Id: I0c9e142ce5d30c443c4fc6998de3387ec751b1d7
parent 37065cb7
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,20 @@ Loader {
property bool canOpen: root.transferStatus === Interaction.TransferStatus.TRANSFER_FINISHED || isOutgoing
property real maxMsgWidth: root.width - senderMargin - 2 * hPadding - avatarBlockWidth - buttonsLoader.width - 24 - 6 - 24
// Timer to update the translation bar
Loader {
id: timerLoader
active: root.transferStatus === Interaction.TransferStatus.TRANSFER_ONGOING
sourceComponent: Timer {
interval: 1000 // Update every second
running: true
repeat: true
onTriggered: {
transferStats = MessagesAdapter.getTransferStats(transferId, root.transferStatus);
}
}
}
isOutgoing: Author === CurrentAccount.uri
showTime: root.showTime
seq: root.seq
......@@ -136,7 +150,7 @@ Loader {
timestamp: root.timestamp
formattedTime: root.formattedTime
formattedDay: root.formattedTime
extraHeight: progressBar.visible ? 18 : 0
extraHeight: progressBar.visible ? 25 : 0
innerContent.children: [
RowLayout {
......@@ -212,9 +226,10 @@ Loader {
imageColor: JamiTheme.chatviewButtonColor
onClicked: {
if (root.transferStatus === Interaction.TransferStatus.TRANSFER_ONGOING) {
return MessagesAdapter.cancelFile(transferId);
MessagesAdapter.cancelFile(transferId);
} else {
return MessagesAdapter.acceptFile(transferId);
buttonsLoader.iconSource = JamiResources.connecting_black_24dp_svg;
MessagesAdapter.acceptFile(transferId);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment