2 * Copyright (C) 2008 Nokia Corporation, all rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * * Neither the name of the Nokia Corporation nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
19 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
21 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
22 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include <config.h> /* For GETTEXT_PACKAGE, etc */
34 #include <glib/gi18n.h>
35 #include <gtk/gtkwidget.h>
36 #include <gtk/gtkmain.h>
37 #include "modest-easysetup-wizard.h"
39 /* Copied from modest-main.c: */
41 MODEST_ERR_NONE = 0, /* no error */
42 MODEST_ERR_OPTIONS = 1, /* error in the options */
43 MODEST_ERR_CONF = 2, /* error getting confuration db */
44 MODEST_ERR_UI = 3, /* error in the UI */
45 MODEST_ERR_HILDON = 4, /* error with Hildon (maemo-only) */
46 MODEST_ERR_RUN = 5, /* error running */
47 MODEST_ERR_PARAM = 7, /* error in one or more of the parameters */
48 MODEST_ERR_INIT = 8 /* error in initialization */
51 static gboolean modest_easysetup_init(int argc, char *argv[])
53 /* Setup gettext, to use our .po files: */
54 /* GETTEXT_PACKAGE is defined in config.h */
55 /* OSSO_MODEST_EASYSETUP_LOCALEDIR is defined in config.h */
56 bindtextdomain (GETTEXT_PACKAGE, OSSO_MODEST_EASYSETUP_LOCALEDIR);
57 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
58 textdomain (GETTEXT_PACKAGE);
60 if (!gtk_init_check(&argc, &argv)) {
61 g_printerr ("osso-modest-easysetup: failed to initialize GTK+\n");
68 static gboolean modest_easysetup_uninit()
74 main (int argc, char *argv[])
76 if (!modest_easysetup_init (argc, argv)) {
77 g_printerr ("osso-modest-easysetup: cannot init runtime\n");
78 return MODEST_ERR_INIT;
81 ModestEasysetupWizardDialog *wizard = modest_easysetup_wizard_dialog_new ();
82 gtk_dialog_run (GTK_DIALOG (wizard));
84 if (!modest_easysetup_uninit ())
85 g_printerr ("osso-modest-easysetup: shutdown failed\n");
87 return MODEST_ERR_NONE;