gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r32282 - in gnunet-gtk: contrib src/conversation


From: gnunet
Subject: [GNUnet-SVN] r32282 - in gnunet-gtk: contrib src/conversation
Date: Mon, 10 Feb 2014 22:52:15 +0100

Author: yids
Date: 2014-02-10 22:52:14 +0100 (Mon, 10 Feb 2014)
New Revision: 32282

Modified:
   gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade
   gnunet-gtk/src/conversation/gnunet-conversation-gtk.c
   gnunet-gtk/src/conversation/gnunet-conversation-gtk.h
Log:
- some work on the contacts selection feature
- some namechanges of vars and objects



Modified: gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade        
2014-02-10 20:56:44 UTC (rev 32281)
+++ gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade        
2014-02-10 21:52:14 UTC (rev 32282)
@@ -588,7 +588,7 @@
                             <property name="can_focus">False</property>
                             <property 
name="model">gnunet_conversation_gtk_contacts_zone_liststore</property>
                             <property 
name="tearoff_title">Phonebook:</property>
-                            <signal name="changed" 
handler="gnunet_conversation_gtk_zone_combobox_changed_cb" swapped="no"/>
+                            <signal name="changed" 
handler="gnunet_conversation_gtk_contacts_zone_combobox_changed_cb" 
swapped="no"/>
                             <child>
                               <object class="GtkCellRendererText" 
id="gnunet_conversation_gtk_contacts_zone_ego_name_cellrenderertext"/>
                               <attributes>
@@ -809,6 +809,12 @@
       </row>
     </data>
   </object>
+  <object class="GtkTreeStore" 
id="gnunet_conversation_gtk_contacts_zone_treestore">
+    <columns>
+      <!-- column-name zone -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkListStore" id="gnunet_conversation_gtk_history_liststore">
     <columns>
       <!-- column-name logTime -->
@@ -833,10 +839,4 @@
       </row>
     </data>
   </object>
-  <object class="GtkTreeStore" id="gnunet_conversation_gtk_zone_treestore">
-    <columns>
-      <!-- column-name zone -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
 </interface>

Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk.c       2014-02-10 
20:56:44 UTC (rev 32281)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk.c       2014-02-10 
21:52:14 UTC (rev 32282)
@@ -481,7 +481,7 @@
   call_state = CS_RESOLVING;
   GNUNET_assert (NULL == call);
   call =
