root/trunk/src/tmut-main.c

Revision 81 (checked in by pvanhoof, 4 months ago)

2008-04-17 Philip Van Hoof <pvanhoof@gnome.org>

        • Introduced the library libtmut-1.0
Line 
1 /* TMut
2  * Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof@gnome.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with self library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #if HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23
24 #include <gtk/gtk.h>
25 #include <glib/gi18n-lib.h>
26
27 #include <tny-account-store.h>
28 #include <tny-account-store-view.h>
29
30 #include "tmut-platform-factory.h"
31 #include "tmut-menu-view.h"
32 #include "tmut-shell-window.h"
33 #include "tmut-shared.h"
34
35 int 
36 main (int argc, char **argv)
37 {
38         GtkWidget *window;
39         TnyAccountStore *account_store;
40         TnyAccountStoreView *view;
41
42         if (!g_thread_supported ())
43                 g_thread_init (NULL);
44
45         gdk_threads_init ();
46
47         gdk_threads_enter ();
48         gtk_init (&argc, &argv);
49
50         bindtextdomain(GETTEXT_PACKAGE, TMUT_LOCALE_DIR);
51
52         window = GTK_WIDGET (tmut_shell_window_new ());
53         gtk_window_set_title (GTK_WINDOW (window), _("TMut"));
54
55         platfact = tmut_platform_factory_get_instance ();
56         account_store = tny_platform_factory_new_account_store (platfact);
57
58         view = TNY_ACCOUNT_STORE_VIEW (tmut_menu_view_new ());
59         gtk_widget_show (GTK_WIDGET (view));
60
61         tmut_shell_window_set_child (TMUT_SHELL_WINDOW (window),
62                 TMUT_SHELL_CHILD (view), NULL);
63
64         tny_account_store_view_set_account_store (view, account_store);
65
66         g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), 0);
67
68         gtk_widget_show (window);
69
70         gtk_main();
71         gdk_threads_leave ();
72
73         return 0;
74 }
75
Note: See TracBrowser for help on using the browser.