61
61
Component.onCompleted: internal.connectToDownloadObject()
62
62
onDownloadManagerChanged: internal.connectToDownloadObject()
67
verticalCenter: parent.verticalCenter
69
leftMargin: units.gu(2)
71
rightMargin: units.gu(2)
68
SlotsLayout.position: SlotsLayout.Leading
78
anchors.verticalCenter: parent.verticalCenter
79
anchors.verticalCenterOffset: downloadDelegate.incomplete ? -units.gu(1) : 0
86
76
fillMode: Image.PreserveAspectFit
87
sourceSize.width: parent.width
88
sourceSize.height: parent.height
89
anchors.verticalCenter: parent.verticalCenter
77
sourceSize.width: width
78
sourceSize.height: height
95
83
anchors.fill: parent
96
84
anchors.margins: units.gu(0.2)
97
source: "image://theme/%1".arg(name != "" ? name : "save")
85
source: "image://theme/%1".arg(downloadDelegate.icon || "save")
98
86
visible: thumbimage.status !== Image.Ready
105
anchors.top: iconContainer.top
106
anchors.left: iconContainer.right
107
anchors.leftMargin: units.gu(2)
108
anchors.right: parent.right
112
width: parent.width - cancelColumn.width
113
height: parent.height
119
elide: Text.ElideRight
127
elide: Text.ElideRight
132
height: error.visible ? units.gu(1) : units.gu(2)
134
visible: downloadDelegate.incomplete
139
visible: incomplete && download === undefined || errorMessage !== ""
147
anchors.verticalCenter: parent.verticalCenter
148
name: "dialog-warning-symbolic"
149
color: theme.palette.normal.negative
153
width: parent.width - errorIcon.width
154
anchors.left: errorIcon.right
155
anchors.leftMargin: units.gu(1)
156
anchors.verticalCenter: errorIcon.verticalCenter
158
color: theme.palette.normal.negative
159
text: errorMessage !== "" ? errorMessage
160
: (incomplete && download === undefined) ? i18n.tr("Download failed")
162
elide: Text.ElideRight
166
IndeterminateProgressBar {
169
height: units.gu(0.5)
170
visible: downloadDelegate.incomplete && !error.visible
171
progress: downloadDelegate.progress
172
// Work around UDM bug #1450144
173
indeterminateProgress: downloadDelegate.progress < 0 || downloadDelegate.progress > 100
180
anchors.top: detailsColumn.top
181
anchors.left: detailsColumn.right
182
anchors.leftMargin: units.gu(2)
183
width: downloadDelegate.incomplete && !error.visible ? cancelButton.width + units.gu(2) : 0
186
visible: downloadDelegate.incomplete && !error.visible
188
text: i18n.tr("Cancel")
198
visible: !progressBar.indeterminateProgress && downloadDelegate.incomplete
200
&& !downloadDelegate.paused
201
width: cancelButton.width
202
horizontalAlignment: Text.AlignHCenter
204
text: progressBar.progress + "%"
208
visible: downloadDelegate.paused
209
text: i18n.tr("Resume")
210
width: cancelButton.width
96
elide: Text.ElideRight
107
elide: Text.ElideRight
115
height: error.visible ? units.gu(1) : units.gu(2)
125
visible: (incomplete && (download === undefined)) || errorMessage
136
anchors.verticalCenter: parent.verticalCenter
137
name: "dialog-warning-symbolic"
138
color: theme.palette.normal.negative
143
left: errorIcon.right
144
leftMargin: units.gu(1)
146
verticalCenter: parent.verticalCenter
149
color: theme.palette.normal.negative
150
text: errorMessage ||
151
((incomplete && download === undefined) ? i18n.tr("Download failed") : "")
152
elide: Text.ElideRight
156
IndeterminateProgressBar {
162
height: units.gu(0.5)
163
visible: incomplete && !error.visible
164
progress: downloadDelegate.progress
165
// Work around UDM bug #1450144
166
indeterminateProgress: progress < 0 || progress > 100
171
SlotsLayout.position: SlotsLayout.Trailing
173
width: (incomplete && !error.visible) ? cancelButton.width : 0
177
visible: incomplete && !error.visible
178
text: i18n.tr("Cancel")
188
visible: !progressBar.indeterminateProgress && incomplete
189
&& !error.visible && !paused
190
width: cancelButton.width
191
horizontalAlignment: Text.AlignHCenter
193
// TRANSLATORS: %1 is the percentage of the download completed so far
194
text: i18n.tr("%1%").arg(progressBar.progress)
199
text: i18n.tr("Resume")
200
width: cancelButton.width