1
From c701d94542173056de5056b44ab8353d5ec3df6d Mon Sep 17 00:00:00 2001
2
From: Lionel Le Folgoc <lionel@lefolgoc.net>
3
Date: Fri, 1 Apr 2011 20:12:06 +0200
4
Subject: Improve vendor support for the default panel config
6
In addition to /etc/xdg/xfce4/panel/default.xml, search for
7
"xfce4/panel/default.xml" in XDG_CONFIG_DIRS. If the file found is not the
8
default upstream one (e.g. /etc/xdg/xdg-xubuntu/xfce4/panel/default.xml instead
9
of /etc/xdg/xfce4/panel/default.xml), and if there is no old 4.6 config to
10
migrate, then do not display the config migration dialog, but directly apply
11
the vendor setting found.
13
Bug-Ubuntu: https://bugs.launchpad.net/bugs/747137
16
migrate/main.c | 17 ++++++++++++++---
17
1 files changed, 14 insertions(+), 3 deletions(-)
19
diff --git a/migrate/main.c b/migrate/main.c
20
index 0893d0a..492818b 100644
25
main (gint argc, gchar **argv)
28
+ gchar *file, *default_file;
32
@@ -73,6 +73,15 @@ main (gint argc, gchar **argv)
33
/* lookup the old 4.6 config file */
34
file = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, XFCE_46_CONFIG);
36
+ /* lookup the new default config file */
37
+ if (!(default_file = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, "xfce4/panel/default.xml")))
38
+ default_file = g_strdup (DEFAULT_CONFIG);
39
+ /* if this default file isn't the upstream one, then it comes from the vendor
40
+ (xubuntu-default-settings, or linaro-default-settings, or else…), so skip
41
+ the dialog and apply it directly, when there's no old 4.6 config to migrate. */
42
+ if (g_strcmp0 (DEFAULT_CONFIG, default_file) && !file)
43
+ goto apply_vendor_settings;
45
/* create question dialog */
46
dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
47
_("Welcome to the first start of the panel"));
48
@@ -94,7 +103,7 @@ main (gint argc, gchar **argv)
50
button = gtk_dialog_add_button (GTK_DIALOG (dialog), _("Use default config"), GTK_RESPONSE_YES);
51
gtk_widget_set_tooltip_text (button, _("Load the default configuration"));
52
- default_config_exists = g_file_test (DEFAULT_CONFIG, G_FILE_TEST_IS_REGULAR);
53
+ default_config_exists = g_file_test (default_file, G_FILE_TEST_IS_REGULAR);
54
gtk_widget_set_sensitive (button, default_config_exists);
55
if (default_config_exists && file == NULL)
56
default_response = GTK_RESPONSE_YES;
57
@@ -119,8 +128,9 @@ main (gint argc, gchar **argv)
59
else if (result == GTK_RESPONSE_YES && default_config_exists)
61
+apply_vendor_settings:
62
/* apply default config */
63
- if (!migrate_default (DEFAULT_CONFIG, &error))
64
+ if (!migrate_default (default_file, &error))
66
xfce_dialog_show_error (NULL, error, _("Failed to load the default configuration"));
68
@@ -128,6 +138,7 @@ main (gint argc, gchar **argv)
72
+ g_free (default_file);
76
--- xfce4-panel-4.8.2.orig/po/POTFILES.skip
77
+++ xfce4-panel-4.8.2/po/POTFILES.skip
79
.pc/0001-Tasklist-add-button-release-event-to-proxy-item-bug-.patch/plugins/tasklist/tasklist-widget.c
80
+.pc/xubuntu_support-multiple-vendor-default-configs.patch/migrate/main.c