gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r32047 - gnunet-gtk/src/conversation


From: gnunet
Subject: [GNUnet-SVN] r32047 - gnunet-gtk/src/conversation
Date: Mon, 27 Jan 2014 20:34:31 +0100

Author: yids
Date: 2014-01-27 20:34:31 +0100 (Mon, 27 Jan 2014)
New Revision: 32047

Modified:
   gnunet-gtk/src/conversation/gnunet-conversation-gtk.c
Log:
Add contact is working now


Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk.c       2014-01-27 
16:41:08 UTC (rev 32046)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk.c       2014-01-27 
19:34:31 UTC (rev 32047)
@@ -338,6 +338,8 @@
 {
   struct GNUNET_GNSRECORD_Data rd;
 
+  LOG ("start_phone\n");
+
   if (NULL == caller_id)
   {
     LOG (_("Ego `%s' no longer available, phone is now down.\n"), ego_name);
@@ -470,6 +472,7 @@
 static void
 do_accept (const char *args)
 {
+  FPRINTF (stderr, "do_accept run");
   struct CallList *cl;
   char buf[32];
 
@@ -715,6 +718,7 @@
 static void
 do_reject (const char *args)
 {
+  FPRINTF (stderr, "doing reject");
   struct CallList *cl;
   char buf[32];
 
@@ -803,6 +807,9 @@
     GNUNET_NAMESTORE_zone_iterator_next (list_it);
     return;
   }
+  //FPRINTF (stdout,
+//         "%s:\n",
+//         rname);
   for (i = 0; i < rd_len; i++)
   {
 
@@ -1012,7 +1019,7 @@
   }
   if (NULL != ns)
   {
-    GNUNET_NAMESTORE_disconnect (ns);
+    GNUNET_IDENTITY_disconnect (ns);
     ns = NULL;
   }
 
@@ -1108,13 +1115,15 @@
   speaker = GNUNET_SPEAKER_create_from_hardware (cfg);
   mic = GNUNET_MICROPHONE_create_from_hardware (cfg);
 
-  if (ego_name == NULL)
+//  ego_name = "phone_ego"; 
+  if (NULL == ego_name)
   {
-    ego_name = "phone-ego"; 
-
-    LOG (_("No ego given, using default: %s "), ego_name);
+    ego_name = "phone-ego";
+    LOG ("%s", _("No ego given, using default \"phone-ego\" \n"));
+    return;
   }
 
+
   id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL);
 
 //  zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id);
@@ -1140,15 +1149,12 @@
     {'e', "ego", "ego",
      gettext_noop ("select ego to use"), 1,
      &GNUNET_GETOPT_set_string, &ego_name},
+
     {'t', "tray", NULL,
      gettext_noop ("start in tray mode"), 0,
      &GNUNET_GETOPT_set_one, &tray_only},
     GNUNET_GETOPT_OPTION_END
   };
-
-
-
-
   if (GNUNET_OK !=
       GNUNET_GTK_main_loop_start ("gnunet-conversation-gtk",
                                   "GTK GUI for conversation", argc, argv,
@@ -1157,6 +1163,7 @@
                                   &run))
     return 1;
   return 0;
+  FPRINTF (stderr, "line %i", line);
 }
 
 /* gui stuff start */
@@ -1235,6 +1242,8 @@
   address_entry = GTK_ENTRY (get_object ("GNUNET_GTK_conversation_address"));
   to_addr = gtk_entry_get_text (address_entry);
 
+//    FPRINTF (stderr, _("calling: %s \n"), to_addr ); 
+
   do_call (to_addr);
   disable_button ("GNUNET_GTK_conversation_accept_button");
   do_status ("");
@@ -1251,6 +1260,7 @@
   enable_button ("GNUNET_GTK_conversation_call_button");
 
 
+  //FPRINTF (stderr, "hangup clicked \n");
   do_reject ("");
   do_status ("");
 }
@@ -1261,6 +1271,7 @@
 void
 GNUNET_CONVERSATION_GTK_on_accept_clicked ()
 {
+  FPRINTF (stderr, "accept clicked \n");
   do_accept (0);
  // hide_infobar ();
 }
@@ -1282,7 +1293,14 @@
 void
 GNUNET_CONVERSATION_GTK_on_pause_clicked ()
 {
+//    GtkEntry *entry; 
 do_suspend("0");
+  //FPRINTF (stderr, "pause clicked \n");
+  //do_pause("");
+  //  entry = GTK_ENTRY((get_object ("GNUNET_GTK_conversation_address")));
+  //FPRINTF (stderr, gtk_entry_get_text (entry));
+//    gtk_entry_set_text (entry, "testtextje");
+//  show_infobar ();
 }
 
 /**
@@ -1291,6 +1309,7 @@
 void
 GNUNET_CONVERSATION_GTK_on_resume_clicked ()
 {
+  //FPRINTF (stderr, "reject clicked \n");
   do_resume ("");
 }
 
@@ -1300,11 +1319,39 @@
 void
 GNUNET_CONVERSATION_GTK_on_status_clicked ()
 {
+
+  FPRINTF (stderr, "status clicked \n");
+
+//    do_accept("0"); 
   do_status (" ");
+  //quick_message('hee blaaat you have a call from blaat');
 }
 
+/*
+void
+GNUNET_contact_test ()
+{
+FPRINTF (stderr, "gnunet contact test"
+}
+*/
 
