~ubuntu-branches/ubuntu/natty/xfce4-panel/natty

« back to all changes in this revision

Viewing changes to debian/patches/xubuntu_support-multiple-vendor-default-configs.patch

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2011-04-01 20:43:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110401204300-sq45qhoziet0nc6l
Tags: 4.8.2-1ubuntu1
* debian/patches:
  - xubuntu_support-multiple-vendor-default-configs.patch: search for the
    default.xml default config in XDG_CONFIG_DIRS as well, and do not
    display the chooser dialog in this case.                      lp: #747137
  - 0001-Tasklist-add-button-release-event-to-proxy-item-bug-.patch: taken
    from upstream git 'xfce-4.8' branch, fixes window switching with a
    drop down selector.                                           lp: #743689
  - series: added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
 
 
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.
 
12
 
 
13
Bug-Ubuntu: https://bugs.launchpad.net/bugs/747137
 
14
Forwarded: not-needed
 
15
---
 
16
 migrate/main.c |   17 ++++++++++++++---
 
17
 1 files changed, 14 insertions(+), 3 deletions(-)
 
18
 
 
19
diff --git a/migrate/main.c b/migrate/main.c
 
20
index 0893d0a..492818b 100644
 
21
--- a/migrate/main.c
 
22
+++ b/migrate/main.c
 
23
@@ -43,7 +43,7 @@
 
24
 gint
 
25
 main (gint argc, gchar **argv)
 
26
 {
 
27
-  gchar     *file;
 
28
+  gchar     *file, *default_file;
 
29
   GError    *error = NULL;
 
30
   GtkWidget *dialog;
 
31
   GtkWidget *button;
 
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);
 
35
 
 
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;
 
44
+
 
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)
 
49
 
 
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)
 
58
     }
 
59
   else if (result == GTK_RESPONSE_YES && default_config_exists)
 
60
     {
 
61
+apply_vendor_settings:
 
62
       /* apply default config */
 
63
-      if (!migrate_default (DEFAULT_CONFIG, &error))
 
64
+      if (!migrate_default (default_file, &error))
 
65
         {
 
66
           xfce_dialog_show_error (NULL, error, _("Failed to load the default configuration"));
 
67
           g_error_free (error);
 
68
@@ -128,6 +138,7 @@ main (gint argc, gchar **argv)
 
69
         }
 
70
     }
 
71
 
 
72
+  g_free (default_file);
 
73
   g_free (file);
 
74
 
 
75
   xfconf_shutdown ();
 
76
--- xfce4-panel-4.8.2.orig/po/POTFILES.skip
 
77
+++ xfce4-panel-4.8.2/po/POTFILES.skip
 
78
@@ -1 +1,2 @@
 
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