diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-09 14:29:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-09 14:29:34 +0000 |
commit | 8595e122088dd3f3b02d0a1625a5cc403e770f96 (patch) | |
tree | 7c37e9c6362bed76fe994e82e1b3b1535d7b6486 /src/fs | |
parent | 766c8bc9f71de9549894beabbd61848f15c053d0 (diff) | |
download | gnunet-gtk-8595e122088dd3f3b02d0a1625a5cc403e770f96.tar.gz gnunet-gtk-8595e122088dd3f3b02d0a1625a5cc403e770f96.zip |
make namestore API less brittle/sublte to use
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-fs-gtk.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c index c00a764f..cbbc1984 100644 --- a/src/fs/gnunet-fs-gtk.c +++ b/src/fs/gnunet-fs-gtk.c | |||
@@ -562,6 +562,24 @@ service_status_change (void *cls, | |||
562 | } | 562 | } |
563 | 563 | ||
564 | 564 | ||
565 | static void | ||
566 | monitor_zone_error (void *cls) | ||
567 | { | ||
568 | GtkListStore *ls; | ||
569 | |||
570 | ls = GTK_LIST_STORE (GNUNET_FS_GTK_get_main_window_object ("namespace_label_liststore")); | ||
571 | gtk_list_store_clear (ls); | ||
572 | gtk_widget_hide (GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_combobox"))); | ||
573 | } | ||
574 | |||
575 | |||
576 | static void | ||
577 | monitor_zone_sync (void *cls) | ||
578 | { | ||
579 | gtk_widget_show (GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_combobox"))); | ||
580 | } | ||
581 | |||
582 | |||
565 | /** | 583 | /** |
566 | * Process a record that was stored in the namestore in the | 584 | * Process a record that was stored in the namestore in the |
567 | * "sks_zone". Adds (or removes) the respective label to the | 585 | * "sks_zone". Adds (or removes) the respective label to the |
@@ -588,11 +606,6 @@ monitor_zone_records (void *cls, | |||
588 | gchar *label_gnu; | 606 | gchar *label_gnu; |
589 | 607 | ||
590 | ls = GTK_LIST_STORE (GNUNET_FS_GTK_get_main_window_object ("namespace_label_liststore")); | 608 | ls = GTK_LIST_STORE (GNUNET_FS_GTK_get_main_window_object ("namespace_label_liststore")); |
591 | if (NULL == zone) | ||
592 | { | ||
593 | gtk_list_store_clear (ls); | ||
594 | return; | ||
595 | } | ||
596 | label_gnu = g_strdup_printf ("%s.%s", | 609 | label_gnu = g_strdup_printf ("%s.%s", |
597 | label, | 610 | label, |
598 | "gnu"); | 611 | "gnu"); |
@@ -660,8 +673,11 @@ handle_sks_zone_identity (void *cls, | |||
660 | main_context.zm = GNUNET_NAMESTORE_zone_monitor_start (main_context.cfg, | 673 | main_context.zm = GNUNET_NAMESTORE_zone_monitor_start (main_context.cfg, |
661 | main_context.sks_zone, | 674 | main_context.sks_zone, |
662 | GNUNET_YES, | 675 | GNUNET_YES, |
676 | &monitor_zone_error, | ||
677 | NULL, | ||
663 | &monitor_zone_records, | 678 | &monitor_zone_records, |
664 | NULL, | 679 | NULL, |
680 | &monitor_zone_sync, | ||
665 | NULL); | 681 | NULL); |
666 | } | 682 | } |
667 | 683 | ||