Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/UpdatesPage.qml
Show All 39 Lines | 39 | { | |||
---|---|---|---|---|---|
40 | id: updateAction | 40 | id: updateAction | ||
41 | text: page.unselected>0 ? i18n("Update Selected") : i18n("Update All") | 41 | text: page.unselected>0 ? i18n("Update Selected") : i18n("Update All") | ||
42 | visible: updateModel.toUpdateCount | 42 | visible: updateModel.toUpdateCount | ||
43 | iconName: "update-none" | 43 | iconName: "update-none" | ||
44 | enabled: !resourcesUpdatesModel.isProgressing && !ResourcesModel.isFetching | 44 | enabled: !resourcesUpdatesModel.isProgressing && !ResourcesModel.isFetching | ||
45 | onTriggered: resourcesUpdatesModel.updateAll() | 45 | onTriggered: resourcesUpdatesModel.updateAll() | ||
46 | } | 46 | } | ||
47 | 47 | | |||
48 | BusyIndicator { | ||||
49 | id: indicator | ||||
50 | anchors.centerIn: parent | ||||
51 | width: Kirigami.Units.gridUnit * 8 | ||||
52 | height: width | ||||
53 | visible: page.isBusy | ||||
54 | } | ||||
55 | | ||||
48 | footer: ScrollView { | 56 | footer: ScrollView { | ||
49 | id: scv | 57 | id: scv | ||
50 | width: parent.width | 58 | width: parent.width | ||
51 | height: visible ? Kirigami.Units.gridUnit * 10 : 0 | 59 | height: visible ? Kirigami.Units.gridUnit * 10 : 0 | ||
52 | visible: log.contents.length > 0 | 60 | visible: log.contents.length > 0 | ||
53 | TextArea { | 61 | TextArea { | ||
54 | readOnly: true | 62 | readOnly: true | ||
55 | text: log.contents | 63 | text: log.contents | ||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 138 | footer: ColumnLayout { | |||
132 | anchors.left: parent.left | 140 | anchors.left: parent.left | ||
133 | Kirigami.Heading { | 141 | Kirigami.Heading { | ||
134 | Layout.fillWidth: true | 142 | Layout.fillWidth: true | ||
135 | Layout.alignment: Qt.AlignHCenter | 143 | Layout.alignment: Qt.AlignHCenter | ||
136 | horizontalAlignment: Text.AlignHCenter | 144 | horizontalAlignment: Text.AlignHCenter | ||
137 | visible: page.footerLabel !== "" | 145 | visible: page.footerLabel !== "" | ||
138 | text: page.footerLabel | 146 | text: page.footerLabel | ||
139 | } | 147 | } | ||
140 | BusyIndicator { | | |||
141 | id: indicator | | |||
142 | Layout.alignment: Qt.AlignHCenter | | |||
143 | Layout.preferredWidth: Kirigami.Units.gridUnit * 12 | | |||
144 | Layout.preferredHeight: Layout.preferredWidth | | |||
145 | visible: page.isBusy | | |||
146 | } | | |||
147 | Kirigami.Icon { | 148 | Kirigami.Icon { | ||
148 | Layout.alignment: Qt.AlignHCenter | 149 | Layout.alignment: Qt.AlignHCenter | ||
149 | visible: !indicator.visible && page.footerLabel !== "" | 150 | visible: !indicator.visible && page.footerLabel !== "" | ||
150 | source: "update-none" | 151 | source: "update-none" | ||
151 | opacity: 0.3 | 152 | opacity: 0.3 | ||
152 | width: Kirigami.Units.gridUnit * 12 | 153 | width: Kirigami.Units.gridUnit * 12 | ||
153 | height: width | 154 | height: width | ||
154 | } | 155 | } | ||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | 309 | state: ( resourcesUpdatesModel.isProgressing ? "progressing" | |||
314 | : secSinceUpdate < 1000 * 60 * 60 * 24 ? "uptodate" | 315 | : secSinceUpdate < 1000 * 60 * 60 * 24 ? "uptodate" | ||
315 | : secSinceUpdate < 1000 * 60 * 60 * 24 * 7 ? "medium" | 316 | : secSinceUpdate < 1000 * 60 * 60 * 24 * 7 ? "medium" | ||
316 | : "low" | 317 | : "low" | ||
317 | ) | 318 | ) | ||
318 | 319 | | |||
319 | states: [ | 320 | states: [ | ||
320 | State { | 321 | State { | ||
321 | name: "fetching" | 322 | name: "fetching" | ||
322 | PropertyChanges { target: page; footerLabel: i18nc("@info", "Fetching Updates...") } | | |||
323 | PropertyChanges { target: page; isBusy: true } | 323 | PropertyChanges { target: page; isBusy: true } | ||
324 | }, | 324 | }, | ||
325 | State { | 325 | State { | ||
326 | name: "progressing" | 326 | name: "progressing" | ||
327 | PropertyChanges { target: page; supportsRefreshing: false } | 327 | PropertyChanges { target: page; supportsRefreshing: false } | ||
328 | PropertyChanges { target: page.actions; main: cancelUpdateAction } | 328 | PropertyChanges { target: page.actions; main: cancelUpdateAction } | ||
329 | }, | 329 | }, | ||
330 | State { | 330 | State { | ||
Show All 36 Lines |