Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/UpdatesPage.qml
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | 10 | { | |||
---|---|---|---|---|---|
108 | 108 | | |||
109 | readonly property int unselected: (updateModel.totalUpdatesCount - updateModel.toUpdateCount) | 109 | readonly property int unselected: (updateModel.totalUpdatesCount - updateModel.toUpdateCount) | ||
110 | 110 | | |||
111 | header: ToolBar { | 111 | header: ToolBar { | ||
112 | Kirigami.Theme.colorSet: Kirigami.Theme.Button | 112 | Kirigami.Theme.colorSet: Kirigami.Theme.Button | ||
113 | Kirigami.Theme.inherit: false | 113 | Kirigami.Theme.inherit: false | ||
114 | visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates | 114 | visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates | ||
115 | 115 | | |||
116 | RowLayout { | | |||
117 | anchors.fill: parent | | |||
118 | enabled: updateAction.enabled | | |||
119 | | ||||
120 | CheckBox { | 116 | CheckBox { | ||
121 | Layout.leftMargin: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing | 117 | Layout.leftMargin: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing | ||
122 | enabled: !resourcesUpdatesModel.isProgressing && !ResourcesModel.isFetching | 118 | Layout.fillWidth: true | ||
119 | text: page.unselected === 0 ? i18n("All updates selected (%1)", updateModel.updateSize) : i18np("%1/%2 update selected (%3)", "%1/%2 updates selected (%3)", updateModel.toUpdateCount, updateModel.totalUpdatesCount, updateModel.updateSize) | ||||
120 | enabled: updateAction.enabled && !resourcesUpdatesModel.isProgressing && !ResourcesModel.isFetching | ||||
123 | tristate: true | 121 | tristate: true | ||
124 | checkState: updateModel.toUpdateCount === 0 ? Qt.Unchecked | 122 | checkState: updateModel.toUpdateCount === 0 ? Qt.Unchecked | ||
125 | : updateModel.toUpdateCount === updateModel.totalUpdatesCount ? Qt.Checked | 123 | : updateModel.toUpdateCount === updateModel.totalUpdatesCount ? Qt.Checked | ||
126 | : Qt.PartiallyChecked | 124 | : Qt.PartiallyChecked | ||
127 | 125 | | |||
128 | onClicked: { | 126 | onClicked: { | ||
129 | if (updateModel.toUpdateCount === 0) | 127 | if (updateModel.toUpdateCount === 0) | ||
130 | updateModel.checkAll() | 128 | updateModel.checkAll() | ||
131 | else | 129 | else | ||
132 | updateModel.uncheckAll() | 130 | updateModel.uncheckAll() | ||
133 | } | 131 | } | ||
134 | } | 132 | } | ||
135 | | ||||
136 | Label { | | |||
137 | Layout.fillWidth: true | | |||
138 | text: page.unselected === 0 ? i18n("All updates selected (%1)", updateModel.updateSize) : i18np("%1/%2 update selected (%3)", "%1/%2 updates selected (%3)", updateModel.toUpdateCount, updateModel.totalUpdatesCount, updateModel.updateSize) | | |||
139 | elide: Text.ElideRight | | |||
140 | } | | |||
141 | } | | |||
142 | } | 133 | } | ||
143 | 134 | | |||
144 | supportsRefreshing: true | 135 | supportsRefreshing: true | ||
145 | onRefreshingChanged: { | 136 | onRefreshingChanged: { | ||
146 | ResourcesModel.updateAction.triggered() | 137 | ResourcesModel.updateAction.triggered() | ||
147 | refreshing = false | 138 | refreshing = false | ||
148 | } | 139 | } | ||
149 | 140 | | |||
▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines |