]> git.pld-linux.org Git - packages/xfce4-panel.git/blob - xfce4-panel-no-empty-panel.patch
- rel 2
[packages/xfce4-panel.git] / xfce4-panel-no-empty-panel.patch
1 --- xfce4-panel-4.8.6/migrate/main.c~   2011-09-21 20:59:09.000000000 +0200
2 +++ xfce4-panel-4.8.6/migrate/main.c    2011-10-24 12:09:17.247228900 +0200
3 @@ -50,7 +50,6 @@
4    gint       result;
5    gint       retval = EXIT_SUCCESS;
6    gboolean   default_config_exists;
7 -  gint       default_response = GTK_RESPONSE_CANCEL;
8  
9    /* set translation domain */
10    xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
11 @@ -72,14 +71,27 @@
12  
13    /* lookup the old 4.6 config file */
14    file = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, XFCE_46_CONFIG);
15 +  default_config_exists = g_file_test (DEFAULT_CONFIG, G_FILE_TEST_IS_REGULAR);
16 +  if (file == NULL)
17 +    {
18 +      /* apply default config */
19 +      if (default_config_exists && !migrate_default (DEFAULT_CONFIG, &error))
20 +        {
21 +          xfce_dialog_show_error (NULL, error, _("Failed to load the default configuration"));
22 +          g_error_free (error);
23 +          retval = EXIT_FAILURE;
24 +        }
25 +      xfconf_shutdown ();
26 +      return retval;
27 +    }
28  
29    /* create question dialog */
30    dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
31                                     _("Welcome to the first start of the panel"));
32    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s%s%s",
33 -      file != NULL ? _("Because the panel moved to a new system for storing the "
34 -                       "settings, it has to load a fresh initial configuration.") : "",
35 -      file != NULL ? " " : "",
36 +      _("Because the panel moved to a new system for storing the "
37 +        "settings, it has to load a fresh initial configuration."),
38 +      " ",
39                       _("Choose below which setup you want for the first startup."));
40    gtk_window_set_title (GTK_WINDOW (dialog), _("Panel"));
41    gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_PREFERENCES);
42 @@ -88,26 +100,18 @@
43  
44    button = gtk_dialog_add_button (GTK_DIALOG (dialog), _("Migrate old config"), GTK_RESPONSE_OK);
45    gtk_widget_set_tooltip_text (button, _("Migrate the old 4.6 configuration to Xfconf"));
46 -  gtk_widget_set_sensitive (button, file != NULL);
47 -  if (file != NULL)
48 -    default_response = GTK_RESPONSE_OK;
49 +  gtk_widget_set_sensitive (button, TRUE);
50  
51    button = gtk_dialog_add_button (GTK_DIALOG (dialog), _("Use default config"), GTK_RESPONSE_YES);
52    gtk_widget_set_tooltip_text (button, _("Load the default configuration"));
53 -  default_config_exists = g_file_test (DEFAULT_CONFIG, 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 -
58 -  button = gtk_dialog_add_button (GTK_DIALOG (dialog), _("One empty panel"), GTK_RESPONSE_CANCEL);
59 -  gtk_widget_set_tooltip_text (button, _("Start with one empty panel"));
60  
61 -  gtk_dialog_set_default_response (GTK_DIALOG (dialog), default_response);
62 +  gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
63  
64    result = gtk_dialog_run (GTK_DIALOG (dialog));
65    gtk_widget_destroy (dialog);
66  
67 -  if (result == GTK_RESPONSE_OK && file != NULL)
68 +  if (result == GTK_RESPONSE_OK)
69      {
70        /* restore 4.6 config */
71        if (!migrate_46 (file, &error))
This page took 0.083538 seconds and 3 git commands to generate.