diff options
Diffstat (limited to 'src/conversation/gnunet-conversation-gtk.c')
-rw-r--r-- | src/conversation/gnunet-conversation-gtk.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/src/conversation/gnunet-conversation-gtk.c b/src/conversation/gnunet-conversation-gtk.c index 80766cae..2dfc6457 100644 --- a/src/conversation/gnunet-conversation-gtk.c +++ b/src/conversation/gnunet-conversation-gtk.c | |||
@@ -33,24 +33,23 @@ struct GNUNET_CONVERSATION_Caller *caller_selected = NULL; | |||
33 | /************* | 33 | /************* |
34 | * common * | 34 | * common * |
35 | *************/ | 35 | *************/ |
36 | 36 | /** | |
37 | /** | 37 | * * Handle to our main loop. |
38 | * Handle to our main loop. | 38 | * */ |
39 | */ | ||
40 | static struct GNUNET_GTK_MainLoop *ml; | 39 | static struct GNUNET_GTK_MainLoop *ml; |
41 | 40 | ||
42 | |||
43 | |||
44 | /** | 41 | /** |
45 | * Get our configuration. | 42 | * Get our configuration. |
46 | * | 43 | * |
47 | * @return configuration handle | 44 | * @return configuration handle |
48 | **/ | 45 | */ |
49 | extern struct GNUNET_CONFIGURATION_Handle * | 46 | const struct GNUNET_CONFIGURATION_Handle * |
50 | GIG_get_configuration () | 47 | GIG_get_configuration (); |
51 | { | 48 | |
52 | return GNUNET_GTK_main_loop_get_configuration (ml); | 49 | /** |
53 | } | 50 | * Our configurations. |
51 | */ | ||
52 | static struct GNUNET_CONFIGURATION_Handle *cfg; | ||
54 | 53 | ||
55 | /** | 54 | /** |
56 | * Name of our ego. | 55 | * Name of our ego. |
@@ -794,7 +793,7 @@ start_phone () | |||
794 | } | 793 | } |
795 | //GNUNET_assert (NULL == phone); | 794 | //GNUNET_assert (NULL == phone); |
796 | phone = | 795 | phone = |
797 | GNUNET_CONVERSATION_phone_create (GIG_get_configuration(), caller_id, &phone_event_handler, | 796 | GNUNET_CONVERSATION_phone_create (cfg, caller_id, &phone_event_handler, |
798 | NULL); | 797 | NULL); |
799 | /* FIXME: get record and print full GNS record info later here... */ | 798 | /* FIXME: get record and print full GNS record info later here... */ |
800 | if (NULL == phone) | 799 | if (NULL == phone) |
@@ -905,7 +904,7 @@ do_call (const char *arg) | |||
905 | call_state = CS_RESOLVING; | 904 | call_state = CS_RESOLVING; |
906 | GNUNET_assert (NULL == call); | 905 | GNUNET_assert (NULL == call); |
907 | call = | 906 | call = |
908 | GNUNET_CONVERSATION_call_start (GIG_get_configuration(), caller_id, arg, speaker, mic, | 907 | GNUNET_CONVERSATION_call_start (cfg, caller_id, arg, speaker, mic, |
909 | &call_event_handler, NULL); | 908 | &call_event_handler, NULL); |
910 | UPDATE_STATUS (_("We are calling `%s', his phone should be ringing."), | 909 | UPDATE_STATUS (_("We are calling `%s', his phone should be ringing."), |
911 | peer_name); | 910 | peer_name); |
@@ -1314,9 +1313,7 @@ identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, | |||
1314 | return; | 1313 | return; |
1315 | } | 1314 | } |
1316 | caller_id = ego; | 1315 | caller_id = ego; |
1317 | 1316 | GNUNET_CONFIGURATION_set_value_number (cfg, "CONVERSATION", "LINE", line); | |
1318 | |||
1319 | //GNUNET_CONFIGURATION_set_value_number (GIG_get_configuration(), "CONVERSATION_GTK", "LINE", line); | ||
1320 | //zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id); | 1317 | //zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id); |
1321 | // ns = GNUNET_NAMESTORE_connect (cfg); | 1318 | // ns = GNUNET_NAMESTORE_connect (cfg); |
1322 | 1319 | ||
@@ -1325,6 +1322,17 @@ identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, | |||
1325 | start_phone(); | 1322 | start_phone(); |
1326 | } | 1323 | } |
1327 | 1324 | ||
1325 | /** | ||
1326 | * Get our configuration. | ||
1327 | * | ||
1328 | * @return configuration handle | ||
1329 | */ | ||
1330 | const struct GNUNET_CONFIGURATION_Handle * | ||
1331 | GIG_get_configuration () | ||
1332 | { | ||
1333 | return GNUNET_GTK_main_loop_get_configuration (ml); | ||
1334 | } | ||
1335 | |||
1328 | 1336 | ||
1329 | 1337 | ||
1330 | 1338 | ||
@@ -1474,7 +1482,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1474 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, | 1482 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, |
1475 | NULL); | 1483 | NULL); |
1476 | 1484 | ||
1477 | //cfg = GIG_get_configuration (); | 1485 | cfg = GIG_get_configuration (); |
1478 | 1486 | ||
1479 | speaker = GNUNET_SPEAKER_create_from_hardware (GIG_get_configuration ()); | 1487 | speaker = GNUNET_SPEAKER_create_from_hardware (GIG_get_configuration ()); |
1480 | mic = GNUNET_MICROPHONE_create_from_hardware (GIG_get_configuration ()); | 1488 | mic = GNUNET_MICROPHONE_create_from_hardware (GIG_get_configuration ()); |
@@ -1485,7 +1493,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1485 | LOG (_("No ego given, using default: %s "), ego_name); | 1493 | LOG (_("No ego given, using default: %s "), ego_name); |
1486 | 1494 | ||
1487 | } | 1495 | } |
1488 | id = GNUNET_IDENTITY_connect (GIG_get_configuration(), &identity_cb, NULL); | 1496 | id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL); |
1489 | 1497 | ||
1490 | GNUNET_CONVERSATION_GTK_CONTACTS_init (); | 1498 | GNUNET_CONVERSATION_GTK_CONTACTS_init (); |
1491 | } | 1499 | } |