Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/UpdatesPage.qml
Show All 26 Lines | 19 | ResourcesUpdatesModel { | |||
---|---|---|---|---|---|
27 | 27 | | |||
28 | Component.onCompleted: { | 28 | Component.onCompleted: { | ||
29 | if (!isProgressing) { | 29 | if (!isProgressing) { | ||
30 | resourcesUpdatesModel.prepare() | 30 | resourcesUpdatesModel.prepare() | ||
31 | } | 31 | } | ||
32 | } | 32 | } | ||
33 | } | 33 | } | ||
34 | 34 | | |||
35 | contextualActions: [refreshAction] | | |||
36 | | ||||
37 | UpdateModel { | 35 | UpdateModel { | ||
38 | id: updateModel | 36 | id: updateModel | ||
39 | backend: resourcesUpdatesModel | 37 | backend: resourcesUpdatesModel | ||
40 | } | 38 | } | ||
41 | 39 | | |||
42 | Kirigami.Action | 40 | Kirigami.Action | ||
43 | { | 41 | { | ||
44 | id: updateAction | 42 | id: updateAction | ||
Show All 10 Lines | 51 | { | |||
55 | iconName: "dialog-cancel" | 53 | iconName: "dialog-cancel" | ||
56 | text: i18n("Cancel") | 54 | text: i18n("Cancel") | ||
57 | enabled: resourcesUpdatesModel.transaction && resourcesUpdatesModel.transaction.isCancellable | 55 | enabled: resourcesUpdatesModel.transaction && resourcesUpdatesModel.transaction.isCancellable | ||
58 | onTriggered: resourcesUpdatesModel.transaction.cancel() | 56 | onTriggered: resourcesUpdatesModel.transaction.cancel() | ||
59 | } | 57 | } | ||
60 | 58 | | |||
61 | readonly property int unselected: (updateModel.totalUpdatesCount - updateModel.toUpdateCount) | 59 | readonly property int unselected: (updateModel.totalUpdatesCount - updateModel.toUpdateCount) | ||
62 | readonly property QtObject currentAction: resourcesUpdatesModel.isProgressing ? cancelUpdateAction : updateAction | 60 | readonly property QtObject currentAction: resourcesUpdatesModel.isProgressing ? cancelUpdateAction : updateAction | ||
63 | actions.main: currentAction | 61 | actions { | ||
62 | left: refreshAction | ||||
63 | main: currentAction | ||||
64 | } | ||||
64 | 65 | | |||
65 | header: QQC2.ToolBar { | 66 | header: QQC2.ToolBar { | ||
66 | visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates | 67 | visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates | ||
67 | 68 | | |||
68 | RowLayout { | 69 | RowLayout { | ||
69 | anchors.fill: parent | 70 | anchors.fill: parent | ||
70 | LabelBackground { | 71 | LabelBackground { | ||
71 | Layout.leftMargin: Kirigami.Units.gridUnit | 72 | Layout.leftMargin: Kirigami.Units.gridUnit | ||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |