aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryids <yids@140774ce-b5e7-0310-ab8b-a85725594a96>2014-02-10 21:52:14 +0000
committeryids <yids@140774ce-b5e7-0310-ab8b-a85725594a96>2014-02-10 21:52:14 +0000
commitd1cdd51eeae111820a0ddbad3e21020992f93936 (patch)
treefe5de24ed43fc72de685c614b112ab6bf8f06183
parent02ed77f5d3cdcaadd57d43149a6c56b12ab96768 (diff)
downloadgnunet-gtk-d1cdd51eeae111820a0ddbad3e21020992f93936.tar.gz
gnunet-gtk-d1cdd51eeae111820a0ddbad3e21020992f93936.zip
- some work on the contacts selection feature
- some namechanges of vars and objects
-rw-r--r--contrib/gnunet_conversation_gtk_main_window.glade14
-rw-r--r--src/conversation/gnunet-conversation-gtk.c71
-rw-r--r--src/conversation/gnunet-conversation-gtk.h9
3 files changed, 47 insertions, 47 deletions
diff --git a/contrib/gnunet_conversation_gtk_main_window.glade b/contrib/gnunet_conversation_gtk_main_window.glade
index d0ae9050..d36b755b 100644
--- a/contrib/gnunet_conversation_gtk_main_window.glade
+++ b/contrib/gnunet_conversation_gtk_main_window.glade
@@ -588,7 +588,7 @@
588 <property name="can_focus">False</property> 588 <property name="can_focus">False</property>
589 <property name="model">gnunet_conversation_gtk_contacts_zone_liststore</property> 589 <property name="model">gnunet_conversation_gtk_contacts_zone_liststore</property>
590 <property name="tearoff_title">Phonebook:</property> 590 <property name="tearoff_title">Phonebook:</property>
591 <signal name="changed" handler="gnunet_conversation_gtk_zone_combobox_changed_cb" swapped="no"/> 591 <signal name="changed" handler="gnunet_conversation_gtk_contacts_zone_combobox_changed_cb" swapped="no"/>
592 <child> 592 <child>
593 <object class="GtkCellRendererText" id="gnunet_conversation_gtk_contacts_zone_ego_name_cellrenderertext"/> 593 <object class="GtkCellRendererText" id="gnunet_conversation_gtk_contacts_zone_ego_name_cellrenderertext"/>
594 <attributes> 594 <attributes>
@@ -809,6 +809,12 @@
809 </row> 809 </row>
810 </data> 810 </data>
811 </object> 811 </object>
812 <object class="GtkTreeStore" id="gnunet_conversation_gtk_contacts_zone_treestore">
813 <columns>
814 <!-- column-name zone -->
815 <column type="gchararray"/>
816 </columns>
817 </object>
812 <object class="GtkListStore" id="gnunet_conversation_gtk_history_liststore"> 818 <object class="GtkListStore" id="gnunet_conversation_gtk_history_liststore">
813 <columns> 819 <columns>
814 <!-- column-name logTime --> 820 <!-- column-name logTime -->
@@ -833,10 +839,4 @@
833 </row> 839 </row>
834 </data> 840 </data>
835 </object> 841 </object>
836 <object class="GtkTreeStore" id="gnunet_conversation_gtk_zone_treestore">
837 <columns>
838 <!-- column-name zone -->
839 <column type="gchararray"/>
840 </columns>
841 </object>
842</interface> 842</interface>
diff --git a/src/conversation/gnunet-conversation-gtk.c b/src/conversation/gnunet-conversation-gtk.c
index fd19f33d..4dbc8ba0 100644
--- a/src/conversation/gnunet-conversation-gtk.c
+++ b/src/conversation/gnunet-conversation-gtk.c
@@ -481,7 +481,7 @@ do_call (const char *arg)
481 call_state = CS_RESOLVING; 481 call_state = CS_RESOLVING;
482 GNUNET_assert (NULL == call); 482 GNUNET_assert (NULL == call);
483 call = 483 call =
484 GNUNET_CONVERSATION_call_start (cfg, caller_id, arg, speaker, mic, 484 GNUNET_CONVERSATION_call_start (cfg, caller_id, arg, speaker, mic,
485 &call_event_handler, NULL); 485 &call_event_handler, NULL);
486 UPDATE_STATUS (_("We are calling `%s', his phone should be ringing."), 486 UPDATE_STATUS (_("We are calling `%s', his phone should be ringing."),
487 peer_name); 487 peer_name);
@@ -841,7 +841,7 @@ display_record (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
841 const char *ets; 841 const char *ets;
842 struct GNUNET_TIME_Absolute at; 842 struct GNUNET_TIME_Absolute at;
843 struct GNUNET_TIME_Relative rt; 843 struct GNUNET_TIME_Relative rt;
844 GtkTreeIter iter; 844 GtkTreeIter display_iter;
845 845
846 if (NULL == rname) 846 if (NULL == rname)
847 { 847 {
@@ -893,8 +893,8 @@ display_record (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
893// FPRINTF (stdout, "%s", rname); 893// FPRINTF (stdout, "%s", rname);
894 if (rd[i].record_type == 65536 || rd[i].record_type == 65542) 894 if (rd[i].record_type == 65536 || rd[i].record_type == 65542)
895 { 895 {
896 gtk_list_store_append (contacts_liststore, &iter); 896 gtk_list_store_append (contacts_liststore, &display_iter);
897 gtk_list_store_set (contacts_liststore, &iter, 1, type, 0, rname, -1); 897 gtk_list_store_set (contacts_liststore, &display_iter, 1, type, 0, rname, -1);
898 } 898 }
899 899
900/* FPRINTF (stdout, 900/* FPRINTF (stdout,
@@ -983,7 +983,8 @@ identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
983{ 983{
984 struct GNUNET_CRYPTO_EcdsaPublicKey pk; 984 struct GNUNET_CRYPTO_EcdsaPublicKey pk;
985 char *s; 985 char *s;
986 986// GtkTreeIter iter;
987
987 if (NULL != ego) 988 if (NULL != ego)
988 { 989 {
989 GNUNET_IDENTITY_ego_get_public_key (ego, &pk); 990 GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
@@ -992,9 +993,11 @@ identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
992 gtk_list_store_insert_with_values (zone_liststore, 993 gtk_list_store_insert_with_values (zone_liststore,
993 &iter, -1, 994 &iter, -1,
994 0, name, 995 0, name,
996 1, ego,
995 -1); 997 -1);
996 } 998 }
997 999
1000
998 if (NULL == name) 1001 if (NULL == name)
999 return; 1002 return;
1000 if (ego == caller_id) 1003 if (ego == caller_id)
@@ -1168,10 +1171,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1168 ("gnunet_conversation_gtk_contacts_liststore")); 1171 ("gnunet_conversation_gtk_contacts_liststore"));
1169 contacts_treeview = 1172 contacts_treeview =
1170 GTK_TREE_VIEW (get_object ("gnunet_conversation_gtk_treeview")); 1173 GTK_TREE_VIEW (get_object ("gnunet_conversation_gtk_treeview"));
1171 contacts_treestore = 1174 contacts_treemodel = GTK_TREE_MODEL (contacts_liststore);
1172 GTK_TREE_STORE (get_object
1173 ("gnunet_conversation_gtk_contacts_treestore"));
1174 contacts_treemodel = GTK_TREE_MODEL (contacts_treestore);
1175 1175
1176 // call history 1176 // call history
1177 history_liststore = 1177 history_liststore =
@@ -1184,11 +1184,11 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1184 1184
1185 // zone list 1185 // zone list
1186 zone_liststore = 1186 zone_liststore =
1187 GTK_LIST_STORE (get_object ("gnunet_conversation_gtk_zone_liststore")); 1187 GTK_LIST_STORE (get_object ("gnunet_conversation_gtk_contacts_zone_liststore"));
1188 zone_treeview = 1188 //zone_treeview =
1189 GTK_TREE_VIEW (get_object ("gnunet_conversation_gtk_zone_treeview")); 1189 // GTK_TREE_VIEW (get_object ("gnunet_conversation_gtk_zone_treeview"));
1190 zone_treestore = 1190 zone_treestore =
1191 GTK_TREE_STORE (get_object ("gnunet_conversation_gtk_zone_treestore")); 1191 GTK_TREE_STORE (get_object ("gnunet_conversation_gtk_contacts_zone_treestore"));
1192 zone_treemodel = GTK_TREE_MODEL (zone_treestore); 1192 zone_treemodel = GTK_TREE_MODEL (zone_treestore);
1193 1193
1194 //gtk_tree_view_set_activate_on_single_click(contacts_treeview, TRUE); 1194 //gtk_tree_view_set_activate_on_single_click(contacts_treeview, TRUE);
@@ -1697,8 +1697,8 @@ GNUNET_contact_test ()
1697// GNUNET_IDENTITY_disconnect (id); 1697// GNUNET_IDENTITY_disconnect (id);
1698// &print_ego; 1698// &print_ego;
1699 //sh = GNUNET_IDENTITY_connect (cfg, &print_ego, NULL); 1699 //sh = GNUNET_IDENTITY_connect (cfg, &print_ego, NULL);
1700 1700// GNUNET_NAMESTORE_zone_iterator_next(list_it);
1701} 1701}
1702 1702
1703/** 1703/**
1704 * A different zone was selected in the zone toggle bar. Load the 1704 * A different zone was selected in the zone toggle bar. Load the
@@ -1708,27 +1708,32 @@ GNUNET_contact_test ()
1708 * @param user_data builder, unused 1708 * @param user_data builder, unused
1709 */ 1709 */
1710void 1710void
1711gnunet_conversation_gtk_zone_combobox_changed_cb (GtkComboBox *widget, 1711gnunet_conversation_gtk_contacts_zone_combobox_changed_cb (GtkComboBox *widget,
1712 gpointer user_data) 1712 gpointer user_data)
1713{ 1713{
1714 GtkTreeIter iter; 1714 GtkTreeIter contacts_zone_iter;
1715 struct GNUNET_IDENTITY_Ego *ego; 1715 struct GNUNET_IDENTITY_Ego *tempEgo;
1716 // char *name; 1716 char *tempName;
1717 1717 struct GNUNET_CRYPTO_EcdsaPrivateKey temp_zone_pkey;
1718// if (! gtk_combo_box_get_active_iter (widget, 1718
1719// &iter)) 1719
1720// { 1720 gtk_combo_box_get_active_iter(widget, &contacts_zone_iter);
1721// load_zone (NULL, NULL); 1721
1722// return; 1722 gtk_tree_model_get (GTK_TREE_MODEL (zone_liststore),
1723// } 1723 &contacts_zone_iter,
1724 gtk_tree_model_get (zone_liststore, 1724 0, &tempName,
1725 &iter, 1725 1, &tempEgo,
1726 0, name,
1727 -1); 1726 -1);
1728 GNUNET_IDENTITY_disconnect (id); 1727 FPRINTF(stderr,"blat: %s\n", tempName);
1729// ego_name = name; 1728 temp_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (tempEgo);
1730 id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL); 1729 gtk_list_store_clear(contacts_liststore);
1731// load_zone (name, ego); 1730
1731 list_it =
1732 GNUNET_NAMESTORE_zone_iteration_start (ns, &temp_zone_pkey, &display_record,
1733 NULL);
1734
1735// GNUNET_IDENTITY_disconnect (id);
1736
1732} 1737}
1733 1738
1734 1739
diff --git a/src/conversation/gnunet-conversation-gtk.h b/src/conversation/gnunet-conversation-gtk.h
index 665d4614..e3dadd3f 100644
--- a/src/conversation/gnunet-conversation-gtk.h
+++ b/src/conversation/gnunet-conversation-gtk.h
@@ -296,13 +296,6 @@ static void
296identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, 296identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
297 const char *name); 297 const char *name);
298 298
299
300enum CONVERSATION_ModelColumns
301{
302 // gchar array
303 CONVERSATION_CONTACT_NAME = 0
304};
305
306/** 299/**
307 * List of active calls 300 * List of active calls
308 */ 301 */
@@ -517,4 +510,6 @@ struct GNUNET_GTK_NAMESTORE_PluginEnvironment
517 510
518 511
519 512
513
514
520#endif 515#endif