Accepting request 555206 from GNOME:Factory

- Drop gnome-control-center-allow-extra-tools-in-shell.patch and
  gnome-control-center-add-alacarte-for-sle.patch: The new UI
  doesn't have a main window with all icons any more (bsc#1071214). (forwarded request 554961 from zhangxiaofei)

OBS-URL: https://build.opensuse.org/request/show/555206
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gnome-control-center?expand=0&rev=161
This commit is contained in:
Dominique Leuenberger 2017-12-09 19:26:22 +00:00 committed by Git OBS Bridge
commit c59dfe4985
4 changed files with 7 additions and 167 deletions

View File

@ -1,24 +0,0 @@
From df1f2a24bc6d8ff3be90e4c7d810fe13bdce8780 Mon Sep 17 00:00:00 2001
From: Felix Zhang <fezhang@suse.com>
Date: Sun, 4 Sep 2016 00:08:10 +0800
Subject: [PATCH] add alacarte for sle
---
shell/cc-panel-loader.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c
index e24fc6e..011da0e 100644
--- a/shell/cc-panel-loader.c
+++ b/shell/cc-panel-loader.c
@@ -102,6 +102,7 @@ static struct {
#ifdef BUILD_WACOM
PANEL_TYPE("wacom", cc_wacom_panel_get_type ),
#endif
+ PANEL_TYPE("alacarte", NULL ),
PANEL_TYPE("ca.desrt.dconf-editor", NULL ),
PANEL_TYPE("gnome-tweak-tool", NULL ),
PANEL_TYPE("gpk-prefs", NULL ),
--
2.6.6

View File

@ -1,137 +0,0 @@
diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c
index fc235fe..816cd1c 100644
--- a/shell/cc-panel-loader.c
+++ b/shell/cc-panel-loader.c
@@ -106,6 +106,12 @@ static struct {
#ifdef BUILD_WACOM
PANEL_TYPE("wacom", cc_wacom_panel_get_type ),
#endif
+ PANEL_TYPE("ca.desrt.dconf-editor", NULL ),
+ PANEL_TYPE("gnome-tweak-tool", NULL ),
+ PANEL_TYPE("gpk-prefs", NULL ),
+ PANEL_TYPE("itweb-settings", NULL ),
+ PANEL_TYPE("tracker-preferences", NULL ),
+ PANEL_TYPE("YaST", NULL ),
};
GList *
@@ -139,7 +145,8 @@ parse_categories (GDesktopAppInfo *app)
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"))
+ else if (g_strv_contains (const_strv (split), "X-GNOME-PersonalSettings")
+ || g_strv_contains (const_strv (split), "X-GNOME-DesktopSettings"))
retval = CC_CATEGORY_PERSONAL;
else if (g_strv_contains (const_strv (split), "X-GNOME-SystemSettings"))
retval = CC_CATEGORY_SYSTEM;
@@ -148,7 +155,8 @@ parse_categories (GDesktopAppInfo *app)
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"))
+ else if (g_strv_contains (const_strv (split), "X-GNOME-PersonalizationSettings")
+ || g_strv_contains (const_strv (split), "X-GNOME-DesktopSettings"))
retval = CC_CATEGORY_PERSONALIZATION;
else if (g_strv_contains (const_strv (split), "X-GNOME-AccountSettings"))
retval = CC_CATEGORY_ACCOUNT;
@@ -181,15 +189,31 @@ cc_panel_loader_fill_model (CcShellModel *model)
{
g_autoptr (GDesktopAppInfo) app;
g_autofree gchar *desktop_name = NULL;
+ g_autofree gchar *name = NULL;
gint category;
+#ifndef CC_PANEL_LOADER_NO_GTYPES
+ if (all_panels[i].get_type == NULL)
+ {
+ desktop_name = g_strconcat (all_panels[i].name,
+ ".desktop", NULL);
+ name = g_strconcat ("suse-",all_panels[i].name, NULL);
+ }
+ else
+#endif
+ {
desktop_name = g_strconcat ("gnome-", all_panels[i].name,
"-panel.desktop", NULL);
+ name = g_strconcat (all_panels[i].name, NULL);
+ }
app = g_desktop_app_info_new (desktop_name);
if (!app)
{
+ if (!g_str_has_prefix(name, "suse-"))
+ {
g_warning ("Ignoring broken panel %s (missing desktop file)", all_panels[i].name);
+ }
continue;
}
@@ -201,7 +225,7 @@ cc_panel_loader_fill_model (CcShellModel *model)
* 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);
+ cc_shell_model_add_item (model, category, G_APP_INFO (app), name);
}
}
diff --git a/shell/cc-window.c b/shell/cc-window.c
index 9f29c55..3be0d4e 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -114,6 +114,41 @@ get_icon_name_from_g_icon (GIcon *gicon)
return NULL;
}
+static void
+suse_activate_desktop (const gchar *id)
+{
+ GDesktopAppInfo *appinfo;
+ const gchar *desktop_file;
+ GdkScreen *screen;
+ GdkDisplay *display;
+ GdkAppLaunchContext *context;
+ GError *error;
+
+ desktop_file = g_strconcat ("/usr/share/applications/", id,
+ ".desktop", NULL);
+ appinfo = g_desktop_app_info_new_from_filename (desktop_file);
+ if (appinfo == NULL)
+ return;
+
+ screen = gdk_screen_get_default();
+ display = gdk_screen_get_display (screen);
+ context = gdk_display_get_app_launch_context (display);
+ gdk_app_launch_context_set_screen (context, screen);
+ gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
+
+ error = NULL;
+ g_app_info_launch_uris (G_APP_INFO (appinfo), NULL,
+ (GAppLaunchContext *) context,
+ &error);
+ if (error) {
+ g_printerr ("Could not launch '%s': %s\n", id, error->message);
+ g_clear_error (&error);
+ }
+
+ g_object_unref (context);
+ g_object_unref (appinfo);
+}
+
static gboolean
activate_panel (CcWindow *self,
const gchar *id,
@@ -126,6 +161,12 @@ activate_panel (CcWindow *self,
if (!id)
return FALSE;
+ if (g_str_has_prefix(id, "suse-"))
+ {
+ /* we strip suse- prefix from the id we got to retrieve .desktop on disk */
+ suse_activate_desktop (id+strlen("suse-"));
+ return FALSE;
+ }
self->current_panel = GTK_WIDGET (cc_panel_loader_load_by_name (CC_SHELL (self), id, parameters));
cc_shell_set_active_panel (CC_SHELL (self), CC_PANEL (self->current_panel));

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Dec 7 10:01:26 UTC 2017 - fezhang@suse.com
- Drop gnome-control-center-allow-extra-tools-in-shell.patch and
gnome-control-center-add-alacarte-for-sle.patch: The new UI
doesn't have a main window with all icons any more (bsc#1071214).
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Nov 1 18:39:45 UTC 2017 - dimstar@opensuse.org Wed Nov 1 18:39:45 UTC 2017 - dimstar@opensuse.org

View File

@ -44,10 +44,6 @@ Patch3: control-center-network-add-domain-suffix-match.patch
### SLE only patches get 1000 or more as number. ### SLE only patches get 1000 or more as number.
# PATCH-FEATURE-SLE gnome-control-center-allow-extra-tools-in-shell.patch fezhang@suse.com -- Add dconf-editor, gnome-tweak-tool, pkg-prefs, itweb-settings, tracker-preferences and Yast to g-c-c.
Patch1000: gnome-control-center-allow-extra-tools-in-shell.patch
# PATCH-FEATURE-SLE gnome-control-center-add-alacarte-for-sle.patch badshah400@gmail.com -- Add back alacarte for SLE since they require it for their classic mode, on the other hand for TW and other openSUSE versions it should be enough that alacarte is still available from shell overview, just not in the g-c-c shell. This patch must be applied only if required and then immediately after gnome-control-center-allow-extra-tools-in-shell.patch
Patch1001: gnome-control-center-add-alacarte-for-sle.patch
# PATCH-FEATURE-SLE gnome-control-center-890979-change-remote-passwd.patch bnc#890979 dliang@suse.com -- user: Enable remote user to change password in user panel # PATCH-FEATURE-SLE gnome-control-center-890979-change-remote-passwd.patch bnc#890979 dliang@suse.com -- user: Enable remote user to change password in user panel
Patch1002: gnome-control-center-890979-change-remote-passwd.patch Patch1002: gnome-control-center-890979-change-remote-passwd.patch
# PATCH-FEATURE-SLE gnome-control-center-info-never-use-gnome-software.patch bsc#999336 fezhang@suse.com -- info: Never search for gnome-software as an option when checking for updates on SLE and Leap 42.2, because we use gpk-update-viewer. # PATCH-FEATURE-SLE gnome-control-center-info-never-use-gnome-software.patch bsc#999336 fezhang@suse.com -- info: Never search for gnome-software as an option when checking for updates on SLE and Leap 42.2, because we use gpk-update-viewer.
@ -204,8 +200,6 @@ GNOME control center.
# SLE only patches 1000+ # SLE only patches 1000+
%if !0%{?is_opensuse} %if !0%{?is_opensuse}
translation-update-upstream translation-update-upstream
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1 %patch1002 -p1
%patch1003 -p1 %patch1003 -p1
%patch1004 -p1 %patch1004 -p1