aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/gnunet_conversation_gtk_main_window.glade40
-rw-r--r--src/conversation/gnunet-conversation-gtk.c8
-rw-r--r--src/conversation/gnunet-conversation-gtk_about.c2
-rw-r--r--src/conversation/gnunet-conversation-gtk_contacts.c11
-rw-r--r--src/conversation/gnunet-conversation-gtk_log.c4
-rw-r--r--src/conversation/gnunet-conversation-gtk_phone.c54
-rw-r--r--src/conversation/gnunet-conversation-gtk_zones.c25
-rw-r--r--src/conversation/gnunet-conversation-gtk_zones.h9
8 files changed, 113 insertions, 40 deletions
diff --git a/contrib/gnunet_conversation_gtk_main_window.glade b/contrib/gnunet_conversation_gtk_main_window.glade
index ea6b3462..2437996f 100644
--- a/contrib/gnunet_conversation_gtk_main_window.glade
+++ b/contrib/gnunet_conversation_gtk_main_window.glade
@@ -69,7 +69,7 @@
69 <property name="default_width">700</property> 69 <property name="default_width">700</property>
70 <property name="default_height">500</property> 70 <property name="default_height">500</property>
71 <property name="icon_name">contact-new</property> 71 <property name="icon_name">contact-new</property>
72 <signal name="delete-event" handler="GNUNET_GTK_conversation_quit_cb" swapped="no"/> 72 <signal name="delete-event" handler="gnunet_conversation_gtk_quit_cb" swapped="no"/>
73 <child> 73 <child>
74 <object class="GtkBox" id="gnunet_conversation_gtk_main_vbox"> 74 <object class="GtkBox" id="gnunet_conversation_gtk_main_vbox">
75 <property name="visible">True</property> 75 <property name="visible">True</property>
@@ -80,25 +80,25 @@
80 <property name="visible">True</property> 80 <property name="visible">True</property>
81 <property name="can_focus">False</property> 81 <property name="can_focus">False</property>
82 <child> 82 <child>
83 <object class="GtkMenuItem" id="GNUNET_GTK_conversation_file_menuitem"> 83 <object class="GtkMenuItem" id="gnunet_conversation_gtk_file_menuitem">
84 <property name="use_action_appearance">False</property> 84 <property name="use_action_appearance">False</property>
85 <property name="visible">True</property> 85 <property name="visible">True</property>
86 <property name="can_focus">False</property> 86 <property name="can_focus">False</property>
87 <property name="label" translatable="yes">_File</property> 87 <property name="label" translatable="yes">_File</property>
88 <property name="use_underline">True</property> 88 <property name="use_underline">True</property>
89 <child type="submenu"> 89 <child type="submenu">
90 <object class="GtkMenu" id="GNUNET_GTK_conversation_file_menu"> 90 <object class="GtkMenu" id="gnunet_conversation_gtk_file_menu">
91 <property name="visible">True</property> 91 <property name="visible">True</property>
92 <property name="can_focus">False</property> 92 <property name="can_focus">False</property>
93 <child> 93 <child>
94 <object class="GtkImageMenuItem" id="GNUNET_GTK_conversation_quit_imagemenuitem"> 94 <object class="GtkImageMenuItem" id="gnunet_conversation_conversation_quit_imagemenuitem">
95 <property name="label">gtk-quit</property> 95 <property name="label">gtk-quit</property>
96 <property name="use_action_appearance">False</property> 96 <property name="use_action_appearance">False</property>
97 <property name="visible">True</property> 97 <property name="visible">True</property>
98 <property name="can_focus">False</property> 98 <property name="can_focus">False</property>
99 <property name="use_underline">True</property> 99 <property name="use_underline">True</property>
100 <property name="use_stock">True</property> 100 <property name="use_stock">True</property>
101 <signal name="activate" handler="GNUNET_GTK_conversation_quit_cb" swapped="no"/> 101 <signal name="activate" handler="gnunet_conversation_gtk_quit_cb" swapped="no"/>
102 </object> 102 </object>
103 </child> 103 </child>
104 </object> 104 </object>
@@ -162,25 +162,25 @@
162 </object> 162 </object>
163 </child> 163 </child>
164 <child> 164 <child>
165 <object class="GtkMenuItem" id="GNUNET_GTK_conversation_help_menuitem"> 165 <object class="GtkMenuItem" id="gnunet_conversation_gtk_help_menuitem">
166 <property name="use_action_appearance">False</property> 166 <property name="use_action_appearance">False</property>
167 <property name="visible">True</property> 167 <property name="visible">True</property>
168 <property name="can_focus">False</property> 168 <property name="can_focus">False</property>
169 <property name="label" translatable="yes">_Help</property> 169 <property name="label" translatable="yes">_Help</property>
170 <property name="use_underline">True</property> 170 <property name="use_underline">True</property>
171 <child type="submenu"> 171 <child type="submenu">
172 <object class="GtkMenu" id="GNUNET_GTK_conversation_help_menu"> 172 <object class="GtkMenu" id="gnunet_conversation_gtk_help_menu">
173 <property name="visible">True</property> 173 <property name="visible">True</property>
174 <property name="can_focus">False</property> 174 <property name="can_focus">False</property>
175 <child> 175 <child>
176 <object class="GtkImageMenuItem" id="GNUNET_GTK_conversation_about_imagemenuitem"> 176 <object class="GtkImageMenuItem" id="gnunet_conversation_gtk_about_imagemenuitem">
177 <property name="label">gtk-about</property> 177 <property name="label">gtk-about</property>
178 <property name="use_action_appearance">False</property> 178 <property name="use_action_appearance">False</property>
179 <property name="visible">True</property> 179 <property name="visible">True</property>
180 <property name="can_focus">False</property> 180 <property name="can_focus">False</property>
181 <property name="use_underline">True</property> 181 <property name="use_underline">True</property>
182 <property name="use_stock">True</property> 182 <property name="use_stock">True</property>
183 <signal name="activate" handler="GNUNET_GTK_conversation_about_imagemenuitem_activate_cb" swapped="no"/> 183 <signal name="activate" handler="gnunet_conversation_gtk_about_imagemenuitem_activate_cb" swapped="no"/>
184 </object> 184 </object>
185 </child> 185 </child>
186 </object> 186 </object>
@@ -404,7 +404,7 @@
404 </packing> 404 </packing>
405 </child> 405 </child>
406 <child> 406 <child>
407 <object class="GtkButton" id="GNUNET_GTK_conversation_suspend_button"> 407 <object class="GtkButton" id="gnunet_conversation_gtk_suspend_button">
408 <property name="label">gtk-media-pause</property> 408 <property name="label">gtk-media-pause</property>
409 <property name="use_action_appearance">False</property> 409 <property name="use_action_appearance">False</property>
410 <property name="sensitive">False</property> 410 <property name="sensitive">False</property>
@@ -412,7 +412,7 @@
412 <property name="receives_default">True</property> 412 <property name="receives_default">True</property>
413 <property name="use_stock">True</property> 413 <property name="use_stock">True</property>
414 <property name="image_position">top</property> 414 <property name="image_position">top</property>
415 <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_pause_clicked" swapped="no"/> 415 <signal name="clicked" handler="gnunet_conversation_gtk_on_pause_clicked" swapped="no"/>
416 </object> 416 </object>
417 <packing> 417 <packing>
418 <property name="expand">False</property> 418 <property name="expand">False</property>
@@ -430,7 +430,7 @@
430 <property name="receives_default">True</property> 430 <property name="receives_default">True</property>
431 <property name="use_stock">True</property> 431 <property name="use_stock">True</property>
432 <property name="image_position">top</property> 432 <property name="image_position">top</property>
433 <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_hangup_clicked" swapped="no"/> 433 <signal name="clicked" handler="gnunet_conversation_gtk_on_hangup_clicked" swapped="no"/>
434 </object> 434 </object>
435 <packing> 435 <packing>
436 <property name="expand">False</property> 436 <property name="expand">False</property>
@@ -465,7 +465,9 @@
465 <property name="enable_search">False</property> 465 <property name="enable_search">False</property>
466 <property name="search_column">0</property> 466 <property name="search_column">0</property>
467 <child internal-child="selection"> 467 <child internal-child="selection">
468 <object class="GtkTreeSelection" id="gnunet_conversation_gtk_active_calls_treeview_selection"/> 468 <object class="GtkTreeSelection" id="gnunet_conversation_gtk_active_calls_treeview_selection">
469 <signal name="changed" handler="gnunet_conversation_gtk_active_calls_treeview_selection_changed_cb" swapped="no"/>
470 </object>
469 </child> 471 </child>
470 <child> 472 <child>
471 <object class="GtkTreeViewColumn" id="caller_numColumn"> 473 <object class="GtkTreeViewColumn" id="caller_numColumn">
@@ -536,7 +538,7 @@
536 <property name="spacing">5</property> 538 <property name="spacing">5</property>
537 <property name="layout_style">start</property> 539 <property name="layout_style">start</property>
538 <child> 540 <child>
539 <object class="GtkImage" id="GNUNET_GTK_status_icon"> 541 <object class="GtkImage" id="gnunet_conversation_gtk_status_icon">
540 <property name="width_request">75</property> 542 <property name="width_request">75</property>
541 <property name="height_request">75</property> 543 <property name="height_request">75</property>
542 <property name="visible">True</property> 544 <property name="visible">True</property>
@@ -560,7 +562,7 @@
560 <property name="can_focus">True</property> 562 <property name="can_focus">True</property>
561 <property name="receives_default">True</property> 563 <property name="receives_default">True</property>
562 <property name="xalign">0.4699999988079071</property> 564 <property name="xalign">0.4699999988079071</property>
563 <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_use_current_button_clicked" swapped="no"/> 565 <signal name="clicked" handler="gnunet_conversation_gtk_use_current_button_clicked" swapped="no"/>
564 </object> 566 </object>
565 <packing> 567 <packing>
566 <property name="expand">False</property> 568 <property name="expand">False</property>
@@ -594,7 +596,7 @@
594 <property name="sensitive">False</property> 596 <property name="sensitive">False</property>
595 <property name="can_focus">True</property> 597 <property name="can_focus">True</property>
596 <property name="receives_default">True</property> 598 <property name="receives_default">True</property>
597 <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_resume_clicked" swapped="no"/> 599 <signal name="clicked" handler="gnunet_conversation_gtk_on_resume_clicked" swapped="no"/>
598 </object> 600 </object>
599 <packing> 601 <packing>
600 <property name="expand">False</property> 602 <property name="expand">False</property>
@@ -913,12 +915,12 @@
913 <property name="can_focus">False</property> 915 <property name="can_focus">False</property>
914 <property name="left_padding">12</property> 916 <property name="left_padding">12</property>
915 <child> 917 <child>
916 <object class="GtkScrolledWindow" id="GNUNET_GTK_conversation_log_scroll"> 918 <object class="GtkScrolledWindow" id="gnunet_conversation_gtk_log_scroll">
917 <property name="visible">True</property> 919 <property name="visible">True</property>
918 <property name="can_focus">True</property> 920 <property name="can_focus">True</property>
919 <property name="shadow_type">in</property> 921 <property name="shadow_type">in</property>
920 <child> 922 <child>
921 <object class="GtkTextView" id="GNUNET_GTK_conversation_log"> 923 <object class="GtkTextView" id="gnunet_conversation_gtk_log">
922 <property name="visible">True</property> 924 <property name="visible">True</property>
923 <property name="can_focus">True</property> 925 <property name="can_focus">True</property>
924 <property name="editable">False</property> 926 <property name="editable">False</property>
@@ -959,7 +961,7 @@
959 </packing> 961 </packing>
960 </child> 962 </child>
961 <child> 963 <child>
962 <object class="GtkStatusbar" id="GNUNET_GTK_conversation_statusbar"> 964 <object class="GtkStatusbar" id="gnunet_conversation_gtk_statusbar">
963 <property name="visible">True</property> 965 <property name="visible">True</property>
964 <property name="can_focus">False</property> 966 <property name="can_focus">False</property>
965 <property name="orientation">vertical</property> 967 <property name="orientation">vertical</property>
diff --git a/src/conversation/gnunet-conversation-gtk.c b/src/conversation/gnunet-conversation-gtk.c
index 38566df6..efe7f082 100644
--- a/src/conversation/gnunet-conversation-gtk.c
+++ b/src/conversation/gnunet-conversation-gtk.c
@@ -92,7 +92,7 @@ GCG_set_status_icon (const char *icon_name)
92 GtkImage *status_icon; 92 GtkImage *status_icon;
93 93
94 status_icon = GTK_IMAGE (GCG_get_main_window_object 94 status_icon = GTK_IMAGE (GCG_get_main_window_object
95 ("GNUNET_GTK_status_icon")); 95 ("gnunet_conversation_gtk_status_icon"));
96 gtk_image_set_from_icon_name (status_icon, 96 gtk_image_set_from_icon_name (status_icon,
97 icon_name, 97 icon_name,
98 GTK_ICON_SIZE_BUTTON); 98 GTK_ICON_SIZE_BUTTON);
@@ -123,11 +123,11 @@ static void
123shutdown_task (void *cls, 123shutdown_task (void *cls,
124 const struct GNUNET_SCHEDULER_TaskContext *tc) 124 const struct GNUNET_SCHEDULER_TaskContext *tc)
125{ 125{
126 GCG_EGOS_shutdown ();
127 GCG_ZONES_shutdown ();
126 GCG_PHONE_shutdown (); 128 GCG_PHONE_shutdown ();
127 GCG_CONTACTS_shutdown (); 129 GCG_CONTACTS_shutdown ();
128 GCG_IMPORT_shutdown (); 130 GCG_IMPORT_shutdown ();
129 GCG_EGOS_shutdown ();
130 GCG_ZONES_shutdown ();
131 GNUNET_GTK_tray_icon_destroy (); 131 GNUNET_GTK_tray_icon_destroy ();
132 GNUNET_GTK_main_loop_quit (ml); 132 GNUNET_GTK_main_loop_quit (ml);
133 ml = NULL; 133 ml = NULL;
@@ -141,7 +141,7 @@ shutdown_task (void *cls,
141 * @param user_data unused 141 * @param user_data unused
142 */ 142 */
143void 143void
144GNUNET_GTK_conversation_quit_cb (GObject *object, 144gnunet_conversation_gtk_quit_cb (GObject *object,
145 gpointer user_data) 145 gpointer user_data)
146{ 146{
147 GNUNET_SCHEDULER_shutdown (); 147 GNUNET_SCHEDULER_shutdown ();
diff --git a/src/conversation/gnunet-conversation-gtk_about.c b/src/conversation/gnunet-conversation-gtk_about.c
index cea0955a..cc655959 100644
--- a/src/conversation/gnunet-conversation-gtk_about.c
+++ b/src/conversation/gnunet-conversation-gtk_about.c
@@ -31,7 +31,7 @@
31 * This displays an about window 31 * This displays an about window
32 */ 32 */
33void 33void
34GNUNET_GTK_conversation_about_imagemenuitem_activate_cb (GtkWidget * dummy, 34gnunet_conversation_gtk_about_imagemenuitem_activate_cb (GtkWidget * dummy,
35 gpointer data) 35 gpointer data)
36{ 36{
37 GNUNET_GTK_display_about ("gnunet_conversation_gtk_about_window.glade"); 37 GNUNET_GTK_display_about ("gnunet_conversation_gtk_about_window.glade");
diff --git a/src/conversation/gnunet-conversation-gtk_contacts.c b/src/conversation/gnunet-conversation-gtk_contacts.c
index b080c8fc..531d5256 100644
--- a/src/conversation/gnunet-conversation-gtk_contacts.c
+++ b/src/conversation/gnunet-conversation-gtk_contacts.c
@@ -28,8 +28,8 @@
28 */ 28 */
29#include "gnunet-conversation-gtk.h" 29#include "gnunet-conversation-gtk.h"
30#include "gnunet-conversation-gtk_contacts.h" 30#include "gnunet-conversation-gtk_contacts.h"
31#include "gnunet-conversation-gtk_egos.h"
32#include "gnunet-conversation-gtk_phone.h" 31#include "gnunet-conversation-gtk_phone.h"
32#include "gnunet-conversation-gtk_zones.h"
33 33
34 34
35/** 35/**
@@ -252,15 +252,20 @@ gnunet_conversation_gtk_contacts_zone_combobox_changed_cb (GtkComboBox *widget,
252 struct GNUNET_IDENTITY_Ego *ego; 252 struct GNUNET_IDENTITY_Ego *ego;
253 const struct GNUNET_CRYPTO_EcdsaPrivateKey *temp_zone_pkey; 253 const struct GNUNET_CRYPTO_EcdsaPrivateKey *temp_zone_pkey;
254 254
255 ego = GCG_EGOS_get_selected_ego ();
256 temp_zone_pkey = GNUNET_IDENTITY_ego_get_private_key (ego);
257 if (NULL != zone_mon) 255 if (NULL != zone_mon)
258 { 256 {
259 GNUNET_NAMESTORE_zone_monitor_stop (zone_mon); 257 GNUNET_NAMESTORE_zone_monitor_stop (zone_mon);
260 zone_mon = NULL; 258 zone_mon = NULL;
261 } 259 }
262 gtk_list_store_clear (contacts_liststore); 260 gtk_list_store_clear (contacts_liststore);
261 ego = GCG_ZONES_get_selected_zone ();
262 if (NULL == ego)
263 {
264 /* ego deselected (likely shutdown) */
265 return;
266 }
263 gtk_widget_hide (contacts_treeview); 267 gtk_widget_hide (contacts_treeview);
268 temp_zone_pkey = GNUNET_IDENTITY_ego_get_private_key (ego);
264 zone_mon = GNUNET_NAMESTORE_zone_monitor_start (GCG_get_configuration (), 269 zone_mon = GNUNET_NAMESTORE_zone_monitor_start (GCG_get_configuration (),
265 temp_zone_pkey, 270 temp_zone_pkey,
266 GNUNET_YES, 271 GNUNET_YES,
diff --git a/src/conversation/gnunet-conversation-gtk_log.c b/src/conversation/gnunet-conversation-gtk_log.c
index a77954af..6540d322 100644
--- a/src/conversation/gnunet-conversation-gtk_log.c
+++ b/src/conversation/gnunet-conversation-gtk_log.c
@@ -46,7 +46,7 @@ GCG_log (const char *message,
46 va_list ap; 46 va_list ap;
47 47
48 log_view = GTK_TEXT_VIEW (GCG_get_main_window_object 48 log_view = GTK_TEXT_VIEW (GCG_get_main_window_object
49 ("GNUNET_GTK_conversation_log")); 49 ("gnunet_conversation_gtk_log"));
50 logbuff = GTK_TEXT_BUFFER (gtk_text_view_get_buffer (log_view)); 50 logbuff = GTK_TEXT_BUFFER (gtk_text_view_get_buffer (log_view));
51 va_start (ap, message); 51 va_start (ap, message);
52 fmsg = g_strdup_vprintf (message, 52 fmsg = g_strdup_vprintf (message,
@@ -78,7 +78,7 @@ GCG_update_status_bar (const gchar *message,
78 va_list ap; 78 va_list ap;
79 79
80 status_bar = GTK_STATUSBAR (GCG_get_main_window_object 80 status_bar = GTK_STATUSBAR (GCG_get_main_window_object
81 ("GNUNET_GTK_conversation_statusbar")); 81 ("gnunet_conversation_gtk_statusbar"));
82 status_bar_context = gtk_statusbar_get_context_id (status_bar, 82 status_bar_context = gtk_statusbar_get_context_id (status_bar,
83 "blaat"); // blaat!? 83 "blaat"); // blaat!?
84 va_start (ap, message); 84 va_start (ap, message);
diff --git a/src/conversation/gnunet-conversation-gtk_phone.c b/src/conversation/gnunet-conversation-gtk_phone.c
index 841e3db3..74d49805 100644
--- a/src/conversation/gnunet-conversation-gtk_phone.c
+++ b/src/conversation/gnunet-conversation-gtk_phone.c
@@ -417,7 +417,8 @@ destroy_in (struct IncomingCall *ic)
417 ic->caller = NULL; 417 ic->caller = NULL;
418 } 418 }
419 GNUNET_free (ic->caller_id); 419 GNUNET_free (ic->caller_id);
420 gtk_tree_row_reference_free (ic->rr); 420 if (NULL != ic->rr)
421 gtk_tree_row_reference_free (ic->rr);
421 GNUNET_free (ic); 422 GNUNET_free (ic);
422} 423}
423 424
@@ -436,7 +437,8 @@ destroy_out (struct OutgoingCall *oc)
436 oc->call = NULL; 437 oc->call = NULL;
437 } 438 }
438 GNUNET_free (oc->caller_id); 439 GNUNET_free (oc->caller_id);
439 gtk_tree_row_reference_free (oc->rr); 440 if (NULL != oc->rr)
441 gtk_tree_row_reference_free (oc->rr);
440 GNUNET_free (oc); 442 GNUNET_free (oc);
441} 443}
442 444
@@ -566,6 +568,8 @@ check_call_sensitivity ()
566 sens = (NULL == active_in) && (NULL == active_out); 568 sens = (NULL == active_in) && (NULL == active_out);
567 if (0 == strlen (gtk_entry_get_text (address_entry))) 569 if (0 == strlen (gtk_entry_get_text (address_entry)))
568 sens = FALSE; 570 sens = FALSE;
571 if (NULL == phone)
572 sens = FALSE;
569 gtk_widget_set_sensitive (b_call, sens); 573 gtk_widget_set_sensitive (b_call, sens);
570} 574}
571 575
@@ -1102,11 +1106,11 @@ GNUNET_CONVERSATION_GTK_on_reject_clicked (GtkButton *button,
1102 * @param user_data builder (unused) 1106 * @param user_data builder (unused)
1103 */ 1107 */
1104void 1108void
1105GNUNET_CONVERSATION_GTK_use_current_button_clicked (GtkButton *button, 1109gnunet_conversation_gtk_use_current_button_clicked (GtkButton *button,
1106 gpointer *user_data) 1110 gpointer *user_data)
1107{ 1111{
1108 // FIXME: implement, use "GSC_add_contact" 1112 GNUNET_break (0); // FIXME: implement!
1109 // FIXME: need to determine desired label for the contact! 1113 // need to determine desired label for the contact!
1110 // => prompt user!? 1114 // => prompt user!?
1111#if 0 1115#if 0
1112 const gchar *target; 1116 const gchar *target;
@@ -1124,7 +1128,7 @@ GNUNET_CONVERSATION_GTK_use_current_button_clicked (GtkButton *button,
1124 * @param user_data builder (unused) 1128 * @param user_data builder (unused)
1125 */ 1129 */
1126void 1130void
1127GNUNET_CONVERSATION_GTK_on_resume_clicked (GtkButton *button, 1131gnunet_conversation_gtk_on_resume_clicked (GtkButton *button,
1128 gpointer user_data) 1132 gpointer user_data)
1129{ 1133{
1130 struct IncomingCall *ic; 1134 struct IncomingCall *ic;
@@ -1193,7 +1197,7 @@ GNUNET_CONVERSATION_GTK_on_resume_clicked (GtkButton *button,
1193 * @param user_data builder (unused) 1197 * @param user_data builder (unused)
1194 */ 1198 */
1195void 1199void
1196GNUNET_CONVERSATION_GTK_on_pause_clicked (GtkButton *button, 1200gnunet_conversation_gtk_on_pause_clicked (GtkButton *button,
1197 gpointer user_data) 1201 gpointer user_data)
1198{ 1202{
1199 enum OutCallState os; 1203 enum OutCallState os;
@@ -1301,7 +1305,7 @@ GNUNET_CONVERSATION_GTK_on_pause_clicked (GtkButton *button,
1301 * @param user_data builder (unused) 1305 * @param user_data builder (unused)
1302 */ 1306 */
1303void 1307void
1304GNUNET_CONVERSATION_GTK_on_hangup_clicked (GtkButton *button, 1308gnunet_conversation_gtk_on_hangup_clicked (GtkButton *button,
1305 gpointer user_data) 1309 gpointer user_data)
1306{ 1310{
1307 if ( (NULL == active_in) && 1311 if ( (NULL == active_in) &&
@@ -1561,6 +1565,15 @@ gnunet_conversation_gtk_call_button_clicked_cb (GtkButton *button,
1561 arg, 1565 arg,
1562 speaker, mic, 1566 speaker, mic,
1563 &call_event_handler, oc); 1567 &call_event_handler, oc);
1568 if (NULL == oc->call)
1569 {
1570 GCG_HISTORY_add (GCG_HISTORY_TYPE_FAILED,
1571 oc->caller_id,
1572 oc->caller_num);
1573 destroy_out (oc);
1574 return;
1575 }
1576 active_out = oc;
1564 gtk_list_store_insert_with_values (active_liststore, 1577 gtk_list_store_insert_with_values (active_liststore,
1565 &iter, 1578 &iter,
1566 -1, 1579 -1,
@@ -1607,6 +1620,25 @@ gnunet_conversation_gtk_address_entry_changed_cb (GtkEditable *editable,
1607 1620
1608 1621
1609/** 1622/**
1623 * Update sensitivity of the "copy" button.
1624 */
1625static void
1626update_copy_sensitivity ()
1627{
1628 const gchar *label;
1629
1630 label = gtk_entry_get_text (GTK_ENTRY
1631 (GCG_get_main_window_object
1632 ("gnunet_conversation_gtk_ego_label_entry")));
1633 if ( (NULL == label) ||
1634 (0 == strlen (label)) )
1635 gtk_widget_set_sensitive (b_copy, FALSE);
1636 else
1637 gtk_widget_set_sensitive (b_copy, TRUE);
1638}
1639
1640
1641/**
1610 * Our phone record has changed, update the information 1642 * Our phone record has changed, update the information
1611 * published in the GNU Name System. 1643 * published in the GNU Name System.
1612 */ 1644 */
@@ -1622,11 +1654,9 @@ update_phone_record ()
1622 if ( (NULL == label) || 1654 if ( (NULL == label) ||
1623 (0 == strlen (label)) ) 1655 (0 == strlen (label)) )
1624 { 1656 {
1625 gtk_widget_set_sensitive (b_copy, FALSE);
1626 GSC_remove_phone (); 1657 GSC_remove_phone ();
1627 return; 1658 return;
1628 } 1659 }
1629 gtk_widget_set_sensitive (b_copy, TRUE);
1630 GNUNET_CONVERSATION_phone_get_record (phone, 1660 GNUNET_CONVERSATION_phone_get_record (phone,
1631 &rd); 1661 &rd);
1632 GSC_add_phone (label, &rd); 1662 GSC_add_phone (label, &rd);
@@ -1663,6 +1693,7 @@ gnunet_conversation_gtk_ego_label_entry_preedit_changed_cb (GtkEntry *entry,
1663 -1, 1693 -1,
1664 NULL, 1694 NULL,
1665 preedit); 1695 preedit);
1696 update_copy_sensitivity ();
1666 update_phone_record (); 1697 update_phone_record ();
1667} 1698}
1668 1699
@@ -1678,6 +1709,7 @@ void
1678gnunet_conversation_gtk_ego_label_comboboxtext_changed_cb (GtkComboBox *widget, 1709gnunet_conversation_gtk_ego_label_comboboxtext_changed_cb (GtkComboBox *widget,
1679 gpointer user_data) 1710 gpointer user_data)
1680{ 1711{
1712 update_copy_sensitivity ();
1681 update_phone_record (); 1713 update_phone_record ();
1682} 1714}
1683 1715
@@ -1719,6 +1751,7 @@ gnunet_conversation_gtk_ego_combobox_changed_cb (GtkComboBox *widget,
1719 return; 1751 return;
1720 } 1752 }
1721 update_phone_record (); 1753 update_phone_record ();
1754 update_copy_sensitivity ();
1722 check_call_sensitivity (); 1755 check_call_sensitivity ();
1723 do_status (); 1756 do_status ();
1724} 1757}
@@ -1735,7 +1768,6 @@ GCG_PHONE_init ()
1735 cfg = GCG_get_configuration (); 1768 cfg = GCG_get_configuration ();
1736 speaker = GNUNET_SPEAKER_create_from_hardware (cfg); 1769 speaker = GNUNET_SPEAKER_create_from_hardware (cfg);
1737 mic = GNUNET_MICROPHONE_create_from_hardware (cfg); 1770 mic = GNUNET_MICROPHONE_create_from_hardware (cfg);
1738
1739 b_add_contact = GTK_WIDGET (GCG_get_main_window_object 1771 b_add_contact = GTK_WIDGET (GCG_get_main_window_object
1740 ("gnunet_conversation_gtk_add_contact_button")); 1772 ("gnunet_conversation_gtk_add_contact_button"));
1741 b_accept = GTK_WIDGET (GCG_get_main_window_object 1773 b_accept = GTK_WIDGET (GCG_get_main_window_object
diff --git a/src/conversation/gnunet-conversation-gtk_zones.c b/src/conversation/gnunet-conversation-gtk_zones.c
index 7b2c021c..0499405e 100644
--- a/src/conversation/gnunet-conversation-gtk_zones.c
+++ b/src/conversation/gnunet-conversation-gtk_zones.c
@@ -64,6 +64,31 @@ static char *default_ego;
64 64
65 65
66/** 66/**
67 * Obtain the currently selected zone.
68 *
69 * @return NULL if no ego is selected
70 */
71struct GNUNET_IDENTITY_Ego *
72GCG_ZONES_get_selected_zone ()
73{
74 struct GNUNET_IDENTITY_Ego *ego;
75 GtkTreeIter iter;
76 GtkComboBox *cb;
77
78 cb = GTK_COMBO_BOX (GCG_get_main_window_object
79 ("gnunet_conversation_gtk_contacts_zone_combobox"));
80 if (! gtk_combo_box_get_active_iter (cb,
81 &iter))
82 return NULL;
83 gtk_tree_model_get (GTK_TREE_MODEL (zone_liststore),
84 &iter,
85 ZONE_LS_EGO, &ego,
86 -1);
87 return ego;
88}
89
90
91/**
67 * Function called by identity service with information about zones. 92 * Function called by identity service with information about zones.
68 * 93 *
69 * @param cls NULL 94 * @param cls NULL
diff --git a/src/conversation/gnunet-conversation-gtk_zones.h b/src/conversation/gnunet-conversation-gtk_zones.h
index 56f94bf8..3b3e2239 100644
--- a/src/conversation/gnunet-conversation-gtk_zones.h
+++ b/src/conversation/gnunet-conversation-gtk_zones.h
@@ -31,6 +31,15 @@
31 31
32 32
33/** 33/**
34 * Obtain the currently selected zone.
35 *
36 * @return NULL if no ego is selected
37 */
38struct GNUNET_IDENTITY_Ego *
39GCG_ZONES_get_selected_zone (void);
40
41
42/**
34 * Initialize the contact list 43 * Initialize the contact list
35 * 44 *
36 * @param ego_name default ego to pre-select 45 * @param ego_name default ego to pre-select