aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-07 21:28:16 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-07 21:28:16 +0000
commit0b3630b48775eeb6a236a59aea0de90758dc0369 (patch)
tree9658caa08279264a300e582e44cf436c53ae4c4d
parent5f7524e840f1744d4c57c8d1608b57d62e93397b (diff)
downloadgnunet-gtk-0b3630b48775eeb6a236a59aea0de90758dc0369.tar.gz
gnunet-gtk-0b3630b48775eeb6a236a59aea0de90758dc0369.zip
-fix build with new fs/namespace/ecc/identity APIs
-rw-r--r--contrib/Makefile.am4
-rw-r--r--contrib/gnunet_identity_gtk_create_ego_dialog.glade (renamed from contrib/gnunet_fs_gtk_create_namespace_dialog.glade)0
-rw-r--r--contrib/gnunet_identity_gtk_organize_ego_dialog.glade (renamed from contrib/gnunet_fs_gtk_namespace_organizer.glade)0
-rw-r--r--src/fs/Makefile.am4
-rw-r--r--src/fs/gnunet-fs-gtk.h2
-rw-r--r--src/fs/gnunet-fs-gtk_advertise-pseudonym.c29
-rw-r--r--src/fs/gnunet-fs-gtk_advertise-pseudonym.h16
-rw-r--r--src/fs/gnunet-fs-gtk_common.c25
-rw-r--r--src/fs/gnunet-fs-gtk_event-handler.c46
-rw-r--r--src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c30
-rw-r--r--src/fs/gnunet-fs-gtk_main-window-search.c4
-rw-r--r--src/fs/gnunet-fs-gtk_namespace_manager.c70
-rw-r--r--src/fs/gnunet-fs-gtk_publish-dialog.c86
-rw-r--r--src/identity/gnunet-identity-gtk_create_ego.c (renamed from src/fs/gnunet-fs-gtk_create-pseudonym.c)0
-rw-r--r--src/identity/gnunet-identity-gtk_ego_organizer.c (renamed from src/fs/gnunet-fs-gtk_namespace_organizer.c)0
-rw-r--r--src/identity/gnunet-identity-gtk_ego_organizer.h (renamed from src/fs/gnunet-fs-gtk_namespace_organizer.h)0
16 files changed, 192 insertions, 124 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 82907723..2d7f0be2 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -28,11 +28,9 @@ pkgdata_DATA = \
28 green.png \ 28 green.png \
29 searching_sources.gif \ 29 searching_sources.gif \
30 gnunet_fs_gtk_about_window.glade \ 30 gnunet_fs_gtk_about_window.glade \
31 gnunet_fs_gtk_create_namespace_dialog.glade \
32 gnunet_fs_gtk_download_as_dialog.glade \ 31 gnunet_fs_gtk_download_as_dialog.glade \
33 gnunet_fs_gtk_main_window.glade \ 32 gnunet_fs_gtk_main_window.glade \
34 gnunet_fs_gtk_namespace_manager.glade \ 33 gnunet_fs_gtk_namespace_manager.glade \
35 gnunet_fs_gtk_namespace_organizer.glade \
36 gnunet_fs_gtk_edit_publication.glade \ 34 gnunet_fs_gtk_edit_publication.glade \
37 gnunet_fs_gtk_open_directory_dialog.glade \ 35 gnunet_fs_gtk_open_directory_dialog.glade \
38 gnunet_fs_gtk_open_url_dialog.glade \ 36 gnunet_fs_gtk_open_url_dialog.glade \
@@ -45,6 +43,8 @@ pkgdata_DATA = \
45 gnunet_fs_gtk_unindex.glade \ 43 gnunet_fs_gtk_unindex.glade \
46 gnunet_fs_gtk_progress_dialog.glade \ 44 gnunet_fs_gtk_progress_dialog.glade \
47 gnunet_gtk_status_bar_menu.glade \ 45 gnunet_gtk_status_bar_menu.glade \
46 gnunet_identity_gtk_create_ego_dialog.glade \
47 gnunet_identity_gtk_organizer_ego_dialog.glade \
48 gnunet_peerinfo_gtk_about_window.glade \ 48 gnunet_peerinfo_gtk_about_window.glade \
49 gnunet_peerinfo_gtk_main_window.glade \ 49 gnunet_peerinfo_gtk_main_window.glade \
50 gnunet_statistics_gtk_about_window.glade \ 50 gnunet_statistics_gtk_about_window.glade \
diff --git a/contrib/gnunet_fs_gtk_create_namespace_dialog.glade b/contrib/gnunet_identity_gtk_create_ego_dialog.glade
index 812411c6..812411c6 100644
--- a/contrib/gnunet_fs_gtk_create_namespace_dialog.glade
+++ b/contrib/gnunet_identity_gtk_create_ego_dialog.glade
diff --git a/contrib/gnunet_fs_gtk_namespace_organizer.glade b/contrib/gnunet_identity_gtk_organize_ego_dialog.glade
index 0e4b112c..0e4b112c 100644
--- a/contrib/gnunet_fs_gtk_namespace_organizer.glade
+++ b/contrib/gnunet_identity_gtk_organize_ego_dialog.glade
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am
index cd4673b6..39c8d98e 100644
--- a/src/fs/Makefile.am
+++ b/src/fs/Makefile.am
@@ -17,7 +17,6 @@ gnunet_fs_gtk_SOURCES = \
17 gnunet-fs-gtk_advertise-pseudonym.h \ 17 gnunet-fs-gtk_advertise-pseudonym.h \
18 gnunet-fs-gtk_anonymity-widgets.c gnunet-fs-gtk_anonymity-widgets.h \ 18 gnunet-fs-gtk_anonymity-widgets.c gnunet-fs-gtk_anonymity-widgets.h \
19 gnunet-fs-gtk_common.c gnunet-fs-gtk_common.h \ 19 gnunet-fs-gtk_common.c gnunet-fs-gtk_common.h \
20 gnunet-fs-gtk_create-pseudonym.c \
21 gnunet-fs-gtk_download-save-as.c gnunet-fs-gtk_download-save-as.h \ 20 gnunet-fs-gtk_download-save-as.c gnunet-fs-gtk_download-save-as.h \
22 gnunet-fs-gtk_event-handler.c gnunet-fs-gtk_event-handler.h \ 21 gnunet-fs-gtk_event-handler.c gnunet-fs-gtk_event-handler.h \
23 gnunet-fs-gtk_main-window-connection.c \ 22 gnunet-fs-gtk_main-window-connection.c \
@@ -30,8 +29,6 @@ gnunet_fs_gtk_SOURCES = \
30 gnunet-fs-gtk_unindex.c gnunet-fs-gtk_unindex.h \ 29 gnunet-fs-gtk_unindex.c gnunet-fs-gtk_unindex.h \
31 gnunet-fs-gtk_publish-dialog.c \ 30 gnunet-fs-gtk_publish-dialog.c \
32 gnunet-fs-gtk_publish-edit-dialog.c gnunet-fs-gtk_publish-edit-dialog.h \ 31 gnunet-fs-gtk_publish-edit-dialog.c gnunet-fs-gtk_publish-edit-dialog.h \
33 gnunet-fs-gtk_namespace_organizer.c \
34 gnunet-fs-gtk_namespace_organizer.h \
35 gnunet-fs-gtk_namespace_manager.c \ 32 gnunet-fs-gtk_namespace_manager.c \
36 gnunet-fs-gtk_namespace_manager.h 33 gnunet-fs-gtk_namespace_manager.h
37 34
@@ -43,6 +40,7 @@ gnunet_fs_gtk_LDADD = \
43 -lgnunetutil \ 40 -lgnunetutil \
44 -lgnunetarm \ 41 -lgnunetarm \
45 -lgnunetfs \ 42 -lgnunetfs \
43 -lgnunetidentity \
46 $(INTLLIBS) 44 $(INTLLIBS)
47gnunet_fs_gtk_LDFLAGS = \ 45gnunet_fs_gtk_LDFLAGS = \
48 -export-dynamic 46 -export-dynamic
diff --git a/src/fs/gnunet-fs-gtk.h b/src/fs/gnunet-fs-gtk.h
index c19e07b8..abf1844e 100644
--- a/src/fs/gnunet-fs-gtk.h
+++ b/src/fs/gnunet-fs-gtk.h
@@ -55,7 +55,7 @@ struct GNUNET_GTK_MainWindowContext
55 55
56 GtkTreeRowReference *ns_selector_pushed_row; 56 GtkTreeRowReference *ns_selector_pushed_row;
57 GtkTreeRowReference *selected_ns_row; 57 GtkTreeRowReference *selected_ns_row;
58 struct GNUNET_FS_pseudonym_DiscoveryHandle *ns_discovery_handle; 58 struct GNUNET_FS_Pseudonym_DiscoveryHandle *ns_discovery_handle;
59 GtkWindow *ns_manager; 59 GtkWindow *ns_manager;
60 gulong ns_manager_delete_handler_id; 60 gulong ns_manager_delete_handler_id;
61 61
diff --git a/src/fs/gnunet-fs-gtk_advertise-pseudonym.c b/src/fs/gnunet-fs-gtk_advertise-pseudonym.c
index 811551b8..388aa22b 100644
--- a/src/fs/gnunet-fs-gtk_advertise-pseudonym.c
+++ b/src/fs/gnunet-fs-gtk_advertise-pseudonym.c
@@ -1,10 +1,10 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 (C) 2005, 2006, 2010, 2012 Christian Grothoff (and other contributing authors) 3 (C) 2005-2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
@@ -59,7 +59,7 @@ struct NamespaceAdvertisementContext
59 /** 59 /**
60 * Handle to the namespace to advertise. 60 * Handle to the namespace to advertise.
61 */ 61 */
62 struct GNUNET_FS_Namespace *ns; 62 struct GNUNET_CRYPTO_EccPrivateKey ns;
63 63
64 /** 64 /**
65 * Root of the namespace is stored here temporarily. 65 * Root of the namespace is stored here temporarily.
@@ -98,14 +98,14 @@ advertise_namespace (void *cls,
98{ 98{
99 struct NamespaceAdvertisementContext *nds = cls; 99 struct NamespaceAdvertisementContext *nds = cls;
100 struct GNUNET_FS_Uri *sks_uri; 100 struct GNUNET_FS_Uri *sks_uri;
101 char *emsg; 101 struct GNUNET_CRYPTO_EccPublicKey pub;
102 102
103 emsg = NULL; 103 GNUNET_CRYPTO_ecc_key_get_public (&nds->ns, &pub);
104 sks_uri = GNUNET_FS_uri_sks_create (nds->ns, nds->root, &emsg); 104 sks_uri = GNUNET_FS_uri_sks_create (&pub, nds->root);
105 GNUNET_assert (NULL == emsg);
106 GNUNET_FS_publish_ksk (GNUNET_FS_GTK_get_fs_handle (), 105 GNUNET_FS_publish_ksk (GNUNET_FS_GTK_get_fs_handle (),
107 *uri, meta, sks_uri, 106 *uri, meta, sks_uri,
108 bo, GNUNET_FS_PUBLISH_OPTION_NONE, NULL, NULL); 107 bo, GNUNET_FS_PUBLISH_OPTION_NONE,
108 NULL, NULL);
109 GNUNET_FS_uri_destroy (sks_uri); 109 GNUNET_FS_uri_destroy (sks_uri);
110 return GNUNET_SYSERR; 110 return GNUNET_SYSERR;
111} 111}
@@ -132,29 +132,28 @@ adv_pseudonym_edit_publish_dialog_cb (gpointer cls,
132 GNUNET_FS_file_information_inspect (nds->fip, &advertise_namespace, nds); 132 GNUNET_FS_file_information_inspect (nds->fip, &advertise_namespace, nds);
133 nds->root = NULL; 133 nds->root = NULL;
134 } 134 }
135 GNUNET_FS_namespace_delete (nds->ns, GNUNET_NO);
136 GNUNET_FS_file_information_destroy (nds->fip, NULL, NULL); 135 GNUNET_FS_file_information_destroy (nds->fip, NULL, NULL);
137 GNUNET_free (nds); 136 GNUNET_free (nds);
138} 137}
139 138
140 139
141
142/** 140/**
143 * Call the publication editor dialog in namespace advertising mode, 141 * Call the publication editor dialog in namespace advertising mode,
144 * and publish the namespace when it's OK'ed. 142 * and publish the namespace when it's OK'ed.
145 * 143 *
146 * @param ns namespace to advertise (takes ownership of it) 144 * @param ns namespace to advertise
147 * @param transient_for parent window for the dialog 145 * @param transient_for parent window for the dialog
148 */ 146 */
149void 147void
150GNUNET_FS_GTK_advertise_namespace (struct GNUNET_FS_Namespace *ns, GtkWindow *transient_for) 148GNUNET_FS_GTK_advertise_namespace (const struct GNUNET_CRYPTO_EccPrivateKey *ns,
149 GtkWindow *transient_for)
151{ 150{
152 struct NamespaceAdvertisementContext *nds; 151 struct NamespaceAdvertisementContext *nds;
153 struct GNUNET_FS_BlockOptions bo; 152 struct GNUNET_FS_BlockOptions bo;
154 struct GNUNET_CONTAINER_MetaData *meta; 153 struct GNUNET_CONTAINER_MetaData *meta;
155 154
156 nds = GNUNET_malloc (sizeof (struct NamespaceAdvertisementContext)); 155 nds = GNUNET_new (struct NamespaceAdvertisementContext);
157 nds->ns = ns; 156 nds->ns = *ns;
158 memset (&bo, 0, sizeof (struct GNUNET_FS_BlockOptions)); 157 memset (&bo, 0, sizeof (struct GNUNET_FS_BlockOptions));
159 bo.expiration_time = GNUNET_FS_year_to_time (GNUNET_FS_get_current_year () + 2); 158 bo.expiration_time = GNUNET_FS_year_to_time (GNUNET_FS_get_current_year () + 2);
160 bo.anonymity_level = 1; 159 bo.anonymity_level = 1;
diff --git a/src/fs/gnunet-fs-gtk_advertise-pseudonym.h b/src/fs/gnunet-fs-gtk_advertise-pseudonym.h
index c5c53de7..4002401e 100644
--- a/src/fs/gnunet-fs-gtk_advertise-pseudonym.h
+++ b/src/fs/gnunet-fs-gtk_advertise-pseudonym.h
@@ -1,10 +1,10 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 (C) 2005, 2006, 2010, 2012 Christian Grothoff (and other contributing authors) 3 (C) 2005-2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
@@ -17,27 +17,27 @@
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20
21#ifndef GNUNET_FS_GTK_ADVERTISE_PSEUDONYM_H
22#define GNUNET_FS_GTK_ADVERTISE_PSEUDONYM_H
23
24/** 20/**
25 * @file src/fs/gnunet-fs-gtk_advertise-pseudonym.h 21 * @file src/fs/gnunet-fs-gtk_advertise-pseudonym.h
26 * @author Christian Grothoff 22 * @author Christian Grothoff
27 * @brief run the advertising dialog (using the edit-publish 23 * @brief run the advertising dialog (using the edit-publish
28 * dialog functions) and finally do the advertising 24 * dialog functions) and finally do the advertising
29 */ 25 */
26#ifndef GNUNET_FS_GTK_ADVERTISE_PSEUDONYM_H
27#define GNUNET_FS_GTK_ADVERTISE_PSEUDONYM_H
28
30#include "gnunet-fs-gtk_common.h" 29#include "gnunet-fs-gtk_common.h"
31 30
32/** 31/**
33 * Call the publication editor dialog in namespace advertising mode, 32 * Call the publication editor dialog in namespace advertising mode,
34 * and publish the namespace when it's OK'ed. 33 * and publish the namespace when it's OK'ed.
35 * 34 *
36 * @param ns namespace to advertise (takes ownership of it) 35 * @param ns namespace to advertise
37 * @param transient_for parent window for the dialog 36 * @param transient_for parent window for the dialog
38 */ 37 */
39void 38void
40GNUNET_FS_GTK_advertise_namespace (struct GNUNET_FS_Namespace *ns, GtkWindow *transient_for); 39GNUNET_FS_GTK_advertise_namespace (const struct GNUNET_CRYPTO_EccPrivateKey *ns,
40 GtkWindow *transient_for);
41 41
42#endif 42#endif
43 43
diff --git a/src/fs/gnunet-fs-gtk_common.c b/src/fs/gnunet-fs-gtk_common.c
index bf118cad..f4be95d3 100644
--- a/src/fs/gnunet-fs-gtk_common.c
+++ b/src/fs/gnunet-fs-gtk_common.c
@@ -322,14 +322,14 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
322 GtkLabel *sel_namespace_label; 322 GtkLabel *sel_namespace_label;
323 GtkTreePath *treepath; 323 GtkTreePath *treepath;
324 GtkEntry *query_entry; 324 GtkEntry *query_entry;
325 struct GNUNET_FS_PseudonymIdentifier *nsid; 325 struct GNUNET_CRYPTO_EccPublicKey *nsid;
326 struct GNUNET_FS_PseudonymIdentifier want; 326 struct GNUNET_CRYPTO_EccPublicKey want;
327 327
328 if (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri)) 328 if (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri))
329 { 329 {
330 struct DownloadEntry *de; 330 struct DownloadEntry *de;
331 331
332 de = GNUNET_malloc (sizeof (struct DownloadEntry)); 332 de = GNUNET_new (struct DownloadEntry);
333 de->anonymity = anonymity_level; 333 de->anonymity = anonymity_level;
334 de->uri = GNUNET_FS_uri_dup (uri); 334 de->uri = GNUNET_FS_uri_dup (uri);
335 GNUNET_FS_GTK_open_download_as_dialog (de); 335 GNUNET_FS_GTK_open_download_as_dialog (de);
@@ -366,7 +366,7 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
366 while ( ( (NULL == nsid) || 366 while ( ( (NULL == nsid) ||
367 (0 != memcmp (nsid, 367 (0 != memcmp (nsid,
368 &want, 368 &want,
369 sizeof (struct GNUNET_FS_PseudonymIdentifier))) ) && 369 sizeof (struct GNUNET_CRYPTO_EccPublicKey))) ) &&
370 (gtk_tree_model_iter_next (namespace_treestore, &iter)) ) 370 (gtk_tree_model_iter_next (namespace_treestore, &iter)) )
371 gtk_tree_model_get (namespace_treestore, &iter, 371 gtk_tree_model_get (namespace_treestore, &iter,
372 GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY, 372 GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY,
@@ -375,7 +375,7 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
375 if ( (NULL == nsid) || 375 if ( (NULL == nsid) ||
376 (0 != memcmp (nsid, 376 (0 != memcmp (nsid,
377 &want, 377 &want,
378 sizeof (struct GNUNET_FS_PseudonymIdentifier))) ) 378 sizeof (struct GNUNET_CRYPTO_EccPublicKey))) )
379 { 379 {
380 /* namespace unknown / not in list!? */ 380 /* namespace unknown / not in list!? */
381 GNUNET_break (0); 381 GNUNET_break (0);
@@ -448,16 +448,20 @@ static int largest_namespace_rating = INT_MIN;
448 */ 448 */
449static int 449static int
450find_largest_namespace_rating_iterator (void *cls, 450find_largest_namespace_rating_iterator (void *cls,
451 const struct GNUNET_FS_PseudonymIdentifier *pseudonym, const char *name, 451 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
452 const char *unique_name, 452 const char *name,
453 const struct GNUNET_CONTAINER_MetaData *md, int32_t rating) 453 const char *unique_name,
454 const struct GNUNET_CONTAINER_MetaData *md,
455 int32_t rating)
454{ 456{
455 int *largest = cls; 457 int *largest = cls;
458
456 if (*largest < rating) 459 if (*largest < rating)
457 *largest = rating; 460 *largest = rating;
458 return GNUNET_OK; 461 return GNUNET_OK;
459} 462}
460 463
464
461/** 465/**
462 * Finds largest namespace rating. 466 * Finds largest namespace rating.
463 * Used to calculate a rating for newly discovered namespaces. 467 * Used to calculate a rating for newly discovered namespaces.
@@ -472,10 +476,12 @@ GNUNET_GTK_find_largest_namespace_rating ()
472 if (largest_namespace_rating != INT_MIN) 476 if (largest_namespace_rating != INT_MIN)
473 return largest_namespace_rating; 477 return largest_namespace_rating;
474 (void) GNUNET_FS_pseudonym_list_all (GNUNET_FS_GTK_get_configuration (), 478 (void) GNUNET_FS_pseudonym_list_all (GNUNET_FS_GTK_get_configuration (),
475 find_largest_namespace_rating_iterator, &largest_namespace_rating); 479 &find_largest_namespace_rating_iterator,
480 &largest_namespace_rating);
476 return largest_namespace_rating; 481 return largest_namespace_rating;
477} 482}
478 483
484
479/** 485/**
480 * Sets largest namespace rating. 486 * Sets largest namespace rating.
481 * Used to change cached largest namespace rating, when namespace list 487 * Used to change cached largest namespace rating, when namespace list
@@ -491,6 +497,7 @@ GNUNET_GTK_set_largest_namespace_rating (int new_value)
491 largest_namespace_rating = new_value; 497 largest_namespace_rating = new_value;
492} 498}
493 499
500
494/** 501/**
495 * Converts a GtkTreeRowReference to a GtkTreeIter. 502 * Converts a GtkTreeRowReference to a GtkTreeIter.
496 * 503 *
diff --git a/src/fs/gnunet-fs-gtk_event-handler.c b/src/fs/gnunet-fs-gtk_event-handler.c
index 24833481..bbe7772d 100644
--- a/src/fs/gnunet-fs-gtk_event-handler.c
+++ b/src/fs/gnunet-fs-gtk_event-handler.c
@@ -1,10 +1,10 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2010, 2011, 2012 Christian Grothoff (and other contributing authors) 3 (C) 2010-2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
@@ -968,13 +968,21 @@ copy_search_uri_to_clipboard_ctx_menu (GtkMenuItem *item, gpointer user_data)
968 GNUNET_free (uris); 968 GNUNET_free (uris);
969} 969}
970 970
971/* Called for each embedded sks. Return GNUNET_OK to continue iteration */ 971
972typedef int (*embedded_sks_callback) (void *cls, const struct GNUNET_FS_Uri *sks_uri, 972/**
973 const char *sks_uri_string, struct GNUNET_FS_PseudonymIdentifier *nsid); 973 * Called for each embedded sks.
974 *
975 * @return GNUNET_OK to continue iteration
976 */
977typedef int (*EmbeddedSksCallback) (void *cls,
978 const struct GNUNET_FS_Uri *sks_uri,
979 const char *sks_uri_string,
980 const struct GNUNET_CRYPTO_EccPublicKey *nsid);
981
974 982
975struct sks_scanner_callback_context 983struct sks_scanner_callback_context
976{ 984{
977 embedded_sks_callback cb; 985 EmbeddedSksCallback cb;
978 void *cls; 986 void *cls;
979}; 987};
980 988
@@ -1014,7 +1022,8 @@ check_for_embedded_sks (void *cls,
1014 char *id = GNUNET_FS_uri_sks_get_content_id (sks_uri); 1022 char *id = GNUNET_FS_uri_sks_get_content_id (sks_uri);
1015 if (NULL != id) 1023 if (NULL != id)
1016 { 1024 {
1017 struct GNUNET_FS_PseudonymIdentifier nsid; 1025 struct GNUNET_CRYPTO_EccPublicKey nsid;
1026
1018 if ((0 == strcmp (id, "/")) && 1027 if ((0 == strcmp (id, "/")) &&
1019 (GNUNET_OK == GNUNET_FS_uri_sks_get_namespace (sks_uri, &nsid))) 1028 (GNUNET_OK == GNUNET_FS_uri_sks_get_namespace (sks_uri, &nsid)))
1020 result = ctx->cb (ctx->cls, sks_uri, data, &nsid); 1029 result = ctx->cb (ctx->cls, sks_uri, data, &nsid);
@@ -1034,7 +1043,7 @@ check_for_embedded_sks (void *cls,
1034 */ 1043 */
1035static void 1044static void
1036find_embedded_sks (const struct GNUNET_CONTAINER_MetaData *meta, 1045find_embedded_sks (const struct GNUNET_CONTAINER_MetaData *meta,
1037 embedded_sks_callback cb, void *cls) 1046 EmbeddedSksCallback cb, void *cls)
1038{ 1047{
1039 struct sks_scanner_callback_context ctx; 1048 struct sks_scanner_callback_context ctx;
1040 1049
@@ -1045,21 +1054,25 @@ find_embedded_sks (const struct GNUNET_CONTAINER_MetaData *meta,
1045} 1054}
1046 1055
1047 1056
1048struct sks_population_context 1057struct SksPopulationContext
1049{ 1058{
1050 GtkMenu *menu; 1059 GtkMenu *menu;
1051 int counter; 1060 int counter;
1052 uintptr_t anonymity_level; 1061 uintptr_t anonymity_level;
1053}; 1062};
1054 1063
1055/* Called for every SKS URI in metadata. Adds up to 3 menu items 1064
1065/**
1066 * Called for every SKS URI in metadata. Adds up to 3 menu items
1056 * that will initiate downloads for these SKS URIs 1067 * that will initiate downloads for these SKS URIs
1057 */ 1068 */
1058static int 1069static int
1059populate_popup_with_sks_items (void *cls, const struct GNUNET_FS_Uri *sks_uri, 1070populate_popup_with_sks_items (void *cls,
1060 const char *sks_uri_string, struct GNUNET_FS_PseudonymIdentifier *nsid) 1071 const struct GNUNET_FS_Uri *sks_uri,
1072 const char *sks_uri_string,
1073 const struct GNUNET_CRYPTO_EccPublicKey *nsid)
1061{ 1074{
1062 struct sks_population_context *ctx = cls; 1075 struct SksPopulationContext *ctx = cls;
1063 GtkWidget *child; 1076 GtkWidget *child;
1064 char *label; 1077 char *label;
1065 GtkWidget *ns_association_icon; 1078 GtkWidget *ns_association_icon;
@@ -1084,6 +1097,7 @@ populate_popup_with_sks_items (void *cls, const struct GNUNET_FS_Uri *sks_uri,
1084 return (ctx->counter < 4) ? GNUNET_OK : GNUNET_SYSERR; 1097 return (ctx->counter < 4) ? GNUNET_OK : GNUNET_SYSERR;
1085} 1098}
1086 1099
1100
1087/** 1101/**
1088 * Context menu was requested for a search result list. 1102 * Context menu was requested for a search result list.
1089 * Compute which menu items are applicable and display 1103 * Compute which menu items are applicable and display
@@ -1110,9 +1124,9 @@ search_list_popup (GtkTreeModel *tm,
1110 struct SearchListPopupContext *spc; 1124 struct SearchListPopupContext *spc;
1111 struct GNUNET_CONTAINER_MetaData *meta; 1125 struct GNUNET_CONTAINER_MetaData *meta;
1112 int is_directory = GNUNET_NO; 1126 int is_directory = GNUNET_NO;
1113 struct sks_population_context sks_pop_ctx; 1127 struct SksPopulationContext sks_pop_ctx;
1114 1128
1115 spc = GNUNET_malloc (sizeof (struct SearchListPopupContext)); 1129 spc = GNUNET_new (struct SearchListPopupContext);
1116 spc->tab = tab; 1130 spc->tab = tab;
1117 path = gtk_tree_model_get_path (tm, iter); 1131 path = gtk_tree_model_get_path (tm, iter);
1118 spc->rr = gtk_tree_row_reference_new (tm, path); 1132 spc->rr = gtk_tree_row_reference_new (tm, path);
@@ -2166,7 +2180,7 @@ static int
2166see_if_there_are_any_sks_uris (void *cls, 2180see_if_there_are_any_sks_uris (void *cls,
2167 const struct GNUNET_FS_Uri *sks_uri, 2181 const struct GNUNET_FS_Uri *sks_uri,
2168 const char *sks_uri_string, 2182 const char *sks_uri_string,
2169 struct GNUNET_FS_PseudonymIdentifier *nsid) 2183 const struct GNUNET_CRYPTO_EccPublicKey *nsid)
2170{ 2184{
2171 gboolean *gb = cls; 2185 gboolean *gb = cls;
2172 2186
diff --git a/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c b/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
index 6e67db94..7e2df958 100644
--- a/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
+++ b/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
@@ -4,7 +4,7 @@
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
@@ -292,14 +292,17 @@ GNUNET_FS_GTK_search_namespace_dropdown_button_toggled_cb (GtkToggleButton *
292 * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort 292 * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort
293 */ 293 */
294static int 294static int
295add_namespace_to_ts (void *cls, const struct GNUNET_FS_PseudonymIdentifier *pseudonym, 295add_namespace_to_ts (void *cls,
296 const char *name, const char *unique_name, 296 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
297 const struct GNUNET_CONTAINER_MetaData *md, int rating) 297 const char *name,
298 const char *unique_name,
299 const struct GNUNET_CONTAINER_MetaData *md,
300 int rating)
298{ 301{
299 GtkTreeStore *ts = cls; 302 GtkTreeStore *ts = cls;
300 char *root; 303 char *root;
301 char *ns_name, *unique_ns_name; 304 char *ns_name, *unique_ns_name;
302 struct GNUNET_FS_PseudonymIdentifier *nsid; 305 struct GNUNET_CRYPTO_EccPublicKey *nsid;
303 char *description; 306 char *description;
304 int desc_is_a_dup; 307 int desc_is_a_dup;
305 char *uris; 308 char *uris;
@@ -311,11 +314,12 @@ add_namespace_to_ts (void *cls, const struct GNUNET_FS_PseudonymIdentifier *pseu
311 return GNUNET_OK; 314 return GNUNET_OK;
312 315
313 GNUNET_FS_pseudonym_get_info (GNUNET_FS_GTK_get_configuration (), 316 GNUNET_FS_pseudonym_get_info (GNUNET_FS_GTK_get_configuration (),
314 pseudonym, NULL, NULL, &ns_name, NULL); 317 pseudonym, NULL, NULL,
318 &ns_name, NULL);
315 unique_ns_name = GNUNET_FS_pseudonym_name_uniquify ( 319 unique_ns_name = GNUNET_FS_pseudonym_name_uniquify (
316 GNUNET_FS_GTK_get_configuration (), pseudonym, ns_name, NULL); 320 GNUNET_FS_GTK_get_configuration (), pseudonym, ns_name, NULL);
317 GNUNET_free (ns_name); 321 GNUNET_free (ns_name);
318 nsid = GNUNET_malloc (sizeof (struct GNUNET_FS_PseudonymIdentifier)); 322 nsid = GNUNET_new (struct GNUNET_CRYPTO_EccPublicKey);
319 *nsid = *pseudonym; 323 *nsid = *pseudonym;
320 root = NULL; 324 root = NULL;
321 uris = GNUNET_CONTAINER_meta_data_get_by_type (md, EXTRACTOR_METATYPE_URI); 325 uris = GNUNET_CONTAINER_meta_data_get_by_type (md, EXTRACTOR_METATYPE_URI);
@@ -345,12 +349,14 @@ add_namespace_to_ts (void *cls, const struct GNUNET_FS_PseudonymIdentifier *pseu
345 return GNUNET_OK; 349 return GNUNET_OK;
346} 350}
347 351
352
348void 353void
349GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *main_ctx) 354GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *main_ctx)
350{ 355{
351 GtkTreeIter iter; 356 GtkTreeIter iter;
352 GtkTreePath *treepath; 357 GtkTreePath *treepath;
353 struct GNUNET_FS_PseudonymIdentifier *key = NULL, *selected_ns_id; 358 struct GNUNET_CRYPTO_EccPublicKey *key = NULL;
359 struct GNUNET_CRYPTO_EccPublicKey *selected_ns_id;
354 360
355 gboolean found = FALSE; 361 gboolean found = FALSE;
356 gchar *value = NULL; 362 gchar *value = NULL;
@@ -375,10 +381,10 @@ GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *mai
375 main_ctx->selected_ns_row = NULL; 381 main_ctx->selected_ns_row = NULL;
376 } 382 }
377 selected_ns_id = NULL; 383 selected_ns_id = NULL;
378 if (key != NULL) 384 if (NULL != key)
379 { 385 {
380 selected_ns_id = GNUNET_malloc (sizeof (struct GNUNET_FS_PseudonymIdentifier)); 386 selected_ns_id = GNUNET_new (struct GNUNET_CRYPTO_EccPublicKey);
381 memcpy (selected_ns_id, key, sizeof (struct GNUNET_FS_PseudonymIdentifier)); 387 *selected_ns_id = *key;
382 } 388 }
383 389
384 if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL ( 390 if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (
@@ -427,7 +433,7 @@ GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *mai
427 -1); 433 -1);
428 if (selected_ns_id == NULL) 434 if (selected_ns_id == NULL)
429 found = TRUE; 435 found = TRUE;
430 else if (key != NULL && memcmp (key, selected_ns_id, sizeof (struct GNUNET_FS_PseudonymIdentifier)) == 0) 436 else if (key != NULL && memcmp (key, selected_ns_id, sizeof (struct GNUNET_CRYPTO_EccPublicKey)) == 0)
431 found = TRUE; 437 found = TRUE;
432 if (found || (TRUE != gtk_tree_model_iter_next (GTK_TREE_MODEL ( 438 if (found || (TRUE != gtk_tree_model_iter_next (GTK_TREE_MODEL (
433 main_ctx->search_ns_treestore), &iter))) 439 main_ctx->search_ns_treestore), &iter)))
diff --git a/src/fs/gnunet-fs-gtk_main-window-search.c b/src/fs/gnunet-fs-gtk_main-window-search.c
index e49e84b2..6b621a1a 100644
--- a/src/fs/gnunet-fs-gtk_main-window-search.c
+++ b/src/fs/gnunet-fs-gtk_main-window-search.c
@@ -39,7 +39,7 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx)
39 guint anonymity_level; 39 guint anonymity_level;
40 gchar *keywords; 40 gchar *keywords;
41 gchar *mime_keyword; 41 gchar *mime_keyword;
42 struct GNUNET_FS_PseudonymIdentifier *nsid; 42 struct GNUNET_CRYPTO_EccPublicKey *nsid;
43 struct GNUNET_FS_Uri *uri; 43 struct GNUNET_FS_Uri *uri;
44 44
45 /* get anonymity level */ 45 /* get anonymity level */
@@ -118,7 +118,7 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx)
118 /* build KSK/SKS URI */ 118 /* build KSK/SKS URI */
119 if (NULL != nsid) 119 if (NULL != nsid)
120 { 120 {
121 uri = GNUNET_FS_uri_sks_create_from_nsid (nsid, keywords); 121 uri = GNUNET_FS_uri_sks_create (nsid, keywords);
122 GNUNET_assert (uri != NULL); 122 GNUNET_assert (uri != NULL);
123 } 123 }
124 else 124 else
diff --git a/src/fs/gnunet-fs-gtk_namespace_manager.c b/src/fs/gnunet-fs-gtk_namespace_manager.c
index 1e5ca9f1..ca4a14c5 100644
--- a/src/fs/gnunet-fs-gtk_namespace_manager.c
+++ b/src/fs/gnunet-fs-gtk_namespace_manager.c
@@ -1,10 +1,10 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 (C) 2005, 2006, 2010, 2012 Christian Grothoff (and other contributing authors) 3 (C) 2005-2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
@@ -73,6 +73,7 @@ struct GNUNET_GTK_NamespaceManagerContext
73#define GNUNET_GTK_NAMESPACE_DETAILS_DATA_MIME_COLUMN 4 73#define GNUNET_GTK_NAMESPACE_DETAILS_DATA_MIME_COLUMN 4
74#define GNUNET_GTK_NAMESPACE_DETAILS_VALUE_COLUMN 5 74#define GNUNET_GTK_NAMESPACE_DETAILS_VALUE_COLUMN 5
75 75
76
76static void 77static void
77sort_order_list (struct GNUNET_GTK_NamespaceManagerContext *ctx, 78sort_order_list (struct GNUNET_GTK_NamespaceManagerContext *ctx,
78 int sort_column) 79 int sort_column)
@@ -175,6 +176,7 @@ sort_order_list (struct GNUNET_GTK_NamespaceManagerContext *ctx,
175 g_free (row_ints); 176 g_free (row_ints);
176} 177}
177 178
179
178void 180void
179GNUNET_GTK_namespace_manager_namespace_order_column_clicked_cb ( 181GNUNET_GTK_namespace_manager_namespace_order_column_clicked_cb (
180 GtkTreeViewColumn *treeviewcolumn, gpointer user_data) 182 GtkTreeViewColumn *treeviewcolumn, gpointer user_data)
@@ -194,6 +196,7 @@ GNUNET_GTK_namespace_manager_namespace_order_column_clicked_cb (
194 } 196 }
195} 197}
196 198
199
197void 200void
198GNUNET_GTK_namespace_manager_known_namespaces_delete_button_clicked_cb ( 201GNUNET_GTK_namespace_manager_known_namespaces_delete_button_clicked_cb (
199 GtkButton *button, gpointer user_data) 202 GtkButton *button, gpointer user_data)
@@ -241,13 +244,14 @@ GNUNET_GTK_namespace_manager_known_namespaces_delete_button_clicked_cb (
241 ctx->uneditable_md = NULL; 244 ctx->uneditable_md = NULL;
242} 245}
243 246
247
244void 248void
245GNUNET_GTK_namespace_manager_known_namespaces_swap_rank_button_clicked_cb ( 249GNUNET_GTK_namespace_manager_known_namespaces_swap_rank_button_clicked_cb (
246 GtkButton *button, gpointer user_data) 250 GtkButton *button, gpointer user_data)
247{ 251{
248 struct GNUNET_GTK_NamespaceManagerContext *ctx = user_data; 252 struct GNUNET_GTK_NamespaceManagerContext *ctx = user_data;
249 GtkTreeIter known_iter, order_iter; 253 GtkTreeIter known_iter, order_iter;
250 struct GNUNET_FS_PseudonymIdentifier *nsid; 254 struct GNUNET_CRYPTO_EccPublicKey *nsid;
251 int32_t old_rank, new_rank; 255 int32_t old_rank, new_rank;
252 GtkTreeRowReference *order_row, *known_row; 256 GtkTreeRowReference *order_row, *known_row;
253 257
@@ -315,6 +319,7 @@ GNUNET_GTK_namespace_manager_known_namespaces_swap_rank_button_clicked_cb (
315 } 319 }
316} 320}
317 321
322
318void 323void
319GNUNET_GTK_namespace_manager_namespace_order_apply_clicked_cb ( 324GNUNET_GTK_namespace_manager_namespace_order_apply_clicked_cb (
320 GtkButton *button, gpointer user_data) 325 GtkButton *button, gpointer user_data)
@@ -358,6 +363,7 @@ GNUNET_GTK_namespace_manager_namespace_order_apply_clicked_cb (
358 } 363 }
359} 364}
360 365
366
361void 367void
362GNUNET_GTK_namespace_manager_namespace_details_add_button_clicked_cb ( 368GNUNET_GTK_namespace_manager_namespace_details_add_button_clicked_cb (
363 GtkButton *button, gpointer user_data) 369 GtkButton *button, gpointer user_data)
@@ -367,6 +373,7 @@ GNUNET_GTK_namespace_manager_namespace_details_add_button_clicked_cb (
367 */ 373 */
368} 374}
369 375
376
370void 377void
371GNUNET_GTK_namespace_manager_namespace_details_delete_button_clicked_cb ( 378GNUNET_GTK_namespace_manager_namespace_details_delete_button_clicked_cb (
372 GtkButton *button, gpointer user_data) 379 GtkButton *button, gpointer user_data)
@@ -381,6 +388,7 @@ GNUNET_GTK_namespace_manager_namespace_details_delete_button_clicked_cb (
381 gtk_widget_set_sensitive (ctx->details_apply_button, TRUE); 388 gtk_widget_set_sensitive (ctx->details_apply_button, TRUE);
382} 389}
383 390
391
384void 392void
385GNUNET_GTK_namespace_manager_namespace_details_apply_button_clicked_cb ( 393GNUNET_GTK_namespace_manager_namespace_details_apply_button_clicked_cb (
386 GtkButton *button, gpointer user_data) 394 GtkButton *button, gpointer user_data)
@@ -448,6 +456,7 @@ GNUNET_GTK_namespace_manager_namespace_details_apply_button_clicked_cb (
448 gtk_widget_set_sensitive (ctx->details_apply_button, FALSE); 456 gtk_widget_set_sensitive (ctx->details_apply_button, FALSE);
449} 457}
450 458
459
451void 460void
452GNUNET_GTK_namespace_manager_name_text_editing_started_cb ( 461GNUNET_GTK_namespace_manager_name_text_editing_started_cb (
453 GtkCellRenderer *renderer, GtkCellEditable *editable, gchar *path, 462 GtkCellRenderer *renderer, GtkCellEditable *editable, gchar *path,
@@ -484,6 +493,7 @@ GNUNET_GTK_namespace_manager_name_text_editing_started_cb (
484 } 493 }
485} 494}
486 495
496
487void 497void
488GNUNET_GTK_namespace_manager_name_text_edited_cb ( 498GNUNET_GTK_namespace_manager_name_text_edited_cb (
489 GtkCellRendererText *renderer, gchar *path, gchar *new_text, 499 GtkCellRendererText *renderer, gchar *path, gchar *new_text,
@@ -504,7 +514,7 @@ GNUNET_GTK_namespace_manager_name_text_edited_cb (
504 if (gtk_tree_model_get_iter (GTK_TREE_MODEL (ctx->known_ns_store), 514 if (gtk_tree_model_get_iter (GTK_TREE_MODEL (ctx->known_ns_store),
505 &iter, tree_path)) 515 &iter, tree_path))
506 { 516 {
507 struct GNUNET_FS_PseudonymIdentifier *nsid; 517 struct GNUNET_CRYPTO_EccPublicKey *nsid;
508 gtk_tree_model_get (GTK_TREE_MODEL (ctx->known_ns_store), &iter, 518 gtk_tree_model_get (GTK_TREE_MODEL (ctx->known_ns_store), &iter,
509 GNUNET_GTK_KNOWN_NAMESPACES_IDENTIFIER_BIN_COLUMN, &nsid, 519 GNUNET_GTK_KNOWN_NAMESPACES_IDENTIFIER_BIN_COLUMN, &nsid,
510 GNUNET_GTK_KNOWN_NAMESPACES_ORDER_ROW_REFERENCE_COLUMN, &order_row, 520 GNUNET_GTK_KNOWN_NAMESPACES_ORDER_ROW_REFERENCE_COLUMN, &order_row,
@@ -535,6 +545,7 @@ GNUNET_GTK_namespace_manager_name_text_edited_cb (
535 } 545 }
536} 546}
537 547
548
538void 549void
539GNUNET_GTK_namespace_manager_namespace_details_type_text_edited_cb ( 550GNUNET_GTK_namespace_manager_namespace_details_type_text_edited_cb (
540 GtkCellRendererText *renderer, gchar *path, gchar *new_text, 551 GtkCellRendererText *renderer, gchar *path, gchar *new_text,
@@ -557,6 +568,7 @@ GNUNET_GTK_namespace_manager_namespace_details_type_text_edited_cb (
557 */ 568 */
558} 569}
559 570
571
560void 572void
561GNUNET_GTK_namespace_manager_namespace_details_value_text_edited_cb ( 573GNUNET_GTK_namespace_manager_namespace_details_value_text_edited_cb (
562 GtkCellRendererText *renderer, gchar *path, gchar *new_text, 574 GtkCellRendererText *renderer, gchar *path, gchar *new_text,
@@ -588,6 +600,7 @@ GNUNET_GTK_namespace_manager_namespace_details_value_text_edited_cb (
588 } 600 }
589} 601}
590 602
603
591/** 604/**
592 * Iterator over all known pseudonyms. 605 * Iterator over all known pseudonyms.
593 * Populate "known ns" and "ns order" lists. 606 * Populate "known ns" and "ns order" lists.
@@ -599,23 +612,25 @@ GNUNET_GTK_namespace_manager_namespace_details_value_text_edited_cb (
599 * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort 612 * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort
600 */ 613 */
601static int 614static int
602populate_known_ns_list (void *cls, const struct GNUNET_FS_PseudonymIdentifier *pseudonym, 615populate_known_ns_list (void *cls,
603 const char *name, const char *unique_name, 616 const struct GNUNET_CRYPTO_EccPublicKey *pseudonym,
604 const struct GNUNET_CONTAINER_MetaData *md, int rating) 617 const char *name, const char *unique_name,
618 const struct GNUNET_CONTAINER_MetaData *md,
619 int rating)
605{ 620{
606 struct GNUNET_GTK_NamespaceManagerContext *ctx = cls; 621 struct GNUNET_GTK_NamespaceManagerContext *ctx = cls;
607 struct GNUNET_FS_PseudonymIdentifier *nsid; 622 struct GNUNET_CRYPTO_EccPublicKey *nsid;
608 char buf[1024]; 623 char buf[1024];
609 char *ret; 624 char *ret;
610 GtkTreeIter known_iter, order_iter; 625 GtkTreeIter known_iter, order_iter;
611 struct GNUNET_CONTAINER_MetaData *md_copy; 626 struct GNUNET_CONTAINER_MetaData *md_copy;
612 char *non_null_name, *non_null_unique_name; 627 char *non_null_name, *non_null_unique_name;
613 628
614 nsid = GNUNET_malloc (sizeof (struct GNUNET_FS_PseudonymIdentifier)); 629 nsid = GNUNET_new (struct GNUNET_CRYPTO_EccPublicKey);
615 *nsid = *pseudonym; 630 *nsid = *pseudonym;
616 631
617 ret = GNUNET_STRINGS_data_to_string (nsid, 632 ret = GNUNET_STRINGS_data_to_string (nsid,
618 sizeof (struct GNUNET_FS_PseudonymIdentifier), 633 sizeof (struct GNUNET_CRYPTO_EccPublicKey),
619 buf, 634 buf,
620 sizeof (buf)); 635 sizeof (buf));
621 GNUNET_assert (NULL != ret); 636 GNUNET_assert (NULL != ret);
@@ -661,13 +676,14 @@ populate_known_ns_list (void *cls, const struct GNUNET_FS_PseudonymIdentifier *p
661 return GNUNET_OK; 676 return GNUNET_OK;
662} 677}
663 678
679
664static void 680static void
665apply_known_ns_changes (struct GNUNET_GTK_NamespaceManagerContext *ctx) 681apply_known_ns_changes (struct GNUNET_GTK_NamespaceManagerContext *ctx)
666{ 682{
667 GtkTreeIter iter; 683 GtkTreeIter iter;
668 gint i; 684 gint i;
669 gint row_count; 685 gint row_count;
670 struct GNUNET_FS_PseudonymIdentifier *nsid; 686 struct GNUNET_CRYPTO_EccPublicKey *nsid;
671 char *name; 687 char *name;
672 int32_t rank; 688 int32_t rank;
673 struct GNUNET_CONTAINER_MetaData *md; 689 struct GNUNET_CONTAINER_MetaData *md;
@@ -693,6 +709,7 @@ apply_known_ns_changes (struct GNUNET_GTK_NamespaceManagerContext *ctx)
693 ctx->known_ns_store), &iter)) 709 ctx->known_ns_store), &iter))
694 break; 710 break;
695 } 711 }
712#if FIXME_NAMESPACE_REMOVAL
696 while (NULL != ctx->deleted_namespaces) 713 while (NULL != ctx->deleted_namespaces)
697 { 714 {
698 nsid = ctx->deleted_namespaces->data; 715 nsid = ctx->deleted_namespaces->data;
@@ -701,18 +718,19 @@ apply_known_ns_changes (struct GNUNET_GTK_NamespaceManagerContext *ctx)
701 GNUNET_FS_pseudonym_remove (GNUNET_FS_GTK_get_configuration (), nsid); 718 GNUNET_FS_pseudonym_remove (GNUNET_FS_GTK_get_configuration (), nsid);
702 GNUNET_free (nsid); 719 GNUNET_free (nsid);
703 } 720 }
704
705 ctx->deleted_namespaces = g_list_delete_link (ctx->deleted_namespaces, ctx->deleted_namespaces); 721 ctx->deleted_namespaces = g_list_delete_link (ctx->deleted_namespaces, ctx->deleted_namespaces);
706 } 722 }
723#endif
707} 724}
708 725
726
709static void 727static void
710free_lists_contents (struct GNUNET_GTK_NamespaceManagerContext *ctx) 728free_lists_contents (struct GNUNET_GTK_NamespaceManagerContext *ctx)
711{ 729{
712 GtkTreeIter iter; 730 GtkTreeIter iter;
713 gint i; 731 gint i;
714 gint row_count; 732 gint row_count;
715 struct GNUNET_FS_PseudonymIdentifier *nsid; 733 struct GNUNET_CRYPTO_EccPublicKey *nsid;
716 GtkTreeRowReference *order_row; 734 GtkTreeRowReference *order_row;
717 struct GNUNET_CONTAINER_MetaData *md; 735 struct GNUNET_CONTAINER_MetaData *md;
718 736
@@ -763,6 +781,7 @@ free_lists_contents (struct GNUNET_GTK_NamespaceManagerContext *ctx)
763 GNUNET_CONTAINER_meta_data_destroy (ctx->uneditable_md); 781 GNUNET_CONTAINER_meta_data_destroy (ctx->uneditable_md);
764} 782}
765 783
784
766void 785void
767GNUNET_GTK_namespace_manager_dialog_response_cb (GtkDialog *dialog, 786GNUNET_GTK_namespace_manager_dialog_response_cb (GtkDialog *dialog,
768 gint response_id, gpointer user_data) 787 gint response_id, gpointer user_data)
@@ -796,13 +815,13 @@ static gboolean
796mark_as_mine (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, 815mark_as_mine (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
797 gpointer data) 816 gpointer data)
798{ 817{
799 const struct GNUNET_FS_PseudonymIdentifier *mine_id = data; 818 const struct GNUNET_CRYPTO_EccPublicKey *mine_id = data;
800 const struct GNUNET_FS_PseudonymIdentifier *ns_id; 819 const struct GNUNET_CRYPTO_EccPublicKey *ns_id;
801 820
802 gtk_tree_model_get (model, iter, 821 gtk_tree_model_get (model, iter,
803 GNUNET_GTK_KNOWN_NAMESPACES_IDENTIFIER_BIN_COLUMN, &ns_id, -1); 822 GNUNET_GTK_KNOWN_NAMESPACES_IDENTIFIER_BIN_COLUMN, &ns_id, -1);
804 823
805 if (memcmp (ns_id, mine_id, sizeof (struct GNUNET_FS_PseudonymIdentifier)) != 0) 824 if (memcmp (ns_id, mine_id, sizeof (struct GNUNET_CRYPTO_EccPublicKey)) != 0)
806 return FALSE; 825 return FALSE;
807 826
808 gtk_list_store_set (GTK_LIST_STORE (model), iter, 827 gtk_list_store_set (GTK_LIST_STORE (model), iter,
@@ -810,6 +829,7 @@ mark_as_mine (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
810 return TRUE; 829 return TRUE;
811} 830}
812 831
832
813/** 833/**
814 * Callback with information about local (!) namespaces. 834 * Callback with information about local (!) namespaces.
815 * Contains the names of the local namespace and the global 835 * Contains the names of the local namespace and the global
@@ -821,7 +841,7 @@ mark_as_mine (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
821 */ 841 */
822static void 842static void
823mark_namespaces_as_mine (void *cls, const char *name, 843mark_namespaces_as_mine (void *cls, const char *name,
824 const struct GNUNET_FS_PseudonymIdentifier *id) 844 const struct GNUNET_CRYPTO_EccPublicKey *id)
825{ 845{
826 struct GNUNET_GTK_NamespaceManagerContext *ctx = cls; 846 struct GNUNET_GTK_NamespaceManagerContext *ctx = cls;
827 847
@@ -829,6 +849,7 @@ mark_namespaces_as_mine (void *cls, const char *name,
829 (gpointer) id); 849 (gpointer) id);
830} 850}
831 851
852
832/** 853/**
833 * Type of a function that libextractor calls for each 854 * Type of a function that libextractor calls for each
834 * meta data item found. 855 * meta data item found.
@@ -881,6 +902,7 @@ populate_details_list (void *cls, const char *plugin_name,
881 return 0; 902 return 0;
882} 903}
883 904
905
884static void 906static void
885ns_details_selection_changed (GtkTreeSelection *treeselection, 907ns_details_selection_changed (GtkTreeSelection *treeselection,
886 gpointer user_data) 908 gpointer user_data)
@@ -897,6 +919,7 @@ ns_details_selection_changed (GtkTreeSelection *treeselection,
897 gtk_widget_set_sensitive (ctx->details_delete_button, TRUE); 919 gtk_widget_set_sensitive (ctx->details_delete_button, TRUE);
898} 920}
899 921
922
900static void 923static void
901known_ns_selection_changed (GtkTreeSelection *treeselection, 924known_ns_selection_changed (GtkTreeSelection *treeselection,
902 gpointer user_data) 925 gpointer user_data)
@@ -925,12 +948,13 @@ known_ns_selection_changed (GtkTreeSelection *treeselection,
925 gtk_widget_set_sensitive (ctx->details_apply_button, FALSE); 948 gtk_widget_set_sensitive (ctx->details_apply_button, FALSE);
926} 949}
927 950
951
928GtkWindow * 952GtkWindow *
929GNUNET_GTK_namespace_manager_open (struct GNUNET_GTK_MainWindowContext *main_ctx) 953GNUNET_GTK_namespace_manager_open (struct GNUNET_GTK_MainWindowContext *main_ctx)
930{ 954{
931 struct GNUNET_GTK_NamespaceManagerContext *ctx; 955 struct GNUNET_GTK_NamespaceManagerContext *ctx;
932 956
933 ctx = GNUNET_malloc (sizeof (struct GNUNET_GTK_NamespaceManagerContext)); 957 ctx = GNUNET_new (struct GNUNET_GTK_NamespaceManagerContext);
934 ctx->builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_namespace_manager.glade", ctx); 958 ctx->builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_namespace_manager.glade", ctx);
935 if (ctx->builder == NULL) 959 if (ctx->builder == NULL)
936 { 960 {
@@ -980,9 +1004,11 @@ GNUNET_GTK_namespace_manager_open (struct GNUNET_GTK_MainWindowContext *main_ctx
980 (void) GNUNET_FS_pseudonym_list_all (GNUNET_FS_GTK_get_configuration (), 1004 (void) GNUNET_FS_pseudonym_list_all (GNUNET_FS_GTK_get_configuration (),
981 populate_known_ns_list, ctx); 1005 populate_known_ns_list, ctx);
982 1006
1007#if FIXME_USE_IDENTITY_SERVICE
983 /* mark our own namespaces as such */ 1008 /* mark our own namespaces as such */
984 GNUNET_FS_namespace_list (GNUNET_FS_GTK_get_fs_handle (), 1009 GNUNET_FS_namespace_list (GNUNET_FS_GTK_get_fs_handle (),
985 mark_namespaces_as_mine, ctx); 1010 &mark_namespaces_as_mine, ctx);
1011#endif
986 1012
987 /* sort namespace order list by rank (initially) */ 1013 /* sort namespace order list by rank (initially) */
988 sort_order_list (ctx, GNUNET_GTK_NAMESPACE_ORDER_RANK_COLUMN); 1014 sort_order_list (ctx, GNUNET_GTK_NAMESPACE_ORDER_RANK_COLUMN);
@@ -994,7 +1020,8 @@ GNUNET_GTK_namespace_manager_open (struct GNUNET_GTK_MainWindowContext *main_ctx
994 return ctx->namespace_manager; 1020 return ctx->namespace_manager;
995} 1021}
996 1022
997void 1023
1024static void
998ns_manager_deleted (GtkWindow *object, gpointer user_data) 1025ns_manager_deleted (GtkWindow *object, gpointer user_data)
999{ 1026{
1000 struct GNUNET_GTK_MainWindowContext *ctx = user_data; 1027 struct GNUNET_GTK_MainWindowContext *ctx = user_data;
@@ -1005,6 +1032,7 @@ ns_manager_deleted (GtkWindow *object, gpointer user_data)
1005 return; 1032 return;
1006} 1033}
1007 1034
1035
1008void 1036void
1009GNUNET_GTK_open_ns_manager (struct GNUNET_GTK_MainWindowContext *ctx) 1037GNUNET_GTK_open_ns_manager (struct GNUNET_GTK_MainWindowContext *ctx)
1010{ 1038{
@@ -1022,6 +1050,7 @@ GNUNET_GTK_open_ns_manager (struct GNUNET_GTK_MainWindowContext *ctx)
1022 ctx->ns_manager_delete_handler_id = g_signal_connect (G_OBJECT (ctx->ns_manager), "destroy", G_CALLBACK (ns_manager_deleted), ctx); 1050 ctx->ns_manager_delete_handler_id = g_signal_connect (G_OBJECT (ctx->ns_manager), "destroy", G_CALLBACK (ns_manager_deleted), ctx);
1023} 1051}
1024 1052
1053
1025void 1054void
1026GNUNET_GTK_main_menu_file_manage_pseudonyms_activate_cb (GtkMenuItem *menuitem, 1055GNUNET_GTK_main_menu_file_manage_pseudonyms_activate_cb (GtkMenuItem *menuitem,
1027 gpointer user_data) 1056 gpointer user_data)
@@ -1029,6 +1058,7 @@ GNUNET_GTK_main_menu_file_manage_pseudonyms_activate_cb (GtkMenuItem *menuitem,
1029 GNUNET_GTK_open_ns_manager (user_data); 1058 GNUNET_GTK_open_ns_manager (user_data);
1030} 1059}
1031 1060
1061
1032void 1062void
1033namespace_selector_manage_namespaces_button_clicked_cb (GtkButton *button, gpointer user_data) 1063namespace_selector_manage_namespaces_button_clicked_cb (GtkButton *button, gpointer user_data)
1034{ 1064{
diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c b/src/fs/gnunet-fs-gtk_publish-dialog.c
index 14a855ea..975db8c0 100644
--- a/src/fs/gnunet-fs-gtk_publish-dialog.c
+++ b/src/fs/gnunet-fs-gtk_publish-dialog.c
@@ -1,10 +1,10 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 (C) 2005, 2006, 2010, 2012 Christian Grothoff (and other contributing authors) 3 (C) 2005-2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
@@ -27,6 +27,8 @@
27#include "gnunet-fs-gtk_publish-edit-dialog.h" 27#include "gnunet-fs-gtk_publish-edit-dialog.h"
28#include <gnunet/gnunet_util_lib.h> 28#include <gnunet/gnunet_util_lib.h>
29#include <gnunet/gnunet_fs_service.h> 29#include <gnunet/gnunet_fs_service.h>
30#include <gnunet/gnunet_identity_service.h>
31
30 32
31#define MARKER_DIR_FILE_SIZE "-" 33#define MARKER_DIR_FILE_SIZE "-"
32 34
@@ -246,7 +248,7 @@ struct MainPublishingDialogContext
246 /** 248 /**
247 * Default namespace. May be NULL. 249 * Default namespace. May be NULL.
248 */ 250 */
249 struct GNUNET_FS_Namespace *ns; 251 struct GNUNET_IDENTITY_Ego *ns;
250 252
251 /** 253 /**
252 * Stores the value that was in identifier_entry previously. 254 * Stores the value that was in identifier_entry previously.
@@ -390,13 +392,13 @@ struct AddDirClientContext
390}; 392};
391 393
392 394
393static void clear_keywords_from_tm (struct MainPublishingDialogContext *ctx); 395static void
396clear_keywords_from_tm (struct MainPublishingDialogContext *ctx);
394 397
395 398
396/* ************************ editing operations inside the master dialog ********************* */ 399/* ************************ editing operations inside the master dialog ********************* */
397 400
398 401
399
400/** 402/**
401 * Check if two GtkTreeIters refer to the same element. 403 * Check if two GtkTreeIters refer to the same element.
402 * 404 *
@@ -406,9 +408,9 @@ static void clear_keywords_from_tm (struct MainPublishingDialogContext *ctx);
406 * @return GNUNET_YES if they are equal 408 * @return GNUNET_YES if they are equal
407 */ 409 */
408static int 410static int
409gtk_tree_iter_equals (GtkTreeModel * tm, 411gtk_tree_iter_equals (GtkTreeModel *tm,
410 GtkTreeIter * i1, 412 GtkTreeIter *i1,
411 GtkTreeIter * i2) 413 GtkTreeIter *i2)
412{ 414{
413 GtkTreePath *p1; 415 GtkTreePath *p1;
414 GtkTreePath *p2; 416 GtkTreePath *p2;
@@ -2041,8 +2043,6 @@ close_master_publish_dialog (struct MainPublishingDialogContext *ctx)
2041 gtk_widget_destroy (GTK_WIDGET (ctx->master_pubdialog)); 2043 gtk_widget_destroy (GTK_WIDGET (ctx->master_pubdialog));
2042 g_object_unref (G_OBJECT (ctx->builder)); 2044 g_object_unref (G_OBJECT (ctx->builder));
2043 GNUNET_free_non_null (ctx->ns_name); 2045 GNUNET_free_non_null (ctx->ns_name);
2044 if (ctx->ns)
2045 GNUNET_FS_namespace_delete (ctx->ns, GNUNET_NO);
2046 g_free (ctx->previous_id); 2046 g_free (ctx->previous_id);
2047 GNUNET_free (ctx); 2047 GNUNET_free (ctx);
2048 return GNUNET_YES; 2048 return GNUNET_YES;
@@ -2073,17 +2073,12 @@ insert_advertisement (void *cls, struct GNUNET_FS_FileInformation *fi,
2073 void **client_info) 2073 void **client_info)
2074{ 2074{
2075 struct MainPublishingDialogContext *ctx = cls; 2075 struct MainPublishingDialogContext *ctx = cls;
2076 2076 struct GNUNET_CRYPTO_EccPublicKey pub;
2077 struct GNUNET_FS_Uri *sks_uri; 2077 struct GNUNET_FS_Uri *sks_uri;
2078 char *emsg;
2079 char *sks_uri_string; 2078 char *sks_uri_string;
2080 2079
2081 emsg = NULL; 2080 GNUNET_IDENTITY_ego_get_public_key (ctx->ns, &pub);
2082 sks_uri = GNUNET_FS_uri_sks_create (ctx->ns, "/", &emsg); 2081 sks_uri = GNUNET_FS_uri_sks_create (&pub, "/");
2083 GNUNET_free_non_null (emsg);
2084 if (NULL == sks_uri)
2085 return GNUNET_SYSERR;
2086
2087 sks_uri_string = GNUNET_FS_uri_to_string (sks_uri); 2082 sks_uri_string = GNUNET_FS_uri_to_string (sks_uri);
2088 GNUNET_FS_uri_destroy (sks_uri); 2083 GNUNET_FS_uri_destroy (sks_uri);
2089 if (NULL == sks_uri_string) 2084 if (NULL == sks_uri_string)
@@ -2110,7 +2105,7 @@ GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton * button,
2110{ 2105{
2111 struct MainPublishingDialogContext *ctx = user_data; 2106 struct MainPublishingDialogContext *ctx = user_data;
2112 gchar *namespace_id; 2107 gchar *namespace_id;
2113 struct GNUNET_FS_Namespace *ns; 2108 struct GNUNET_IDENTITY_Ego *ns;
2114 const gchar *namespace_uid; 2109 const gchar *namespace_uid;
2115 struct GNUNET_FS_FileInformation *fi; 2110 struct GNUNET_FS_FileInformation *fi;
2116 GtkTreeIter iter; 2111 GtkTreeIter iter;
@@ -2144,7 +2139,8 @@ GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton * button,
2144 if (NULL != (id_entry_text = gtk_entry_get_text (GTK_ENTRY (ctx->identifier_entry)))) 2139 if (NULL != (id_entry_text = gtk_entry_get_text (GTK_ENTRY (ctx->identifier_entry))))
2145 namespace_id = g_strdup (id_entry_text); 2140 namespace_id = g_strdup (id_entry_text);
2146 else if (!do_global) 2141 else if (!do_global)
2147 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Global publication is disabled, but namespace_id is not available\n"); 2142 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2143 "Global publication is disabled, but namespace_id is not available\n");
2148 if ((NULL != namespace_id) && ('\0' == namespace_id[0])) 2144 if ((NULL != namespace_id) && ('\0' == namespace_id[0]))
2149 { 2145 {
2150 g_free (namespace_id); 2146 g_free (namespace_id);
@@ -2158,10 +2154,12 @@ GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton * button,
2158 ns = ctx->ns; 2154 ns = ctx->ns;
2159 } 2155 }
2160 else if (!do_global) 2156 else if (!do_global)
2161 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Global publication is disabled, but namespace_id unavailable or zero-length\n"); 2157 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2158 "Global publication is disabled, but namespace_id unavailable or zero-length\n");
2162 } 2159 }
2163 else if (!do_global) 2160 else if (!do_global)
2164 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Global publication is disabled, ns is either NULL or disabled, yet 'Execute' was pressed\n"); 2161 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2162 "Global publication is disabled, ns is either NULL or disabled, yet 'Execute' was pressed\n");
2165 if ((!do_global) && (NULL == ns)) 2163 if ((!do_global) && (NULL == ns))
2166 { 2164 {
2167 g_free (namespace_id); 2165 g_free (namespace_id);
@@ -2179,7 +2177,8 @@ GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton * button,
2179 GNUNET_FS_file_information_inspect (fi, insert_advertisement, ctx); 2177 GNUNET_FS_file_information_inspect (fi, insert_advertisement, ctx);
2180 /* FIXME-FEATURE-BUG-MINOR: should we convert namespace id and uid from UTF8? */ 2178 /* FIXME-FEATURE-BUG-MINOR: should we convert namespace id and uid from UTF8? */
2181 GNUNET_FS_publish_start (GNUNET_FS_GTK_get_fs_handle (), 2179 GNUNET_FS_publish_start (GNUNET_FS_GTK_get_fs_handle (),
2182 fi, ns, 2180 fi,
2181 GNUNET_IDENTITY_ego_get_private_key (ns),
2183 namespace_id, namespace_uid, 2182 namespace_id, namespace_uid,
2184 GNUNET_FS_PUBLISH_OPTION_NONE); 2183 GNUNET_FS_PUBLISH_OPTION_NONE);
2185 } 2184 }
@@ -2384,7 +2383,7 @@ struct UpdateableContext
2384 /** 2383 /**
2385 * Handle to the namespace. 2384 * Handle to the namespace.
2386 */ 2385 */
2387 struct GNUNET_FS_Namespace *ns; 2386 struct GNUNET_IDENTITY_Ego *ns;
2388 2387
2389 /** 2388 /**
2390 * Hash codes of identifiers already added to tree store. 2389 * Hash codes of identifiers already added to tree store.
@@ -2531,7 +2530,10 @@ add_updateable_to_ts (void *cls, const char *last_id,
2531 sc.ns = uc->ns; 2530 sc.ns = uc->ns;
2532 sc.seen = uc->seen; 2531 sc.seen = uc->seen;
2533 sc.update_called = GNUNET_NO; 2532 sc.update_called = GNUNET_NO;
2534 GNUNET_FS_namespace_list_updateable (uc->ns, next_id, &add_updateable_to_ts, 2533 GNUNET_FS_namespace_list_updateable (GNUNET_FS_GTK_get_fs_handle (),
2534 GNUNET_IDENTITY_ego_get_private_key (uc->ns),
2535 next_id,
2536 &add_updateable_to_ts,
2535 &sc); 2537 &sc);
2536 if ((sc.update_called == GNUNET_NO) && (next_id != NULL) && 2538 if ((sc.update_called == GNUNET_NO) && (next_id != NULL) &&
2537 (strlen (next_id) > 0)) 2539 (strlen (next_id) > 0))
@@ -2560,12 +2562,15 @@ add_updateable_to_ts (void *cls, const char *last_id,
2560 * @return GNUNET_YES, always. 2562 * @return GNUNET_YES, always.
2561 */ 2563 */
2562static int 2564static int
2563free_seen_paths (void *cls, const struct GNUNET_HashCode * key, void *value) 2565free_seen_paths (void *cls,
2566 const struct GNUNET_HashCode *key,
2567 void *value)
2564{ 2568{
2565 GNUNET_free_non_null (value); 2569 GNUNET_free_non_null (value);
2566 return GNUNET_YES; 2570 return GNUNET_YES;
2567} 2571}
2568 2572
2573
2569/** 2574/**
2570 * Add all updateable entries of the current namespace to the 2575 * Add all updateable entries of the current namespace to the
2571 * tree store. 2576 * tree store.
@@ -2575,7 +2580,8 @@ free_seen_paths (void *cls, const struct GNUNET_HashCode * key, void *value)
2575 * @param id identity of the namespace to add 2580 * @param id identity of the namespace to add
2576 */ 2581 */
2577static void 2582static void
2578add_namespace_to_ts (GtkTreeStore *ts, struct GNUNET_FS_Namespace *ns) 2583add_namespace_to_ts (GtkTreeStore *ts,
2584 struct GNUNET_IDENTITY_Ego *ns)
2579{ 2585{
2580 struct UpdateableContext uc; 2586 struct UpdateableContext uc;
2581 2587
@@ -2584,13 +2590,15 @@ add_namespace_to_ts (GtkTreeStore *ts, struct GNUNET_FS_Namespace *ns)
2584 uc.ns = ns; 2590 uc.ns = ns;
2585 uc.update_called = GNUNET_NO; 2591 uc.update_called = GNUNET_NO;
2586 uc.seen = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); 2592 uc.seen = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO);
2587 GNUNET_FS_namespace_list_updateable (uc.ns, NULL, &add_updateable_to_ts, &uc); 2593 GNUNET_FS_namespace_list_updateable (GNUNET_FS_GTK_get_fs_handle (),
2594 GNUNET_IDENTITY_ego_get_private_key (uc.ns),
2595 NULL,
2596 &add_updateable_to_ts, &uc);
2588 GNUNET_CONTAINER_multihashmap_iterate (uc.seen, free_seen_paths, NULL); 2597 GNUNET_CONTAINER_multihashmap_iterate (uc.seen, free_seen_paths, NULL);
2589 GNUNET_CONTAINER_multihashmap_destroy (uc.seen); 2598 GNUNET_CONTAINER_multihashmap_destroy (uc.seen);
2590} 2599}
2591 2600
2592 2601
2593
2594/** 2602/**
2595 * Run the file-publishing operation (by opening the master publishing dialog). 2603 * Run the file-publishing operation (by opening the master publishing dialog).
2596 * 2604 *
@@ -2598,7 +2606,8 @@ add_namespace_to_ts (GtkTreeStore *ts, struct GNUNET_FS_Namespace *ns)
2598 * @param user_data builder of the main window 2606 * @param user_data builder of the main window
2599 */ 2607 */
2600void 2608void
2601GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget * dummy, gpointer user_data) 2609GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget * dummy,
2610 gpointer user_data)
2602{ 2611{
2603 struct MainPublishingDialogContext *ctx; 2612 struct MainPublishingDialogContext *ctx;
2604/* GtkTreeView *pseudonym_treeview;*/ 2613/* GtkTreeView *pseudonym_treeview;*/
@@ -2608,9 +2617,9 @@ GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget * dummy, gpointer user_
2608 int own_enabled; 2617 int own_enabled;
2609 int global_enabled; 2618 int global_enabled;
2610 2619
2611 ctx = GNUNET_malloc (sizeof (struct MainPublishingDialogContext)); 2620 ctx = GNUNET_new (struct MainPublishingDialogContext);
2612 ctx->builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_dialog.glade", ctx); 2621 ctx->builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_dialog.glade", ctx);
2613 if (ctx->builder == NULL) 2622 if (NULL == ctx->builder)
2614 { 2623 {
2615 GNUNET_break (0); 2624 GNUNET_break (0);
2616 GNUNET_free (ctx); 2625 GNUNET_free (ctx);
@@ -2678,16 +2687,21 @@ GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget * dummy, gpointer user_
2678 G_CALLBACK (identifiers_selection_changed_cb), ctx); 2687 G_CALLBACK (identifiers_selection_changed_cb), ctx);
2679 2688
2680 cfg = GNUNET_FS_GTK_get_configuration (); 2689 cfg = GNUNET_FS_GTK_get_configuration ();
2681 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, 2690#if FIXME_MIGRATE_TO_IDENTITY_SERVICE
2682 "gnunet-fs-gtk", "DEFAULT_NAMESPACE", &ctx->ns_name)) 2691 if (GNUNET_OK !=
2692 GNUNET_CONFIGURATION_get_value_string (cfg,
2693 "gnunet-fs-gtk",
2694 "DEFAULT_NAMESPACE",
2695 &ctx->ns_name))
2683 ctx->ns_name = NULL; 2696 ctx->ns_name = NULL;
2684 else 2697 else
2685 { 2698 {
2686 ctx->ns = GNUNET_FS_namespace_open_existing (GNUNET_FS_GTK_get_fs_handle (), ctx->ns_name); 2699 ctx->ns = GNUNET_FS_namespace_open_existing (GNUNET_FS_GTK_get_fs_handle (),
2700 ctx->ns_name);
2687 if (NULL == ctx->ns) 2701 if (NULL == ctx->ns)
2688 GNUNET_free (ctx->ns_name); 2702 GNUNET_free (ctx->ns_name);
2689 } 2703 }
2690 2704#endif
2691 have_ns = (NULL != ctx->ns); 2705 have_ns = (NULL != ctx->ns);
2692 2706
2693 gtk_widget_set_sensitive (ctx->own_checkbox, have_ns); 2707 gtk_widget_set_sensitive (ctx->own_checkbox, have_ns);
diff --git a/src/fs/gnunet-fs-gtk_create-pseudonym.c b/src/identity/gnunet-identity-gtk_create_ego.c
index e88c617c..e88c617c 100644
--- a/src/fs/gnunet-fs-gtk_create-pseudonym.c
+++ b/src/identity/gnunet-identity-gtk_create_ego.c
diff --git a/src/fs/gnunet-fs-gtk_namespace_organizer.c b/src/identity/gnunet-identity-gtk_ego_organizer.c
index 2cf7db65..2cf7db65 100644
--- a/src/fs/gnunet-fs-gtk_namespace_organizer.c
+++ b/src/identity/gnunet-identity-gtk_ego_organizer.c
diff --git a/src/fs/gnunet-fs-gtk_namespace_organizer.h b/src/identity/gnunet-identity-gtk_ego_organizer.h
index 72392f7d..72392f7d 100644
--- a/src/fs/gnunet-fs-gtk_namespace_organizer.h
+++ b/src/identity/gnunet-identity-gtk_ego_organizer.h