-
Notifications
You must be signed in to change notification settings - Fork 950
Expand file tree
/
Copy pathResolveConflictsDialog.qml
More file actions
167 lines (130 loc) · 4.44 KB
/
ResolveConflictsDialog.qml
File metadata and controls
167 lines (130 loc) · 4.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQml
import QtQuick
import QtQuick.Window as QtWindow
import QtQuick.Layouts
import QtQuick.Controls
import QtQml.Models
import com.nextcloud.desktopclient
import "./tray"
ApplicationWindow {
id: conflictsDialog
required property var allConflicts
flags: Qt.Window | Qt.Dialog
visible: true
LayoutMirroring.enabled: Application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
width: Style.minimumWidthResolveConflictsDialog
height: Style.minimumHeightResolveConflictsDialog
minimumWidth: Style.minimumWidthResolveConflictsDialog
minimumHeight: Style.minimumHeightResolveConflictsDialog
title: qsTr('Solve sync conflicts')
onClosing: function(close) {
Systray.destroyDialog(self);
close.accepted = true
}
ColumnLayout {
anchors.fill: parent
anchors.leftMargin: 10
anchors.rightMargin: 10
anchors.bottomMargin: 5
anchors.topMargin: 10
spacing: 15
z: 2
EnforcedPlainTextLabel {
text: qsTr("%1 files in conflict", 'indicate the number of conflicts to resolve', delegateModel.count).arg(delegateModel.count)
font.bold: true
font.pixelSize: Style.bigFontPixelSizeResolveConflictsDialog
Layout.fillWidth: true
}
EnforcedPlainTextLabel {
text: qsTr("Choose if you want to keep the local version, server version, or both. If you choose both, the local file will have a number added to its name.")
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.pixelSize: Style.fontPixelSizeResolveConflictsDialog
Layout.fillWidth: true
Layout.topMargin: -15
}
RowLayout {
Layout.fillWidth: true
Layout.topMargin: 5
CheckBox {
id: selectExisting
Layout.fillWidth: true
text: qsTr('All local versions')
leftPadding: 0
implicitWidth: 100
font.pixelSize: Style.fontPixelSizeResolveConflictsDialog
checked: realModel.allConflictingSelected
onToggled: function() {
realModel.selectAllConflicting(checked)
}
}
CheckBox {
id: selectConflict
Layout.fillWidth: true
text: qsTr('All server versions')
leftPadding: 0
implicitWidth: 100
font.pixelSize: Style.fontPixelSizeResolveConflictsDialog
checked: realModel.allExistingsSelected
onToggled: function() {
realModel.selectAllExisting(checked)
}
}
}
Rectangle {
Layout.fillWidth: true
Layout.leftMargin: 5
Layout.rightMargin: 5
color: palette.dark
height: 1
}
SyncConflictsModel {
id: realModel
conflictActivities: conflictsDialog.allConflicts
}
ScrollView {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ListView {
id: conflictListView
model: DelegateModel {
id: delegateModel
model: realModel
delegate: ConflictDelegate {
width: conflictListView.contentItem.width
height: 100
}
}
}
}
DialogButtonBox {
Layout.fillWidth: true
Button {
text: qsTr("Resolve conflicts")
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
}
Button {
text: qsTr("Cancel")
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
}
onAccepted: function() {
realModel.applySolution()
Systray.destroyDialog(conflictsDialog)
}
onRejected: function() {
Systray.destroyDialog(conflictsDialog)
}
}
}
Rectangle {
color: palette.base
anchors.fill: parent
z: 1
}
}