Commit 95c39a6f authored by Nate Graham's avatar Nate Graham 🔩

Improve update states' UI

Summary:
- Add a busy indicator when something is refreshing or checking
- Update strings to be a bit more user-friendly
- Don't change the Update page's title; status is adequately indicated by the footer text already

BUG: 402897
CCBUG: 396140
FIXED-IN: 5.16.0

Test Plan:
For example:
{F6698086, size=full}

Reviewers: apol, #vdg, #discover_software_store

Reviewed By: apol, #discover_software_store

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D19825
parent d35df725
......@@ -69,7 +69,7 @@ Kirigami.ApplicationWindow
TopLevelPageData {
id: updateAction
iconName: ResourcesModel.updatesCount>0 ? ResourcesModel.hasSecurityUpdates ? "update-high" : "update-low" : "update-none"
text: ResourcesModel.updatesCount<=0 ? (ResourcesModel.isFetching ? i18n("Checking for updates...") : i18n("No Updates") ) : i18nc("Update section name", "Update (%1)", ResourcesModel.updatesCount)
text: ResourcesModel.updatesCount<=0 ? (ResourcesModel.isFetching ? i18n("Fetching Updates...") : i18n("Up to Date") ) : i18nc("Update section name", "Update (%1)", ResourcesModel.updatesCount)
component: topUpdateComp
objectName: "update"
}
......
......@@ -12,6 +12,7 @@ DiscoverPage
title: i18n("Updates")
property string footerLabel: ""
property bool isBusy: false
ResourcesUpdatesModel {
id: resourcesUpdatesModel
......@@ -141,9 +142,18 @@ DiscoverPage
visible: page.footerLabel !== ""
text: page.footerLabel
}
BusyIndicator {
id: indicator
Layout.alignment: Qt.AlignHCenter
Layout.minimumWidth: Kirigami.Units.gridUnit * 12
Layout.maximumWidth: Layout.minimumWidth
Layout.minimumHeight: Layout.minimumWidth
Layout.maximumHeight: Layout.minimumHeight
visible: page.isBusy
}
Kirigami.Icon {
Layout.alignment: Qt.AlignHCenter
visible: page.footerLabel !== ""
visible: !indicator.visible && page.footerLabel !== ""
source: "update-none"
opacity: 0.3
width: Kirigami.Units.gridUnit * 12
......@@ -307,14 +317,14 @@ DiscoverPage
states: [
State {
name: "fetching"
PropertyChanges { target: page; title: i18nc("@info", "Fetching...") }
PropertyChanges { target: page; footerLabel: i18nc("@info", "Checking for updates...") }
PropertyChanges { target: page; footerLabel: i18nc("@info", "Fetching updates...") }
PropertyChanges { target: page; isBusy: true }
},
State {
name: "progressing"
PropertyChanges { target: page; title: i18nc("@info", "Updating...") }
PropertyChanges { target: page; supportsRefreshing: false }
PropertyChanges { target: page; footerLabel: resourcesUpdatesModel.progress<=0 ? i18nc("@info", "Fetching updates") : "" }
PropertyChanges { target: page; footerLabel: resourcesUpdatesModel.progress<=0 ? i18nc("@info", "Fetching updates...") : "" }
PropertyChanges { target: page; isBusy: true }
},
State {
name: "has-updates"
......@@ -322,22 +332,19 @@ DiscoverPage
},
State {
name: "reboot"
PropertyChanges { target: page; title: i18nc("@info", "The system requires a restart") }
PropertyChanges { target: page; footerLabel: i18nc("@info", "Restart") }
PropertyChanges { target: page; footerLabel: i18nc("@info", "The system requires a restart") }
},
State {
name: "now-uptodate"
PropertyChanges { target: page; title: i18nc("@info", "The system is up to date") }
PropertyChanges { target: page; footerLabel: i18nc("@info", "No updates") }
PropertyChanges { target: page; footerLabel: i18nc("@info", "Up to date") }
},
State {
name: "uptodate"
PropertyChanges { target: page; title: i18nc("@info", "The system is up to date") }
PropertyChanges { target: page; footerLabel: i18nc("@info", "No updates") }
PropertyChanges { target: page; footerLabel: i18nc("@info", "Up to date") }
},
State {
name: "medium"
PropertyChanges { target: page; title: i18nc("@info", "No updates are available") }
PropertyChanges { target: page; title: i18nc("@info", "Up to date") }
},
State {
name: "low"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment