- plugin for home applet 'Internet Search' - search in mDictionary - change Copyright...
[mdictionary] / src / manager / src / whitestork.c
1 /*******************************************************************************
2 This file is part of WhiteStork.
3
4 WhiteStork is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 WhiteStork 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
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License 
15 along with WhiteStork; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
18 Copyright 2006 ComArch S.A.
19 *******************************************************************************/
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 #include <glib.h>
24 #include <stdlib.h>
25 #include <pc-instances.h>
26 #include <ws_manager.h>
27 #include <gconf/gconf-client.h>
28 #include <gconf/gconf.h>
29
30 int main (gint argc, gchar** argv)
31 {
32         /* check if there is no other instance of WhiteStork */
33         if (is_already_running_this_application() > 1)
34         {
35                 /* if YES - do not start another one - terminate*/
36                 g_debug("Another instance of application curently is running\n");
37                 //return 1;
38         }
39         g_type_init();
40         //GError* err;
41         
42         /* run GUI for WhiteStork */
43         /*
44         if ( !g_spawn_command_line_async("/usr/bin/WhiteStork", &err) )
45         {
46                 g_debug("Could not run GUI for WhiteStork\nReason: %s",
47                         err->message);
48                 return 2;
49         }
50         */
51         
52         WSMngSearchData* search_data = ws_manager_create();
53         
54         ws_mng_init_dbus(search_data);
55         ws_mng_init(search_data);
56         
57         ws_mng_start_main_loop(search_data);
58         
59         ws_mng_close(search_data);
60         
61         //g_free(search_data);
62         
63         return 0;
64 }
65 #ifdef __cplusplus
66 }
67 #endif