ReceivingForm.ui.qml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import QtQuick 2.12
  2. import QtQuick.Controls 2.5
  3. import QtQuick.Layouts 1.3
  4. Page {
  5. width: 1280
  6. height: 470
  7. id: receivingForm
  8. font.capitalization: Font.MixedCase
  9. Connections {
  10. target: _qmlHandler
  11. onReceivingListFile: {
  12. fileList.append({
  13. "fileName": fileName,
  14. "fileSize": fileSize + " kB",
  15. "fileProgress": "",
  16. "fileDecryptable": fileDecryptable,
  17. "fileExistsLocally": existsLocally
  18. })
  19. }
  20. onReceivingClearFileList: {
  21. fileList.clear()
  22. }
  23. }
  24. ColumnLayout {
  25. anchors.fill: parent
  26. ScrollView {
  27. Layout.preferredWidth: parent.width
  28. Layout.preferredHeight: 400
  29. ListView {
  30. anchors.fill: parent
  31. model: fileList
  32. clip: true
  33. delegate: ReceivingFileTemplate {
  34. fileNameText: fileName
  35. fileSizeText: fileSize
  36. fileProgressText: fileProgress
  37. fileDecryptableText: fileDecryptable
  38. fileExists: fileExistsLocally
  39. }
  40. }
  41. }
  42. ListModel {
  43. id: fileList
  44. }
  45. RowLayout {
  46. Layout.preferredWidth: parent.width
  47. Layout.preferredHeight: 70
  48. Button {
  49. id: receivingListFilesButton
  50. Layout.preferredWidth: 180
  51. Layout.preferredHeight: parent.height
  52. text: qsTr("Refresh File List")
  53. // @disable-check M223
  54. onClicked: {
  55. // @disable-check M222
  56. _qmlHandler.onReceivingListFilesButton()
  57. }
  58. }
  59. }
  60. }
  61. }