-      GNUNET_CONVERSATION_call_start (cfg, caller_id, arg, speaker, mic,
+     GNUNET_CONVERSATION_call_start (cfg, caller_id, arg, speaker, mic,
                                       &call_event_handler, NULL);
   UPDATE_STATUS (_("We are calling `%s', his phone should be ringing."),
                  peer_name);
@@ -841,7 +841,7 @@
   const char *ets;
   struct GNUNET_TIME_Absolute at;
   struct GNUNET_TIME_Relative rt;
-  GtkTreeIter iter;
+  GtkTreeIter display_iter;
 
   if (NULL == rname)
   {
@@ -893,8 +893,8 @@
 //    FPRINTF (stdout, "%s", rname);
     if (rd[i].record_type == 65536 || rd[i].record_type == 65542)
     {
-      gtk_list_store_append (contacts_liststore, &iter);
-      gtk_list_store_set (contacts_liststore, &iter, 1, type, 0, rname, -1);
+      gtk_list_store_append (contacts_liststore, &display_iter);
+      gtk_list_store_set (contacts_liststore, &display_iter, 1, type, 0, 
rname, -1);
     }
 
 /*        FPRINTF (stdout,
@@ -983,7 +983,8 @@
 {
   struct GNUNET_CRYPTO_EcdsaPublicKey pk;
   char *s;
-
+//  GtkTreeIter iter;
+  
   if (NULL != ego) 
   { 
   GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
@@ -992,9 +993,11 @@
   gtk_list_store_insert_with_values (zone_liststore,
                                        &iter, -1,
                                        0, name,
+                                      1, ego,
                                        -1); 
   }
 
+
   if (NULL == name)
     return;
   if (ego == caller_id)
@@ -1168,10 +1171,7 @@
                       ("gnunet_conversation_gtk_contacts_liststore"));
   contacts_treeview =
       GTK_TREE_VIEW (get_object ("gnunet_conversation_gtk_treeview"));
-  contacts_treestore =
-      GTK_TREE_STORE (get_object
-                      ("gnunet_conversation_gtk_contacts_treestore"));
-  contacts_treemodel = GTK_TREE_MODEL (contacts_treestore);
+  contacts_treemodel = GTK_TREE_MODEL (contacts_liststore);
 
   // call history
   history_liststore =
@@ -1184,11 +1184,11 @@
 
   // zone list
   zone_liststore =
-     GTK_LIST_STORE (get_object ("gnunet_conversation_gtk_zone_liststore"));
-  zone_treeview =
-      GTK_TREE_VIEW (get_object ("gnunet_conversation_gtk_zone_treeview"));
+     GTK_LIST_STORE (get_object 
("gnunet_conversation_gtk_contacts_zone_liststore"));
+  //zone_treeview =
+  //    GTK_TREE_VIEW (get_object ("gnunet_conversation_gtk_zone_treeview"));
   zone_treestore =
-      GTK_TREE_STORE (get_object ("gnunet_conversation_gtk_zone_treestore"));
+      GTK_TREE_STORE (get_object 
("gnunet_conversation_gtk_contacts_zone_treestore"));
   zone_treemodel = GTK_TREE_MODEL (zone_treestore);
 
   //gtk_tree_view_set_activate_on_single_click(contacts_treeview, TRUE);
@@ -1697,9 +1697,9 @@
 //  GNUNET_IDENTITY_disconnect (id);
 //  &print_ego;
   //sh = GNUNET_IDENTITY_connect (cfg, &print_ego, NULL); 
+//  GNUNET_NAMESTORE_zone_iterator_next(list_it);
+} 
 
-}
-
 /**
  * A different zone was selected in the zone toggle bar.  Load the
  * appropriate zone.
@@ -1708,27 +1708,32 @@
  * @param user_data builder, unused
  */
 void
-gnunet_conversation_gtk_zone_combobox_changed_cb (GtkComboBox *widget,
+gnunet_conversation_gtk_contacts_zone_combobox_changed_cb (GtkComboBox *widget,
                                                gpointer user_data)
 {
-  GtkTreeIter iter;
-  struct GNUNET_IDENTITY_Ego *ego;
- // char *name;
+  GtkTreeIter contacts_zone_iter;
+  struct GNUNET_IDENTITY_Ego *tempEgo;
+  char *tempName;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey temp_zone_pkey;
 
-//  if (! gtk_combo_box_get_active_iter (widget,
-//                                       &iter))
-//  {
-//    load_zone (NULL, NULL);
-//    return;
-//  }
-  gtk_tree_model_get (zone_liststore,
-                      &iter,
-                      0, name,
+
+  gtk_combo_box_get_active_iter(widget, &contacts_zone_iter);   
+
+  gtk_tree_model_get (GTK_TREE_MODEL (zone_liststore),
+                      &contacts_zone_iter,
+                      0, &tempName,
+                      1, &tempEgo,
                       -1);
-  GNUNET_IDENTITY_disconnect (id);
-//  ego_name = name;
-  id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL);
-//  load_zone (name, ego);
+  FPRINTF(stderr,"blat: %s\n", tempName);
+  temp_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (tempEgo);
+  gtk_list_store_clear(contacts_liststore);
+
+  list_it =
+    GNUNET_NAMESTORE_zone_iteration_start (ns, &temp_zone_pkey, 
&display_record,
+                                           NULL);
+  
+//  GNUNET_IDENTITY_disconnect (id);
+
 }
 
 

Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk.h
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk.h       2014-02-10 
20:56:44 UTC (rev 32281)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk.h       2014-02-10 
21:52:14 UTC (rev 32282)
@@ -296,13 +296,6 @@
 identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
              const char *name);
 
-
-enum CONVERSATION_ModelColumns
-{
-  // gchar array 
-  CONVERSATION_CONTACT_NAME = 0
-};
-
 /**
  * List of active calls
  */
@@ -517,4 +510,6 @@
 
 
 
+
+
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]