diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-06-02 15:17:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-06-02 15:17:27 +0000 |
commit | c27d898af416555621a7404eba787b54b8825ac7 (patch) | |
tree | 83ac05592c24714e4e3da6d09624b76c6dd7b3f8 | |
parent | 249ef3c8c6fc901626e44cd2946ebc251d38d7e9 (diff) | |
download | gnunet-gtk-c27d898af416555621a7404eba787b54b8825ac7.tar.gz gnunet-gtk-c27d898af416555621a7404eba787b54b8825ac7.zip |
misc improvements to conversation GUI
-rw-r--r-- | contrib/gnunet_conversation_gtk_main_window.glade | 217 | ||||
-rw-r--r-- | src/conversation/Makefile.am | 2 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_contacts.c | 8 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_history.c | 63 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_history.h | 73 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_import.c | 24 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_import.h | 18 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_phone.c | 422 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_visibility.c | 14 |
9 files changed, 596 insertions, 245 deletions
diff --git a/contrib/gnunet_conversation_gtk_main_window.glade b/contrib/gnunet_conversation_gtk_main_window.glade index 593abc1a..646efe80 100644 --- a/contrib/gnunet_conversation_gtk_main_window.glade +++ b/contrib/gnunet_conversation_gtk_main_window.glade | |||
@@ -1,6 +1,7 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!-- Generated with glade 3.18.3 --> | ||
2 | <interface> | 3 | <interface> |
3 | <!-- interface-requires gtk+ 3.0 --> | 4 | <requires lib="gtk+" version="3.0"/> |
4 | <object class="GtkListStore" id="gnunet_conversation_gtk_active_calls_liststore"> | 5 | <object class="GtkListStore" id="gnunet_conversation_gtk_active_calls_liststore"> |
5 | <columns> | 6 | <columns> |
6 | <!-- column-name remote_user_name --> | 7 | <!-- column-name remote_user_name --> |
@@ -55,6 +56,10 @@ | |||
55 | <column type="gchararray"/> | 56 | <column type="gchararray"/> |
56 | <!-- column-name logContact --> | 57 | <!-- column-name logContact --> |
57 | <column type="gchararray"/> | 58 | <column type="gchararray"/> |
59 | <!-- column-name logCallNumber --> | ||
60 | <column type="guint"/> | ||
61 | <!-- column-name logTimeNumber --> | ||
62 | <column type="guint64"/> | ||
58 | </columns> | 63 | </columns> |
59 | </object> | 64 | </object> |
60 | <object class="GtkWindow" id="gnunet_conversation_gtk_main_window"> | 65 | <object class="GtkWindow" id="gnunet_conversation_gtk_main_window"> |
@@ -112,6 +117,14 @@ | |||
112 | <property name="visible">True</property> | 117 | <property name="visible">True</property> |
113 | <property name="can_focus">False</property> | 118 | <property name="can_focus">False</property> |
114 | <child> | 119 | <child> |
120 | <object class="GtkCheckMenuItem" id="gnunet_conversation_gtk_view_address_book_checkmenuitem"> | ||
121 | <property name="visible">True</property> | ||
122 | <property name="can_focus">False</property> | ||
123 | <property name="label" translatable="yes">_Address Book</property> | ||
124 | <property name="use_underline">True</property> | ||
125 | </object> | ||
126 | </child> | ||
127 | <child> | ||
115 | <object class="GtkCheckMenuItem" id="gnunet_conversation_gtk_view_caller_id_checkmenuitem"> | 128 | <object class="GtkCheckMenuItem" id="gnunet_conversation_gtk_view_caller_id_checkmenuitem"> |
116 | <property name="use_action_appearance">False</property> | 129 | <property name="use_action_appearance">False</property> |
117 | <property name="visible">True</property> | 130 | <property name="visible">True</property> |
@@ -119,7 +132,6 @@ | |||
119 | <property name="label" translatable="yes">_Caller Identity</property> | 132 | <property name="label" translatable="yes">_Caller Identity</property> |
120 | <property name="use_underline">True</property> | 133 | <property name="use_underline">True</property> |
121 | <property name="active">True</property> | 134 | <property name="active">True</property> |
122 | <property name="draw_as_radio">True</property> | ||
123 | <signal name="toggled" handler="gnunet_conversation_gtk_view_caller_id_checkmenuitem_toggled_cb" swapped="no"/> | 135 | <signal name="toggled" handler="gnunet_conversation_gtk_view_caller_id_checkmenuitem_toggled_cb" swapped="no"/> |
124 | </object> | 136 | </object> |
125 | </child> | 137 | </child> |
@@ -210,10 +222,10 @@ | |||
210 | <property name="visible">True</property> | 222 | <property name="visible">True</property> |
211 | <property name="can_focus">False</property> | 223 | <property name="can_focus">False</property> |
212 | <child> | 224 | <child> |
213 | <object class="GtkLabel" id="gnunet_conversation_gtk_ego_label_label"> | 225 | <object class="GtkLabel" id="gnunet_conversation_gtk_ego_label"> |
214 | <property name="visible">True</property> | 226 | <property name="visible">True</property> |
215 | <property name="can_focus">False</property> | 227 | <property name="can_focus">False</property> |
216 | <property name="label" translatable="yes">Label:</property> | 228 | <property name="label" translatable="yes">Ego:</property> |
217 | </object> | 229 | </object> |
218 | <packing> | 230 | <packing> |
219 | <property name="expand">False</property> | 231 | <property name="expand">False</property> |
@@ -223,33 +235,30 @@ | |||
223 | </packing> | 235 | </packing> |
224 | </child> | 236 | </child> |
225 | <child> | 237 | <child> |
226 | <object class="GtkComboBoxText" id="gnunet_conversation_gtk_ego_label_comboboxtext"> | 238 | <object class="GtkComboBox" id="gnunet_conversation_gtk_ego_combobox"> |
227 | <property name="visible">True</property> | 239 | <property name="visible">True</property> |
228 | <property name="can_focus">False</property> | 240 | <property name="can_focus">False</property> |
229 | <property name="has_entry">True</property> | 241 | <property name="model">gnunet_conversation_gtk_ego_liststore</property> |
230 | <property name="entry_text_column">0</property> | 242 | <signal name="changed" handler="gnunet_conversation_gtk_ego_combobox_changed_cb" swapped="no"/> |
231 | <property name="id_column">1</property> | 243 | <child> |
232 | <items> | 244 | <object class="GtkCellRendererText" id="gnunet_conversation_gtk_outgoing_zone_ego_name_cellrenderertext"/> |
233 | <item translatable="yes">phone</item> | 245 | <attributes> |
234 | </items> | 246 | <attribute name="text">0</attribute> |
235 | <child internal-child="entry"> | 247 | </attributes> |
236 | <object class="GtkEntry" id="comboboxtext-entry"> | ||
237 | <property name="can_focus">False</property> | ||
238 | </object> | ||
239 | </child> | 248 | </child> |
240 | </object> | 249 | </object> |
241 | <packing> | 250 | <packing> |
242 | <property name="expand">False</property> | 251 | <property name="expand">True</property> |
243 | <property name="fill">True</property> | 252 | <property name="fill">True</property> |
244 | <property name="padding">5</property> | 253 | <property name="padding">5</property> |
245 | <property name="position">1</property> | 254 | <property name="position">1</property> |
246 | </packing> | 255 | </packing> |
247 | </child> | 256 | </child> |
248 | <child> | 257 | <child> |
249 | <object class="GtkLabel" id="gnunet_conversation_gtk_ego_label"> | 258 | <object class="GtkLabel" id="gnunet_conversation_gtk_ego_label_label"> |
250 | <property name="visible">True</property> | 259 | <property name="visible">True</property> |
251 | <property name="can_focus">False</property> | 260 | <property name="can_focus">False</property> |
252 | <property name="label" translatable="yes">Ego:</property> | 261 | <property name="label" translatable="yes">Label:</property> |
253 | </object> | 262 | </object> |
254 | <packing> | 263 | <packing> |
255 | <property name="expand">False</property> | 264 | <property name="expand">False</property> |
@@ -259,16 +268,24 @@ | |||
259 | </packing> | 268 | </packing> |
260 | </child> | 269 | </child> |
261 | <child> | 270 | <child> |
262 | <object class="GtkComboBox" id="gnunet_conversation_gtk_ego_combobox"> | 271 | <object class="GtkComboBoxText" id="gnunet_conversation_gtk_ego_label_comboboxtext"> |
263 | <property name="visible">True</property> | 272 | <property name="visible">True</property> |
264 | <property name="can_focus">False</property> | 273 | <property name="can_focus">True</property> |
265 | <property name="model">gnunet_conversation_gtk_ego_liststore</property> | 274 | <property name="active">0</property> |
266 | <signal name="changed" handler="gnunet_conversation_gtk_ego_combobox_changed_cb" swapped="no"/> | 275 | <property name="has_entry">True</property> |
267 | <child> | 276 | <items> |
268 | <object class="GtkCellRendererText" id="gnunet_conversation_gtk_outgoing_zone_ego_name_cellrenderertext"/> | 277 | <item translatable="yes">phone</item> |
269 | <attributes> | 278 | </items> |
270 | <attribute name="text">0</attribute> | 279 | <signal name="changed" handler="gnunet_conversation_gtk_ego_label_comboboxtext_changed_cb" swapped="no"/> |
271 | </attributes> | 280 | <child internal-child="entry"> |
281 | <object class="GtkEntry" id="gnunet_conversation_gtk_ego_label_entry"> | ||
282 | <property name="visible">True</property> | ||
283 | <property name="can_focus">True</property> | ||
284 | <property name="tooltip_text" translatable="yes">Enter the label under which your phone should be published in your ego's zone here. The default is 'phone'.</property> | ||
285 | <property name="max_length">63</property> | ||
286 | <property name="caps_lock_warning">False</property> | ||
287 | <signal name="preedit-changed" handler="gnunet_conversation_gtk_ego_label_entry_preedit_changed_cb" swapped="no"/> | ||
288 | </object> | ||
272 | </child> | 289 | </child> |
273 | </object> | 290 | </object> |
274 | <packing> | 291 | <packing> |
@@ -283,15 +300,17 @@ | |||
283 | <property name="label">gtk-copy</property> | 300 | <property name="label">gtk-copy</property> |
284 | <property name="use_action_appearance">False</property> | 301 | <property name="use_action_appearance">False</property> |
285 | <property name="visible">True</property> | 302 | <property name="visible">True</property> |
303 | <property name="sensitive">False</property> | ||
286 | <property name="can_focus">True</property> | 304 | <property name="can_focus">True</property> |
287 | <property name="receives_default">True</property> | 305 | <property name="receives_default">True</property> |
288 | <property name="use_action_appearance">False</property> | 306 | <property name="tooltip_text" translatable="yes">Copy our phone address to the clipboard.</property> |
289 | <property name="use_stock">True</property> | 307 | <property name="use_stock">True</property> |
290 | <signal name="clicked" handler="gnunet_conversation_gtk_ego_copy_button_clicked_cb" swapped="no"/> | 308 | <signal name="clicked" handler="gnunet_conversation_gtk_ego_copy_button_clicked_cb" swapped="no"/> |
291 | </object> | 309 | </object> |
292 | <packing> | 310 | <packing> |
293 | <property name="expand">False</property> | 311 | <property name="expand">False</property> |
294 | <property name="fill">False</property> | 312 | <property name="fill">False</property> |
313 | <property name="padding">5</property> | ||
295 | <property name="position">4</property> | 314 | <property name="position">4</property> |
296 | </packing> | 315 | </packing> |
297 | </child> | 316 | </child> |
@@ -303,7 +322,7 @@ | |||
303 | <object class="GtkLabel" id="gnunet_conversation_gtk_ego_frame_label"> | 322 | <object class="GtkLabel" id="gnunet_conversation_gtk_ego_frame_label"> |
304 | <property name="visible">True</property> | 323 | <property name="visible">True</property> |
305 | <property name="can_focus">False</property> | 324 | <property name="can_focus">False</property> |
306 | <property name="label" translatable="yes">Caller Identity</property> | 325 | <property name="label" translatable="yes"><b>Caller Identity</b></property> |
307 | <property name="use_markup">True</property> | 326 | <property name="use_markup">True</property> |
308 | </object> | 327 | </object> |
309 | </child> | 328 | </child> |
@@ -311,6 +330,7 @@ | |||
311 | <packing> | 330 | <packing> |
312 | <property name="expand">False</property> | 331 | <property name="expand">False</property> |
313 | <property name="fill">True</property> | 332 | <property name="fill">True</property> |
333 | <property name="padding">5</property> | ||
314 | <property name="position">0</property> | 334 | <property name="position">0</property> |
315 | </packing> | 335 | </packing> |
316 | </child> | 336 | </child> |
@@ -352,7 +372,6 @@ | |||
352 | <property name="visible">True</property> | 372 | <property name="visible">True</property> |
353 | <property name="can_focus">True</property> | 373 | <property name="can_focus">True</property> |
354 | <property name="invisible_char">•</property> | 374 | <property name="invisible_char">•</property> |
355 | <property name="invisible_char_set">True</property> | ||
356 | <signal name="changed" handler="gnunet_conversation_gtk_address_entry_changed_cb" swapped="no"/> | 375 | <signal name="changed" handler="gnunet_conversation_gtk_address_entry_changed_cb" swapped="no"/> |
357 | </object> | 376 | </object> |
358 | <packing> | 377 | <packing> |
@@ -367,9 +386,9 @@ | |||
367 | <property name="label">gtk-connect</property> | 386 | <property name="label">gtk-connect</property> |
368 | <property name="use_action_appearance">False</property> | 387 | <property name="use_action_appearance">False</property> |
369 | <property name="visible">True</property> | 388 | <property name="visible">True</property> |
389 | <property name="sensitive">False</property> | ||
370 | <property name="can_focus">True</property> | 390 | <property name="can_focus">True</property> |
371 | <property name="receives_default">True</property> | 391 | <property name="receives_default">True</property> |
372 | <property name="use_action_appearance">False</property> | ||
373 | <property name="use_underline">True</property> | 392 | <property name="use_underline">True</property> |
374 | <property name="use_stock">True</property> | 393 | <property name="use_stock">True</property> |
375 | <property name="image_position">top</property> | 394 | <property name="image_position">top</property> |
@@ -389,7 +408,6 @@ | |||
389 | <property name="sensitive">False</property> | 408 | <property name="sensitive">False</property> |
390 | <property name="can_focus">True</property> | 409 | <property name="can_focus">True</property> |
391 | <property name="receives_default">True</property> | 410 | <property name="receives_default">True</property> |
392 | <property name="use_action_appearance">False</property> | ||
393 | <property name="use_stock">True</property> | 411 | <property name="use_stock">True</property> |
394 | <property name="image_position">top</property> | 412 | <property name="image_position">top</property> |
395 | <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_pause_clicked" swapped="no"/> | 413 | <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_pause_clicked" swapped="no"/> |
@@ -408,7 +426,6 @@ | |||
408 | <property name="sensitive">False</property> | 426 | <property name="sensitive">False</property> |
409 | <property name="can_focus">True</property> | 427 | <property name="can_focus">True</property> |
410 | <property name="receives_default">True</property> | 428 | <property name="receives_default">True</property> |
411 | <property name="use_action_appearance">False</property> | ||
412 | <property name="use_stock">True</property> | 429 | <property name="use_stock">True</property> |
413 | <property name="image_position">top</property> | 430 | <property name="image_position">top</property> |
414 | <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_hangup_clicked" swapped="no"/> | 431 | <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_hangup_clicked" swapped="no"/> |
@@ -432,6 +449,7 @@ | |||
432 | <object class="GtkBox" id="gnunet_conversation_gtk_active_calls_hbox"> | 449 | <object class="GtkBox" id="gnunet_conversation_gtk_active_calls_hbox"> |
433 | <property name="visible">True</property> | 450 | <property name="visible">True</property> |
434 | <property name="can_focus">False</property> | 451 | <property name="can_focus">False</property> |
452 | <property name="spacing">5</property> | ||
435 | <child> | 453 | <child> |
436 | <object class="GtkScrolledWindow" id="gnunet_conversation_gtk_active_calls_scrolledwindow"> | 454 | <object class="GtkScrolledWindow" id="gnunet_conversation_gtk_active_calls_scrolledwindow"> |
437 | <property name="visible">True</property> | 455 | <property name="visible">True</property> |
@@ -445,7 +463,7 @@ | |||
445 | <property name="enable_search">False</property> | 463 | <property name="enable_search">False</property> |
446 | <property name="search_column">0</property> | 464 | <property name="search_column">0</property> |
447 | <child internal-child="selection"> | 465 | <child internal-child="selection"> |
448 | <object class="GtkTreeSelection" id="treeview-selection5"/> | 466 | <object class="GtkTreeSelection" id="gnunet_conversation_gtk_active_calls_treeview_selection"/> |
449 | </child> | 467 | </child> |
450 | <child> | 468 | <child> |
451 | <object class="GtkTreeViewColumn" id="caller_numColumn"> | 469 | <object class="GtkTreeViewColumn" id="caller_numColumn"> |
@@ -455,10 +473,8 @@ | |||
455 | <property name="sort_indicator">True</property> | 473 | <property name="sort_indicator">True</property> |
456 | <property name="sort_column_id">2</property> | 474 | <property name="sort_column_id">2</property> |
457 | <child> | 475 | <child> |
458 | <object class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_active_calls_num"> | 476 | <object class="GtkCellRendererText" id="gnunet_conersation_gtk__active_calls_num"> |
459 | <property name="background_gdk">#000000000000</property> | ||
460 | <property name="font">Normal</property> | 477 | <property name="font">Normal</property> |
461 | <property name="foreground_gdk">#000000000000</property> | ||
462 | <property name="background_rgba">rgba(0,0,0,0)</property> | 478 | <property name="background_rgba">rgba(0,0,0,0)</property> |
463 | <property name="foreground_rgba">rgba(0,0,0,0)</property> | 479 | <property name="foreground_rgba">rgba(0,0,0,0)</property> |
464 | </object> | 480 | </object> |
@@ -476,7 +492,7 @@ | |||
476 | <property name="sort_indicator">True</property> | 492 | <property name="sort_indicator">True</property> |
477 | <property name="sort_column_id">7</property> | 493 | <property name="sort_column_id">7</property> |
478 | <child> | 494 | <child> |
479 | <object class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_active_calls_state"/> | 495 | <object class="GtkCellRendererText" id="gnunet_conversation_gtk_active_calls_state"/> |
480 | <attributes> | 496 | <attributes> |
481 | <attribute name="text">7</attribute> | 497 | <attribute name="text">7</attribute> |
482 | </attributes> | 498 | </attributes> |
@@ -492,7 +508,7 @@ | |||
492 | <property name="sort_indicator">True</property> | 508 | <property name="sort_indicator">True</property> |
493 | <property name="sort_column_id">0</property> | 509 | <property name="sort_column_id">0</property> |
494 | <child> | 510 | <child> |
495 | <object class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_active_calls_id"/> | 511 | <object class="GtkCellRendererText" id="gnunet_conversation_gtk_active_calls_id"/> |
496 | <attributes> | 512 | <attributes> |
497 | <attribute name="text">0</attribute> | 513 | <attribute name="text">0</attribute> |
498 | </attributes> | 514 | </attributes> |
@@ -505,6 +521,7 @@ | |||
505 | <packing> | 521 | <packing> |
506 | <property name="expand">True</property> | 522 | <property name="expand">True</property> |
507 | <property name="fill">True</property> | 523 | <property name="fill">True</property> |
524 | <property name="padding">5</property> | ||
508 | <property name="position">0</property> | 525 | <property name="position">0</property> |
509 | </packing> | 526 | </packing> |
510 | </child> | 527 | </child> |
@@ -514,6 +531,7 @@ | |||
514 | <property name="can_focus">False</property> | 531 | <property name="can_focus">False</property> |
515 | <property name="border_width">2</property> | 532 | <property name="border_width">2</property> |
516 | <property name="orientation">vertical</property> | 533 | <property name="orientation">vertical</property> |
534 | <property name="spacing">5</property> | ||
517 | <property name="layout_style">start</property> | 535 | <property name="layout_style">start</property> |
518 | <child> | 536 | <child> |
519 | <object class="GtkImage" id="GNUNET_GTK_status_icon"> | 537 | <object class="GtkImage" id="GNUNET_GTK_status_icon"> |
@@ -538,7 +556,6 @@ | |||
538 | <property name="sensitive">False</property> | 556 | <property name="sensitive">False</property> |
539 | <property name="can_focus">True</property> | 557 | <property name="can_focus">True</property> |
540 | <property name="receives_default">True</property> | 558 | <property name="receives_default">True</property> |
541 | <property name="use_action_appearance">False</property> | ||
542 | <property name="xalign">0.4699999988079071</property> | 559 | <property name="xalign">0.4699999988079071</property> |
543 | <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_use_current_button_clicked" swapped="no"/> | 560 | <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_use_current_button_clicked" swapped="no"/> |
544 | </object> | 561 | </object> |
@@ -557,7 +574,6 @@ | |||
557 | <property name="sensitive">False</property> | 574 | <property name="sensitive">False</property> |
558 | <property name="can_focus">True</property> | 575 | <property name="can_focus">True</property> |
559 | <property name="receives_default">True</property> | 576 | <property name="receives_default">True</property> |
560 | <property name="use_action_appearance">False</property> | ||
561 | <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_accept_clicked" swapped="no"/> | 577 | <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_accept_clicked" swapped="no"/> |
562 | </object> | 578 | </object> |
563 | <packing> | 579 | <packing> |
@@ -575,7 +591,6 @@ | |||
575 | <property name="sensitive">False</property> | 591 | <property name="sensitive">False</property> |
576 | <property name="can_focus">True</property> | 592 | <property name="can_focus">True</property> |
577 | <property name="receives_default">True</property> | 593 | <property name="receives_default">True</property> |
578 | <property name="use_action_appearance">False</property> | ||
579 | <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_resume_clicked" swapped="no"/> | 594 | <signal name="clicked" handler="GNUNET_CONVERSATION_GTK_on_resume_clicked" swapped="no"/> |
580 | </object> | 595 | </object> |
581 | <packing> | 596 | <packing> |
@@ -593,7 +608,6 @@ | |||
593 | <property name="sensitive">False</property> | 608 | <property name="sensitive">False</property> |
594 | <property name="can_focus">True</property> | 609 | <property name="can_focus">True</property> |
595 | <property name="receives_default">True</property> | 610 | <property name="receives_default">True</property> |
596 | <property name="use_action_appearance">False</property> | ||
597 | </object> | 611 | </object> |
598 | <packing> | 612 | <packing> |
599 | <property name="expand">False</property> | 613 | <property name="expand">False</property> |
@@ -626,13 +640,15 @@ | |||
626 | <object class="GtkLabel" id="gnunet_conversation_gtk_call_label"> | 640 | <object class="GtkLabel" id="gnunet_conversation_gtk_call_label"> |
627 | <property name="visible">True</property> | 641 | <property name="visible">True</property> |
628 | <property name="can_focus">False</property> | 642 | <property name="can_focus">False</property> |
629 | <property name="label" translatable="yes">Call Information</property> | 643 | <property name="label" translatable="yes"><b>Call Information</b></property> |
644 | <property name="use_markup">True</property> | ||
630 | </object> | 645 | </object> |
631 | </child> | 646 | </child> |
632 | </object> | 647 | </object> |
633 | <packing> | 648 | <packing> |
634 | <property name="expand">True</property> | 649 | <property name="expand">True</property> |
635 | <property name="fill">True</property> | 650 | <property name="fill">True</property> |
651 | <property name="padding">5</property> | ||
636 | <property name="position">1</property> | 652 | <property name="position">1</property> |
637 | </packing> | 653 | </packing> |
638 | </child> | 654 | </child> |
@@ -697,61 +713,70 @@ | |||
697 | <property name="visible">True</property> | 713 | <property name="visible">True</property> |
698 | <property name="can_focus">True</property> | 714 | <property name="can_focus">True</property> |
699 | <property name="receives_default">True</property> | 715 | <property name="receives_default">True</property> |
700 | <property name="use_action_appearance">False</property> | 716 | <property name="tooltip_text" translatable="yes">Add phone address from clipboard to address book.</property> |
701 | <property name="use_stock">True</property> | 717 | <property name="use_stock">True</property> |
702 | <signal name="clicked" handler="gnunet_conversation_gtk_contacts_paste_button_clicked_cb" swapped="no"/> | 718 | <signal name="clicked" handler="gnunet_conversation_gtk_contacts_paste_button_clicked_cb" swapped="no"/> |
703 | </object> | 719 | </object> |
704 | <packing> | 720 | <packing> |
705 | <property name="expand">False</property> | 721 | <property name="expand">False</property> |
706 | <property name="fill">True</property> | 722 | <property name="fill">False</property> |
723 | <property name="padding">5</property> | ||
707 | <property name="position">2</property> | 724 | <property name="position">2</property> |
708 | </packing> | 725 | </packing> |
709 | </child> | 726 | </child> |
710 | </object> | 727 | </object> |
711 | <packing> | 728 | <packing> |
712 | <property name="expand">False</property> | 729 | <property name="expand">False</property> |
713 | <property name="fill">True</property> | 730 | <property name="fill">False</property> |
731 | <property name="padding">5</property> | ||
714 | <property name="position">0</property> | 732 | <property name="position">0</property> |
715 | </packing> | 733 | </packing> |
716 | </child> | 734 | </child> |
717 | <child> | 735 | <child> |
718 | <object class="GtkTreeView" id="gnunet_conversation_gtk_contact_list_treeview"> | 736 | <object class="GtkScrolledWindow" id="gnunet_conversation_gtk_contact_list_scrolledwindow"> |
719 | <property name="visible">True</property> | 737 | <property name="visible">True</property> |
720 | <property name="can_focus">True</property> | 738 | <property name="can_focus">True</property> |
721 | <property name="model">gnunet_conversation_gtk_contacts_liststore</property> | 739 | <property name="shadow_type">in</property> |
722 | <property name="headers_clickable">False</property> | ||
723 | <property name="search_column">0</property> | ||
724 | <signal name="row-activated" handler="gnunet_conversation_gtk_contact_list_treeview_row_activated_cb" swapped="no"/> | ||
725 | <child internal-child="selection"> | ||
726 | <object class="GtkTreeSelection" id="treeview-selection"/> | ||
727 | </child> | ||
728 | <child> | 740 | <child> |
729 | <object class="GtkTreeViewColumn" id="gnunet_conversation_gtk_contact_list_type_column"> | 741 | <object class="GtkTreeView" id="gnunet_conversation_gtk_contact_list_treeview"> |
730 | <property name="title" translatable="yes">Type</property> | 742 | <property name="visible">True</property> |
743 | <property name="can_focus">True</property> | ||
744 | <property name="model">gnunet_conversation_gtk_contacts_liststore</property> | ||
745 | <property name="headers_clickable">False</property> | ||
746 | <property name="search_column">0</property> | ||
747 | <signal name="row-activated" handler="gnunet_conversation_gtk_contact_list_treeview_row_activated_cb" swapped="no"/> | ||
748 | <child internal-child="selection"> | ||
749 | <object class="GtkTreeSelection" id="treeview-selection"/> | ||
750 | </child> | ||
731 | <child> | 751 | <child> |
732 | <object class="GtkCellRendererText" id="gnunet_conversation_gtk_contact_list_type_renderer"/> | 752 | <object class="GtkTreeViewColumn" id="gnunet_conversation_gtk_contact_list_type_column"> |
733 | <attributes> | 753 | <property name="title" translatable="yes">Type</property> |
734 | <attribute name="text">1</attribute> | 754 | <child> |
735 | </attributes> | 755 | <object class="GtkCellRendererText" id="gnunet_conversation_gtk_contact_list_type_renderer"/> |
756 | <attributes> | ||
757 | <attribute name="text">1</attribute> | ||
758 | </attributes> | ||
759 | </child> | ||
760 | </object> | ||
736 | </child> | 761 | </child> |
737 | </object> | ||
738 | </child> | ||
739 | <child> | ||
740 | <object class="GtkTreeViewColumn" id="gnunet_conversation_gtk_contact_list_value_column"> | ||
741 | <property name="resizable">True</property> | ||
742 | <property name="title" translatable="yes">Name</property> | ||
743 | <property name="expand">True</property> | ||
744 | <child> | 762 | <child> |
745 | <object class="GtkCellRendererText" id="gnunet_conversation_gtk_contact_list_value_renderer"/> | 763 | <object class="GtkTreeViewColumn" id="gnunet_conversation_gtk_contact_list_value_column"> |
746 | <attributes> | 764 | <property name="resizable">True</property> |
747 | <attribute name="text">0</attribute> | 765 | <property name="title" translatable="yes">Name</property> |
748 | </attributes> | 766 | <property name="expand">True</property> |
767 | <child> | ||
768 | <object class="GtkCellRendererText" id="gnunet_conversation_gtk_contact_list_value_renderer"/> | ||
769 | <attributes> | ||
770 | <attribute name="text">0</attribute> | ||
771 | </attributes> | ||
772 | </child> | ||
773 | </object> | ||
749 | </child> | 774 | </child> |
750 | </object> | 775 | </object> |
751 | </child> | 776 | </child> |
752 | </object> | 777 | </object> |
753 | <packing> | 778 | <packing> |
754 | <property name="expand">True</property> | 779 | <property name="expand">False</property> |
755 | <property name="fill">True</property> | 780 | <property name="fill">True</property> |
756 | <property name="position">1</property> | 781 | <property name="position">1</property> |
757 | </packing> | 782 | </packing> |
@@ -764,13 +789,15 @@ | |||
764 | <object class="GtkLabel" id="gnunet_conversation_address_book_label"> | 789 | <object class="GtkLabel" id="gnunet_conversation_address_book_label"> |
765 | <property name="visible">True</property> | 790 | <property name="visible">True</property> |
766 | <property name="can_focus">False</property> | 791 | <property name="can_focus">False</property> |
767 | <property name="label" translatable="yes">Address Book</property> | 792 | <property name="label" translatable="yes"><b>Address Book</b></property> |
793 | <property name="use_markup">True</property> | ||
768 | </object> | 794 | </object> |
769 | </child> | 795 | </child> |
770 | </object> | 796 | </object> |
771 | <packing> | 797 | <packing> |
772 | <property name="expand">False</property> | 798 | <property name="expand">True</property> |
773 | <property name="fill">True</property> | 799 | <property name="fill">True</property> |
800 | <property name="padding">5</property> | ||
774 | <property name="position">2</property> | 801 | <property name="position">2</property> |
775 | </packing> | 802 | </packing> |
776 | </child> | 803 | </child> |
@@ -802,6 +829,9 @@ | |||
802 | <child> | 829 | <child> |
803 | <object class="GtkTreeViewColumn" id="timeColumn"> | 830 | <object class="GtkTreeViewColumn" id="timeColumn"> |
804 | <property name="title" translatable="yes">Time</property> | 831 | <property name="title" translatable="yes">Time</property> |
832 | <property name="reorderable">True</property> | ||
833 | <property name="sort_indicator">True</property> | ||
834 | <property name="sort_column_id">4</property> | ||
805 | <child> | 835 | <child> |
806 | <object class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_time_window_renderer"/> | 836 | <object class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_time_window_renderer"/> |
807 | <attributes> | 837 | <attributes> |
@@ -811,19 +841,23 @@ | |||
811 | </object> | 841 | </object> |
812 | </child> | 842 | </child> |
813 | <child> | 843 | <child> |
814 | <object class="GtkTreeViewColumn" id="eventColumn"> | 844 | <object class="GtkTreeViewColumn" id="gnunet_conversation_gtk_history_number_treeviewcolumn"> |
815 | <property name="title" translatable="yes">Event</property> | 845 | <property name="title" translatable="yes">#</property> |
846 | <property name="clickable">True</property> | ||
847 | <property name="reorderable">True</property> | ||
848 | <property name="sort_indicator">True</property> | ||
849 | <property name="sort_column_id">3</property> | ||
816 | <child> | 850 | <child> |
817 | <object class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_event_window_renderer"/> | 851 | <object class="GtkCellRendererText" id="gnunet_conversation_gtk_history_number_cellrenderertext"/> |
818 | <attributes> | 852 | <attributes> |
819 | <attribute name="text">1</attribute> | 853 | <attribute name="text">3</attribute> |
820 | </attributes> | 854 | </attributes> |
821 | </child> | 855 | </child> |
822 | </object> | 856 | </object> |
823 | </child> | 857 | </child> |
824 | <child> | 858 | <child> |
825 | <object class="GtkTreeViewColumn" id="contactColumn"> | 859 | <object class="GtkTreeViewColumn" id="contactColumn"> |
826 | <property name="title" translatable="yes">Contact</property> | 860 | <property name="title" translatable="yes">Caller ID</property> |
827 | <child> | 861 | <child> |
828 | <object class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_contact_window_renderer"/> | 862 | <object class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_contact_window_renderer"/> |
829 | <attributes> | 863 | <attributes> |
@@ -832,6 +866,17 @@ | |||
832 | </child> | 866 | </child> |
833 | </object> | 867 | </object> |
834 | </child> | 868 | </child> |
869 | <child> | ||
870 | <object class="GtkTreeViewColumn" id="eventColumn"> | ||
871 | <property name="title" translatable="yes">Event</property> | ||
872 | <child> | ||
873 | <object class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_event_window_renderer"/> | ||
874 | <attributes> | ||
875 | <attribute name="text">1</attribute> | ||
876 | </attributes> | ||
877 | </child> | ||
878 | </object> | ||
879 | </child> | ||
835 | </object> | 880 | </object> |
836 | </child> | 881 | </child> |
837 | </object> | 882 | </object> |
@@ -842,13 +887,15 @@ | |||
842 | <object class="GtkLabel" id="gnunet_conversation_gtk_history_label"> | 887 | <object class="GtkLabel" id="gnunet_conversation_gtk_history_label"> |
843 | <property name="visible">True</property> | 888 | <property name="visible">True</property> |
844 | <property name="can_focus">False</property> | 889 | <property name="can_focus">False</property> |
845 | <property name="label" translatable="yes">History</property> | 890 | <property name="label" translatable="yes"><b>History</b></property> |
891 | <property name="use_markup">True</property> | ||
846 | </object> | 892 | </object> |
847 | </child> | 893 | </child> |
848 | </object> | 894 | </object> |
849 | <packing> | 895 | <packing> |
850 | <property name="expand">False</property> | 896 | <property name="expand">True</property> |
851 | <property name="fill">True</property> | 897 | <property name="fill">True</property> |
898 | <property name="padding">5</property> | ||
852 | <property name="position">3</property> | 899 | <property name="position">3</property> |
853 | </packing> | 900 | </packing> |
854 | </child> | 901 | </child> |
@@ -885,13 +932,15 @@ | |||
885 | <object class="GtkLabel" id="gnunet_conversation_gtk_log_label"> | 932 | <object class="GtkLabel" id="gnunet_conversation_gtk_log_label"> |
886 | <property name="visible">True</property> | 933 | <property name="visible">True</property> |
887 | <property name="can_focus">False</property> | 934 | <property name="can_focus">False</property> |
888 | <property name="label" translatable="yes">Logs</property> | 935 | <property name="label" translatable="yes"><b>Logs</b></property> |
936 | <property name="use_markup">True</property> | ||
889 | </object> | 937 | </object> |
890 | </child> | 938 | </child> |
891 | </object> | 939 | </object> |
892 | <packing> | 940 | <packing> |
893 | <property name="expand">False</property> | 941 | <property name="expand">True</property> |
894 | <property name="fill">True</property> | 942 | <property name="fill">True</property> |
943 | <property name="padding">5</property> | ||
895 | <property name="position">4</property> | 944 | <property name="position">4</property> |
896 | </packing> | 945 | </packing> |
897 | </child> | 946 | </child> |
diff --git a/src/conversation/Makefile.am b/src/conversation/Makefile.am index 71f940ba..35a1fb1f 100644 --- a/src/conversation/Makefile.am +++ b/src/conversation/Makefile.am | |||
@@ -35,7 +35,7 @@ gnunet_conversation_gtk_LDADD = \ | |||
35 | $(top_builddir)/src/lib/libgnunetgtk.la \ | 35 | $(top_builddir)/src/lib/libgnunetgtk.la \ |
36 | @GTK_LIBS@ \ | 36 | @GTK_LIBS@ \ |
37 | @GLADE_LIBS@ @GNUNET_LIBS@ \ | 37 | @GLADE_LIBS@ @GNUNET_LIBS@ \ |
38 | -lgnunetutil -lgnunetidentity -lgnunetconversation -lgnunetspeaker -lgnunetmicrophone -lgnunetnamestore -lgnunetgnsrecord -lgnunetgns -lgnunetfs -lextractor \ | 38 | -lgnunetutil -lgnunetidentity -lgnunetconversation -lgnunetspeaker -lgnunetmicrophone -lgnunetnamestore -lgnunetdnsparser -lgnunetgnsrecord -lgnunetgns -lgnunetfs -lextractor \ |
39 | $(INTLLIBS) | 39 | $(INTLLIBS) |
40 | gnunet_conversation_gtk_LDFLAGS = \ | 40 | gnunet_conversation_gtk_LDFLAGS = \ |
41 | -export-dynamic | 41 | -export-dynamic |
diff --git a/src/conversation/gnunet-conversation-gtk_contacts.c b/src/conversation/gnunet-conversation-gtk_contacts.c index 7df39bb2..b080c8fc 100644 --- a/src/conversation/gnunet-conversation-gtk_contacts.c +++ b/src/conversation/gnunet-conversation-gtk_contacts.c | |||
@@ -64,7 +64,7 @@ static GtkTreeModel *contacts_treemodel; | |||
64 | */ | 64 | */ |
65 | static struct GNUNET_NAMESTORE_ZoneMonitor *zone_mon; | 65 | static struct GNUNET_NAMESTORE_ZoneMonitor *zone_mon; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * The tree view widget. | 68 | * The tree view widget. |
69 | */ | 69 | */ |
70 | static GtkWidget *contacts_treeview; | 70 | static GtkWidget *contacts_treeview; |
@@ -101,7 +101,7 @@ gnunet_conversation_gtk_contact_list_treeview_row_activated_cb (GtkTreeView *tr | |||
101 | if (0 == strcmp (type, "PKEY")) | 101 | if (0 == strcmp (type, "PKEY")) |
102 | { | 102 | { |
103 | GNUNET_asprintf (&address, | 103 | GNUNET_asprintf (&address, |
104 | "call.%s.gnu", | 104 | "phone.%s.gnu", |
105 | name); | 105 | name); |
106 | } | 106 | } |
107 | else | 107 | else |
@@ -281,7 +281,7 @@ void | |||
281 | gnunet_conversation_gtk_contacts_paste_button_clicked_cb (GtkButton *button, | 281 | gnunet_conversation_gtk_contacts_paste_button_clicked_cb (GtkButton *button, |
282 | gpointer user_data) | 282 | gpointer user_data) |
283 | { | 283 | { |
284 | GNUNET_break (0); | 284 | GNUNET_break (0); // FIXME: not implemented |
285 | } | 285 | } |
286 | 286 | ||
287 | 287 | ||
@@ -293,7 +293,7 @@ GCG_CONTACTS_init () | |||
293 | { | 293 | { |
294 | contacts_treeview | 294 | contacts_treeview |
295 | = GTK_WIDGET (GCG_get_main_window_object | 295 | = GTK_WIDGET (GCG_get_main_window_object |
296 | ("gnunet_conversation_gtk_treeview")); | 296 | ("gnunet_conversation_gtk_contact_list_treeview")); |
297 | #if GTK_CHECK_VERSION(3,10,0) | 297 | #if GTK_CHECK_VERSION(3,10,0) |
298 | gtk_tree_view_set_activate_on_single_click (GTK_TREE_VIEW (contacts_treeview), | 298 | gtk_tree_view_set_activate_on_single_click (GTK_TREE_VIEW (contacts_treeview), |
299 | TRUE); | 299 | TRUE); |
diff --git a/src/conversation/gnunet-conversation-gtk_history.c b/src/conversation/gnunet-conversation-gtk_history.c index 2010e633..8d5baa2e 100644 --- a/src/conversation/gnunet-conversation-gtk_history.c +++ b/src/conversation/gnunet-conversation-gtk_history.c | |||
@@ -46,7 +46,17 @@ enum HistoryListstoreValues | |||
46 | /** | 46 | /** |
47 | * Human-readable name of the contact involved (gchar *) | 47 | * Human-readable name of the contact involved (gchar *) |
48 | */ | 48 | */ |
49 | HISTORY_LS_CONTACT = 2 | 49 | HISTORY_LS_CONTACT = 2, |
50 | |||
51 | /** | ||
52 | * Unique number associated with the call (guint) | ||
53 | */ | ||
54 | HISTORY_LS_NUMBER = 3, | ||
55 | |||
56 | /** | ||
57 | * Number of the entry used for sorting by timestamp (guint64) | ||
58 | */ | ||
59 | HISTORY_LS_TIME_ORDER = 4 | ||
50 | }; | 60 | }; |
51 | 61 | ||
52 | 62 | ||
@@ -61,43 +71,70 @@ static GtkListStore *history_liststore; | |||
61 | * | 71 | * |
62 | * @param type type of the event | 72 | * @param type type of the event |
63 | * @param contact_name name of the contact person | 73 | * @param contact_name name of the contact person |
74 | * @param call_number unique number for the call | ||
64 | */ | 75 | */ |
65 | void | 76 | void |
66 | GCG_HISTORY_add (enum GCG_HISTORY_Type type, | 77 | GCG_HISTORY_add (enum GCG_HISTORY_Type type, |
67 | const char *contact_name) | 78 | const char *contact_name, |
79 | guint call_number) | ||
68 | { | 80 | { |
69 | GtkTreeIter iter; | 81 | GtkTreeIter iter; |
82 | struct GNUNET_TIME_Absolute now; | ||
70 | const char *event; | 83 | const char *event; |
71 | const char *ts; | 84 | const char *ts; |
72 | 85 | ||
73 | switch (type) | 86 | switch (type) |
74 | { | 87 | { |
75 | case GCG_HISTORY_TYPE_ACCEPTED: | 88 | case GCG_HISTORY_TYPE_OUTGOING_CALL: |
89 | event = "Dialing"; | ||
90 | break; | ||
91 | case GCG_HISTORY_TYPE_OUTGOING_RINGING: | ||
92 | event = "Waiting"; | ||
93 | break; | ||
94 | case GCG_HISTORY_TYPE_OUTGOING_ACCEPTED: | ||
76 | event = "Accepted"; | 95 | event = "Accepted"; |
77 | break; | 96 | break; |
78 | case GCG_HISTORY_TYPE_REJECTED: | 97 | case GCG_HISTORY_TYPE_INCOMING_CALL: |
79 | event = "Rejected"; | 98 | event = "Ringing"; |
80 | break; | 99 | break; |
81 | case GCG_HISTORY_TYPE_OUTGOING: | 100 | case GCG_HISTORY_TYPE_INCOMING_ACCEPTED: |
82 | event = "Outgoing"; | 101 | event = "Answering"; |
83 | break; | 102 | break; |
84 | case GCG_HISTORY_TYPE_HANGUP: | 103 | case GCG_HISTORY_TYPE_INCOMING_REJECTED: |
85 | event = "Hangup"; | 104 | event = "Rejected"; |
86 | break; | 105 | break; |
87 | case GCG_HISTORY_TYPE_MISSED: | 106 | case GCG_HISTORY_TYPE_INCOMING_MISSED: |
88 | event = "Missed"; | 107 | event = "Missed"; |
89 | break; | 108 | break; |
90 | default: | 109 | case GCG_HISTORY_TYPE_SUSPEND_LOCAL: |
91 | event = "UNKNOWN"; | 110 | event = "Suspending"; |
111 | break; | ||
112 | case GCG_HISTORY_TYPE_RESUMED_LOCAL: | ||
113 | event = "Resuming"; | ||
114 | break; | ||
115 | case GCG_HISTORY_TYPE_SUSPEND_REMOTE: | ||
116 | event = "On hold"; | ||
117 | break; | ||
118 | case GCG_HISTORY_TYPE_RESUMED_REMOTE: | ||
119 | event = "Resumed"; | ||
120 | break; | ||
121 | case GCG_HISTORY_TYPE_HANGUP: | ||
122 | event = "Hang up"; | ||
123 | break; | ||
124 | case GCG_HISTORY_TYPE_FAILED: | ||
125 | event = "Failed"; | ||
92 | break; | 126 | break; |
93 | } | 127 | } |
94 | ts = GNUNET_STRINGS_absolute_time_to_string (GNUNET_TIME_absolute_get ()); | 128 | now = GNUNET_TIME_absolute_get (); |
129 | ts = GNUNET_STRINGS_absolute_time_to_string (now); | ||
95 | gtk_list_store_insert_with_values (history_liststore, | 130 | gtk_list_store_insert_with_values (history_liststore, |
96 | &iter, | 131 | &iter, |
97 | -1, | 132 | -1, |
98 | HISTORY_LS_TIME, ts, | 133 | HISTORY_LS_TIME, ts, |
99 | HISTORY_LS_EVENT, event, | 134 | HISTORY_LS_EVENT, event, |
100 | HISTORY_LS_CONTACT, contact_name, | 135 | HISTORY_LS_CONTACT, contact_name, |
136 | HISTORY_LS_NUMBER, call_number, | ||
137 | HISTORY_LS_TIME_ORDER, (guint64) now.abs_value_us, | ||
101 | -1); | 138 | -1); |
102 | } | 139 | } |
103 | 140 | ||
diff --git a/src/conversation/gnunet-conversation-gtk_history.h b/src/conversation/gnunet-conversation-gtk_history.h index 4d6a7839..722555f5 100644 --- a/src/conversation/gnunet-conversation-gtk_history.h +++ b/src/conversation/gnunet-conversation-gtk_history.h | |||
@@ -33,11 +33,72 @@ | |||
33 | */ | 33 | */ |
34 | enum GCG_HISTORY_Type | 34 | enum GCG_HISTORY_Type |
35 | { | 35 | { |
36 | GCG_HISTORY_TYPE_ACCEPTED, | 36 | /** |
37 | GCG_HISTORY_TYPE_REJECTED, | 37 | * We initiated an outgoing call. |
38 | GCG_HISTORY_TYPE_OUTGOING, | 38 | */ |
39 | GCG_HISTORY_TYPE_OUTGOING_CALL, | ||
40 | |||
41 | /** | ||
42 | * We are ringing other party in outgoing call. | ||
43 | */ | ||
44 | GCG_HISTORY_TYPE_OUTGOING_RINGING, | ||
45 | |||
46 | /** | ||
47 | * An outgoing call was accepted. | ||
48 | */ | ||
49 | GCG_HISTORY_TYPE_OUTGOING_ACCEPTED, | ||
50 | |||
51 | /** | ||
52 | * We have an incoming call. | ||
53 | */ | ||
54 | GCG_HISTORY_TYPE_INCOMING_CALL, | ||
55 | |||
56 | /** | ||
57 | * We answered an incoming call. | ||
58 | */ | ||
59 | GCG_HISTORY_TYPE_INCOMING_ACCEPTED, | ||
60 | |||
61 | /** | ||
62 | * We rejected an incoming call. | ||
63 | */ | ||
64 | GCG_HISTORY_TYPE_INCOMING_REJECTED, | ||
65 | |||
66 | /** | ||
67 | * We missed a call (phone was ringing and | ||
68 | * then caller hung up before we did anything). | ||
69 | */ | ||
70 | GCG_HISTORY_TYPE_INCOMING_MISSED, | ||
71 | |||
72 | /** | ||
73 | * We suspended an active call. | ||
74 | */ | ||
75 | GCG_HISTORY_TYPE_SUSPEND_LOCAL, | ||
76 | |||
77 | /** | ||
78 | * We resumed a suspended call. | ||
79 | */ | ||
80 | GCG_HISTORY_TYPE_RESUMED_LOCAL, | ||
81 | |||
82 | /** | ||
83 | * Remote suspended an active call. | ||
84 | */ | ||
85 | GCG_HISTORY_TYPE_SUSPEND_REMOTE, | ||
86 | |||
87 | /** | ||
88 | * Remote resumed suspended call. | ||
89 | */ | ||
90 | GCG_HISTORY_TYPE_RESUMED_REMOTE, | ||
91 | |||
92 | /** | ||
93 | * Either side terminated an active call. | ||
94 | */ | ||
39 | GCG_HISTORY_TYPE_HANGUP, | 95 | GCG_HISTORY_TYPE_HANGUP, |
40 | GCG_HISTORY_TYPE_MISSED | 96 | |
97 | /** | ||
98 | * Failed to resolve target. | ||
99 | */ | ||
100 | GCG_HISTORY_TYPE_FAILED | ||
101 | |||
41 | }; | 102 | }; |
42 | 103 | ||
43 | 104 | ||
@@ -46,10 +107,12 @@ enum GCG_HISTORY_Type | |||
46 | * | 107 | * |
47 | * @param type type of the event | 108 | * @param type type of the event |
48 | * @param contact_name name of the contact person | 109 | * @param contact_name name of the contact person |
110 | * @param call_number unique number for the call | ||
49 | */ | 111 | */ |
50 | void | 112 | void |
51 | GCG_HISTORY_add (enum GCG_HISTORY_Type type, | 113 | GCG_HISTORY_add (enum GCG_HISTORY_Type type, |
52 | const char *contact_name); | 114 | const char *contact_name, |
115 | guint call_number); | ||
53 | 116 | ||
54 | 117 | ||
55 | /** | 118 | /** |
diff --git a/src/conversation/gnunet-conversation-gtk_import.c b/src/conversation/gnunet-conversation-gtk_import.c index 428894d7..5458bac3 100644 --- a/src/conversation/gnunet-conversation-gtk_import.c +++ b/src/conversation/gnunet-conversation-gtk_import.c | |||
@@ -117,6 +117,30 @@ GSC_add_contact (const gchar *name, | |||
117 | 117 | ||
118 | 118 | ||
119 | /** | 119 | /** |
120 | * Add phone address to namestore. | ||
121 | * | ||
122 | * @param label label to use for the phone record | ||
123 | * @param rd record data to publish | ||
124 | */ | ||
125 | void | ||
126 | GSC_add_phone (const gchar *label, | ||
127 | const struct GNUNET_GNSRECORD_Data *rd) | ||
128 | { | ||
129 | GNUNET_break (0); // FIXME: not implemented! | ||
130 | } | ||
131 | |||
132 | |||
133 | /** | ||
134 | * Remove previously added phone address from namestore. | ||
135 | */ | ||
136 | void | ||
137 | GSC_remove_phone () | ||
138 | { | ||
139 | GNUNET_break (0); // FIXME: not implemented! | ||
140 | } | ||
141 | |||
142 | |||
143 | /** | ||
120 | * Initialize the import subsystem. | 144 | * Initialize the import subsystem. |
121 | */ | 145 | */ |
122 | void | 146 | void |
diff --git a/src/conversation/gnunet-conversation-gtk_import.h b/src/conversation/gnunet-conversation-gtk_import.h index 759a5e07..000fa4e9 100644 --- a/src/conversation/gnunet-conversation-gtk_import.h +++ b/src/conversation/gnunet-conversation-gtk_import.h | |||
@@ -41,6 +41,24 @@ GSC_add_contact (const gchar *name, | |||
41 | 41 | ||
42 | 42 | ||
43 | /** | 43 | /** |
44 | * Add phone address to namestore. | ||
45 | * | ||
46 | * @param label label to use for the phone record | ||
47 | * @param rd record data to publish | ||
48 | */ | ||
49 | void | ||
50 | GSC_add_phone (const gchar *label, | ||
51 | const struct GNUNET_GNSRECORD_Data *rd); | ||
52 | |||
53 | |||
54 | /** | ||
55 | * Remove previously added phone address from namestore. | ||
56 | */ | ||
57 | void | ||
58 | GSC_remove_phone (void); | ||
59 | |||
60 | |||
61 | /** | ||
44 | * Initialize the import subsystem. | 62 | * Initialize the import subsystem. |
45 | */ | 63 | */ |
46 | void | 64 | void |
diff --git a/src/conversation/gnunet-conversation-gtk_phone.c b/src/conversation/gnunet-conversation-gtk_phone.c index 22f2e2af..4f6972e4 100644 --- a/src/conversation/gnunet-conversation-gtk_phone.c +++ b/src/conversation/gnunet-conversation-gtk_phone.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "gnunet-conversation-gtk.h" | 28 | #include "gnunet-conversation-gtk.h" |
29 | #include "gnunet-conversation-gtk_egos.h" | 29 | #include "gnunet-conversation-gtk_egos.h" |
30 | #include "gnunet-conversation-gtk_history.h" | 30 | #include "gnunet-conversation-gtk_history.h" |
31 | #include "gnunet-conversation-gtk_import.h" | ||
31 | #include "gnunet-conversation-gtk_log.h" | 32 | #include "gnunet-conversation-gtk_log.h" |
32 | #include "gnunet-conversation-gtk_phone.h" | 33 | #include "gnunet-conversation-gtk_phone.h" |
33 | 34 | ||
@@ -231,7 +232,7 @@ struct OutgoingCall | |||
231 | /** | 232 | /** |
232 | * Name of conversation partner. | 233 | * Name of conversation partner. |
233 | */ | 234 | */ |
234 | char *peer_name; | 235 | char *caller_id; |
235 | 236 | ||
236 | /** | 237 | /** |
237 | * Location of this call in the list. | 238 | * Location of this call in the list. |
@@ -334,6 +335,11 @@ static GtkWidget *b_call; | |||
334 | static GtkWidget *b_hangup; | 335 | static GtkWidget *b_hangup; |
335 | 336 | ||
336 | /** | 337 | /** |
338 | * The "copy" button. | ||
339 | */ | ||
340 | static GtkWidget *b_copy; | ||
341 | |||
342 | /** | ||
337 | * Our address entry. | 343 | * Our address entry. |
338 | */ | 344 | */ |
339 | static GtkEntry *address_entry; | 345 | static GtkEntry *address_entry; |
@@ -362,9 +368,6 @@ in_call_state_to_string (enum InCallState is) | |||
362 | return _("on hold"); | 368 | return _("on hold"); |
363 | case IN_STATE_SUSPENDED_BOTH: | 369 | case IN_STATE_SUSPENDED_BOTH: |
364 | return _("suspended and on hold"); | 370 | return _("suspended and on hold"); |
365 | default: | ||
366 | GNUNET_break (0); | ||
367 | break; | ||
368 | } | 371 | } |
369 | return NULL; | 372 | return NULL; |
370 | } | 373 | } |
@@ -395,9 +398,6 @@ out_call_state_to_string (enum OutCallState os) | |||
395 | return _("on hold"); | 398 | return _("on hold"); |
396 | case OUT_STATE_SUSPENDED_BOTH: | 399 | case OUT_STATE_SUSPENDED_BOTH: |
397 | return _("suspended and on hold"); | 400 | return _("suspended and on hold"); |
398 | default: | ||
399 | GNUNET_break (0); | ||
400 | break; | ||
401 | } | 401 | } |
402 | return NULL; | 402 | return NULL; |
403 | } | 403 | } |
@@ -435,7 +435,7 @@ destroy_out (struct OutgoingCall *oc) | |||
435 | GNUNET_CONVERSATION_call_stop (oc->call); | 435 | GNUNET_CONVERSATION_call_stop (oc->call); |
436 | oc->call = NULL; | 436 | oc->call = NULL; |
437 | } | 437 | } |
438 | GNUNET_free (oc->peer_name); | 438 | GNUNET_free (oc->caller_id); |
439 | gtk_tree_row_reference_free (oc->rr); | 439 | gtk_tree_row_reference_free (oc->rr); |
440 | GNUNET_free (oc); | 440 | GNUNET_free (oc); |
441 | } | 441 | } |
@@ -461,9 +461,93 @@ do_status () | |||
461 | if ( (NULL == active_in) && | 461 | if ( (NULL == active_in) && |
462 | (NULL == active_out) ) | 462 | (NULL == active_out) ) |
463 | { | 463 | { |
464 | GCG_update_status_bar ("%s", | 464 | if (NULL != phone) |
465 | _("We are listening for incoming calls")); | 465 | { |
466 | GCG_set_status_icon ("gnunet-conversation-gtk-tray-available"); | 466 | GCG_update_status_bar ("%s", |
467 | _("We are listening for incoming calls")); | ||
468 | GCG_set_status_icon ("gnunet-conversation-gtk-tray-available"); | ||
469 | } | ||
470 | else | ||
471 | { | ||
472 | if (NULL == GCG_EGOS_get_selected_ego ()) | ||
473 | { | ||
474 | GCG_update_status_bar ("%s", | ||
475 | _("No ego selected, phone is down.")); | ||
476 | GCG_set_status_icon ("gnunet-conversation-gtk-tray-pending"); | ||
477 | } | ||
478 | else | ||
479 | { | ||
480 | GCG_update_status_bar ("%s", | ||
481 | _("Failed to setup phone (internal error)")); | ||
482 | GCG_set_status_icon ("gnunet-conversation-offline"); | ||
483 | } | ||
484 | } | ||
485 | return; | ||
486 | } | ||
487 | if (NULL != active_in) | ||
488 | { | ||
489 | switch (active_in->state) | ||
490 | { | ||
491 | case IN_STATE_NONE: | ||
492 | GNUNET_break (0); | ||
493 | break; | ||
494 | case IN_STATE_RINGING: | ||
495 | GNUNET_break (0); | ||
496 | break; | ||
497 | case IN_STATE_CONNECTED: | ||
498 | GCG_update_status_bar (_("In a conversation with `%s'."), | ||
499 | active_in->caller_id); | ||
500 | GCG_set_status_icon ("gnunet-conversation-call-active"); | ||
501 | break; | ||
502 | case IN_STATE_SUSPENDED_LOCAL: | ||
503 | GNUNET_break (0); | ||
504 | break; | ||
505 | case IN_STATE_SUSPENDED_REMOTE: | ||
506 | GCG_update_status_bar (_("On hold in a conversation with `%s'."), | ||
507 | active_in->caller_id); | ||
508 | GCG_set_status_icon ("gnunet-conversation-call-on-hold"); | ||
509 | break; | ||
510 | case IN_STATE_SUSPENDED_BOTH: | ||
511 | GNUNET_break (0); | ||
512 | break; | ||
513 | } | ||
514 | return; | ||
515 | } | ||
516 | if (NULL != active_out) | ||
517 | { | ||
518 | switch (active_out->state) | ||
519 | { | ||
520 | case OUT_STATE_NONE: | ||
521 | GNUNET_break (0); | ||
522 | break; | ||
523 | case OUT_STATE_RESOLVING: | ||
524 | GCG_update_status_bar (_("Resolving `%s'."), | ||
525 | active_out->caller_id); | ||
526 | GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-pending"); | ||
527 | break; | ||
528 | case OUT_STATE_RINGING: | ||
529 | GCG_update_status_bar (_("Ringing `%s'."), | ||
530 | active_out->caller_id); | ||
531 | GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-ringing"); | ||
532 | break; | ||
533 | case OUT_STATE_CONNECTED: | ||
534 | GCG_update_status_bar (_("In a conversation with `%s'."), | ||
535 | active_out->caller_id); | ||
536 | GCG_set_status_icon ("gnunet-conversation-call-active"); | ||
537 | break; | ||
538 | case OUT_STATE_SUSPENDED_LOCAL: | ||
539 | GNUNET_break (0); | ||
540 | break; | ||
541 | case OUT_STATE_SUSPENDED_REMOTE: | ||
542 | GCG_update_status_bar (_("On hold in a conversation with `%s'."), | ||
543 | active_out->caller_id); | ||
544 | GCG_set_status_icon ("gnunet-conversation-call-on-hold"); | ||
545 | break; | ||
546 | case OUT_STATE_SUSPENDED_BOTH: | ||
547 | GNUNET_break (0); | ||
548 | break; | ||
549 | } | ||
550 | return; | ||
467 | } | 551 | } |
468 | } | 552 | } |
469 | 553 | ||
@@ -492,7 +576,7 @@ check_call_sensitivity () | |||
492 | * @param sel selection that changed (belongs to #active_treeview) | 576 | * @param sel selection that changed (belongs to #active_treeview) |
493 | */ | 577 | */ |
494 | static void | 578 | static void |
495 | update_call_buttons (GtkTreeSelection *sel) | 579 | update_call_buttons (GtkTreeSelection *sel) |
496 | { | 580 | { |
497 | GtkTreeIter iter; | 581 | GtkTreeIter iter; |
498 | GtkTreeModel *model; | 582 | GtkTreeModel *model; |
@@ -507,7 +591,7 @@ update_call_buttons (GtkTreeSelection *sel) | |||
507 | &iter)) | 591 | &iter)) |
508 | { | 592 | { |
509 | /* nothing selected, disable buttons */ | 593 | /* nothing selected, disable buttons */ |
510 | gtk_widget_set_sensitive (b_add_contact, FALSE); | 594 | gtk_widget_set_sensitive (b_add_contact, FALSE); |
511 | gtk_widget_set_sensitive (b_accept, FALSE); | 595 | gtk_widget_set_sensitive (b_accept, FALSE); |
512 | gtk_widget_set_sensitive (b_refuse, FALSE); | 596 | gtk_widget_set_sensitive (b_refuse, FALSE); |
513 | gtk_widget_set_sensitive (b_resume, FALSE); | 597 | gtk_widget_set_sensitive (b_resume, FALSE); |
@@ -530,35 +614,33 @@ update_call_buttons (GtkTreeSelection *sel) | |||
530 | GNUNET_break (0); | 614 | GNUNET_break (0); |
531 | break; | 615 | break; |
532 | case IN_STATE_RINGING: | 616 | case IN_STATE_RINGING: |
533 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 617 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
534 | gtk_widget_set_sensitive (b_accept, ! in_call); | 618 | gtk_widget_set_sensitive (b_accept, ! in_call); |
535 | gtk_widget_set_sensitive (b_refuse, TRUE); | 619 | gtk_widget_set_sensitive (b_refuse, TRUE); |
536 | gtk_widget_set_sensitive (b_resume, ! in_call); | 620 | gtk_widget_set_sensitive (b_resume, ! in_call); |
537 | break; | 621 | break; |
538 | case IN_STATE_CONNECTED: | 622 | case IN_STATE_CONNECTED: |
539 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 623 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
540 | gtk_widget_set_sensitive (b_accept, FALSE); | 624 | gtk_widget_set_sensitive (b_accept, FALSE); |
541 | gtk_widget_set_sensitive (b_refuse, (active_in != ic)); | 625 | gtk_widget_set_sensitive (b_refuse, (active_in != ic)); |
542 | gtk_widget_set_sensitive (b_resume, FALSE); | 626 | gtk_widget_set_sensitive (b_resume, FALSE); |
543 | break; | 627 | break; |
544 | case IN_STATE_SUSPENDED_LOCAL: | 628 | case IN_STATE_SUSPENDED_LOCAL: |
545 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 629 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
546 | gtk_widget_set_sensitive (b_accept, FALSE); | 630 | gtk_widget_set_sensitive (b_accept, FALSE); |
547 | gtk_widget_set_sensitive (b_refuse, TRUE); | 631 | gtk_widget_set_sensitive (b_refuse, TRUE); |
548 | gtk_widget_set_sensitive (b_resume, TRUE); | 632 | gtk_widget_set_sensitive (b_resume, TRUE); |
549 | case IN_STATE_SUSPENDED_REMOTE: | 633 | case IN_STATE_SUSPENDED_REMOTE: |
550 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 634 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
551 | gtk_widget_set_sensitive (b_accept, FALSE); | 635 | gtk_widget_set_sensitive (b_accept, FALSE); |
552 | gtk_widget_set_sensitive (b_refuse, TRUE); | 636 | gtk_widget_set_sensitive (b_refuse, TRUE); |
553 | gtk_widget_set_sensitive (b_resume, FALSE); | 637 | gtk_widget_set_sensitive (b_resume, FALSE); |
554 | case IN_STATE_SUSPENDED_BOTH: | 638 | case IN_STATE_SUSPENDED_BOTH: |
555 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 639 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
556 | gtk_widget_set_sensitive (b_accept, FALSE); | 640 | gtk_widget_set_sensitive (b_accept, FALSE); |
557 | gtk_widget_set_sensitive (b_refuse, TRUE); | 641 | gtk_widget_set_sensitive (b_refuse, TRUE); |
558 | gtk_widget_set_sensitive (b_resume, TRUE); | 642 | gtk_widget_set_sensitive (b_resume, TRUE); |
559 | break; | 643 | break; |
560 | default: | ||
561 | GNUNET_assert (0); | ||
562 | } | 644 | } |
563 | break; | 645 | break; |
564 | case CALL_OUT: | 646 | case CALL_OUT: |
@@ -568,41 +650,37 @@ update_call_buttons (GtkTreeSelection *sel) | |||
568 | GNUNET_break (0); | 650 | GNUNET_break (0); |
569 | break; | 651 | break; |
570 | case OUT_STATE_RESOLVING: | 652 | case OUT_STATE_RESOLVING: |
571 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 653 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
572 | gtk_widget_set_sensitive (b_accept, FALSE); | 654 | gtk_widget_set_sensitive (b_accept, FALSE); |
573 | gtk_widget_set_sensitive (b_refuse, FALSE); | 655 | gtk_widget_set_sensitive (b_refuse, FALSE); |
574 | gtk_widget_set_sensitive (b_resume, FALSE); | 656 | gtk_widget_set_sensitive (b_resume, FALSE); |
575 | case OUT_STATE_RINGING: | 657 | case OUT_STATE_RINGING: |
576 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 658 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
577 | gtk_widget_set_sensitive (b_accept, ! in_call); | 659 | gtk_widget_set_sensitive (b_accept, ! in_call); |
578 | gtk_widget_set_sensitive (b_refuse, FALSE); | 660 | gtk_widget_set_sensitive (b_refuse, FALSE); |
579 | gtk_widget_set_sensitive (b_resume, ! in_call); | 661 | gtk_widget_set_sensitive (b_resume, ! in_call); |
580 | case OUT_STATE_CONNECTED: | 662 | case OUT_STATE_CONNECTED: |
581 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 663 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
582 | gtk_widget_set_sensitive (b_accept, FALSE); | 664 | gtk_widget_set_sensitive (b_accept, FALSE); |
583 | gtk_widget_set_sensitive (b_refuse, FALSE); | 665 | gtk_widget_set_sensitive (b_refuse, FALSE); |
584 | gtk_widget_set_sensitive (b_resume, FALSE); | 666 | gtk_widget_set_sensitive (b_resume, FALSE); |
585 | case OUT_STATE_SUSPENDED_LOCAL: | 667 | case OUT_STATE_SUSPENDED_LOCAL: |
586 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 668 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
587 | gtk_widget_set_sensitive (b_accept, FALSE); | 669 | gtk_widget_set_sensitive (b_accept, FALSE); |
588 | gtk_widget_set_sensitive (b_refuse, TRUE); | 670 | gtk_widget_set_sensitive (b_refuse, TRUE); |
589 | gtk_widget_set_sensitive (b_resume, ! in_call); | 671 | gtk_widget_set_sensitive (b_resume, ! in_call); |
590 | case OUT_STATE_SUSPENDED_REMOTE: | 672 | case OUT_STATE_SUSPENDED_REMOTE: |
591 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 673 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
592 | gtk_widget_set_sensitive (b_accept, FALSE); | 674 | gtk_widget_set_sensitive (b_accept, FALSE); |
593 | gtk_widget_set_sensitive (b_refuse, TRUE); | 675 | gtk_widget_set_sensitive (b_refuse, TRUE); |
594 | gtk_widget_set_sensitive (b_resume, FALSE); | 676 | gtk_widget_set_sensitive (b_resume, FALSE); |
595 | case OUT_STATE_SUSPENDED_BOTH: | 677 | case OUT_STATE_SUSPENDED_BOTH: |
596 | gtk_widget_set_sensitive (b_add_contact, TRUE); | 678 | gtk_widget_set_sensitive (b_add_contact, TRUE); |
597 | gtk_widget_set_sensitive (b_accept, FALSE); | 679 | gtk_widget_set_sensitive (b_accept, FALSE); |
598 | gtk_widget_set_sensitive (b_refuse, TRUE); | 680 | gtk_widget_set_sensitive (b_refuse, TRUE); |
599 | gtk_widget_set_sensitive (b_resume, ! in_call); | 681 | gtk_widget_set_sensitive (b_resume, ! in_call); |
600 | default: | ||
601 | GNUNET_assert (0); | ||
602 | } | 682 | } |
603 | break; | 683 | break; |
604 | default: | ||
605 | GNUNET_assert (0); | ||
606 | } | 684 | } |
607 | } | 685 | } |
608 | 686 | ||
@@ -615,7 +693,7 @@ update_call_buttons (GtkTreeSelection *sel) | |||
615 | */ | 693 | */ |
616 | void | 694 | void |
617 | gnunet_conversation_gtk_active_calls_treeview_selection_changed_cb (GtkTreeSelection *sel, | 695 | gnunet_conversation_gtk_active_calls_treeview_selection_changed_cb (GtkTreeSelection *sel, |
618 | gpointer user_data) | 696 | gpointer user_data) |
619 | { | 697 | { |
620 | update_call_buttons (sel); | 698 | update_call_buttons (sel); |
621 | } | 699 | } |
@@ -756,9 +834,9 @@ phone_event_handler (void *cls, | |||
756 | ic->rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (active_liststore), | 834 | ic->rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (active_liststore), |
757 | path); | 835 | path); |
758 | gtk_tree_path_free (path); | 836 | gtk_tree_path_free (path); |
759 | GCG_log (_("A Incoming call from `%s' with number %u\n"), | 837 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_CALL, |
760 | caller_id, | 838 | ic->caller_id, |
761 | ic->caller_num); | 839 | ic->caller_num); |
762 | break; | 840 | break; |
763 | case GNUNET_CONVERSATION_EC_PHONE_HUNG_UP: | 841 | case GNUNET_CONVERSATION_EC_PHONE_HUNG_UP: |
764 | GNUNET_break (in_ring_counter > 0); | 842 | GNUNET_break (in_ring_counter > 0); |
@@ -774,11 +852,27 @@ phone_event_handler (void *cls, | |||
774 | -1); | 852 | -1); |
775 | if (caller == ic->caller) | 853 | if (caller == ic->caller) |
776 | { | 854 | { |
777 | GCG_log (_("phone hung up: %s number: %u"), | 855 | if (ic == active_in) |
778 | ic->caller_id, | 856 | { |
779 | ic->caller_num); | 857 | active_in = NULL; |
858 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, | ||
859 | ic->caller_id, | ||
860 | ic->caller_num); | ||
861 | } | ||
862 | else | ||
863 | { | ||
864 | if (IN_STATE_RINGING == ic->state) | ||
865 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_MISSED, | ||
866 | ic->caller_id, | ||
867 | ic->caller_num); | ||
868 | else | ||
869 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, | ||
870 | ic->caller_id, | ||
871 | ic->caller_num); | ||
872 | } | ||
780 | set_incoming_call_state (ic, | 873 | set_incoming_call_state (ic, |
781 | IN_STATE_NONE); | 874 | IN_STATE_NONE); |
875 | destroy_in (ic); | ||
782 | break; | 876 | break; |
783 | } | 877 | } |
784 | valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (active_liststore), | 878 | valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (active_liststore), |
@@ -812,6 +906,9 @@ caller_event_handler (void *cls, | |||
812 | switch (code) | 906 | switch (code) |
813 | { | 907 | { |
814 | case GNUNET_CONVERSATION_EC_CALLER_SUSPEND: | 908 | case GNUNET_CONVERSATION_EC_CALLER_SUSPEND: |
909 | GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_REMOTE, | ||
910 | ic->caller_id, | ||
911 | ic->caller_num); | ||
815 | is = ic->state; | 912 | is = ic->state; |
816 | switch (ic->state) | 913 | switch (ic->state) |
817 | { | 914 | { |
@@ -833,16 +930,14 @@ caller_event_handler (void *cls, | |||
833 | case IN_STATE_SUSPENDED_BOTH: | 930 | case IN_STATE_SUSPENDED_BOTH: |
834 | GNUNET_assert (0); | 931 | GNUNET_assert (0); |
835 | break; | 932 | break; |
836 | default: | ||
837 | GNUNET_assert (0); | ||
838 | break; | ||
839 | } | 933 | } |
840 | set_incoming_call_state (ic, | 934 | set_incoming_call_state (ic, |
841 | is); | 935 | is); |
842 | GCG_log (_("Call from `%s' suspended by other user\n"), | ||
843 | ic->caller_id); | ||
844 | break; | 936 | break; |
845 | case GNUNET_CONVERSATION_EC_CALLER_RESUME: | 937 | case GNUNET_CONVERSATION_EC_CALLER_RESUME: |
938 | GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_REMOTE, | ||
939 | ic->caller_id, | ||
940 | ic->caller_num); | ||
846 | is = ic->state; | 941 | is = ic->state; |
847 | switch (ic->state) | 942 | switch (ic->state) |
848 | { | 943 | { |
@@ -864,14 +959,9 @@ caller_event_handler (void *cls, | |||
864 | case IN_STATE_SUSPENDED_BOTH: | 959 | case IN_STATE_SUSPENDED_BOTH: |
865 | is = IN_STATE_SUSPENDED_LOCAL; | 960 | is = IN_STATE_SUSPENDED_LOCAL; |
866 | break; | 961 | break; |
867 | default: | ||
868 | GNUNET_assert (0); | ||
869 | break; | ||
870 | } | 962 | } |
871 | set_incoming_call_state (ic, | 963 | set_incoming_call_state (ic, |
872 | is); | 964 | is); |
873 | GCG_log (_("Call from `%s' resumed by other user\n"), | ||
874 | ic->caller_id); | ||
875 | break; | 965 | break; |
876 | } | 966 | } |
877 | do_status(); | 967 | do_status(); |
@@ -922,14 +1012,12 @@ GNUNET_CONVERSATION_GTK_on_accept_clicked (GtkButton *button, | |||
922 | active_in = ic; | 1012 | active_in = ic; |
923 | set_incoming_call_state (ic, | 1013 | set_incoming_call_state (ic, |
924 | IN_STATE_CONNECTED); | 1014 | IN_STATE_CONNECTED); |
925 | GCG_update_status_bar (_("Started a conversation with `%s'."), | ||
926 | ic->caller_id); | ||
927 | GCG_set_status_icon ("gnunet-conversation-call-active"); | ||
928 | GNUNET_CONVERSATION_caller_pick_up (ic->caller, | 1015 | GNUNET_CONVERSATION_caller_pick_up (ic->caller, |
929 | &caller_event_handler, ic, | 1016 | &caller_event_handler, ic, |
930 | speaker, mic); | 1017 | speaker, mic); |
931 | GCG_HISTORY_add (GCG_HISTORY_TYPE_ACCEPTED, | 1018 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_ACCEPTED, |
932 | ic->caller_id); | 1019 | ic->caller_id, |
1020 | ic->caller_num); | ||
933 | do_status (); | 1021 | do_status (); |
934 | } | 1022 | } |
935 | 1023 | ||
@@ -974,10 +1062,9 @@ GNUNET_CONVERSATION_GTK_on_reject_clicked (GtkButton *button, | |||
974 | } | 1062 | } |
975 | GNUNET_break (in_ring_counter > 0); | 1063 | GNUNET_break (in_ring_counter > 0); |
976 | in_ring_counter--; | 1064 | in_ring_counter--; |
977 | GCG_update_status_bar (_("Rejected conversation with `%s'."), | 1065 | GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_REJECTED, |
978 | ic->caller_id); | 1066 | ic->caller_id, |
979 | GCG_HISTORY_add (GCG_HISTORY_TYPE_REJECTED, | 1067 | ic->caller_num); |
980 | ic->caller_id); | ||
981 | set_incoming_call_state (ic, | 1068 | set_incoming_call_state (ic, |
982 | IN_STATE_NONE); | 1069 | IN_STATE_NONE); |
983 | destroy_in (ic); | 1070 | destroy_in (ic); |
@@ -993,10 +1080,9 @@ GNUNET_CONVERSATION_GTK_on_reject_clicked (GtkButton *button, | |||
993 | GNUNET_break (0); | 1080 | GNUNET_break (0); |
994 | return; | 1081 | return; |
995 | } | 1082 | } |
996 | GCG_update_status_bar (_("Terminated suspended conversation with `%s'."), | ||
997 | oc->peer_name); | ||
998 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, | 1083 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, |
999 | oc->peer_name); | 1084 | oc->caller_id, |
1085 | oc->caller_num); | ||
1000 | set_outgoing_call_state (oc, | 1086 | set_outgoing_call_state (oc, |
1001 | OUT_STATE_NONE); | 1087 | OUT_STATE_NONE); |
1002 | destroy_out (oc); | 1088 | destroy_out (oc); |
@@ -1020,10 +1106,13 @@ GNUNET_CONVERSATION_GTK_use_current_button_clicked (GtkButton *button, | |||
1020 | gpointer *user_data) | 1106 | gpointer *user_data) |
1021 | { | 1107 | { |
1022 | // FIXME: implement, use "GSC_add_contact" | 1108 | // FIXME: implement, use "GSC_add_contact" |
1109 | // FIXME: need to determine desired label for the contact! | ||
1110 | // => prompt user!? | ||
1023 | #if 0 | 1111 | #if 0 |
1024 | const gchar *target; | 1112 | const gchar *target; |
1025 | 1113 | ||
1026 | target = gtk_entry_get_text (address_entry); | 1114 | target = gtk_entry_get_text (address_entry); |
1115 | GSC_add_contact (label, address); | ||
1027 | #endif | 1116 | #endif |
1028 | } | 1117 | } |
1029 | 1118 | ||
@@ -1071,12 +1160,11 @@ GNUNET_CONVERSATION_GTK_on_resume_clicked (GtkButton *button, | |||
1071 | active_in = ic; | 1160 | active_in = ic; |
1072 | set_incoming_call_state (ic, | 1161 | set_incoming_call_state (ic, |
1073 | IN_STATE_CONNECTED); | 1162 | IN_STATE_CONNECTED); |
1074 | GCG_update_status_bar (_("Resumed conversation with `%s'."), | ||
1075 | ic->caller_id); | ||
1076 | GCG_set_status_icon ("gnunet-conversation-call-active"); | ||
1077 | GNUNET_CONVERSATION_caller_resume (ic->caller, | 1163 | GNUNET_CONVERSATION_caller_resume (ic->caller, |
1078 | speaker, mic); | 1164 | speaker, mic); |
1079 | // GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED, ic->caller_id); | 1165 | GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_LOCAL, |
1166 | ic->caller_id, | ||
1167 | ic->caller_num); | ||
1080 | do_status (); | 1168 | do_status (); |
1081 | return; | 1169 | return; |
1082 | } | 1170 | } |
@@ -1087,7 +1175,9 @@ GNUNET_CONVERSATION_GTK_on_resume_clicked (GtkButton *button, | |||
1087 | speaker, mic); | 1175 | speaker, mic); |
1088 | set_outgoing_call_state (oc, | 1176 | set_outgoing_call_state (oc, |
1089 | OUT_STATE_CONNECTED); | 1177 | OUT_STATE_CONNECTED); |
1090 | // GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED, ic->caller_id); | 1178 | GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_LOCAL, |
1179 | oc->caller_id, | ||
1180 | oc->caller_num); | ||
1091 | do_status (); | 1181 | do_status (); |
1092 | return; | 1182 | return; |
1093 | } | 1183 | } |
@@ -1118,8 +1208,10 @@ GNUNET_CONVERSATION_GTK_on_pause_clicked (GtkButton *button, | |||
1118 | if (NULL != active_out) | 1208 | if (NULL != active_out) |
1119 | { | 1209 | { |
1120 | /* outgoing */ | 1210 | /* outgoing */ |
1121 | os = active_out->state; | 1211 | GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_LOCAL, |
1122 | switch (active_out->state) | 1212 | active_out->caller_id, |
1213 | active_out->caller_num); | ||
1214 | switch ((os = active_out->state)) | ||
1123 | { | 1215 | { |
1124 | case OUT_STATE_NONE: | 1216 | case OUT_STATE_NONE: |
1125 | GNUNET_assert (0); | 1217 | GNUNET_assert (0); |
@@ -1142,9 +1234,6 @@ GNUNET_CONVERSATION_GTK_on_pause_clicked (GtkButton *button, | |||
1142 | case OUT_STATE_SUSPENDED_BOTH: | 1234 | case OUT_STATE_SUSPENDED_BOTH: |
1143 | GNUNET_assert (0); | 1235 | GNUNET_assert (0); |
1144 | break; | 1236 | break; |
1145 | default: | ||
1146 | GNUNET_assert (0); | ||
1147 | break; | ||
1148 | } | 1237 | } |
1149 | GNUNET_CONVERSATION_call_suspend (active_out->call); | 1238 | GNUNET_CONVERSATION_call_suspend (active_out->call); |
1150 | set_outgoing_call_state (active_out, | 1239 | set_outgoing_call_state (active_out, |
@@ -1158,15 +1247,16 @@ GNUNET_CONVERSATION_GTK_on_pause_clicked (GtkButton *button, | |||
1158 | gtk_widget_set_sensitive (GTK_WIDGET (address_entry), TRUE); | 1247 | gtk_widget_set_sensitive (GTK_WIDGET (address_entry), TRUE); |
1159 | check_call_sensitivity (); | 1248 | check_call_sensitivity (); |
1160 | do_status (); | 1249 | do_status (); |
1161 | // FIXME: logging | ||
1162 | return; | 1250 | return; |
1163 | } | 1251 | } |
1164 | if (NULL != active_in) | 1252 | if (NULL != active_in) |
1165 | { | 1253 | { |
1166 | /* incoming */ | 1254 | /* incoming */ |
1255 | GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_LOCAL, | ||
1256 | active_in->caller_id, | ||
1257 | active_in->caller_num); | ||
1167 | GNUNET_CONVERSATION_caller_suspend (active_in->caller); | 1258 | GNUNET_CONVERSATION_caller_suspend (active_in->caller); |
1168 | is = active_in->state; | 1259 | switch ((is = active_in->state)) |
1169 | switch (active_in->state) | ||
1170 | { | 1260 | { |
1171 | case IN_STATE_NONE: | 1261 | case IN_STATE_NONE: |
1172 | GNUNET_assert (0); | 1262 | GNUNET_assert (0); |
@@ -1186,9 +1276,6 @@ GNUNET_CONVERSATION_GTK_on_pause_clicked (GtkButton *button, | |||
1186 | case IN_STATE_SUSPENDED_BOTH: | 1276 | case IN_STATE_SUSPENDED_BOTH: |
1187 | GNUNET_assert (0); | 1277 | GNUNET_assert (0); |
1188 | break; | 1278 | break; |
1189 | default: | ||
1190 | GNUNET_assert (0); | ||
1191 | break; | ||
1192 | } | 1279 | } |
1193 | set_incoming_call_state (active_in, | 1280 | set_incoming_call_state (active_in, |
1194 | is); | 1281 | is); |
@@ -1201,7 +1288,6 @@ GNUNET_CONVERSATION_GTK_on_pause_clicked (GtkButton *button, | |||
1201 | gtk_widget_set_sensitive (GTK_WIDGET (address_entry), TRUE); | 1288 | gtk_widget_set_sensitive (GTK_WIDGET (address_entry), TRUE); |
1202 | check_call_sensitivity (); | 1289 | check_call_sensitivity (); |
1203 | do_status (); | 1290 | do_status (); |
1204 | // FIXME: logging | ||
1205 | return; | 1291 | return; |
1206 | } | 1292 | } |
1207 | GNUNET_break (0); | 1293 | GNUNET_break (0); |
@@ -1227,11 +1313,13 @@ GNUNET_CONVERSATION_GTK_on_hangup_clicked (GtkButton *button, | |||
1227 | if (NULL != active_out) | 1313 | if (NULL != active_out) |
1228 | { | 1314 | { |
1229 | /* if current call is outgoing, stop it */ | 1315 | /* if current call is outgoing, stop it */ |
1316 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, | ||
1317 | active_out->caller_id, | ||
1318 | active_out->caller_num); | ||
1230 | set_outgoing_call_state (active_out, | 1319 | set_outgoing_call_state (active_out, |
1231 | OUT_STATE_NONE); | 1320 | OUT_STATE_NONE); |
1232 | destroy_out (active_out); | 1321 | destroy_out (active_out); |
1233 | active_out = NULL; | 1322 | active_out = NULL; |
1234 | // FIXME: logging | ||
1235 | gtk_widget_hide (b_suspend); | 1323 | gtk_widget_hide (b_suspend); |
1236 | gtk_widget_hide (b_hangup); | 1324 | gtk_widget_hide (b_hangup); |
1237 | gtk_widget_show (b_call); | 1325 | gtk_widget_show (b_call); |
@@ -1245,6 +1333,9 @@ GNUNET_CONVERSATION_GTK_on_hangup_clicked (GtkButton *button, | |||
1245 | if (NULL != active_in) | 1333 | if (NULL != active_in) |
1246 | { | 1334 | { |
1247 | /* if selected call is incoming, hang it up */ | 1335 | /* if selected call is incoming, hang it up */ |
1336 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, | ||
1337 | active_in->caller_id, | ||
1338 | active_in->caller_num); | ||
1248 | set_incoming_call_state (active_in, | 1339 | set_incoming_call_state (active_in, |
1249 | IN_STATE_NONE); | 1340 | IN_STATE_NONE); |
1250 | destroy_in (active_in); | 1341 | destroy_in (active_in); |
@@ -1257,7 +1348,6 @@ GNUNET_CONVERSATION_GTK_on_hangup_clicked (GtkButton *button, | |||
1257 | gtk_widget_set_sensitive (GTK_WIDGET (address_entry), TRUE); | 1348 | gtk_widget_set_sensitive (GTK_WIDGET (address_entry), TRUE); |
1258 | check_call_sensitivity (); | 1349 | check_call_sensitivity (); |
1259 | do_status (); | 1350 | do_status (); |
1260 | // FIXME: logging | ||
1261 | return; | 1351 | return; |
1262 | } | 1352 | } |
1263 | GNUNET_break (0); | 1353 | GNUNET_break (0); |
@@ -1277,34 +1367,32 @@ call_event_handler (void *cls, | |||
1277 | struct OutgoingCall *oc = cls; | 1367 | struct OutgoingCall *oc = cls; |
1278 | enum OutCallState os; | 1368 | enum OutCallState os; |
1279 | 1369 | ||
1280 | set_outgoing_call_state (oc, code); | ||
1281 | switch (code) | 1370 | switch (code) |
1282 | { | 1371 | { |
1283 | case GNUNET_CONVERSATION_EC_CALL_RINGING: | 1372 | case GNUNET_CONVERSATION_EC_CALL_RINGING: |
1373 | GCG_HISTORY_add (GCG_HISTORY_TYPE_OUTGOING_RINGING, | ||
1374 | oc->caller_id, | ||
1375 | oc->caller_num); | ||
1284 | GNUNET_break (OUT_STATE_RESOLVING == oc->state); | 1376 | GNUNET_break (OUT_STATE_RESOLVING == oc->state); |
1285 | GNUNET_break (active_out == oc); | 1377 | GNUNET_break (active_out == oc); |
1286 | GCG_log (_("Resolved address of `%s'. Now ringing other party."), | ||
1287 | oc->peer_name); | ||
1288 | set_outgoing_call_state (oc, | 1378 | set_outgoing_call_state (oc, |
1289 | OUT_STATE_RINGING); | 1379 | OUT_STATE_RINGING); |
1290 | GCG_log (_("Ringing `%s'.\n"), | 1380 | do_status (); |
1291 | oc->peer_name); | ||
1292 | GCG_update_status_bar (_("Ringing `%s'."), | ||
1293 | oc->peer_name); | ||
1294 | GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-ringing"); | ||
1295 | break; | 1381 | break; |
1296 | case GNUNET_CONVERSATION_EC_CALL_PICKED_UP: | 1382 | case GNUNET_CONVERSATION_EC_CALL_PICKED_UP: |
1383 | GCG_HISTORY_add (GCG_HISTORY_TYPE_OUTGOING_ACCEPTED, | ||
1384 | oc->caller_id, | ||
1385 | oc->caller_num); | ||
1297 | GNUNET_break (OUT_STATE_RINGING == oc->state); | 1386 | GNUNET_break (OUT_STATE_RINGING == oc->state); |
1298 | set_outgoing_call_state (oc, OUT_STATE_CONNECTED); | 1387 | set_outgoing_call_state (oc, OUT_STATE_CONNECTED); |
1299 | GNUNET_break (active_out == oc); | 1388 | GNUNET_break (active_out == oc); |
1300 | gtk_widget_set_sensitive (b_suspend, TRUE); | 1389 | gtk_widget_set_sensitive (b_suspend, TRUE); |
1301 | GCG_log (_("Connection established to `%s'."), | 1390 | do_status (); |
1302 | oc->peer_name); | ||
1303 | GCG_update_status_bar (_("Talking to `%s'."), | ||
1304 | oc->peer_name); | ||
1305 | GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-active"); | ||
1306 | break; | 1391 | break; |
1307 | case GNUNET_CONVERSATION_EC_CALL_GNS_FAIL: | 1392 | case GNUNET_CONVERSATION_EC_CALL_GNS_FAIL: |
1393 | GCG_HISTORY_add (GCG_HISTORY_TYPE_FAILED, | ||
1394 | oc->caller_id, | ||
1395 | oc->caller_num); | ||
1308 | GNUNET_break (OUT_STATE_RESOLVING == oc->state); | 1396 | GNUNET_break (OUT_STATE_RESOLVING == oc->state); |
1309 | GNUNET_break (active_out == oc); | 1397 | GNUNET_break (active_out == oc); |
1310 | set_outgoing_call_state (oc, | 1398 | set_outgoing_call_state (oc, |
@@ -1312,8 +1400,6 @@ call_event_handler (void *cls, | |||
1312 | oc->call = NULL; | 1400 | oc->call = NULL; |
1313 | destroy_out (oc); | 1401 | destroy_out (oc); |
1314 | active_out = NULL; | 1402 | active_out = NULL; |
1315 | GCG_log (_("Failed to resolve %s in current zone."), | ||
1316 | oc->peer_name); | ||
1317 | gtk_widget_hide (b_suspend); | 1403 | gtk_widget_hide (b_suspend); |
1318 | gtk_widget_hide (b_hangup); | 1404 | gtk_widget_hide (b_hangup); |
1319 | gtk_widget_show (b_call); | 1405 | gtk_widget_show (b_call); |
@@ -1323,7 +1409,9 @@ call_event_handler (void *cls, | |||
1323 | do_status (); | 1409 | do_status (); |
1324 | break; | 1410 | break; |
1325 | case GNUNET_CONVERSATION_EC_CALL_HUNG_UP: | 1411 | case GNUNET_CONVERSATION_EC_CALL_HUNG_UP: |
1326 | GCG_log ("%s", _("Call terminated")); | 1412 | GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP, |
1413 | oc->caller_id, | ||
1414 | oc->caller_num); | ||
1327 | set_outgoing_call_state (oc, OUT_STATE_NONE); | 1415 | set_outgoing_call_state (oc, OUT_STATE_NONE); |
1328 | GNUNET_break (active_out == oc); | 1416 | GNUNET_break (active_out == oc); |
1329 | oc->call = NULL; | 1417 | oc->call = NULL; |
@@ -1339,6 +1427,9 @@ call_event_handler (void *cls, | |||
1339 | do_status (); | 1427 | do_status (); |
1340 | break; | 1428 | break; |
1341 | case GNUNET_CONVERSATION_EC_CALL_SUSPENDED: | 1429 | case GNUNET_CONVERSATION_EC_CALL_SUSPENDED: |
1430 | GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_REMOTE, | ||
1431 | oc->caller_id, | ||
1432 | oc->caller_num); | ||
1342 | os = oc->state; | 1433 | os = oc->state; |
1343 | switch (oc->state) | 1434 | switch (oc->state) |
1344 | { | 1435 | { |
@@ -1363,16 +1454,14 @@ call_event_handler (void *cls, | |||
1363 | case OUT_STATE_SUSPENDED_BOTH: | 1454 | case OUT_STATE_SUSPENDED_BOTH: |
1364 | GNUNET_assert (0); | 1455 | GNUNET_assert (0); |
1365 | break; | 1456 | break; |
1366 | default: | ||
1367 | GNUNET_assert (0); | ||
1368 | break; | ||
1369 | } | 1457 | } |
1370 | set_outgoing_call_state (oc, os); | 1458 | set_outgoing_call_state (oc, os); |
1371 | GCG_log (_("Connection to `%s' suspended (by other user)\n"), | ||
1372 | oc->peer_name); | ||
1373 | do_status (); | 1459 | do_status (); |
1374 | break; | 1460 | break; |
1375 | case GNUNET_CONVERSATION_EC_CALL_RESUMED: | 1461 | case GNUNET_CONVERSATION_EC_CALL_RESUMED: |
1462 | GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_REMOTE, | ||
1463 | oc->caller_id, | ||
1464 | oc->caller_num); | ||
1376 | os = oc->state; | 1465 | os = oc->state; |
1377 | switch (oc->state) | 1466 | switch (oc->state) |
1378 | { | 1467 | { |
@@ -1397,18 +1486,10 @@ call_event_handler (void *cls, | |||
1397 | case OUT_STATE_SUSPENDED_BOTH: | 1486 | case OUT_STATE_SUSPENDED_BOTH: |
1398 | os = OUT_STATE_SUSPENDED_LOCAL; | 1487 | os = OUT_STATE_SUSPENDED_LOCAL; |
1399 | break; | 1488 | break; |
1400 | default: | ||
1401 | GNUNET_assert (0); | ||
1402 | break; | ||
1403 | } | 1489 | } |
1404 | GCG_log (_("Connection to `%s' resumed by remote\n"), | ||
1405 | oc->peer_name); | ||
1406 | set_outgoing_call_state (oc, os); | 1490 | set_outgoing_call_state (oc, os); |
1407 | if (OUT_STATE_CONNECTED == os) | 1491 | if (OUT_STATE_CONNECTED == os) |
1408 | { | 1492 | { |
1409 | GCG_update_status_bar (_("Talking to `%s'."), | ||
1410 | oc->peer_name); | ||
1411 | GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-active"); | ||
1412 | GNUNET_break (active_out == oc); | 1493 | GNUNET_break (active_out == oc); |
1413 | gtk_widget_show (b_suspend); | 1494 | gtk_widget_show (b_suspend); |
1414 | gtk_widget_show (b_hangup); | 1495 | gtk_widget_show (b_hangup); |
@@ -1417,10 +1498,12 @@ call_event_handler (void *cls, | |||
1417 | gtk_widget_set_sensitive (b_suspend, TRUE); | 1498 | gtk_widget_set_sensitive (b_suspend, TRUE); |
1418 | gtk_widget_set_sensitive (GTK_WIDGET (address_entry), FALSE); | 1499 | gtk_widget_set_sensitive (GTK_WIDGET (address_entry), FALSE); |
1419 | } | 1500 | } |
1501 | do_status (); | ||
1420 | break; | 1502 | break; |
1421 | case GNUNET_CONVERSATION_EC_CALL_ERROR: | 1503 | case GNUNET_CONVERSATION_EC_CALL_ERROR: |
1422 | GCG_log ("GNUNET_CONVERSATION_EC_CALL_ERROR %s", | 1504 | GCG_HISTORY_add (GCG_HISTORY_TYPE_FAILED, |
1423 | oc->peer_name); | 1505 | oc->caller_id, |
1506 | oc->caller_num); | ||
1424 | set_outgoing_call_state (oc, OUT_STATE_NONE); | 1507 | set_outgoing_call_state (oc, OUT_STATE_NONE); |
1425 | oc->call = NULL; | 1508 | oc->call = NULL; |
1426 | if (active_out == oc) | 1509 | if (active_out == oc) |
@@ -1466,9 +1549,12 @@ gnunet_conversation_gtk_call_button_clicked_cb (GtkButton *button, | |||
1466 | return; | 1549 | return; |
1467 | } | 1550 | } |
1468 | oc = GNUNET_new (struct OutgoingCall); | 1551 | oc = GNUNET_new (struct OutgoingCall); |
1469 | oc->peer_name = GNUNET_strdup (arg); | 1552 | oc->caller_id = GNUNET_strdup (arg); |
1470 | oc->state = OUT_STATE_RESOLVING; | 1553 | oc->state = OUT_STATE_RESOLVING; |
1471 | oc->caller_num = caller_num_gen++; | 1554 | oc->caller_num = caller_num_gen++; |
1555 | GCG_HISTORY_add (GCG_HISTORY_TYPE_OUTGOING_CALL, | ||
1556 | oc->caller_id, | ||
1557 | oc->caller_num); | ||
1472 | oc->call = | 1558 | oc->call = |
1473 | GNUNET_CONVERSATION_call_start (GCG_get_configuration (), | 1559 | GNUNET_CONVERSATION_call_start (GCG_get_configuration (), |
1474 | caller_id, | 1560 | caller_id, |
@@ -1478,7 +1564,7 @@ gnunet_conversation_gtk_call_button_clicked_cb (GtkButton *button, | |||
1478 | gtk_list_store_insert_with_values (active_liststore, | 1564 | gtk_list_store_insert_with_values (active_liststore, |
1479 | &iter, | 1565 | &iter, |
1480 | -1, | 1566 | -1, |
1481 | GCG_PHONE_LS_REMOTE_USER_NAME, oc->peer_name, | 1567 | GCG_PHONE_LS_REMOTE_USER_NAME, oc->caller_id, |
1482 | GCG_PHONE_LS_INCOMING_CALL, NULL, | 1568 | GCG_PHONE_LS_INCOMING_CALL, NULL, |
1483 | GCG_PHONE_LS_NUMBER, oc->caller_num, | 1569 | GCG_PHONE_LS_NUMBER, oc->caller_num, |
1484 | GCG_PHONE_LS_IN_CALL_STATE, IN_STATE_NONE, | 1570 | GCG_PHONE_LS_IN_CALL_STATE, IN_STATE_NONE, |
@@ -1487,20 +1573,12 @@ gnunet_conversation_gtk_call_button_clicked_cb (GtkButton *button, | |||
1487 | GCG_PHONE_LS_OUT_CALL_STATE, oc->state, | 1573 | GCG_PHONE_LS_OUT_CALL_STATE, oc->state, |
1488 | GCG_PHONE_LS_STATE_NAME, out_call_state_to_string (oc->state), | 1574 | GCG_PHONE_LS_STATE_NAME, out_call_state_to_string (oc->state), |
1489 | 1575 | ||
1490 | -1); | 1576 | -1); |
1491 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (active_liststore), | 1577 | path = gtk_tree_model_get_path (GTK_TREE_MODEL (active_liststore), |
1492 | &iter); | 1578 | &iter); |
1493 | oc->rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (active_liststore), | 1579 | oc->rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (active_liststore), |
1494 | path); | 1580 | path); |
1495 | gtk_tree_path_free (path); | 1581 | gtk_tree_path_free (path); |
1496 | /* log event */ | ||
1497 | GCG_log (_("Resolving `%s'.\n"), | ||
1498 | oc->peer_name); | ||
1499 | GCG_update_status_bar (_("Resolving `%s'."), | ||
1500 | oc->peer_name); | ||
1501 | GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-pending"); | ||
1502 | GCG_HISTORY_add (GCG_HISTORY_TYPE_OUTGOING, | ||
1503 | oc->peer_name); | ||
1504 | /* hide "call" button, make address entry insensitive; | 1582 | /* hide "call" button, make address entry insensitive; |
1505 | show suspend button (but not sensitive), | 1583 | show suspend button (but not sensitive), |
1506 | show hangup button (and make sensitive) */ | 1584 | show hangup button (and make sensitive) */ |
@@ -1509,6 +1587,7 @@ gnunet_conversation_gtk_call_button_clicked_cb (GtkButton *button, | |||
1509 | gtk_widget_show (b_suspend); | 1587 | gtk_widget_show (b_suspend); |
1510 | gtk_widget_show (b_hangup); | 1588 | gtk_widget_show (b_hangup); |
1511 | gtk_widget_set_sensitive (b_hangup, TRUE); | 1589 | gtk_widget_set_sensitive (b_hangup, TRUE); |
1590 | do_status (); | ||
1512 | } | 1591 | } |
1513 | 1592 | ||
1514 | 1593 | ||
@@ -1528,6 +1607,82 @@ gnunet_conversation_gtk_address_entry_changed_cb (GtkEditable *editable, | |||
1528 | 1607 | ||
1529 | 1608 | ||
1530 | /** | 1609 | /** |
1610 | * Our phone record has changed, update the information | ||
1611 | * published in the GNU Name System. | ||
1612 | */ | ||
1613 | static void | ||
1614 | update_phone_record () | ||
1615 | { | ||
1616 | struct GNUNET_GNSRECORD_Data rd; | ||
1617 | const gchar *label; | ||
1618 | |||
1619 | label = gtk_entry_get_text (GTK_ENTRY | ||
1620 | (GCG_get_main_window_object | ||
1621 | ("gnunet_conversation_gtk_ego_label_entry"))); | ||
1622 | if ( (NULL == label) || | ||
1623 | (0 == strlen (label)) ) | ||
1624 | { | ||
1625 | gtk_widget_set_sensitive (b_copy, FALSE); | ||
1626 | GSC_remove_phone (); | ||
1627 | return; | ||
1628 | } | ||
1629 | gtk_widget_set_sensitive (b_copy, TRUE); | ||
1630 | GNUNET_CONVERSATION_phone_get_record (phone, | ||
1631 | &rd); | ||
1632 | GSC_add_phone (label, &rd); | ||
1633 | } | ||
1634 | |||
1635 | |||
1636 | /** | ||
1637 | * The user has edited the label. Check if the new label is valid, | ||
1638 | * and if so commit the change to the model and update the phone | ||
1639 | * record. | ||
1640 | * | ||
1641 | * @param entry the entry used to edit the label | ||
1642 | * @param preedit new label | ||
1643 | * @param user_data builder (unused) | ||
1644 | */ | ||
1645 | void | ||
1646 | gnunet_conversation_gtk_ego_label_entry_preedit_changed_cb (GtkEntry *entry, | ||
1647 | gchar *preedit, | ||
1648 | gpointer user_data) | ||
1649 | { | ||
1650 | GtkComboBoxText *cbt; | ||
1651 | |||
1652 | if (GNUNET_OK != | ||
1653 | GNUNET_DNSPARSER_check_label (preedit)) | ||
1654 | { | ||
1655 | GCG_log (_("Invalid label `%s'\n"), | ||
1656 | preedit); | ||
1657 | gdk_beep (); | ||
1658 | return; | ||
1659 | } | ||
1660 | cbt = GTK_COMBO_BOX_TEXT (GCG_get_main_window_object | ||
1661 | ("gnunet_conversation_gtk_ego_label_comboboxtext")); | ||
1662 | gtk_combo_box_text_insert (cbt, | ||
1663 | -1, | ||
1664 | NULL, | ||
1665 | preedit); | ||
1666 | update_phone_record (); | ||
1667 | } | ||
1668 | |||
1669 | |||
1670 | /** | ||
1671 | * The user has changed the selected label in the combo box. Commit | ||
1672 | * the change to the model and update the phone record. | ||
1673 | * | ||
1674 | * @param widget the combo box | ||
1675 | * @param user_data builder (unused) | ||
1676 | */ | ||
1677 | void | ||
1678 | gnunet_conversation_gtk_ego_label_comboboxtext_changed_cb (GtkComboBox *widget, | ||
1679 | gpointer user_data) | ||
1680 | { | ||
1681 | update_phone_record (); | ||
1682 | } | ||
1683 | |||
1684 | |||
1685 | /** | ||
1531 | * @brief outgoing ego selector changed, (re)start the phone. | 1686 | * @brief outgoing ego selector changed, (re)start the phone. |
1532 | * | 1687 | * |
1533 | * @param widget the combo box that changed | 1688 | * @param widget the combo box that changed |
@@ -1537,22 +1692,18 @@ void | |||
1537 | gnunet_conversation_gtk_ego_combobox_changed_cb (GtkComboBox *widget, | 1692 | gnunet_conversation_gtk_ego_combobox_changed_cb (GtkComboBox *widget, |
1538 | gpointer user_data) | 1693 | gpointer user_data) |
1539 | { | 1694 | { |
1540 | struct GNUNET_GNSRECORD_Data rd; | ||
1541 | struct GNUNET_IDENTITY_Ego *caller_id; | 1695 | struct GNUNET_IDENTITY_Ego *caller_id; |
1542 | 1696 | ||
1543 | if (NULL != phone) | 1697 | if (NULL != phone) |
1544 | { | 1698 | { |
1699 | GSC_remove_phone (); | ||
1545 | GNUNET_CONVERSATION_phone_destroy (phone); | 1700 | GNUNET_CONVERSATION_phone_destroy (phone); |
1546 | phone = NULL; | 1701 | phone = NULL; |
1547 | } | 1702 | } |
1548 | caller_id = GCG_EGOS_get_selected_ego (); | 1703 | caller_id = GCG_EGOS_get_selected_ego (); |
1549 | if (NULL == caller_id) | 1704 | if (NULL == caller_id) |
1550 | { | 1705 | { |
1551 | GCG_update_status_bar ("%s", | 1706 | do_status (); |
1552 | _("No ego selected, phone is now down.")); | ||
1553 | GCG_log ("%s\n", | ||
1554 | _("No ego selected, phone is now down.")); | ||
1555 | GCG_set_status_icon ("gnunet-conversation-gtk-tray-pending"); | ||
1556 | check_call_sensitivity (); | 1707 | check_call_sensitivity (); |
1557 | return; | 1708 | return; |
1558 | } | 1709 | } |
@@ -1563,19 +1714,11 @@ gnunet_conversation_gtk_ego_combobox_changed_cb (GtkComboBox *widget, | |||
1563 | NULL); | 1714 | NULL); |
1564 | if (NULL == phone) | 1715 | if (NULL == phone) |
1565 | { | 1716 | { |
1566 | GCG_update_status_bar ("%s", | ||
1567 | _("Failed to setup phone (internal error)")); | ||
1568 | GCG_log ("%s", | ||
1569 | _("Failed to setup phone (internal error)\n")); | ||
1570 | GCG_set_status_icon ("gnunet-conversation-offline"); | ||
1571 | check_call_sensitivity (); | 1717 | check_call_sensitivity (); |
1718 | do_status (); | ||
1572 | return; | 1719 | return; |
1573 | } | 1720 | } |
1574 | GNUNET_CONVERSATION_phone_get_record (phone, | 1721 | update_phone_record (); |
1575 | &rd); | ||
1576 | /* FIXME: publish record to GNS! */ | ||
1577 | GCG_log ("%s\n", | ||
1578 | _("Phone active")); | ||
1579 | check_call_sensitivity (); | 1722 | check_call_sensitivity (); |
1580 | do_status(); | 1723 | do_status(); |
1581 | } | 1724 | } |
@@ -1607,6 +1750,8 @@ GCG_PHONE_init () | |||
1607 | ("gnunet_conversation_gtk_call_button")); | 1750 | ("gnunet_conversation_gtk_call_button")); |
1608 | b_hangup = GTK_WIDGET (GCG_get_main_window_object | 1751 | b_hangup = GTK_WIDGET (GCG_get_main_window_object |
1609 | ("gnunet_conversation_gtk_hangup_button")); | 1752 | ("gnunet_conversation_gtk_hangup_button")); |
1753 | b_copy = GTK_WIDGET (GCG_get_main_window_object | ||
1754 | ("gnunet_conversation_gtk_ego_copy_button")); | ||
1610 | address_entry = GTK_ENTRY (GCG_get_main_window_object | 1755 | address_entry = GTK_ENTRY (GCG_get_main_window_object |
1611 | ("gnunet_conversation_gtk_address_entry")); | 1756 | ("gnunet_conversation_gtk_address_entry")); |
1612 | active_liststore = | 1757 | active_liststore = |
@@ -1636,6 +1781,7 @@ GCG_PHONE_shutdown () | |||
1636 | } | 1781 | } |
1637 | if (NULL != phone) | 1782 | if (NULL != phone) |
1638 | { | 1783 | { |
1784 | GSC_remove_phone (); | ||
1639 | GNUNET_CONVERSATION_phone_destroy (phone); | 1785 | GNUNET_CONVERSATION_phone_destroy (phone); |
1640 | phone = NULL; | 1786 | phone = NULL; |
1641 | } | 1787 | } |
diff --git a/src/conversation/gnunet-conversation-gtk_visibility.c b/src/conversation/gnunet-conversation-gtk_visibility.c index 8fa70e88..b16ea851 100644 --- a/src/conversation/gnunet-conversation-gtk_visibility.c +++ b/src/conversation/gnunet-conversation-gtk_visibility.c | |||
@@ -94,4 +94,18 @@ gnunet_conversation_gtk_view_caller_id_checkmenuitem_toggled_cb (GtkWidget * dum | |||
94 | } | 94 | } |
95 | 95 | ||
96 | 96 | ||
97 | /** | ||
98 | * Address book view is toggled. | ||
99 | * | ||
100 | * @param dummy widget triggering the event | ||
101 | * @param data main window builder (unused) | ||
102 | */ | ||
103 | void | ||
104 | gnunet_conversation_gtk_view_address_book_checkmenuitem_toggled_cb (GtkWidget *dummy, | ||
105 | gpointer data) | ||
106 | { | ||
107 | toggle_view ("gnunet_conversation_gtk_contact_list_frame", | ||
108 | "gnunet_conversation_gtk_view_address_book_checkmenuitem"); | ||
109 | } | ||
110 | |||
97 | /* end of gnunet-conversation-gtk_visibility.c */ | 111 | /* end of gnunet-conversation-gtk_visibility.c */ |