aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/gnunet-conversation-gtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation/gnunet-conversation-gtk.c')
-rw-r--r--src/conversation/gnunet-conversation-gtk.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/conversation/gnunet-conversation-gtk.c b/src/conversation/gnunet-conversation-gtk.c
index 8a036cae..c20a97b2 100644
--- a/src/conversation/gnunet-conversation-gtk.c
+++ b/src/conversation/gnunet-conversation-gtk.c
@@ -893,6 +893,40 @@ add_continuation (void *cls, int32_t success, const char *emsg)
893 //test_finished (); 893 //test_finished ();
894} 894}
895 895
896/**
897 * Continuation called to notify client about result of the
898 * operation.
899 *
900 * @param cls closure, unused
901 * @param success #GNUNET_SYSERR on failure (including timeout/queue drop/failure to validate)
902 * #GNUNET_NO if content was already there
903 * #GNUNET_YES (or other positive value) on success
904 * @param emsg NULL on success, otherwise an error message
905 */
906static void
907del_continuation (void *cls,
908 int32_t success,
909 const char *emsg)
910{
911 del_qe = NULL;
912 if (GNUNET_NO == success)
913 {
914 fprintf (stderr,
915 _("Deleting record failed, record does not exist%s%s\n"),
916 (NULL != emsg) ? ": " : "",
917 (NULL != emsg) ? emsg : "");
918 }
919 if (GNUNET_SYSERR == success)
920 {
921 fprintf (stderr,
922 _("Deleting record failed%s%s\n"),
923 (NULL != emsg) ? ": " : "",
924 (NULL != emsg) ? emsg : "");
925 }
926 // test_finished ();
927}
928
929
896/** 930/**
897 * Function called by identity service with information about egos. 931 * Function called by identity service with information about egos.
898 * 932 *
@@ -1484,6 +1518,28 @@ GNUNET_CONVERSATION_GTK_on_remove_clicked (GtkButton * button,
1484 gpointer * user_data) 1518 gpointer * user_data)
1485{ 1519{
1486 FPRINTF (stderr, "remove clicked \n"); 1520 FPRINTF (stderr, "remove clicked \n");
1521 GtkTreeSelection *selection;
1522 GtkTreeModel *model;
1523 GtkTreeIter iter;
1524
1525 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(contacts_treeview));
1526 if (gtk_tree_selection_get_selected(selection, &model, &iter))
1527 {
1528 gtk_tree_model_get (model, &iter, 0, &name, -1);
1529
1530 }
1531 else
1532 {
1533 g_print ("no row selected.\n");
1534 }
1535 zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (caller_id);
1536 del_qe = GNUNET_NAMESTORE_records_store (ns,
1537 &zone_pkey,
1538 name,
1539 0, NULL,
1540 &del_continuation,
1541 NULL);
1542 gtk_list_store_remove(contacts_liststore, &iter);
1487} 1543}
1488 1544
1489 1545