[gnome-software] Show system apps on the Installed page



commit 6c466e0be4a2493dbaa35eac87b5e0232f1755ca
Author: Kalev Lember <kalevlember gmail com>
Date:   Fri Jun 6 21:11:01 2014 +0200

    Show system apps on the Installed page
    
    This lets people check what apps are installed as part of the system,
    check their version, and move them to different folders if needed.
    
    I've added a new "System Applications" header which should hopefully be
    enough to explain the lack of the Remove button.

 src/gs-plugin-loader.c   |    1 -
 src/gs-shell-installed.c |   24 +++++++++++++++++++++---
 2 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index fbe02f7..f338332 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -993,7 +993,6 @@ gs_plugin_loader_get_installed_thread_cb (GTask *task,
 
        /* filter package list */
        gs_plugin_list_filter (&state->list, gs_plugin_loader_app_is_valid, NULL);
-       gs_plugin_list_filter (&state->list, gs_plugin_loader_app_is_non_system, NULL);
        if (state->list == NULL) {
                g_task_return_new_error (task,
                                         GS_PLUGIN_LOADER_ERROR,
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 3aff1dd..7a07a1f 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -452,6 +452,15 @@ gs_shell_installed_is_addon_id_kind (GsApp *app)
        return TRUE;
 }
 
+static gboolean
+gs_shell_installed_is_system_application (GsApp *app)
+{
+       if (gs_app_get_id_kind (app) == GS_APP_ID_KIND_DESKTOP &&
+           gs_app_get_kind (app) == GS_APP_KIND_SYSTEM)
+               return TRUE;
+       return FALSE;
+}
+
 /**
  * gs_shell_installed_list_header_func
  **/
@@ -468,9 +477,18 @@ gs_shell_installed_list_header_func (GtkListBoxRow *row,
        if (before == NULL)
                return;
 
-       /* desktop -> addons */
-       if (!gs_shell_installed_is_addon_id_kind (gs_app_row_get_app (GS_APP_ROW (before))) &&
-           gs_shell_installed_is_addon_id_kind (gs_app_row_get_app (GS_APP_ROW (row)))) {
+       if (!gs_shell_installed_is_system_application (gs_app_row_get_app (GS_APP_ROW (before))) &&
+           gs_shell_installed_is_system_application (gs_app_row_get_app (GS_APP_ROW (row)))) {
+               /* TRANSLATORS: This is the header dividing the normal
+                * applications and the system ones */
+               header = gtk_label_new (_("System Applications"));
+               g_object_set (header,
+                             "xalign", 0.0,
+                             NULL);
+               context = gtk_widget_get_style_context (header);
+               gtk_style_context_add_class (context, "header-label");
+       } else if (!gs_shell_installed_is_addon_id_kind (gs_app_row_get_app (GS_APP_ROW (before))) &&
+                  gs_shell_installed_is_addon_id_kind (gs_app_row_get_app (GS_APP_ROW (row)))) {
                /* TRANSLATORS: This is the header dividing the normal
                 * applications and the addons */
                header = gtk_label_new (_("Add-ons"));


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