Commit 676f354e authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Show a less encouraging title on our UI when app state is being fetched

So far we were displaying them as disabled but uninstalled. This is
somewhat confusing in some cases, especially for openSUSE users where
this process takes a while.

BUG: 411397
parent 443da354
......@@ -249,7 +249,7 @@ DiscoverPage {
}
Button {
visible: reviewsModel.backend && reviewsModel.backend.isResourceSupported(appInfo.application)
visible: appbutton.isStateAvailable && reviewsModel.backend && reviewsModel.backend.isResourceSupported(appInfo.application)
enabled: appInfo.application.isInstalled
text: appInfo.application.isInstalled ? i18n("Write a Review") : i18n("Install to Write a Review")
......
......@@ -15,8 +15,12 @@ ConditionalLoader
readonly property alias isActive: listener.isActive
readonly property alias progress: listener.progress
readonly property bool isStateAvailable: application.state !== AbstractResource.Broken
readonly property alias listener: listener
readonly property string text: {
if (!root.isStateAvailable) {
return i18nc("State being fetched", "Loading...")
}
if (!application.isInstalled) {
// Must be from a non-default backend; tell the user where it's from
if (backendName.length !== 0) {
......@@ -37,7 +41,7 @@ ConditionalLoader
name: application.isInstalled ? "edit-delete" : "download"
color: !enabled ? Kirigami.Theme.backgroundColor : !listener.isActive ? (application.isInstalled ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor) : Kirigami.Theme.backgroundColor
}
enabled: !listener.isActive && application.state !== AbstractResource.Broken
enabled: !listener.isActive && root.isStateAvailable
onTriggered: root.click()
}
readonly property Kirigami.Action cancelAction: Kirigami.Action {
......
Supports Markdown
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