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 { ...@@ -126,6 +126,20 @@ Loader {
property bool canOpen: root.transferStatus === Interaction.TransferStatus.TRANSFER_FINISHED || isOutgoing property bool canOpen: root.transferStatus === Interaction.TransferStatus.TRANSFER_FINISHED || isOutgoing
property real maxMsgWidth: root.width - senderMargin - 2 * hPadding - avatarBlockWidth - buttonsLoader.width - 24 - 6 - 24 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 isOutgoing: Author === CurrentAccount.uri
showTime: root.showTime showTime: root.showTime
seq: root.seq seq: root.seq
...@@ -136,7 +150,7 @@ Loader { ...@@ -136,7 +150,7 @@ Loader {
timestamp: root.timestamp timestamp: root.timestamp
formattedTime: root.formattedTime formattedTime: root.formattedTime
formattedDay: root.formattedTime formattedDay: root.formattedTime
extraHeight: progressBar.visible ? 18 : 0 extraHeight: progressBar.visible ? 25 : 0
innerContent.children: [ innerContent.children: [
RowLayout { RowLayout {
...@@ -212,9 +226,10 @@ Loader { ...@@ -212,9 +226,10 @@ Loader {
imageColor: JamiTheme.chatviewButtonColor imageColor: JamiTheme.chatviewButtonColor
onClicked: { onClicked: {
if (root.transferStatus === Interaction.TransferStatus.TRANSFER_ONGOING) { if (root.transferStatus === Interaction.TransferStatus.TRANSFER_ONGOING) {
return MessagesAdapter.cancelFile(transferId); MessagesAdapter.cancelFile(transferId);
} else { } 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.
Please register or to comment