ConflictDelegate.qml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (C) 2023 by Matthieu Gallien <matthieu.gallien@nextcloud.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. * for more details.
  13. */
  14. import QtQml 2.15
  15. import QtQuick 2.15
  16. import QtQuick.Layouts 1.15
  17. import QtQuick.Controls 2.15
  18. import Style 1.0
  19. import com.nextcloud.desktopclient 1.0
  20. import "./tray"
  21. Item {
  22. id: root
  23. required property string existingFileName
  24. required property string existingSize
  25. required property string conflictSize
  26. required property string existingDate
  27. required property string conflictDate
  28. required property bool existingSelected
  29. required property bool conflictSelected
  30. required property url existingPreviewUrl
  31. required property url conflictPreviewUrl
  32. required property var model
  33. EnforcedPlainTextLabel {
  34. id: existingFileNameLabel
  35. anchors.top: parent.top
  36. anchors.left: parent.left
  37. text: root.existingFileName
  38. font.weight: Font.Bold
  39. font.pixelSize: 15
  40. }
  41. RowLayout {
  42. anchors.top: existingFileNameLabel.bottom
  43. anchors.bottom: parent.bottom
  44. anchors.left: parent.left
  45. anchors.right: parent.right
  46. anchors.bottomMargin: 8
  47. ConflictItemFileInfo {
  48. Layout.fillWidth: true
  49. Layout.fillHeight: true
  50. itemSelected: root.existingSelected
  51. itemPreviewUrl: root.existingPreviewUrl
  52. itemVersionLabel: qsTr('Local version')
  53. itemDateLabel: root.existingDate
  54. itemFileSizeLabel: root.existingSize
  55. onSelectedChanged: function() {
  56. model.existingSelected = itemSelected
  57. }
  58. }
  59. ConflictItemFileInfo {
  60. Layout.fillWidth: true
  61. Layout.fillHeight: true
  62. itemSelected: root.conflictSelected
  63. itemPreviewUrl: root.conflictPreviewUrl
  64. itemVersionLabel: qsTr('Server version')
  65. itemDateLabel: root.conflictDate
  66. itemFileSizeLabel: root.conflictSize
  67. onSelectedChanged: function() {
  68. model.conflictSelected = itemSelected
  69. }
  70. }
  71. }
  72. }