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
5 gint retval = EXIT_SUCCESS;
6 gboolean default_config_exists;
7 - gint default_response = GTK_RESPONSE_CANCEL;
9 /* set translation domain */
10 xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
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);
18 + /* apply default config */
19 + if (default_config_exists && !migrate_default (DEFAULT_CONFIG, &error))
21 + xfce_dialog_show_error (NULL, error, _("Failed to load the default configuration"));
22 + g_error_free (error);
23 + retval = EXIT_FAILURE;
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."),
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);
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);
48 - default_response = GTK_RESPONSE_OK;
49 + gtk_widget_set_sensitive (button, TRUE);
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;
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"));
61 - gtk_dialog_set_default_response (GTK_DIALOG (dialog), default_response);
62 + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
64 result = gtk_dialog_run (GTK_DIALOG (dialog));
65 gtk_widget_destroy (dialog);
67 - if (result == GTK_RESPONSE_OK && file != NULL)
68 + if (result == GTK_RESPONSE_OK)
70 /* restore 4.6 config */
71 if (!migrate_46 (file, &error))