00001 #include <gtask/gtask.h> 00002 00003 /* information to set up 00004 * If the program is a provider 00005 * program display name (get from env) 00006 * program name (get from env) 00007 * 00008 * whether or not they are showing their own progress information 00009 * scalable icons 00010 * a callback for getting umm . . callbacks 00011 */ 00012 void 00013 gtask_init( int *argc, char ***argv, GTaskRole role ) { 00014 GTaskConnectionGroup *conn_group; 00015 // GTaskConnection *conn; 00016 00017 g_type_init( ); 00018 00019 gtask_factory_set_program( NULL, g_get_prgname() ); 00020 gtask_factory_set_application( NULL, g_get_application_name( ) ); 00021 00022 conn_group = gtask_connection_group_new( ); 00023 00024 /* 00025 conn = gtask_connection_new_with_properties( "gtaskd", role ); 00026 00027 if( !gtask_connection_connect_domain_socket_default( conn ) ) { 00028 char *argv[2]; 00029 00030 argv[0] = "gtaskd"; 00031 argv[1] = NULL; 00032 00033 g_warning( "could not connect to gtaskd, attempting to start it" ); 00034 00035 ** @todo check error * 00036 if( g_spawn_async( NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL ) ) 00037 { 00038 ** @todo should probably wait a second or so before attempting 00039 * to connect, or perhaps just queue up the connect 00040 * in the evenr loop? 00041 * 00042 gtask_connection_connect_domain_socket_default( conn ); 00043 } else { 00044 g_warning( "error starting up gtaskd" ); 00045 } 00046 } 00047 00048 gtask_connection_group_add_connection( conn_group, conn ); 00049 */ 00050 00051 gtask_factory_set_connection_group( NULL, conn_group ); 00052 00053 //g_object_unref( (GObject *) conn ); 00054 g_object_unref( (GObject *) conn_group ); 00055 00056 printf( "done with setup\n" ); 00057 }