aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhark <hark@puscii.nl>2014-02-23 17:43:29 +0000
committerhark <hark@puscii.nl>2014-02-23 17:43:29 +0000
commitdd93b7305f0e37ac2f9ce74aaa1d0f4f66752e59 (patch)
tree2949336f6635ccc86692427cbae79932ddaa6c84
parent0c410e9fb4fe76096d22b1baee593751790320f6 (diff)
downloadgnunet-gtk-dd93b7305f0e37ac2f9ce74aaa1d0f4f66752e59.tar.gz
gnunet-gtk-dd93b7305f0e37ac2f9ce74aaa1d0f4f66752e59.zip
fixed previous commit
-rw-r--r--src/conversation/gnunet-conversation-gtk.c46
-rw-r--r--src/conversation/gnunet-conversation-gtk_contacts.c8
2 files changed, 31 insertions, 23 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 */
40static struct GNUNET_GTK_MainLoop *ml; 39static 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 */
49extern struct GNUNET_CONFIGURATION_Handle * 46const struct GNUNET_CONFIGURATION_Handle *
50GIG_get_configuration () 47GIG_get_configuration ();
51{ 48
52 return GNUNET_GTK_main_loop_get_configuration (ml); 49/**
53} 50 * Our configurations.
51 */
52static 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 */
1330const struct GNUNET_CONFIGURATION_Handle *
1331GIG_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}
diff --git a/src/conversation/gnunet-conversation-gtk_contacts.c b/src/conversation/gnunet-conversation-gtk_contacts.c
index f3e2bf0c..6619363e 100644
--- a/src/conversation/gnunet-conversation-gtk_contacts.c
+++ b/src/conversation/gnunet-conversation-gtk_contacts.c
@@ -46,7 +46,7 @@
46/** 46/**
47 * Our configurations. 47 * Our configurations.
48 */ 48 */
49//static struct GNUNET_CONFIGURATION_Handle *cfg; 49static struct GNUNET_CONFIGURATION_Handle *cfg;
50/** 50/**
51 * Name of our ego. 51 * Name of our ego.
52 */ 52 */
@@ -302,7 +302,7 @@ identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
302 302
303 303
304// zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id); 304// zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id);
305 ns = GNUNET_NAMESTORE_connect (GIG_get_configuration ()); 305 ns = GNUNET_NAMESTORE_connect (cfg);
306 306
307 307
308// list_it = 308// list_it =
@@ -631,7 +631,7 @@ GNUNET_CONVERSATION_GTK_CONTACTS_init ()
631{ 631{
632 GtkTreeIter iterContactsInit; 632 GtkTreeIter iterContactsInit;
633 633
634 //cfg = GIG_get_configuration (); 634 cfg = GIG_get_configuration ();
635 635
636 636
637 // contacts 637 // contacts
@@ -657,7 +657,7 @@ GNUNET_CONVERSATION_GTK_CONTACTS_init ()
657 657
658 gtk_combo_box_set_active_iter(GTK_COMBO_BOX (GNUNET_CONVERSATION_GTK_get_main_window_object ("gnunet_conversation_gtk_contacts_zone_combobox")), &iterContactsInit); 658 gtk_combo_box_set_active_iter(GTK_COMBO_BOX (GNUNET_CONVERSATION_GTK_get_main_window_object ("gnunet_conversation_gtk_contacts_zone_combobox")), &iterContactsInit);
659 659
660 id = GNUNET_IDENTITY_connect (GIG_get_configuration (), &identity_cb, NULL); 660 id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL);
661// zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id); 661// zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id);
662// gtk_combo_box_set_active(GTK_WIDGET (get_object ("gnunet_conversation_gtk_contacts_zone_combobox")), 1); 662// gtk_combo_box_set_active(GTK_WIDGET (get_object ("gnunet_conversation_gtk_contacts_zone_combobox")), 1);
663// gtk_combo_box_set_active(GTK_WIDGET (get_object (ml,"gnunet_conversation_gtk_outgoing_zone_combobox")), 1); 663// gtk_combo_box_set_active(GTK_WIDGET (get_object (ml,"gnunet_conversation_gtk_outgoing_zone_combobox")), 1);