1 /* Copyright (c) 2007, Nokia Corporation
6 #include <config.h> /* For GETTEXT_PACKAGE, etc */
9 #include <glib/gi18n.h>
10 #include <gtk/gtkwidget.h>
11 #include <gtk/gtkmain.h>
12 #include "modest-easysetup-wizard.h"
14 /* Copied from modest-main.c: */
16 MODEST_ERR_NONE = 0, /* no error */
17 MODEST_ERR_OPTIONS = 1, /* error in the options */
18 MODEST_ERR_CONF = 2, /* error getting confuration db */
19 MODEST_ERR_UI = 3, /* error in the UI */
20 MODEST_ERR_HILDON = 4, /* error with Hildon (maemo-only) */
21 MODEST_ERR_RUN = 5, /* error running */
22 MODEST_ERR_PARAM = 7, /* error in one or more of the parameters */
23 MODEST_ERR_INIT = 8 /* error in initialization */
26 static gboolean modest_easysetup_init(int argc, char *argv[])
28 /* Setup gettext, to use our .po files: */
29 /* GETTEXT_PACKAGE is defined in config.h */
30 /* OSSO_MODEST_EASYSETUP_LOCALEDIR is defined in config.h */
31 bindtextdomain (GETTEXT_PACKAGE, OSSO_MODEST_EASYSETUP_LOCALEDIR);
32 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
33 textdomain (GETTEXT_PACKAGE);
35 if (!gtk_init_check(&argc, &argv)) {
36 g_printerr ("osso-modest-easysetup: failed to initialize GTK+\n");
43 static gboolean modest_easysetup_uninit()
49 main (int argc, char *argv[])
51 if (!modest_easysetup_init (argc, argv)) {
52 g_printerr ("osso-modest-easysetup: cannot init runtime\n");
53 return MODEST_ERR_INIT;
56 ModestEasysetupWizardDialog *wizard = modest_easysetup_wizard_dialog_new ();
57 gtk_dialog_run (GTK_DIALOG (wizard));
59 if (!modest_easysetup_uninit ())
60 g_printerr ("osso-modest-easysetup: shutdown failed\n");
62 return MODEST_ERR_NONE;