[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r33468 - in gnunet-gtk: contrib src/conversation
From: |
gnunet |
Subject: |
[GNUnet-SVN] r33468 - in gnunet-gtk: contrib src/conversation |
Date: |
Mon, 2 Jun 2014 17:17:27 +0200 |
Author: grothoff
Date: 2014-06-02 17:17:27 +0200 (Mon, 02 Jun 2014)
New Revision: 33468
Modified:
gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade
gnunet-gtk/src/conversation/Makefile.am
gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
gnunet-gtk/src/conversation/gnunet-conversation-gtk_history.c
gnunet-gtk/src/conversation/gnunet-conversation-gtk_history.h
gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.c
gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.h
gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c
gnunet-gtk/src/conversation/gnunet-conversation-gtk_visibility.c
Log:
misc improvements to conversation GUI
Modified: gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade
2014-06-02 12:18:18 UTC (rev 33467)
+++ gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade
2014-06-02 15:17:27 UTC (rev 33468)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkListStore"
id="gnunet_conversation_gtk_active_calls_liststore">
<columns>
<!-- column-name remote_user_name -->
@@ -55,6 +56,10 @@
<column type="gchararray"/>
<!-- column-name logContact -->
<column type="gchararray"/>
+ <!-- column-name logCallNumber -->
+ <column type="guint"/>
+ <!-- column-name logTimeNumber -->
+ <column type="guint64"/>
</columns>
</object>
<object class="GtkWindow" id="gnunet_conversation_gtk_main_window">
@@ -112,6 +117,14 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
+ <object class="GtkCheckMenuItem"
id="gnunet_conversation_gtk_view_address_book_checkmenuitem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Address
Book</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
<object class="GtkCheckMenuItem"
id="gnunet_conversation_gtk_view_caller_id_checkmenuitem">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
@@ -119,7 +132,6 @@
<property name="label" translatable="yes">_Caller
Identity</property>
<property name="use_underline">True</property>
<property name="active">True</property>
- <property name="draw_as_radio">True</property>
<signal name="toggled"
handler="gnunet_conversation_gtk_view_caller_id_checkmenuitem_toggled_cb"
swapped="no"/>
</object>
</child>
@@ -210,10 +222,10 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkLabel"
id="gnunet_conversation_gtk_ego_label_label">
+ <object class="GtkLabel"
id="gnunet_conversation_gtk_ego_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label"
translatable="yes">Label:</property>
+ <property name="label"
translatable="yes">Ego:</property>
</object>
<packing>
<property name="expand">False</property>
@@ -223,33 +235,30 @@
</packing>
</child>
<child>
- <object class="GtkComboBoxText"
id="gnunet_conversation_gtk_ego_label_comboboxtext">
+ <object class="GtkComboBox"
id="gnunet_conversation_gtk_ego_combobox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="has_entry">True</property>
- <property
name="entry_text_column">0</property>
- <property name="id_column">1</property>
- <items>
- <item translatable="yes">phone</item>
- </items>
- <child internal-child="entry">
- <object class="GtkEntry"
id="comboboxtext-entry">
- <property
name="can_focus">False</property>
- </object>
+ <property
name="model">gnunet_conversation_gtk_ego_liststore</property>
+ <signal name="changed"
handler="gnunet_conversation_gtk_ego_combobox_changed_cb" swapped="no"/>
+ <child>
+ <object class="GtkCellRendererText"
id="gnunet_conversation_gtk_outgoing_zone_ego_name_cellrenderertext"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
</child>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel"
id="gnunet_conversation_gtk_ego_label">
+ <object class="GtkLabel"
id="gnunet_conversation_gtk_ego_label_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label"
translatable="yes">Ego:</property>
+ <property name="label"
translatable="yes">Label:</property>
</object>
<packing>
<property name="expand">False</property>
@@ -259,16 +268,24 @@
</packing>
</child>
<child>
- <object class="GtkComboBox"
id="gnunet_conversation_gtk_ego_combobox">
+ <object class="GtkComboBoxText"
id="gnunet_conversation_gtk_ego_label_comboboxtext">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property
name="model">gnunet_conversation_gtk_ego_liststore</property>
- <signal name="changed"
handler="gnunet_conversation_gtk_ego_combobox_changed_cb" swapped="no"/>
- <child>
- <object class="GtkCellRendererText"
id="gnunet_conversation_gtk_outgoing_zone_ego_name_cellrenderertext"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
+ <property name="can_focus">True</property>
+ <property name="active">0</property>
+ <property name="has_entry">True</property>
+ <items>
+ <item translatable="yes">phone</item>
+ </items>
+ <signal name="changed"
handler="gnunet_conversation_gtk_ego_label_comboboxtext_changed_cb"
swapped="no"/>
+ <child internal-child="entry">
+ <object class="GtkEntry"
id="gnunet_conversation_gtk_ego_label_entry">
+ <property
name="visible">True</property>
+ <property
name="can_focus">True</property>
+ <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>
+ <property
name="max_length">63</property>
+ <property
name="caps_lock_warning">False</property>
+ <signal name="preedit-changed"
handler="gnunet_conversation_gtk_ego_label_entry_preedit_changed_cb"
swapped="no"/>
+ </object>
</child>
</object>
<packing>
@@ -283,15 +300,17 @@
<property name="label">gtk-copy</property>
<property
name="use_action_appearance">False</property>
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
+ <property name="tooltip_text"
translatable="yes">Copy our phone address to the clipboard.</property>
<property name="use_stock">True</property>
<signal name="clicked"
handler="gnunet_conversation_gtk_ego_copy_button_clicked_cb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="padding">5</property>
<property name="position">4</property>
</packing>
</child>
@@ -303,7 +322,7 @@
<object class="GtkLabel"
id="gnunet_conversation_gtk_ego_frame_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Caller
Identity</property>
+ <property name="label"
translatable="yes"><b>Caller Identity</b></property>
<property name="use_markup">True</property>
</object>
</child>
@@ -311,6 +330,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
+ <property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
@@ -352,7 +372,6 @@
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="invisible_char">•</property>
- <property
name="invisible_char_set">True</property>
<signal name="changed"
handler="gnunet_conversation_gtk_address_entry_changed_cb" swapped="no"/>
</object>
<packing>
@@ -367,9 +386,9 @@
<property
name="label">gtk-connect</property>
<property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
+ <property
name="sensitive">False</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<property
name="use_underline">True</property>
<property
name="use_stock">True</property>
<property
name="image_position">top</property>
@@ -389,7 +408,6 @@
<property
name="sensitive">False</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<property
name="use_stock">True</property>
<property
name="image_position">top</property>
<signal name="clicked"
handler="GNUNET_CONVERSATION_GTK_on_pause_clicked" swapped="no"/>
@@ -408,7 +426,6 @@
<property
name="sensitive">False</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<property
name="use_stock">True</property>
<property
name="image_position">top</property>
<signal name="clicked"
handler="GNUNET_CONVERSATION_GTK_on_hangup_clicked" swapped="no"/>
@@ -432,6 +449,7 @@
<object class="GtkBox"
id="gnunet_conversation_gtk_active_calls_hbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="spacing">5</property>
<child>
<object class="GtkScrolledWindow"
id="gnunet_conversation_gtk_active_calls_scrolledwindow">
<property
name="visible">True</property>
@@ -445,7 +463,7 @@
<property
name="enable_search">False</property>
<property
name="search_column">0</property>
<child internal-child="selection">
- <object class="GtkTreeSelection"
id="treeview-selection5"/>
+ <object class="GtkTreeSelection"
id="gnunet_conversation_gtk_active_calls_treeview_selection"/>
</child>
<child>
<object
class="GtkTreeViewColumn" id="caller_numColumn">
@@ -455,10 +473,8 @@
<property
name="sort_indicator">True</property>
<property
name="sort_column_id">2</property>
<child>
- <object
class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_active_calls_num">
- <property
name="background_gdk">#000000000000</property>
+ <object
class="GtkCellRendererText" id="gnunet_conersation_gtk__active_calls_num">
<property
name="font">Normal</property>
- <property
name="foreground_gdk">#000000000000</property>
<property
name="background_rgba">rgba(0,0,0,0)</property>
<property
name="foreground_rgba">rgba(0,0,0,0)</property>
</object>
@@ -476,7 +492,7 @@
<property
name="sort_indicator">True</property>
<property
name="sort_column_id">7</property>
<child>
- <object
class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_active_calls_state"/>
+ <object
class="GtkCellRendererText" id="gnunet_conversation_gtk_active_calls_state"/>
<attributes>
<attribute
name="text">7</attribute>
</attributes>
@@ -492,7 +508,7 @@
<property
name="sort_indicator">True</property>
<property
name="sort_column_id">0</property>
<child>
- <object
class="GtkCellRendererText" id="GNUNET_CONVERSATION_GTK_active_calls_id"/>
+ <object
class="GtkCellRendererText" id="gnunet_conversation_gtk_active_calls_id"/>
<attributes>
<attribute
name="text">0</attribute>
</attributes>
@@ -505,6 +521,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
+ <property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
@@ -514,6 +531,7 @@
<property
name="can_focus">False</property>
<property
name="border_width">2</property>
<property
name="orientation">vertical</property>
+ <property name="spacing">5</property>
<property
name="layout_style">start</property>
<child>
<object class="GtkImage"
id="GNUNET_GTK_status_icon">
@@ -538,7 +556,6 @@
<property
name="sensitive">False</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<property
name="xalign">0.4699999988079071</property>
<signal name="clicked"
handler="GNUNET_CONVERSATION_GTK_use_current_button_clicked" swapped="no"/>
</object>
@@ -557,7 +574,6 @@
<property
name="sensitive">False</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_CONVERSATION_GTK_on_accept_clicked" swapped="no"/>
</object>
<packing>
@@ -575,7 +591,6 @@
<property
name="sensitive">False</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
<signal name="clicked"
handler="GNUNET_CONVERSATION_GTK_on_resume_clicked" swapped="no"/>
</object>
<packing>
@@ -593,7 +608,6 @@
<property
name="sensitive">False</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
</object>
<packing>
<property
name="expand">False</property>
@@ -626,13 +640,15 @@
<object class="GtkLabel"
id="gnunet_conversation_gtk_call_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Call
Information</property>
+ <property name="label"
translatable="yes"><b>Call Information</b></property>
+ <property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
+ <property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
@@ -697,61 +713,70 @@
<property
name="visible">True</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
- <property
name="use_action_appearance">False</property>
+ <property name="tooltip_text"
translatable="yes">Add phone address from clipboard to address book.</property>
<property
name="use_stock">True</property>
<signal name="clicked"
handler="gnunet_conversation_gtk_contacts_paste_button_clicked_cb"
swapped="no"/>
</object>
<packing>
<property
name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
+ <property name="padding">5</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
+ <property name="fill">False</property>
+ <property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkTreeView"
id="gnunet_conversation_gtk_contact_list_treeview">
+ <object class="GtkScrolledWindow"
id="gnunet_conversation_gtk_contact_list_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property
name="model">gnunet_conversation_gtk_contacts_liststore</property>
- <property
name="headers_clickable">False</property>
- <property name="search_column">0</property>
- <signal name="row-activated"
handler="gnunet_conversation_gtk_contact_list_treeview_row_activated_cb"
swapped="no"/>
- <child internal-child="selection">
- <object class="GtkTreeSelection"
id="treeview-selection"/>
- </child>
+ <property name="shadow_type">in</property>
<child>
- <object class="GtkTreeViewColumn"
id="gnunet_conversation_gtk_contact_list_type_column">
- <property name="title"
translatable="yes">Type</property>
+ <object class="GtkTreeView"
id="gnunet_conversation_gtk_contact_list_treeview">
+ <property
name="visible">True</property>
+ <property
name="can_focus">True</property>
+ <property
name="model">gnunet_conversation_gtk_contacts_liststore</property>
+ <property
name="headers_clickable">False</property>
+ <property
name="search_column">0</property>
+ <signal name="row-activated"
handler="gnunet_conversation_gtk_contact_list_treeview_row_activated_cb"
swapped="no"/>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"
id="treeview-selection"/>
+ </child>
<child>
- <object class="GtkCellRendererText"
id="gnunet_conversation_gtk_contact_list_type_renderer"/>
- <attributes>
- <attribute
name="text">1</attribute>
- </attributes>
+ <object class="GtkTreeViewColumn"
id="gnunet_conversation_gtk_contact_list_type_column">
+ <property name="title"
translatable="yes">Type</property>
+ <child>
+ <object
class="GtkCellRendererText"
id="gnunet_conversation_gtk_contact_list_type_renderer"/>
+ <attributes>
+ <attribute
name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
</child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn"
id="gnunet_conversation_gtk_contact_list_value_column">
- <property
name="resizable">True</property>
- <property name="title"
translatable="yes">Name</property>
- <property name="expand">True</property>
<child>
- <object class="GtkCellRendererText"
id="gnunet_conversation_gtk_contact_list_value_renderer"/>
- <attributes>
- <attribute
name="text">0</attribute>
- </attributes>
+ <object class="GtkTreeViewColumn"
id="gnunet_conversation_gtk_contact_list_value_column">
+ <property
name="resizable">True</property>
+ <property name="title"
translatable="yes">Name</property>
+ <property
name="expand">True</property>
+ <child>
+ <object
class="GtkCellRendererText"
id="gnunet_conversation_gtk_contact_list_value_renderer"/>
+ <attributes>
+ <attribute
name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
</child>
</object>
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
@@ -764,13 +789,15 @@
<object class="GtkLabel"
id="gnunet_conversation_address_book_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Address
Book</property>
+ <property name="label"
translatable="yes"><b>Address Book</b></property>
+ <property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
+ <property name="padding">5</property>
<property name="position">2</property>
</packing>
</child>
@@ -802,6 +829,9 @@
<child>
<object class="GtkTreeViewColumn"
id="timeColumn">
<property name="title"
translatable="yes">Time</property>
+ <property
name="reorderable">True</property>
+ <property
name="sort_indicator">True</property>
+ <property
name="sort_column_id">4</property>
<child>
<object class="GtkCellRendererText"
id="GNUNET_CONVERSATION_GTK_time_window_renderer"/>
<attributes>
@@ -811,19 +841,23 @@
</object>
</child>
<child>
- <object class="GtkTreeViewColumn"
id="eventColumn">
- <property name="title"
translatable="yes">Event</property>
+ <object class="GtkTreeViewColumn"
id="gnunet_conversation_gtk_history_number_treeviewcolumn">
+ <property name="title"
translatable="yes">#</property>
+ <property
name="clickable">True</property>
+ <property
name="reorderable">True</property>
+ <property
name="sort_indicator">True</property>
+ <property
name="sort_column_id">3</property>
<child>
- <object class="GtkCellRendererText"
id="GNUNET_CONVERSATION_GTK_event_window_renderer"/>
+ <object class="GtkCellRendererText"
id="gnunet_conversation_gtk_history_number_cellrenderertext"/>
<attributes>
- <attribute
name="text">1</attribute>
+ <attribute
name="text">3</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn"
id="contactColumn">
- <property name="title"
translatable="yes">Contact</property>
+ <property name="title"
translatable="yes">Caller ID</property>
<child>
<object class="GtkCellRendererText"
id="GNUNET_CONVERSATION_GTK_contact_window_renderer"/>
<attributes>
@@ -832,6 +866,17 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkTreeViewColumn"
id="eventColumn">
+ <property name="title"
translatable="yes">Event</property>
+ <child>
+ <object class="GtkCellRendererText"
id="GNUNET_CONVERSATION_GTK_event_window_renderer"/>
+ <attributes>
+ <attribute
name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
@@ -842,13 +887,15 @@
<object class="GtkLabel"
id="gnunet_conversation_gtk_history_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label"
translatable="yes">History</property>
+ <property name="label"
translatable="yes"><b>History</b></property>
+ <property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
+ <property name="padding">5</property>
<property name="position">3</property>
</packing>
</child>
@@ -885,13 +932,15 @@
<object class="GtkLabel"
id="gnunet_conversation_gtk_log_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label"
translatable="yes">Logs</property>
+ <property name="label"
translatable="yes"><b>Logs</b></property>
+ <property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
+ <property name="padding">5</property>
<property name="position">4</property>
</packing>
</child>
Modified: gnunet-gtk/src/conversation/Makefile.am
===================================================================
--- gnunet-gtk/src/conversation/Makefile.am 2014-06-02 12:18:18 UTC (rev
33467)
+++ gnunet-gtk/src/conversation/Makefile.am 2014-06-02 15:17:27 UTC (rev
33468)
@@ -35,7 +35,7 @@
$(top_builddir)/src/lib/libgnunetgtk.la \
@GTK_LIBS@ \
@GLADE_LIBS@ @GNUNET_LIBS@ \
- -lgnunetutil -lgnunetidentity -lgnunetconversation -lgnunetspeaker
-lgnunetmicrophone -lgnunetnamestore -lgnunetgnsrecord -lgnunetgns -lgnunetfs
-lextractor \
+ -lgnunetutil -lgnunetidentity -lgnunetconversation -lgnunetspeaker
-lgnunetmicrophone -lgnunetnamestore -lgnunetdnsparser -lgnunetgnsrecord
-lgnunetgns -lgnunetfs -lextractor \
$(INTLLIBS)
gnunet_conversation_gtk_LDFLAGS = \
-export-dynamic
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
2014-06-02 12:18:18 UTC (rev 33467)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
2014-06-02 15:17:27 UTC (rev 33468)
@@ -64,7 +64,7 @@
*/
static struct GNUNET_NAMESTORE_ZoneMonitor *zone_mon;
-/**
+/**
* The tree view widget.
*/
static GtkWidget *contacts_treeview;
@@ -101,7 +101,7 @@
if (0 == strcmp (type, "PKEY"))
{
GNUNET_asprintf (&address,
- "call.%s.gnu",
+ "phone.%s.gnu",
name);
}
else
@@ -281,7 +281,7 @@
gnunet_conversation_gtk_contacts_paste_button_clicked_cb (GtkButton *button,
gpointer user_data)
{
- GNUNET_break (0);
+ GNUNET_break (0); // FIXME: not implemented
}
@@ -293,7 +293,7 @@
{
contacts_treeview
= GTK_WIDGET (GCG_get_main_window_object
- ("gnunet_conversation_gtk_treeview"));
+ ("gnunet_conversation_gtk_contact_list_treeview"));
#if GTK_CHECK_VERSION(3,10,0)
gtk_tree_view_set_activate_on_single_click (GTK_TREE_VIEW
(contacts_treeview),
TRUE);
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_history.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_history.c
2014-06-02 12:18:18 UTC (rev 33467)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_history.c
2014-06-02 15:17:27 UTC (rev 33468)
@@ -46,7 +46,17 @@
/**
* Human-readable name of the contact involved (gchar *)
*/
- HISTORY_LS_CONTACT = 2
+ HISTORY_LS_CONTACT = 2,
+
+ /**
+ * Unique number associated with the call (guint)
+ */
+ HISTORY_LS_NUMBER = 3,
+
+ /**
+ * Number of the entry used for sorting by timestamp (guint64)
+ */
+ HISTORY_LS_TIME_ORDER = 4
};
@@ -61,43 +71,70 @@
*
* @param type type of the event
* @param contact_name name of the contact person
+ * @param call_number unique number for the call
*/
void
GCG_HISTORY_add (enum GCG_HISTORY_Type type,
- const char *contact_name)
+ const char *contact_name,
+ guint call_number)
{
GtkTreeIter iter;
+ struct GNUNET_TIME_Absolute now;
const char *event;
const char *ts;
switch (type)
{
- case GCG_HISTORY_TYPE_ACCEPTED:
+ case GCG_HISTORY_TYPE_OUTGOING_CALL:
+ event = "Dialing";
+ break;
+ case GCG_HISTORY_TYPE_OUTGOING_RINGING:
+ event = "Waiting";
+ break;
+ case GCG_HISTORY_TYPE_OUTGOING_ACCEPTED:
event = "Accepted";
break;
- case GCG_HISTORY_TYPE_REJECTED:
+ case GCG_HISTORY_TYPE_INCOMING_CALL:
+ event = "Ringing";
+ break;
+ case GCG_HISTORY_TYPE_INCOMING_ACCEPTED:
+ event = "Answering";
+ break;
+ case GCG_HISTORY_TYPE_INCOMING_REJECTED:
event = "Rejected";
break;
- case GCG_HISTORY_TYPE_OUTGOING:
- event = "Outgoing";
+ case GCG_HISTORY_TYPE_INCOMING_MISSED:
+ event = "Missed";
break;
+ case GCG_HISTORY_TYPE_SUSPEND_LOCAL:
+ event = "Suspending";
+ break;
+ case GCG_HISTORY_TYPE_RESUMED_LOCAL:
+ event = "Resuming";
+ break;
+ case GCG_HISTORY_TYPE_SUSPEND_REMOTE:
+ event = "On hold";
+ break;
+ case GCG_HISTORY_TYPE_RESUMED_REMOTE:
+ event = "Resumed";
+ break;
case GCG_HISTORY_TYPE_HANGUP:
- event = "Hangup";
+ event = "Hang up";
break;
- case GCG_HISTORY_TYPE_MISSED:
- event = "Missed";
+ case GCG_HISTORY_TYPE_FAILED:
+ event = "Failed";
break;
- default:
- event = "UNKNOWN";
- break;
}
- ts = GNUNET_STRINGS_absolute_time_to_string (GNUNET_TIME_absolute_get ());
+ now = GNUNET_TIME_absolute_get ();
+ ts = GNUNET_STRINGS_absolute_time_to_string (now);
gtk_list_store_insert_with_values (history_liststore,
&iter,
-1,
HISTORY_LS_TIME, ts,
HISTORY_LS_EVENT, event,
HISTORY_LS_CONTACT, contact_name,
+ HISTORY_LS_NUMBER, call_number,
+ HISTORY_LS_TIME_ORDER, (guint64)
now.abs_value_us,
-1);
}
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_history.h
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_history.h
2014-06-02 12:18:18 UTC (rev 33467)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_history.h
2014-06-02 15:17:27 UTC (rev 33468)
@@ -33,11 +33,72 @@
*/
enum GCG_HISTORY_Type
{
- GCG_HISTORY_TYPE_ACCEPTED,
- GCG_HISTORY_TYPE_REJECTED,
- GCG_HISTORY_TYPE_OUTGOING,
+ /**
+ * We initiated an outgoing call.
+ */
+ GCG_HISTORY_TYPE_OUTGOING_CALL,
+
+ /**
+ * We are ringing other party in outgoing call.
+ */
+ GCG_HISTORY_TYPE_OUTGOING_RINGING,
+
+ /**
+ * An outgoing call was accepted.
+ */
+ GCG_HISTORY_TYPE_OUTGOING_ACCEPTED,
+
+ /**
+ * We have an incoming call.
+ */
+ GCG_HISTORY_TYPE_INCOMING_CALL,
+
+ /**
+ * We answered an incoming call.
+ */
+ GCG_HISTORY_TYPE_INCOMING_ACCEPTED,
+
+ /**
+ * We rejected an incoming call.
+ */
+ GCG_HISTORY_TYPE_INCOMING_REJECTED,
+
+ /**
+ * We missed a call (phone was ringing and
+ * then caller hung up before we did anything).
+ */
+ GCG_HISTORY_TYPE_INCOMING_MISSED,
+
+ /**
+ * We suspended an active call.
+ */
+ GCG_HISTORY_TYPE_SUSPEND_LOCAL,
+
+ /**
+ * We resumed a suspended call.
+ */
+ GCG_HISTORY_TYPE_RESUMED_LOCAL,
+
+ /**
+ * Remote suspended an active call.
+ */
+ GCG_HISTORY_TYPE_SUSPEND_REMOTE,
+
+ /**
+ * Remote resumed suspended call.
+ */
+ GCG_HISTORY_TYPE_RESUMED_REMOTE,
+
+ /**
+ * Either side terminated an active call.
+ */
GCG_HISTORY_TYPE_HANGUP,
- GCG_HISTORY_TYPE_MISSED
+
+ /**
+ * Failed to resolve target.
+ */
+ GCG_HISTORY_TYPE_FAILED
+
};
@@ -46,10 +107,12 @@
*
* @param type type of the event
* @param contact_name name of the contact person
+ * @param call_number unique number for the call
*/
void
GCG_HISTORY_add (enum GCG_HISTORY_Type type,
- const char *contact_name);
+ const char *contact_name,
+ guint call_number);
/**
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.c
2014-06-02 12:18:18 UTC (rev 33467)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.c
2014-06-02 15:17:27 UTC (rev 33468)
@@ -117,6 +117,30 @@
/**
+ * Add phone address to namestore.
+ *
+ * @param label label to use for the phone record
+ * @param rd record data to publish
+ */
+void
+GSC_add_phone (const gchar *label,
+ const struct GNUNET_GNSRECORD_Data *rd)
+{
+ GNUNET_break (0); // FIXME: not implemented!
+}
+
+
+/**
+ * Remove previously added phone address from namestore.
+ */
+void
+GSC_remove_phone ()
+{
+ GNUNET_break (0); // FIXME: not implemented!
+}
+
+
+/**
* Initialize the import subsystem.
*/
void
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.h
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.h
2014-06-02 12:18:18 UTC (rev 33467)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.h
2014-06-02 15:17:27 UTC (rev 33468)
@@ -41,6 +41,24 @@
/**
+ * Add phone address to namestore.
+ *
+ * @param label label to use for the phone record
+ * @param rd record data to publish
+ */
+void
+GSC_add_phone (const gchar *label,
+ const struct GNUNET_GNSRECORD_Data *rd);
+
+
+/**
+ * Remove previously added phone address from namestore.
+ */
+void
+GSC_remove_phone (void);
+
+
+/**
* Initialize the import subsystem.
*/
void
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c 2014-06-02
12:18:18 UTC (rev 33467)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_phone.c 2014-06-02
15:17:27 UTC (rev 33468)
@@ -28,6 +28,7 @@
#include "gnunet-conversation-gtk.h"
#include "gnunet-conversation-gtk_egos.h"
#include "gnunet-conversation-gtk_history.h"
+#include "gnunet-conversation-gtk_import.h"
#include "gnunet-conversation-gtk_log.h"
#include "gnunet-conversation-gtk_phone.h"
@@ -231,7 +232,7 @@
/**
* Name of conversation partner.
*/
- char *peer_name;
+ char *caller_id;
/**
* Location of this call in the list.
@@ -334,6 +335,11 @@
static GtkWidget *b_hangup;
/**
+ * The "copy" button.
+ */
+static GtkWidget *b_copy;
+
+/**
* Our address entry.
*/
static GtkEntry *address_entry;
@@ -362,9 +368,6 @@
return _("on hold");
case IN_STATE_SUSPENDED_BOTH:
return _("suspended and on hold");
- default:
- GNUNET_break (0);
- break;
}
return NULL;
}
@@ -395,9 +398,6 @@
return _("on hold");
case OUT_STATE_SUSPENDED_BOTH:
return _("suspended and on hold");
- default:
- GNUNET_break (0);
- break;
}
return NULL;
}
@@ -435,7 +435,7 @@
GNUNET_CONVERSATION_call_stop (oc->call);
oc->call = NULL;
}
- GNUNET_free (oc->peer_name);
+ GNUNET_free (oc->caller_id);
gtk_tree_row_reference_free (oc->rr);
GNUNET_free (oc);
}
@@ -461,10 +461,94 @@
if ( (NULL == active_in) &&
(NULL == active_out) )
{
- GCG_update_status_bar ("%s",
- _("We are listening for incoming calls"));
- GCG_set_status_icon ("gnunet-conversation-gtk-tray-available");
+ if (NULL != phone)
+ {
+ GCG_update_status_bar ("%s",
+ _("We are listening for incoming calls"));
+ GCG_set_status_icon ("gnunet-conversation-gtk-tray-available");
+ }
+ else
+ {
+ if (NULL == GCG_EGOS_get_selected_ego ())
+ {
+ GCG_update_status_bar ("%s",
+ _("No ego selected, phone is down."));
+ GCG_set_status_icon ("gnunet-conversation-gtk-tray-pending");
+ }
+ else
+ {
+ GCG_update_status_bar ("%s",
+ _("Failed to setup phone (internal error)"));
+ GCG_set_status_icon ("gnunet-conversation-offline");
+ }
+ }
+ return;
}
+ if (NULL != active_in)
+ {
+ switch (active_in->state)
+ {
+ case IN_STATE_NONE:
+ GNUNET_break (0);
+ break;
+ case IN_STATE_RINGING:
+ GNUNET_break (0);
+ break;
+ case IN_STATE_CONNECTED:
+ GCG_update_status_bar (_("In a conversation with `%s'."),
+ active_in->caller_id);
+ GCG_set_status_icon ("gnunet-conversation-call-active");
+ break;
+ case IN_STATE_SUSPENDED_LOCAL:
+ GNUNET_break (0);
+ break;
+ case IN_STATE_SUSPENDED_REMOTE:
+ GCG_update_status_bar (_("On hold in a conversation with `%s'."),
+ active_in->caller_id);
+ GCG_set_status_icon ("gnunet-conversation-call-on-hold");
+ break;
+ case IN_STATE_SUSPENDED_BOTH:
+ GNUNET_break (0);
+ break;
+ }
+ return;
+ }
+ if (NULL != active_out)
+ {
+ switch (active_out->state)
+ {
+ case OUT_STATE_NONE:
+ GNUNET_break (0);
+ break;
+ case OUT_STATE_RESOLVING:
+ GCG_update_status_bar (_("Resolving `%s'."),
+ active_out->caller_id);
+ GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-pending");
+ break;
+ case OUT_STATE_RINGING:
+ GCG_update_status_bar (_("Ringing `%s'."),
+ active_out->caller_id);
+ GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-ringing");
+ break;
+ case OUT_STATE_CONNECTED:
+ GCG_update_status_bar (_("In a conversation with `%s'."),
+ active_out->caller_id);
+ GCG_set_status_icon ("gnunet-conversation-call-active");
+ break;
+ case OUT_STATE_SUSPENDED_LOCAL:
+ GNUNET_break (0);
+ break;
+ case OUT_STATE_SUSPENDED_REMOTE:
+ GCG_update_status_bar (_("On hold in a conversation with `%s'."),
+ active_out->caller_id);
+ GCG_set_status_icon ("gnunet-conversation-call-on-hold");
+ break;
+ case OUT_STATE_SUSPENDED_BOTH:
+ GNUNET_break (0);
+ break;
+ }
+ return;
+ }
}
@@ -492,7 +576,7 @@
* @param sel selection that changed (belongs to #active_treeview)
*/
static void
-update_call_buttons (GtkTreeSelection *sel)
+update_call_buttons (GtkTreeSelection *sel)
{
GtkTreeIter iter;
GtkTreeModel *model;
@@ -507,7 +591,7 @@
&iter))
{
/* nothing selected, disable buttons */
- gtk_widget_set_sensitive (b_add_contact, FALSE);
+ gtk_widget_set_sensitive (b_add_contact, FALSE);
gtk_widget_set_sensitive (b_accept, FALSE);
gtk_widget_set_sensitive (b_refuse, FALSE);
gtk_widget_set_sensitive (b_resume, FALSE);
@@ -530,35 +614,33 @@
GNUNET_break (0);
break;
case IN_STATE_RINGING:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, ! in_call);
gtk_widget_set_sensitive (b_refuse, TRUE);
gtk_widget_set_sensitive (b_resume, ! in_call);
break;
case IN_STATE_CONNECTED:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, FALSE);
gtk_widget_set_sensitive (b_refuse, (active_in != ic));
gtk_widget_set_sensitive (b_resume, FALSE);
break;
case IN_STATE_SUSPENDED_LOCAL:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, FALSE);
gtk_widget_set_sensitive (b_refuse, TRUE);
gtk_widget_set_sensitive (b_resume, TRUE);
case IN_STATE_SUSPENDED_REMOTE:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, FALSE);
gtk_widget_set_sensitive (b_refuse, TRUE);
gtk_widget_set_sensitive (b_resume, FALSE);
case IN_STATE_SUSPENDED_BOTH:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, FALSE);
gtk_widget_set_sensitive (b_refuse, TRUE);
gtk_widget_set_sensitive (b_resume, TRUE);
break;
- default:
- GNUNET_assert (0);
}
break;
case CALL_OUT:
@@ -568,41 +650,37 @@
GNUNET_break (0);
break;
case OUT_STATE_RESOLVING:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, FALSE);
gtk_widget_set_sensitive (b_refuse, FALSE);
gtk_widget_set_sensitive (b_resume, FALSE);
case OUT_STATE_RINGING:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, ! in_call);
gtk_widget_set_sensitive (b_refuse, FALSE);
gtk_widget_set_sensitive (b_resume, ! in_call);
case OUT_STATE_CONNECTED:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, FALSE);
gtk_widget_set_sensitive (b_refuse, FALSE);
gtk_widget_set_sensitive (b_resume, FALSE);
case OUT_STATE_SUSPENDED_LOCAL:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, FALSE);
gtk_widget_set_sensitive (b_refuse, TRUE);
gtk_widget_set_sensitive (b_resume, ! in_call);
case OUT_STATE_SUSPENDED_REMOTE:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, FALSE);
gtk_widget_set_sensitive (b_refuse, TRUE);
gtk_widget_set_sensitive (b_resume, FALSE);
case OUT_STATE_SUSPENDED_BOTH:
- gtk_widget_set_sensitive (b_add_contact, TRUE);
+ gtk_widget_set_sensitive (b_add_contact, TRUE);
gtk_widget_set_sensitive (b_accept, FALSE);
gtk_widget_set_sensitive (b_refuse, TRUE);
gtk_widget_set_sensitive (b_resume, ! in_call);
- default:
- GNUNET_assert (0);
}
break;
- default:
- GNUNET_assert (0);
}
}
@@ -615,7 +693,7 @@
*/
void
gnunet_conversation_gtk_active_calls_treeview_selection_changed_cb
(GtkTreeSelection *sel,
- gpointer
user_data)
+ gpointer
user_data)
{
update_call_buttons (sel);
}
@@ -756,9 +834,9 @@
ic->rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (active_liststore),
path);
gtk_tree_path_free (path);
- GCG_log (_("A Incoming call from `%s' with number %u\n"),
- caller_id,
- ic->caller_num);
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_CALL,
+ ic->caller_id,
+ ic->caller_num);
break;
case GNUNET_CONVERSATION_EC_PHONE_HUNG_UP:
GNUNET_break (in_ring_counter > 0);
@@ -774,11 +852,27 @@
-1);
if (caller == ic->caller)
{
- GCG_log (_("phone hung up: %s number: %u"),
- ic->caller_id,
- ic->caller_num);
+ if (ic == active_in)
+ {
+ active_in = NULL;
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP,
+ ic->caller_id,
+ ic->caller_num);
+ }
+ else
+ {
+ if (IN_STATE_RINGING == ic->state)
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_MISSED,
+ ic->caller_id,
+ ic->caller_num);
+ else
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP,
+ ic->caller_id,
+ ic->caller_num);
+ }
set_incoming_call_state (ic,
IN_STATE_NONE);
+ destroy_in (ic);
break;
}
valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (active_liststore),
@@ -812,6 +906,9 @@
switch (code)
{
case GNUNET_CONVERSATION_EC_CALLER_SUSPEND:
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_REMOTE,
+ ic->caller_id,
+ ic->caller_num);
is = ic->state;
switch (ic->state)
{
@@ -833,16 +930,14 @@
case IN_STATE_SUSPENDED_BOTH:
GNUNET_assert (0);
break;
- default:
- GNUNET_assert (0);
- break;
}
set_incoming_call_state (ic,
is);
- GCG_log (_("Call from `%s' suspended by other user\n"),
- ic->caller_id);
break;
case GNUNET_CONVERSATION_EC_CALLER_RESUME:
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_REMOTE,
+ ic->caller_id,
+ ic->caller_num);
is = ic->state;
switch (ic->state)
{
@@ -864,14 +959,9 @@
case IN_STATE_SUSPENDED_BOTH:
is = IN_STATE_SUSPENDED_LOCAL;
break;
- default:
- GNUNET_assert (0);
- break;
}
set_incoming_call_state (ic,
is);
- GCG_log (_("Call from `%s' resumed by other user\n"),
- ic->caller_id);
break;
}
do_status();
@@ -922,14 +1012,12 @@
active_in = ic;
set_incoming_call_state (ic,
IN_STATE_CONNECTED);
- GCG_update_status_bar (_("Started a conversation with `%s'."),
- ic->caller_id);
- GCG_set_status_icon ("gnunet-conversation-call-active");
GNUNET_CONVERSATION_caller_pick_up (ic->caller,
&caller_event_handler, ic,
speaker, mic);
- GCG_HISTORY_add (GCG_HISTORY_TYPE_ACCEPTED,
- ic->caller_id);
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_ACCEPTED,
+ ic->caller_id,
+ ic->caller_num);
do_status ();
}
@@ -974,10 +1062,9 @@
}
GNUNET_break (in_ring_counter > 0);
in_ring_counter--;
- GCG_update_status_bar (_("Rejected conversation with `%s'."),
- ic->caller_id);
- GCG_HISTORY_add (GCG_HISTORY_TYPE_REJECTED,
- ic->caller_id);
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_INCOMING_REJECTED,
+ ic->caller_id,
+ ic->caller_num);
set_incoming_call_state (ic,
IN_STATE_NONE);
destroy_in (ic);
@@ -993,10 +1080,9 @@
GNUNET_break (0);
return;
}
- GCG_update_status_bar (_("Terminated suspended conversation with `%s'."),
- oc->peer_name);
GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP,
- oc->peer_name);
+ oc->caller_id,
+ oc->caller_num);
set_outgoing_call_state (oc,
OUT_STATE_NONE);
destroy_out (oc);
@@ -1020,10 +1106,13 @@
gpointer *user_data)
{
// FIXME: implement, use "GSC_add_contact"
+ // FIXME: need to determine desired label for the contact!
+ // => prompt user!?
#if 0
const gchar *target;
target = gtk_entry_get_text (address_entry);
+ GSC_add_contact (label, address);
#endif
}
@@ -1071,12 +1160,11 @@
active_in = ic;
set_incoming_call_state (ic,
IN_STATE_CONNECTED);
- GCG_update_status_bar (_("Resumed conversation with `%s'."),
- ic->caller_id);
- GCG_set_status_icon ("gnunet-conversation-call-active");
GNUNET_CONVERSATION_caller_resume (ic->caller,
speaker, mic);
- // GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED, ic->caller_id);
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_LOCAL,
+ ic->caller_id,
+ ic->caller_num);
do_status ();
return;
}
@@ -1087,7 +1175,9 @@
speaker, mic);
set_outgoing_call_state (oc,
OUT_STATE_CONNECTED);
- // GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED, ic->caller_id);
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_LOCAL,
+ oc->caller_id,
+ oc->caller_num);
do_status ();
return;
}
@@ -1118,8 +1208,10 @@
if (NULL != active_out)
{
/* outgoing */
- os = active_out->state;
- switch (active_out->state)
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_LOCAL,
+ active_out->caller_id,
+ active_out->caller_num);
+ switch ((os = active_out->state))
{
case OUT_STATE_NONE:
GNUNET_assert (0);
@@ -1142,9 +1234,6 @@
case OUT_STATE_SUSPENDED_BOTH:
GNUNET_assert (0);
break;
- default:
- GNUNET_assert (0);
- break;
}
GNUNET_CONVERSATION_call_suspend (active_out->call);
set_outgoing_call_state (active_out,
@@ -1158,15 +1247,16 @@
gtk_widget_set_sensitive (GTK_WIDGET (address_entry), TRUE);
check_call_sensitivity ();
do_status ();
- // FIXME: logging
return;
}
if (NULL != active_in)
{
/* incoming */
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_LOCAL,
+ active_in->caller_id,
+ active_in->caller_num);
GNUNET_CONVERSATION_caller_suspend (active_in->caller);
- is = active_in->state;
- switch (active_in->state)
+ switch ((is = active_in->state))
{
case IN_STATE_NONE:
GNUNET_assert (0);
@@ -1186,9 +1276,6 @@
case IN_STATE_SUSPENDED_BOTH:
GNUNET_assert (0);
break;
- default:
- GNUNET_assert (0);
- break;
}
set_incoming_call_state (active_in,
is);
@@ -1201,7 +1288,6 @@
gtk_widget_set_sensitive (GTK_WIDGET (address_entry), TRUE);
check_call_sensitivity ();
do_status ();
- // FIXME: logging
return;
}
GNUNET_break (0);
@@ -1227,11 +1313,13 @@
if (NULL != active_out)
{
/* if current call is outgoing, stop it */
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP,
+ active_out->caller_id,
+ active_out->caller_num);
set_outgoing_call_state (active_out,
OUT_STATE_NONE);
destroy_out (active_out);
active_out = NULL;
- // FIXME: logging
gtk_widget_hide (b_suspend);
gtk_widget_hide (b_hangup);
gtk_widget_show (b_call);
@@ -1245,6 +1333,9 @@
if (NULL != active_in)
{
/* if selected call is incoming, hang it up */
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP,
+ active_in->caller_id,
+ active_in->caller_num);
set_incoming_call_state (active_in,
IN_STATE_NONE);
destroy_in (active_in);
@@ -1257,7 +1348,6 @@
gtk_widget_set_sensitive (GTK_WIDGET (address_entry), TRUE);
check_call_sensitivity ();
do_status ();
- // FIXME: logging
return;
}
GNUNET_break (0);
@@ -1277,34 +1367,32 @@
struct OutgoingCall *oc = cls;
enum OutCallState os;
- set_outgoing_call_state (oc, code);
switch (code)
{
case GNUNET_CONVERSATION_EC_CALL_RINGING:
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_OUTGOING_RINGING,
+ oc->caller_id,
+ oc->caller_num);
GNUNET_break (OUT_STATE_RESOLVING == oc->state);
GNUNET_break (active_out == oc);
- GCG_log (_("Resolved address of `%s'. Now ringing other party."),
- oc->peer_name);
set_outgoing_call_state (oc,
OUT_STATE_RINGING);
- GCG_log (_("Ringing `%s'.\n"),
- oc->peer_name);
- GCG_update_status_bar (_("Ringing `%s'."),
- oc->peer_name);
- GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-ringing");
+ do_status ();
break;
case GNUNET_CONVERSATION_EC_CALL_PICKED_UP:
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_OUTGOING_ACCEPTED,
+ oc->caller_id,
+ oc->caller_num);
GNUNET_break (OUT_STATE_RINGING == oc->state);
set_outgoing_call_state (oc, OUT_STATE_CONNECTED);
GNUNET_break (active_out == oc);
gtk_widget_set_sensitive (b_suspend, TRUE);
- GCG_log (_("Connection established to `%s'."),
- oc->peer_name);
- GCG_update_status_bar (_("Talking to `%s'."),
- oc->peer_name);
- GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-active");
+ do_status ();
break;
case GNUNET_CONVERSATION_EC_CALL_GNS_FAIL:
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_FAILED,
+ oc->caller_id,
+ oc->caller_num);
GNUNET_break (OUT_STATE_RESOLVING == oc->state);
GNUNET_break (active_out == oc);
set_outgoing_call_state (oc,
@@ -1312,8 +1400,6 @@
oc->call = NULL;
destroy_out (oc);
active_out = NULL;
- GCG_log (_("Failed to resolve %s in current zone."),
- oc->peer_name);
gtk_widget_hide (b_suspend);
gtk_widget_hide (b_hangup);
gtk_widget_show (b_call);
@@ -1323,7 +1409,9 @@
do_status ();
break;
case GNUNET_CONVERSATION_EC_CALL_HUNG_UP:
- GCG_log ("%s", _("Call terminated"));
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_HANGUP,
+ oc->caller_id,
+ oc->caller_num);
set_outgoing_call_state (oc, OUT_STATE_NONE);
GNUNET_break (active_out == oc);
oc->call = NULL;
@@ -1339,6 +1427,9 @@
do_status ();
break;
case GNUNET_CONVERSATION_EC_CALL_SUSPENDED:
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_SUSPEND_REMOTE,
+ oc->caller_id,
+ oc->caller_num);
os = oc->state;
switch (oc->state)
{
@@ -1363,16 +1454,14 @@
case OUT_STATE_SUSPENDED_BOTH:
GNUNET_assert (0);
break;
- default:
- GNUNET_assert (0);
- break;
}
set_outgoing_call_state (oc, os);
- GCG_log (_("Connection to `%s' suspended (by other user)\n"),
- oc->peer_name);
do_status ();
- break;
+ break;
case GNUNET_CONVERSATION_EC_CALL_RESUMED:
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_RESUMED_REMOTE,
+ oc->caller_id,
+ oc->caller_num);
os = oc->state;
switch (oc->state)
{
@@ -1397,18 +1486,10 @@
case OUT_STATE_SUSPENDED_BOTH:
os = OUT_STATE_SUSPENDED_LOCAL;
break;
- default:
- GNUNET_assert (0);
- break;
}
- GCG_log (_("Connection to `%s' resumed by remote\n"),
- oc->peer_name);
set_outgoing_call_state (oc, os);
if (OUT_STATE_CONNECTED == os)
{
- GCG_update_status_bar (_("Talking to `%s'."),
- oc->peer_name);
- GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-active");
GNUNET_break (active_out == oc);
gtk_widget_show (b_suspend);
gtk_widget_show (b_hangup);
@@ -1417,10 +1498,12 @@
gtk_widget_set_sensitive (b_suspend, TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (address_entry), FALSE);
}
+ do_status ();
break;
case GNUNET_CONVERSATION_EC_CALL_ERROR:
- GCG_log ("GNUNET_CONVERSATION_EC_CALL_ERROR %s",
- oc->peer_name);
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_FAILED,
+ oc->caller_id,
+ oc->caller_num);
set_outgoing_call_state (oc, OUT_STATE_NONE);
oc->call = NULL;
if (active_out == oc)
@@ -1466,9 +1549,12 @@
return;
}
oc = GNUNET_new (struct OutgoingCall);
- oc->peer_name = GNUNET_strdup (arg);
+ oc->caller_id = GNUNET_strdup (arg);
oc->state = OUT_STATE_RESOLVING;
oc->caller_num = caller_num_gen++;
+ GCG_HISTORY_add (GCG_HISTORY_TYPE_OUTGOING_CALL,
+ oc->caller_id,
+ oc->caller_num);
oc->call =
GNUNET_CONVERSATION_call_start (GCG_get_configuration (),
caller_id,
@@ -1478,7 +1564,7 @@
gtk_list_store_insert_with_values (active_liststore,
&iter,
-1,
- GCG_PHONE_LS_REMOTE_USER_NAME,
oc->peer_name,
+ GCG_PHONE_LS_REMOTE_USER_NAME,
oc->caller_id,
GCG_PHONE_LS_INCOMING_CALL, NULL,
GCG_PHONE_LS_NUMBER, oc->caller_num,
GCG_PHONE_LS_IN_CALL_STATE, IN_STATE_NONE,
@@ -1487,20 +1573,12 @@
GCG_PHONE_LS_OUT_CALL_STATE, oc->state,
GCG_PHONE_LS_STATE_NAME,
out_call_state_to_string (oc->state),
- -1);
+ -1);
path = gtk_tree_model_get_path (GTK_TREE_MODEL (active_liststore),
&iter);
oc->rr = gtk_tree_row_reference_new (GTK_TREE_MODEL (active_liststore),
- path);
+ path);
gtk_tree_path_free (path);
- /* log event */
- GCG_log (_("Resolving `%s'.\n"),
- oc->peer_name);
- GCG_update_status_bar (_("Resolving `%s'."),
- oc->peer_name);
- GCG_set_status_icon ("gnunet-conversation-gtk-tray-call-pending");
- GCG_HISTORY_add (GCG_HISTORY_TYPE_OUTGOING,
- oc->peer_name);
/* hide "call" button, make address entry insensitive;
show suspend button (but not sensitive),
show hangup button (and make sensitive) */
@@ -1509,6 +1587,7 @@
gtk_widget_show (b_suspend);
gtk_widget_show (b_hangup);
gtk_widget_set_sensitive (b_hangup, TRUE);
+ do_status ();
}
@@ -1528,6 +1607,82 @@
/**
+ * Our phone record has changed, update the information
+ * published in the GNU Name System.
+ */
+static void
+update_phone_record ()
+{
+ struct GNUNET_GNSRECORD_Data rd;
+ const gchar *label;
+
+ label = gtk_entry_get_text (GTK_ENTRY
+ (GCG_get_main_window_object
+ ("gnunet_conversation_gtk_ego_label_entry")));
+ if ( (NULL == label) ||
+ (0 == strlen (label)) )
+ {
+ gtk_widget_set_sensitive (b_copy, FALSE);
+ GSC_remove_phone ();
+ return;
+ }
+ gtk_widget_set_sensitive (b_copy, TRUE);
+ GNUNET_CONVERSATION_phone_get_record (phone,
+ &rd);
+ GSC_add_phone (label, &rd);
+}
+
+
+/**
+ * The user has edited the label. Check if the new label is valid,
+ * and if so commit the change to the model and update the phone
+ * record.
+ *
+ * @param entry the entry used to edit the label
+ * @param preedit new label
+ * @param user_data builder (unused)
+ */
+void
+gnunet_conversation_gtk_ego_label_entry_preedit_changed_cb (GtkEntry *entry,
+ gchar *preedit,
+ gpointer user_data)
+{
+ GtkComboBoxText *cbt;
+
+ if (GNUNET_OK !=
+ GNUNET_DNSPARSER_check_label (preedit))
+ {
+ GCG_log (_("Invalid label `%s'\n"),
+ preedit);
+ gdk_beep ();
+ return;
+ }
+ cbt = GTK_COMBO_BOX_TEXT (GCG_get_main_window_object
+
("gnunet_conversation_gtk_ego_label_comboboxtext"));
+ gtk_combo_box_text_insert (cbt,
+ -1,
+ NULL,
+ preedit);
+ update_phone_record ();
+}
+
+
+/**
+ * The user has changed the selected label in the combo box. Commit
+ * the change to the model and update the phone record.
+ *
+ * @param widget the combo box
+ * @param user_data builder (unused)
+ */
+void
+gnunet_conversation_gtk_ego_label_comboboxtext_changed_cb (GtkComboBox *widget,
+ gpointer user_data)
+{
+ update_phone_record ();
+}
+
+
+/**
* @brief outgoing ego selector changed, (re)start the phone.
*
* @param widget the combo box that changed
@@ -1537,22 +1692,18 @@
gnunet_conversation_gtk_ego_combobox_changed_cb (GtkComboBox *widget,
gpointer user_data)
{
- struct GNUNET_GNSRECORD_Data rd;
struct GNUNET_IDENTITY_Ego *caller_id;
if (NULL != phone)
{
+ GSC_remove_phone ();
GNUNET_CONVERSATION_phone_destroy (phone);
phone = NULL;
}
caller_id = GCG_EGOS_get_selected_ego ();
if (NULL == caller_id)
{
- GCG_update_status_bar ("%s",
- _("No ego selected, phone is now down."));
- GCG_log ("%s\n",
- _("No ego selected, phone is now down."));
- GCG_set_status_icon ("gnunet-conversation-gtk-tray-pending");
+ do_status ();
check_call_sensitivity ();
return;
}
@@ -1563,19 +1714,11 @@
NULL);
if (NULL == phone)
{
- GCG_update_status_bar ("%s",
- _("Failed to setup phone (internal error)"));
- GCG_log ("%s",
- _("Failed to setup phone (internal error)\n"));
- GCG_set_status_icon ("gnunet-conversation-offline");
check_call_sensitivity ();
+ do_status ();
return;
}
- GNUNET_CONVERSATION_phone_get_record (phone,
- &rd);
- /* FIXME: publish record to GNS! */
- GCG_log ("%s\n",
- _("Phone active"));
+ update_phone_record ();
check_call_sensitivity ();
do_status();
}
@@ -1607,6 +1750,8 @@
("gnunet_conversation_gtk_call_button"));
b_hangup = GTK_WIDGET (GCG_get_main_window_object
("gnunet_conversation_gtk_hangup_button"));
+ b_copy = GTK_WIDGET (GCG_get_main_window_object
+ ("gnunet_conversation_gtk_ego_copy_button"));
address_entry = GTK_ENTRY (GCG_get_main_window_object
("gnunet_conversation_gtk_address_entry"));
active_liststore =
@@ -1636,6 +1781,7 @@
}
if (NULL != phone)
{
+ GSC_remove_phone ();
GNUNET_CONVERSATION_phone_destroy (phone);
phone = NULL;
}
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_visibility.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_visibility.c
2014-06-02 12:18:18 UTC (rev 33467)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_visibility.c
2014-06-02 15:17:27 UTC (rev 33468)
@@ -94,4 +94,18 @@
}
+/**
+ * Address book view is toggled.
+ *
+ * @param dummy widget triggering the event
+ * @param data main window builder (unused)
+ */
+void
+gnunet_conversation_gtk_view_address_book_checkmenuitem_toggled_cb (GtkWidget
*dummy,
+ gpointer data)
+{
+ toggle_view ("gnunet_conversation_gtk_contact_list_frame",
+ "gnunet_conversation_gtk_view_address_book_checkmenuitem");
+}
+
/* end of gnunet-conversation-gtk_visibility.c */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r33468 - in gnunet-gtk: contrib src/conversation,
gnunet <=