+void
+use_current_incoming_address ()
+{
+  FPRINTF (stderr, "use cur addr");
+}
+
+
 /*
+void
+test_function (gint response_id)
+{
+  FPRINTF (stderr, "teest %u", response_id);
+}
+*/
+
+
+/*
  * add a new contact
  * @param name
  * @param address
@@ -1314,18 +1361,31 @@
 //      memmove(&address+1,&address+51,1);
   GtkTreeIter iter;
   struct GNUNET_GNSRECORD_Data rd;
+  struct GNUNET_GNSRECORD_Data *rde;
+  static void *data; 
+  static size_t data_size;
+  struct GNUNET_CRYPTO_EcdsaPublicKey pkey;
 
+  GNUNET_CRYPTO_ecdsa_public_key_from_string (address, strlen (address), 
&pkey);
+  rde=&rd;
   zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id);
-  rd.data = address;
+  rd.data = &pkey;
   rd.data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
   rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
   rd.flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;  // always set to 
relative for testing purposes
+  rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE;
+  rde->expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
   FPRINTF (stderr, "adding\n");
   FPRINTF (stderr, "name: %s\n", name);
   FPRINTF (stderr, "address: %s\n", address);
   add_qe =
-      GNUNET_NAMESTORE_records_store (ns, &zone_pkey, name, 1, &rd, NULL,
-                                      add_qe);
+      GNUNET_NAMESTORE_records_store (ns, 
+                                     &zone_pkey, 
+                                     name, 
+                                     1, 
+                                     rde, 
+                                     &add_continuation,
+                                      &add_qe);
   gtk_list_store_append (contacts_liststore, &iter);
   gtk_list_store_set (contacts_liststore, &iter, 1, "PKEY", 0, name, -1);
 
@@ -1343,6 +1403,7 @@
 {
 //  gint response_id;
 
+  FPRINTF (stderr, "add clicked \n");
   //unused:  *anotherArea, *labelName, *labelAddres *caller_name
 
   GtkLabel *notification; 
@@ -1369,7 +1430,10 @@
                                    _("Cancel"), GTK_RESPONSE_CANCEL, NULL);
   gtk_dialog_add_action_widget (dialog, GTK_WIDGET(currentCheckButton), 
GTK_RESPONSE_OK);
 //  FPRINTF (stderr, "response id : %u", response_id);
-  
+//  g_signal_connect (GTK_BUTTON (currentCheckButton), "clicked",
+//                    G_CALLBACK (use_current_incoming_address), NULL);
+
+
   gtk_dialog_add_action_widget (dialog, GTK_WIDGET(nameEntry), 2);
   gtk_dialog_add_action_widget (dialog, GTK_WIDGET(addressEntry), 3);
 
@@ -1387,19 +1451,22 @@
   switch (gtk_dialog_run (dialog))
   {
   case GTK_RESPONSE_ACCEPT:
+    FPRINTF (stderr, "accept clicked");
     do_status ("");
     add_contact (gtk_entry_get_text (nameEntry),
                  gtk_entry_get_text (addressEntry));
     gtk_widget_destroy (GTK_WIDGET(dialog));
     break;
   case GTK_RESPONSE_CANCEL:
+    FPRINTF (stderr, "cancel clicked");
     do_status ("");
     gtk_widget_destroy (GTK_WIDGET(dialog));
     break;
   case GTK_RESPONSE_OK:
     //use_current_incoming_address();
     gtk_entry_set_text (GTK_ENTRY(addressEntry), callerName);
-    add_contact (gtk_entry_get_text (nameEntry), callerName);
+    add_contact (gtk_entry_get_text (nameEntry), 
+                callerName);
 //              
add_contact(gtk_entry_get_text(nameEntry),memmove(&callerName,&callerName+52,1));
     gtk_widget_destroy (GTK_WIDGET(dialog));
 
@@ -1410,16 +1477,11 @@
 
 }
 
-/**
- * clicked contact remove button
- */
 void
 GNUNET_CONVERSATION_GTK_on_remove_clicked (GtkButton * button,
                                            gpointer * user_data)
 {
-  // FIXME: make this work
-  FPRINTF (stderr, "TODO:remove clicked \n");
-
+  FPRINTF (stderr, "remove clicked \n");
 }
 
 
@@ -1434,6 +1496,7 @@
   gchar *callAddress;
   gchar *type;
 
+  FPRINTF (stderr, "row activated \n");
 
   GtkTreeSelection *selection;
 




reply via email to

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