[gnome-software/mwleeds/hardcoded-pwa-list] fixup! Allow web apps to be in UNAVAILABLE state



commit 486681d96833f0eb1982d65040513636fc50beb5
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Mon May 16 13:29:21 2022 -0700

    fixup! Allow web apps to be in UNAVAILABLE state

 plugins/epiphany/gs-plugin-epiphany.c | 5 ++++-
 src/gs-app-row.c                      | 7 ++-----
 src/gs-details-page.c                 | 4 +---
 3 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/plugins/epiphany/gs-plugin-epiphany.c b/plugins/epiphany/gs-plugin-epiphany.c
index 0a2e68978..9a04d0648 100644
--- a/plugins/epiphany/gs-plugin-epiphany.c
+++ b/plugins/epiphany/gs-plugin-epiphany.c
@@ -367,8 +367,11 @@ gs_epiphany_refine_app_state (GsPlugin *plugin,
                        gs_app_set_state (app, gs_app_get_state (cached_app));
                else if (appstream_source)
                        gs_app_set_state (app, GS_APP_STATE_AVAILABLE);
-               else
+               else {
                        gs_app_set_state (app, GS_APP_STATE_UNAVAILABLE);
+                       gs_app_set_url_missing (app,
+                                               
"https://gitlab.gnome.org/GNOME/gnome-software/-/wikis/How-to-reinstall-a-web-app";);
+               }
        }
 }
 
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 2d110b441..e9ec818af 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -140,16 +140,13 @@ gs_app_row_refresh_button (GsAppRow *app_row, gboolean missing_search_result)
        /* label */
        switch (gs_app_get_state (priv->app)) {
        case GS_APP_STATE_UNAVAILABLE:
-               if (gs_app_get_kind (priv->app) == AS_COMPONENT_KIND_WEB_APP) {
-                       gtk_widget_set_visible (priv->button, FALSE);
-               } else if (missing_search_result) {
-                       gtk_widget_set_visible (priv->button, TRUE);
+               gtk_widget_set_visible (priv->button, TRUE);
+               if (missing_search_result) {
                        /* TRANSLATORS: this is a button next to the search results that
                         * allows the application to be easily installed */
                        gs_progress_button_set_label (GS_PROGRESS_BUTTON (priv->button), _("Visit Website"));
                        gs_progress_button_set_icon_name (GS_PROGRESS_BUTTON (priv->button), NULL);
                } else {
-                       gtk_widget_set_visible (priv->button, TRUE);
                        /* TRANSLATORS: this is a button next to the search results that
                         * allows the application to be easily installed.
                         * The ellipsis indicates that further steps are required */
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 8cce632cb..4a9b4361a 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -848,9 +848,7 @@ gs_details_page_refresh_buttons (GsDetailsPage *self)
                }
                break;
        case GS_APP_STATE_UNAVAILABLE:
-               if (gs_app_get_kind (self->app) == AS_COMPONENT_KIND_WEB_APP) {
-                       gtk_widget_set_visible (self->button_install, FALSE);
-               } else if (gs_app_get_url_missing (self->app) != NULL) {
+               if (gs_app_get_url_missing (self->app) != NULL) {
                        gtk_widget_set_visible (self->button_install, FALSE);
                } else {
                        gtk_widget_set_visible (self->button_install, TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]