summaryrefslogtreecommitdiff
path: root/shell/cc-panel-loader.c
diff options
context:
space:
mode:
authorMohammed Sadiq <sadiq@sadiqpk.org>2017-06-10 20:38:46 +0530
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2017-07-24 22:54:58 -0300
commit1485b50a7a25fc4353e4cc432c94530d9b03732e (patch)
tree3e5feb052c03f3f02f4070083b6ae989a2765760 /shell/cc-panel-loader.c
parent8b09079f342303f830c4234fe1c4155d4cb7aabc (diff)
downloadgnome-control-center-1485b50a7a25fc4353e4cc432c94530d9b03732e.tar.gz
shell-model: Add hidden settings
Some panels shall be shown only in current design, And some other panels shall be shown only in new Shell design. So let's have a code that would help us do that https://bugzilla.gnome.org/show_bug.cgi?id=779216
Diffstat (limited to 'shell/cc-panel-loader.c')
-rw-r--r--shell/cc-panel-loader.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c
index 9582d80dd..4ed994d3c 100644
--- a/shell/cc-panel-loader.c
+++ b/shell/cc-panel-loader.c
@@ -129,7 +129,9 @@ parse_categories (GDesktopAppInfo *app)
#define const_strv(s) ((const gchar* const*) s)
#ifdef CC_ENABLE_ALT_CATEGORIES
- if (g_strv_contains (const_strv (split), "X-GNOME-ConnectivitySettings"))
+ if (g_strv_contains (const_strv (split), "X-GNOME-AltHidden"))
+ retval = CC_CATEGORY_HIDDEN;
+ else if (g_strv_contains (const_strv (split), "X-GNOME-ConnectivitySettings"))
retval = CC_CATEGORY_CONNECTIVITY;
else if (g_strv_contains (const_strv (split), "X-GNOME-PersonalizationSettings"))
retval = CC_CATEGORY_PERSONALIZATION;
@@ -142,7 +144,9 @@ parse_categories (GDesktopAppInfo *app)
else if (g_strv_contains (const_strv (split), "HardwareSettings"))
retval = CC_CATEGORY_HARDWARE;
#else
- if (g_strv_contains (const_strv (split), "HardwareSettings"))
+ if (g_strv_contains (const_strv (split), "X-GNOME-Hidden"))
+ retval = CC_CATEGORY_HIDDEN;
+ else if (g_strv_contains (const_strv (split), "HardwareSettings"))
retval = CC_CATEGORY_HARDWARE;
else if (g_strv_contains (const_strv (split), "X-GNOME-PersonalSettings"))
retval = CC_CATEGORY_PERSONAL;
@@ -189,7 +193,12 @@ cc_panel_loader_fill_model (CcShellModel *model)
if (G_UNLIKELY (category < 0))
continue;
- cc_shell_model_add_item (model, category, G_APP_INFO (app), all_panels[i].name);
+ /* Only add the panel when it is not hidden, e.g. the Details subpanels
+ * that are only visible in the new Shell.
+ */
+ if (category != CC_CATEGORY_HIDDEN)
+ cc_shell_model_add_item (model, category, G_APP_INFO (app), all_panels[i].name);
+
g_object_unref (app);
}
}