2
* Copyright (C) 2008 Canonical Ltd.
3
* Author: Alexander Sack <asac@jwsdot.com>
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21
#define GETTEXT_PACKAGE "ubuntu-migrator"
22
#define LOCALEDIR "po"
23
#define WINDOW_ICON_PATH "/usr/share/pixmaps/thunderbird.png"
25
#include <glib/gi18n.h>
28
static int main_response = 128;
31
do_reply(GtkWidget *dialog,
35
gtk_widget_destroy(dialog);
37
main_response = response;
41
main(int argc, char** argv)
44
GtkWidget *dialog, *label;
46
/* intialize gettext */
47
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
48
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
49
textdomain (GETTEXT_PACKAGE);
51
gtk_init(&argc, &argv);
53
gtk_window_set_default_icon_from_file (WINDOW_ICON_PATH, NULL);
55
/* Create the widgets */
56
dialog = gtk_dialog_new_with_buttons ("Multiple Thunderbird Profiles Found",
59
_("Use Thunderbird 3 Profile"), 1,
60
_("Use Thunderbird 3 Profile, but ask me again"), 0,
61
_("Use Thunderbird 2 Profile"), 2,
64
gtk_dialog_set_default_response (GTK_DIALOG(dialog),
67
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
71
g_signal_connect (dialog,
73
G_CALLBACK (do_reply),
76
GtkWidget *hbox = gtk_hbox_new(FALSE,
79
GtkWidget *icon_view = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION,
80
GTK_ICON_SIZE_DIALOG);
82
label = gtk_label_new (_("Do you want to import your mail and other "
83
"settings from Thunderbird 2, replacing your settings "
84
"from Thunderbird 3?"));
85
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
87
gtk_box_pack_start_defaults(GTK_BOX(hbox), icon_view);
88
gtk_box_pack_start_defaults(GTK_BOX(hbox), label);
90
gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox),
91
hbox, TRUE, TRUE, 10);
92
gtk_widget_show_all (dialog);
94
return main_response < 0 ? 0 : main_response;