aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-fs-gtk.c')
-rw-r--r--src/fs/gnunet-fs-gtk.c63
1 files changed, 52 insertions, 11 deletions
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c
index ceaed0fc..e1261256 100644
--- a/src/fs/gnunet-fs-gtk.c
+++ b/src/fs/gnunet-fs-gtk.c
@@ -223,7 +223,6 @@ GNUNET_GTK_main_window_configure_event_cb (GtkWidget *main_window,
223 223
224/** 224/**
225 * Task run on shutdown. 225 * Task run on shutdown.
226 * FIXME-STYLE: does this need to be a separate task!?
227 * 226 *
228 * @param cls NULL 227 * @param cls NULL
229 * @param tc scheduler context, unused 228 * @param tc scheduler context, unused
@@ -553,10 +552,10 @@ service_status_change (void *cls,
553 * "namespace_label_liststore". 552 * "namespace_label_liststore".
554 * 553 *
555 * @param cls closure 554 * @param cls closure
556 * @param zone private key of the zone 555 * @param zone private key of the zone; NULL on disconnect
557 * @param label label of the records 556 * @param label label of the records; NULL on disconnect
558 * @param rd_count number of entries in @a rd array 557 * @param rd_count number of entries in @a rd array; 0 on removal
559 * @param rd array of records with data to store 558 * @param rd array of records for the label
560 */ 559 */
561static void 560static void
562monitor_zone_records (void *cls, 561monitor_zone_records (void *cls,
@@ -565,7 +564,49 @@ monitor_zone_records (void *cls,
565 unsigned int rd_count, 564 unsigned int rd_count,
566 const struct GNUNET_NAMESTORE_RecordData *rd) 565 const struct GNUNET_NAMESTORE_RecordData *rd)
567{ 566{
568 GNUNET_break (0); // not implemented 567 GtkListStore *ls;
568 GtkTreeModel *tm;
569 GtkTreeIter iter;
570 gchar *id;
571 gchar *label_gnu;
572
573 ls = GTK_LIST_STORE (GNUNET_FS_GTK_get_main_window_object (""));
574 if (NULL == zone)
575 {
576 gtk_list_store_clear (ls);
577 return;
578 }
579 label_gnu = g_strdup_printf ("%s.%s",
580 label,
581 "gnu");
582 if (0 == rd_count)
583 {
584 tm = GTK_TREE_MODEL (ls);
585 if (gtk_tree_model_get_iter_first (tm, &iter))
586 do
587 {
588 gtk_tree_model_get (tm, &iter,
589 0, &id,
590 -1);
591 if (0 == strcmp (id, label_gnu))
592 {
593 GNUNET_assert (gtk_list_store_remove (ls, &iter));
594 g_free (id);
595 g_free (label_gnu);
596 return;
597 }
598 g_free (id);
599 }
600 while (gtk_tree_model_iter_next (tm, &iter));
601 GNUNET_break (0);
602 return;
603 }
604 gtk_list_store_insert_with_values (ls,
605 &iter,
606 -1,
607 0, label_gnu,
608 -1);
609 g_free (label_gnu);
569} 610}
570 611
571 612
@@ -590,11 +631,11 @@ handle_sks_zone_identity (void *cls,
590 main_context.id_op = NULL; 631 main_context.id_op = NULL;
591 632
592 if (NULL == ego) 633 if (NULL == ego)
593 { 634 {
594 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 635 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
595 _("No default ego specified for `fs-sks` service, will not enable namespace search.\n")); 636 _("No default ego specified for `fs-sks` service, will not enable namespace search.\n"));
596 return; 637 return;
597 } 638 }
598 main_context.sks_zone = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey); 639 main_context.sks_zone = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
599 *main_context.sks_zone = *GNUNET_IDENTITY_ego_get_private_key (ego); 640 *main_context.sks_zone = *GNUNET_IDENTITY_ego_get_private_key (ego);
600 gtk_widget_show (GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_label"))); 641 gtk_widget_show (GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_label")));