gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r32051 - gnunet-gtk/src/conversation
Date: Mon, 27 Jan 2014 21:44:51 +0100

Author: yids
Date: 2014-01-27 21:44:50 +0100 (Mon, 27 Jan 2014)
New Revision: 32051

Modified:
   gnunet-gtk/src/conversation/gnunet-conversation-gtk.c
   gnunet-gtk/src/conversation/gnunet-conversation-gtk.h
Log:
Removing contacts works now


Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk.c       2014-01-27 
20:13:38 UTC (rev 32050)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk.c       2014-01-27 
20:44:50 UTC (rev 32051)
@@ -893,6 +893,40 @@
   //test_finished ();
 }
 
+/** 
+ * Continuation called to notify client about result of the
+ * operation.
+ *
+ * @param cls closure, unused
+ * @param success #GNUNET_SYSERR on failure (including timeout/queue 
drop/failure to validate)
+ *                #GNUNET_NO if content was already there
+ *                #GNUNET_YES (or other positive value) on success
+ * @param emsg NULL on success, otherwise an error message
+ */
+static void 
+del_continuation (void *cls,
+                  int32_t success,
+                  const char *emsg)
+{                                         
+  del_qe = NULL;                          
+  if (GNUNET_NO == success)               
+  {                                       
+    fprintf (stderr,                      
+             _("Deleting record failed, record does not exist%s%s\n"),
+             (NULL != emsg) ? ": " : "",
+             (NULL != emsg) ? emsg : "");
+  }
+  if (GNUNET_SYSERR == success)
+  {
+    fprintf (stderr,
+             _("Deleting record failed%s%s\n"),
+             (NULL != emsg) ? ": " : "",
+             (NULL != emsg) ? emsg : "");
+  }
+ // test_finished ();
+}
+
+
 /**
  * Function called by identity service with information about egos.
  *
@@ -1484,6 +1518,28 @@
                                            gpointer * user_data)
 {
   FPRINTF (stderr, "remove clicked \n");
+  GtkTreeSelection *selection;
+  GtkTreeModel     *model;
+  GtkTreeIter       iter;
+  
+  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(contacts_treeview));
+  if (gtk_tree_selection_get_selected(selection, &model, &iter))
+  {
+    gtk_tree_model_get (model, &iter, 0, &name, -1);
+
+  }
+  else
+  {
+    g_print ("no row selected.\n");
+  }
+  zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id);  
+  del_qe = GNUNET_NAMESTORE_records_store (ns,
+                                          &zone_pkey,
+                                          name,
+                                          0, NULL,
+                                          &del_continuation,
+                                          NULL);
+  gtk_list_store_remove(contacts_liststore, &iter);
 }
 
 

Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk.h
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk.h       2014-01-27 
20:13:38 UTC (rev 32050)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk.h       2014-01-27 
20:44:50 UTC (rev 32051)
@@ -356,6 +356,11 @@
 static struct GNUNET_NAMESTORE_QueueEntry *add_qe;
 
 /**
+ * Queue entry for the 'del' operation.
+ */
+static struct GNUNET_NAMESTORE_QueueEntry *del_qe;
+
+/**
  * Global return value
  */
 static int ret;




reply via email to

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