[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r26330 - in gnunet-gtk: contrib src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r26330 - in gnunet-gtk: contrib src/fs |
Date: |
Wed, 6 Mar 2013 09:22:36 +0100 |
Author: LRN
Date: 2013-03-06 09:22:36 +0100 (Wed, 06 Mar 2013)
New Revision: 26330
Modified:
gnunet-gtk/contrib/gnunet_fs_gtk_namespace_organizer.glade
gnunet-gtk/src/fs/gnunet-fs-gtk.c
gnunet-gtk/src/fs/gnunet-fs-gtk.h
gnunet-gtk/src/fs/gnunet-fs-gtk_advertise-pseudonym.c
gnunet-gtk/src/fs/gnunet-fs-gtk_common.c
gnunet-gtk/src/fs/gnunet-fs-gtk_create-pseudonym.c
gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c
gnunet-gtk/src/fs/gnunet-fs-gtk_namespace_manager.c
gnunet-gtk/src/fs/gnunet-fs-gtk_namespace_organizer.c
gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c
Log:
Update to latest FS and pseudonym API changes
Modified: gnunet-gtk/contrib/gnunet_fs_gtk_namespace_organizer.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_fs_gtk_namespace_organizer.glade 2013-03-06
08:22:29 UTC (rev 26329)
+++ gnunet-gtk/contrib/gnunet_fs_gtk_namespace_organizer.glade 2013-03-06
08:22:36 UTC (rev 26330)
@@ -135,46 +135,36 @@
<property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
- <object class="GtkButton"
id="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_unconfirmation_button">
- <property name="label" translatable="yes">No, keep
it.</property>
+ <object class="GtkButton"
id="GNUNET_GTK_namespace_organizer_namespaces_create_namespace_button">
+ <property name="label" translatable="yes">Create</property>
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <signal name="clicked"
handler="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_unconfirmation_button_clicked_cb"
swapped="no"/>
+ <property name="tooltip_text" translatable="yes">Generate new
namespace.</property>
+ <signal name="clicked"
handler="GNUNET_GTK_namespace_organizer_namespaces_create_namespace_button_clicked_cb"
swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkButton"
id="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_confirmation_button">
- <property name="label" translatable="yes">Yes, delete
it!</property>
+ <object class="GtkButton"
id="GNUNET_GTK_namespace_organizer_namespaces_advertise_namespace_button">
+ <property name="label" translatable="yes">Advertise</property>
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <signal name="clicked"
handler="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_confirmation_button_clicked_cb"
swapped="no"/>
+ <property name="tooltip_text" translatable="yes">Make
namespace findable with global file-sharing searches.</property>
+ <signal name="clicked"
handler="GNUNET_GTK_namespace_organizer_namespaces_advertise_namespace_button_clicked_cb"
swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel"
id="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_confirmation_label">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Are you sure? Once
you delete the private key of a namespace, it's lost forever!</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
<object class="GtkButton"
id="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_button">
<property name="label" translatable="yes">Delete</property>
<property name="visible">True</property>
@@ -187,62 +177,49 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">3</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <object class="GtkButton"
id="GNUNET_GTK_namespace_organizer_namespaces_create_namespace_button">
- <property name="label" translatable="yes">Create</property>
- <property name="visible">True</property>
+ <object class="GtkButton"
id="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_confirmation_button">
+ <property name="label" translatable="yes">Yes, delete
it!</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Generate new
namespace.</property>
- <signal name="clicked"
handler="GNUNET_GTK_namespace_organizer_namespaces_create_namespace_button_clicked_cb"
swapped="no"/>
+ <signal name="clicked"
handler="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_confirmation_button_clicked_cb"
swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="pack_type">end</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
- <object class="GtkButton"
id="GNUNET_GTK_namespace_organizer_namespaces_advertise_namespace_button">
- <property name="label" translatable="yes">Advertise</property>
- <property name="visible">True</property>
+ <object class="GtkButton"
id="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_unconfirmation_button">
+ <property name="label" translatable="yes">No, keep
it.</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Make
namespace findable with global file-sharing searches.</property>
- <signal name="clicked"
handler="GNUNET_GTK_namespace_organizer_namespaces_advertise_namespace_button_clicked_cb"
swapped="no"/>
+ <signal name="clicked"
handler="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_unconfirmation_button_clicked_cb"
swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="pack_type">end</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
- <object class="GtkLabel"
id="GNUNET_GTK_namespace_organizer_namespaces_create_namespace_progress_label">
+ <object class="GtkLabel"
id="GNUNET_GTK_namespace_organizer_namespaces_delete_namespace_confirmation_label">
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Generating new
namespace key...</property>
+ <property name="label" translatable="yes">Are you sure? Once
you delete the private key of a namespace, it's lost forever!</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">6</property>
+ <property name="pack_type">end</property>
+ <property name="position">5</property>
</packing>
</child>
- <child>
- <object class="GtkSpinner"
id="GNUNET_GTK_namespace_organizer_namespaces_create_namespace_progress_spinner">
- <property name="can_focus">False</property>
- <property name="active">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">7</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk.c 2013-03-06 08:22:29 UTC (rev 26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk.c 2013-03-06 08:22:36 UTC (rev 26330)
@@ -412,7 +412,7 @@
main_context.preview_image = GTK_IMAGE (GNUNET_FS_GTK_get_main_window_object
("GNUNET_GTK_main_window_preview_image"));
main_context.md_liststore = GTK_LIST_STORE
(GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_meta_data_list_store"));
main_context.md_treeview = GTK_TREE_VIEW
(GNUNET_FS_GTK_get_main_window_object
("GNUNET_GTK_main_window_metadata_treeview"));
- main_context.ns_callback_registered = GNUNET_NO;
+ main_context.ns_discovery_handle = NULL;
main_context.download_location_chooser = GTK_FILE_CHOOSER
(GNUNET_FS_GTK_get_main_window_object
("GNUNET_GTK_search_frame_download_location_chooser"));
main_context.download_name_entry = GTK_ENTRY
(GNUNET_FS_GTK_get_main_window_object
("GNUNET_GTK_search_frame_download_filename_entry"));
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk.h
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk.h 2013-03-06 08:22:29 UTC (rev 26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk.h 2013-03-06 08:22:36 UTC (rev 26330)
@@ -55,7 +55,7 @@
GtkTreeRowReference *ns_selector_pushed_row;
GtkTreeRowReference *selected_ns_row;
- int ns_callback_registered;
+ struct GNUNET_PSEUDONYM_DiscoveryHandle *ns_discovery_handle;
GtkWindow *ns_manager;
gulong ns_manager_delete_handler_id;
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_advertise-pseudonym.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_advertise-pseudonym.c 2013-03-06
08:22:29 UTC (rev 26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_advertise-pseudonym.c 2013-03-06
08:22:36 UTC (rev 26330)
@@ -97,12 +97,16 @@
void **client_info)
{
struct NamespaceAdvertisementContext *nds = cls;
+ struct GNUNET_FS_Uri *sks_uri;
+ char *emsg;
- GNUNET_FS_namespace_advertise (GNUNET_FS_GTK_get_fs_handle (),
- *uri,
- nds->ns,
- meta, bo, nds->root,
- NULL, NULL);
+ emsg = NULL;
+ sks_uri = GNUNET_FS_uri_sks_create (nds->ns, nds->root, &emsg);
+ GNUNET_assert (NULL == emsg);
+ GNUNET_FS_publish_ksk (GNUNET_FS_GTK_get_fs_handle (),
+ *uri, meta, sks_uri,
+ bo, GNUNET_FS_PUBLISH_OPTION_NONE, NULL, NULL);
+ GNUNET_FS_uri_destroy (sks_uri);
return GNUNET_SYSERR;
}
@@ -134,65 +138,7 @@
}
-/**
- * Function called from the pseudonym selection dialog upon completion.
- *
- * @param dialog the pseudonym selection dialog
- * @param response_id response code from the dialog
- * @param user_data the builder of the dialog
- */
-void
-GNUNET_GTK_select_pseudonym_dialog_response_cb (GtkDialog * dialog,
- gint response_id,
- gpointer user_data)
-{
- GtkBuilder *builder = GTK_BUILDER (user_data);
- GtkTreeView *tv;
- GtkTreeSelection *sel;
- GtkTreeModel *tm;
- GtkTreeIter iter;
- struct GNUNET_FS_Namespace *ns;
- struct GNUNET_FS_Namespace *nso;
- GtkWindow *transient;
- if (GTK_RESPONSE_OK != response_id)
- {
- gtk_widget_destroy (GTK_WIDGET (dialog));
- g_object_unref (G_OBJECT (builder));
- return;
- }
- tv = GTK_TREE_VIEW (gtk_builder_get_object
- (builder, "GNUNET_GTK_select_pseudonym_tree_view"));
- sel = gtk_tree_view_get_selection (tv);
- if (! gtk_tree_selection_get_selected (sel, &tm, &iter))
- {
- GNUNET_break (0);
- gtk_widget_destroy (GTK_WIDGET (dialog));
- g_object_unref (G_OBJECT (builder));
- return;
- }
- gtk_tree_model_get (tm, &iter,
- FS_SELECT_PSEUDONYM_NAMESPACE_MC_HANDLE, &ns, -1);
- /* free all namespaces from list store except "ns" */
- if (gtk_tree_model_get_iter_first (tm, &iter))
- {
- do
- {
- gtk_tree_model_get (tm, &iter,
- FS_SELECT_PSEUDONYM_NAMESPACE_MC_HANDLE, &nso, -1);
- if (ns != nso)
- GNUNET_FS_namespace_delete (nso, GNUNET_NO);
- }
- while (gtk_tree_model_iter_next (tm, &iter));
- }
- transient = gtk_window_get_transient_for (GTK_WINDOW (dialog));
-
- gtk_widget_destroy (GTK_WIDGET (dialog));
- g_object_unref (G_OBJECT (builder));
-
- GNUNET_FS_GTK_advertise_namespace (ns, transient);
-}
-
/**
* Call the publication editor dialog in namespace advertising mode,
* and publish the namespace when it's OK'ed.
@@ -227,148 +173,4 @@
}
-/**
- * User deleted 'select pseudonym' dialog. Clean up.
- *
- * @param widget the dialog
- * @param event the destroying event
- * @param user_data the builder of the dialog
- * @return FALSE (allow destruction)
- */
-gboolean
-GNUNET_GTK_select_pseudonym_dialog_delete_event_cb (GtkWidget *widget,
- GdkEvent *event,
- gpointer user_data)
-{
- GtkBuilder *builder = GTK_BUILDER (user_data);
- GtkTreeModel *tm;
- GtkTreeIter iter;
-
- tm = GTK_TREE_MODEL (gtk_builder_get_object (builder,
-
"GNUNET_GTK_select_pseudonym_liststore"));
- if (gtk_tree_model_get_iter_first (tm, &iter))
- {
- do
- {
- struct GNUNET_FS_Namespace *nso;
-
- gtk_tree_model_get (tm, &iter,
- FS_SELECT_PSEUDONYM_NAMESPACE_MC_HANDLE, &nso, -1);
- GNUNET_FS_namespace_delete (nso, GNUNET_NO);
- }
- while (gtk_tree_model_iter_next (tm, &iter));
- }
- g_object_unref (G_OBJECT (builder));
- return FALSE;
-}
-
-
-
-/* *************************** code to create the dialog
********************** */
-
-
-
-/**
- * Callback with information about local (!) namespaces.
- * Contains the names of the local namespace and the global
- * ID. Adds the to the list store.
- *
- * @param cls closure, the list store.
- * @param name human-readable identifier of the namespace
- * @param id hash identifier for the namespace
- */
-static void
-add_to_list (void *cls,
- const char *name,
- const struct GNUNET_HashCode * id)
-{
- GtkListStore *ls = cls;
- GtkTreeIter iter;
- struct GNUNET_FS_Namespace *ns;
-
- ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (),
- name);
- if (NULL == ns)
- {
- GNUNET_break (0);
- return;
- }
- gtk_list_store_insert_with_values (ls, &iter, -1,
- FS_SELECT_PSEUDONYM_NAMESPACE_MC_NAME,
- name,
- FS_SELECT_PSEUDONYM_NAMESPACE_MC_HANDLE,
- ns,
- -1);
-}
-
-
-/**
- * Selection of the pseudonym changed, update the sensitivity
- * of the buttons.
- *
- * @param ts the selection instance
- * @param user_data the builder of the selection dialog
- */
-static void
-selection_changed_cb (GtkTreeSelection * ts, gpointer user_data)
-{
- GtkBuilder *builder = GTK_BUILDER (user_data);
- GtkTreeIter iter;
- GtkWidget *ok_button;
-
- ok_button =
- GTK_WIDGET (gtk_builder_get_object
- (builder, "GNUNET_GTK_select_pseudonym_ok_button"));
- if (gtk_tree_selection_get_selected (ts, NULL, &iter))
- gtk_widget_set_sensitive (ok_button, TRUE);
- else
- gtk_widget_set_sensitive (ok_button, FALSE);
-}
-
-
-/**
- * Advertise pseudonym selected in the menu.
- *
- * @param dummy the menu item
- * @param user_data the builder of the main window, unused
- */
-void
-GNUNET_GTK_main_menu_file_advertise_pseudonym_activate_cb (GtkWidget * dummy,
- gpointer user_data)
-{
- GtkWidget *ad;
- GtkListStore *ls;
- GtkWidget *toplevel;
- GtkTreeView *tv;
- GtkTreeSelection *sel;
- GtkBuilder *builder;
-
- builder = GNUNET_GTK_get_new_builder
("gnunet_fs_gtk_select_pseudonym_dialog.glade", NULL);
- if (NULL == builder)
- {
- GNUNET_break (0);
- return;
- }
- ad = GTK_WIDGET (gtk_builder_get_object
- (builder, "GNUNET_GTK_select_pseudonym_dialog"));
- ls = GTK_LIST_STORE (gtk_builder_get_object
- (builder, "GNUNET_GTK_select_pseudonym_liststore"));
- GNUNET_FS_namespace_list (GNUNET_FS_GTK_get_fs_handle (),
- &add_to_list,
- ls);
-
- /* FIXME-GTK3: this signal can be connected by (modern) Glade automatically
*/
- tv = GTK_TREE_VIEW (gtk_builder_get_object
- (builder, "GNUNET_GTK_select_pseudonym_tree_view"));
- sel = gtk_tree_view_get_selection (tv);
- g_signal_connect (G_OBJECT (sel), "changed",
- G_CALLBACK (selection_changed_cb), builder);
-
- toplevel = gtk_widget_get_toplevel (dummy);
- if (GTK_IS_WINDOW (toplevel))
- gtk_window_set_transient_for (GTK_WINDOW (ad), GTK_WINDOW (toplevel));
- gtk_window_present (GTK_WINDOW (ad));
-}
-
-
/* end of gnunet-fs-gtk_advertise-pseudonym.c */
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_common.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_common.c 2013-03-06 08:22:29 UTC (rev
26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_common.c 2013-03-06 08:22:36 UTC (rev
26330)
@@ -322,8 +322,8 @@
GtkLabel *sel_namespace_label;
GtkTreePath *treepath;
GtkEntry *query_entry;
- struct GNUNET_HashCode *nsid;
- struct GNUNET_HashCode want;
+ struct GNUNET_PseudonymIdentifier *nsid;
+ struct GNUNET_PseudonymIdentifier want;
if (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri))
{
@@ -366,7 +366,7 @@
while ( ( (NULL == nsid) ||
(0 != memcmp (nsid,
&want,
- sizeof (struct GNUNET_HashCode))) ) &&
+ sizeof (struct GNUNET_PseudonymIdentifier))) ) &&
(gtk_tree_model_iter_next (namespace_treestore, &iter)) )
gtk_tree_model_get (namespace_treestore, &iter,
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY,
@@ -375,7 +375,7 @@
if ( (NULL == nsid) ||
(0 != memcmp (nsid,
&want,
- sizeof (struct GNUNET_HashCode))) )
+ sizeof (struct GNUNET_PseudonymIdentifier))) )
{
/* namespace unknown / not in list!? */
GNUNET_break (0);
@@ -448,9 +448,9 @@
*/
static int
find_largest_namespace_rating_iterator (void *cls,
- const struct GNUNET_HashCode *pseudonym, const char *name,
+ const struct GNUNET_PseudonymIdentifier *pseudonym, const char *name,
const char *unique_name,
- const struct GNUNET_CONTAINER_MetaData *md, int rating)
+ const struct GNUNET_CONTAINER_MetaData *md, int32_t rating)
{
int *largest = cls;
if (*largest < rating)
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_create-pseudonym.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_create-pseudonym.c 2013-03-06 08:22:29 UTC
(rev 26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_create-pseudonym.c 2013-03-06 08:22:36 UTC
(rev 26330)
@@ -79,7 +79,6 @@
}
name = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder,
"GNUNET_GTK_create_namespace_name_entry")));
- /* FIXME-FEATURE: show busy dialog while doing key creation */
if (NULL != name)
{
ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name);
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c 2013-03-06 08:22:29 UTC
(rev 26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c 2013-03-06 08:22:36 UTC
(rev 26330)
@@ -966,7 +966,7 @@
/* Called for each embedded sks. Return GNUNET_OK to continue iteration */
typedef int (*embedded_sks_callback) (void *cls, const struct GNUNET_FS_Uri
*sks_uri,
- const char *sks_uri_string, struct GNUNET_HashCode *nsid);
+ const char *sks_uri_string, struct GNUNET_PseudonymIdentifier *nsid);
struct sks_scanner_callback_context
{
@@ -1000,7 +1000,7 @@
char *id = GNUNET_FS_uri_sks_get_content_id (sks_uri);
if (NULL != id)
{
- struct GNUNET_HashCode nsid;
+ struct GNUNET_PseudonymIdentifier nsid;
if ((0 == strcmp (id, "/")) &&
(GNUNET_OK == GNUNET_FS_uri_sks_get_namespace (sks_uri, &nsid)))
result = ctx->cb (ctx->cls, sks_uri, data, &nsid);
@@ -1036,7 +1036,7 @@
*/
static int
populate_popup_with_sks_items (void *cls, const struct GNUNET_FS_Uri *sks_uri,
- const char *sks_uri_string, struct GNUNET_HashCode *nsid)
+ const char *sks_uri_string, struct GNUNET_PseudonymIdentifier *nsid)
{
struct sks_population_context *ctx = cls;
GtkWidget *child;
@@ -2135,7 +2135,7 @@
static int
see_if_there_are_any_sks_uris (void *cls, const struct GNUNET_FS_Uri *sks_uri,
- const char *sks_uri_string, struct GNUNET_HashCode *nsid)
+ const char *sks_uri_string, struct GNUNET_PseudonymIdentifier *nsid)
{
* ((gboolean *) cls) = TRUE;
return GNUNET_SYSERR;
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
2013-03-06 08:22:29 UTC (rev 26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c
2013-03-06 08:22:36 UTC (rev 26330)
@@ -292,14 +292,14 @@
* @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort
*/
static int
-add_namespace_to_ts (void *cls, const struct GNUNET_HashCode * pseudonym,
+add_namespace_to_ts (void *cls, const struct GNUNET_PseudonymIdentifier
*pseudonym,
const char *name, const char *unique_name,
const struct GNUNET_CONTAINER_MetaData *md, int rating)
{
GtkTreeStore *ts = cls;
char *root;
char *ns_name, *unique_ns_name;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
char *description;
int desc_is_a_dup;
char *uris;
@@ -315,7 +315,7 @@
unique_ns_name = GNUNET_PSEUDONYM_name_uniquify (
GNUNET_FS_GTK_get_configuration (), pseudonym, ns_name, NULL);
GNUNET_free (ns_name);
- nsid = GNUNET_malloc (sizeof (struct GNUNET_HashCode));
+ nsid = GNUNET_malloc (sizeof (struct GNUNET_PseudonymIdentifier));
*nsid = *pseudonym;
root = NULL;
uris = GNUNET_CONTAINER_meta_data_get_by_type (md, EXTRACTOR_METATYPE_URI);
@@ -350,7 +350,7 @@
{
GtkTreeIter iter;
GtkTreePath *treepath;
- struct GNUNET_HashCode *key = NULL, *selected_ns_id;
+ struct GNUNET_PseudonymIdentifier *key = NULL, *selected_ns_id;
gboolean found = FALSE;
gchar *value = NULL;
@@ -377,8 +377,8 @@
selected_ns_id = NULL;
if (key != NULL)
{
- selected_ns_id = GNUNET_malloc (sizeof (struct GNUNET_HashCode));
- memcpy (selected_ns_id, key, sizeof (struct GNUNET_HashCode));
+ selected_ns_id = GNUNET_malloc (sizeof (struct
GNUNET_PseudonymIdentifier));
+ memcpy (selected_ns_id, key, sizeof (struct GNUNET_PseudonymIdentifier));
}
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (
@@ -409,12 +409,10 @@
"Do not search in any particular
namespace",
-1);
- if (GNUNET_YES == main_ctx->ns_callback_registered)
- GNUNET_PSEUDONYM_discovery_callback_unregister (add_namespace_to_ts,
- main_ctx->search_ns_treestore);
- GNUNET_PSEUDONYM_discovery_callback_register (main_ctx->cfg,
+ if (NULL != main_ctx->ns_discovery_handle)
+ GNUNET_PSEUDONYM_discovery_callback_unregister
(main_ctx->ns_discovery_handle);
+ main_ctx->ns_discovery_handle = GNUNET_PSEUDONYM_discovery_callback_register
(main_ctx->cfg,
add_namespace_to_ts, main_ctx->search_ns_treestore);
- main_ctx->ns_callback_registered = GNUNET_YES;
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (
main_ctx->search_ns_treestore), &iter))
@@ -429,7 +427,7 @@
-1);
if (selected_ns_id == NULL)
found = TRUE;
- else if (key != NULL && memcmp (key, selected_ns_id, sizeof (struct
GNUNET_HashCode)) == 0)
+ else if (key != NULL && memcmp (key, selected_ns_id, sizeof (struct
GNUNET_PseudonymIdentifier)) == 0)
found = TRUE;
if (found || (TRUE != gtk_tree_model_iter_next (GTK_TREE_MODEL (
main_ctx->search_ns_treestore), &iter)))
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c 2013-03-06
08:22:29 UTC (rev 26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c 2013-03-06
08:22:36 UTC (rev 26330)
@@ -39,7 +39,7 @@
guint anonymity_level;
gchar *keywords;
gchar *mime_keyword;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
struct GNUNET_FS_Uri *uri;
/* get anonymity level */
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_namespace_manager.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_namespace_manager.c 2013-03-06 08:22:29 UTC
(rev 26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_namespace_manager.c 2013-03-06 08:22:36 UTC
(rev 26330)
@@ -200,7 +200,7 @@
{
struct GNUNET_GTK_NamespaceManagerContext *ctx = user_data;
GtkTreeIter iter;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
GtkTreeRowReference *order_row, *known_row;
struct GNUNET_CONTAINER_MetaData *md;
@@ -247,7 +247,7 @@
{
struct GNUNET_GTK_NamespaceManagerContext *ctx = user_data;
GtkTreeIter known_iter, order_iter;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
int32_t old_rank, new_rank;
GtkTreeRowReference *order_row, *known_row;
@@ -504,7 +504,7 @@
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (ctx->known_ns_store),
&iter, tree_path))
{
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
gtk_tree_model_get (GTK_TREE_MODEL (ctx->known_ns_store), &iter,
GNUNET_GTK_KNOWN_NAMESPACES_IDENTIFIER_BIN_COLUMN, &nsid,
GNUNET_GTK_KNOWN_NAMESPACES_ORDER_ROW_REFERENCE_COLUMN, &order_row,
@@ -599,21 +599,27 @@
* @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort
*/
static int
-populate_known_ns_list (void *cls, const struct GNUNET_HashCode *pseudonym,
+populate_known_ns_list (void *cls, const struct GNUNET_PseudonymIdentifier
*pseudonym,
const char *name, const char *unique_name,
const struct GNUNET_CONTAINER_MetaData *md, int rating)
{
struct GNUNET_GTK_NamespaceManagerContext *ctx = cls;
- struct GNUNET_HashCode *nsid;
- struct GNUNET_CRYPTO_HashAsciiEncoded identifier;
+ struct GNUNET_PseudonymIdentifier *nsid;
+ char buf[1024];
+ char *ret;
GtkTreeIter known_iter, order_iter;
struct GNUNET_CONTAINER_MetaData *md_copy;
char *non_null_name, *non_null_unique_name;
- nsid = GNUNET_malloc (sizeof (struct GNUNET_HashCode));
+ nsid = GNUNET_malloc (sizeof (struct GNUNET_PseudonymIdentifier));
*nsid = *pseudonym;
- GNUNET_CRYPTO_hash_to_enc (nsid, &identifier);
+ ret = GNUNET_STRINGS_data_to_string (nsid,
+ sizeof (struct
GNUNET_PseudonymIdentifier),
+ buf,
+ sizeof (buf));
+ GNUNET_assert (NULL != ret);
+ ret[0] = '\0';
GNUNET_PSEUDONYM_get_info (GNUNET_FS_GTK_get_configuration (),
nsid, NULL, NULL, &non_null_name, NULL);
@@ -626,7 +632,7 @@
GNUNET_GTK_KNOWN_NAMESPACES_IS_MINE_COLUMN, FALSE,
GNUNET_GTK_KNOWN_NAMESPACES_RANK_COLUMN, rating,
GNUNET_GTK_KNOWN_NAMESPACES_NAME_COLUMN, non_null_unique_name,
- GNUNET_GTK_KNOWN_NAMESPACES_IDENTIFIER_COLUMN, identifier.encoding,
+ GNUNET_GTK_KNOWN_NAMESPACES_IDENTIFIER_COLUMN, buf,
GNUNET_GTK_KNOWN_NAMESPACES_IDENTIFIER_BIN_COLUMN, nsid,
GNUNET_GTK_KNOWN_NAMESPACES_ORDER_ROW_REFERENCE_COLUMN, NULL,
GNUNET_GTK_KNOWN_NAMESPACES_METADATA_COLUMN, md_copy,
@@ -640,7 +646,7 @@
gtk_list_store_insert_with_values (ctx->ns_order_store, &order_iter,
G_MAXINT,
GNUNET_GTK_NAMESPACE_ORDER_RANK_COLUMN, rating,
GNUNET_GTK_NAMESPACE_ORDER_NAME_COLUMN, non_null_unique_name,
- GNUNET_GTK_NAMESPACE_ORDER_IDENTIFIER_COLUMN, identifier.encoding,
+ GNUNET_GTK_NAMESPACE_ORDER_IDENTIFIER_COLUMN, buf,
GNUNET_GTK_NAMESPACE_ORDER_IDENTIFIER_BIN_COLUMN, nsid,
GNUNET_GTK_NAMESPACE_ORDER_KNOWN_ROW_REFERENCE_COLUMN, rr,
-1);
@@ -661,7 +667,7 @@
GtkTreeIter iter;
gint i;
gint row_count;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
char *name;
int32_t rank;
struct GNUNET_CONTAINER_MetaData *md;
@@ -706,7 +712,7 @@
GtkTreeIter iter;
gint i;
gint row_count;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
GtkTreeRowReference *order_row;
struct GNUNET_CONTAINER_MetaData *md;
@@ -790,13 +796,13 @@
mark_as_mine (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
gpointer data)
{
- const struct GNUNET_HashCode *mine_id = data;
- const struct GNUNET_HashCode *ns_id;
+ const struct GNUNET_PseudonymIdentifier *mine_id = data;
+ const struct GNUNET_PseudonymIdentifier *ns_id;
gtk_tree_model_get (model, iter,
GNUNET_GTK_KNOWN_NAMESPACES_IDENTIFIER_BIN_COLUMN, &ns_id, -1);
- if (memcmp (ns_id, mine_id, sizeof (struct GNUNET_HashCode)) != 0)
+ if (memcmp (ns_id, mine_id, sizeof (struct GNUNET_PseudonymIdentifier)) != 0)
return FALSE;
gtk_list_store_set (GTK_LIST_STORE (model), iter,
@@ -815,7 +821,7 @@
*/
static void
mark_namespaces_as_mine (void *cls, const char *name,
- const struct GNUNET_HashCode * id)
+ const struct GNUNET_PseudonymIdentifier *id)
{
struct GNUNET_GTK_NamespaceManagerContext *ctx = cls;
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_namespace_organizer.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_namespace_organizer.c 2013-03-06
08:22:29 UTC (rev 26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_namespace_organizer.c 2013-03-06
08:22:36 UTC (rev 26330)
@@ -46,8 +46,6 @@
char *default_ns;
GtkTreeRowReference *default_ns_rref;
struct GNUNET_GTK_MainWindowContext *main_ctx;
-
- struct GNUNET_FS_NamespaceCreationContext *nscreator;
};
#define GNUNET_GTK_MY_NAMESPACES_NAME_COLUMN 0
@@ -58,8 +56,7 @@
/**
* User edited the name of a namespace.
- * Rename the namespace, or queue the rename operation until
- * key generation is finished for this namespace.
+ * Rename the namespace.
*
* @param renderer cell renderer
* @param path path to the cell that was edited (as a string)
@@ -84,7 +81,7 @@
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (ctx->my_ns_store),
&iter, tree_path))
{
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
char *old_name;
gtk_tree_model_get (GTK_TREE_MODEL (ctx->my_ns_store), &iter,
GNUNET_GTK_MY_NAMESPACES_NAME_COLUMN, &old_name,
@@ -106,63 +103,6 @@
}
/**
- * Iterate over items in the liststore, find the one that has
- * KEY_BINARY == NULL - that is the item for which the key is
- * being generated.
- * We need this because we don't store a rowreference to the item,
- * although maybe we should...
- *
- * @param ctx NS organizer context
- * @param iter pointer to GTK Tree iterator. If the call succeeds,
- * iter will refer to the item found.
- * @return TRUE if item is found (and *iter is valid), FALSE otherwise
- */
-static gboolean
-find_item_being_generated (struct GNUNET_GTK_NamespaceSelectorContext *ctx,
GtkTreeIter *iter)
-{
- gint row_count;
- struct GNUNET_HashCode *nsid;
-
- row_count = gtk_tree_model_iter_n_children (
- GTK_TREE_MODEL (ctx->my_ns_store), NULL);
-
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (
- ctx->my_ns_store), iter))
- {
- gint i;
- for (i = 0; i < row_count; i++)
- {
- gtk_tree_model_get (GTK_TREE_MODEL (ctx->my_ns_store), iter,
- GNUNET_GTK_MY_NAMESPACES_KEY_BINARY_COLUMN, &nsid,
- -1);
- if (nsid == NULL)
- return TRUE;
- if (TRUE != gtk_tree_model_iter_next (GTK_TREE_MODEL (
- ctx->my_ns_store), iter))
- break;
- }
- }
- return FALSE;
-}
-
-/**
- * Stops key generation.
- *
- * @param ctx NS organizer context
- */
-static void
-stop_generation (struct GNUNET_GTK_NamespaceSelectorContext *ctx)
-{
- GtkTreeIter iter;
- GNUNET_FS_namespace_create_stop (ctx->nscreator);
- ctx->nscreator = NULL;
- if (find_item_being_generated (ctx, &iter))
- gtk_list_store_remove (ctx->my_ns_store, &iter);
- gtk_widget_set_visible (ctx->progress_spinner, FALSE);
- gtk_widget_set_visible (ctx->progress_label, FALSE);
-}
-
-/**
* Frees contents of the namespace list (the nsid values that are stored as
* untyped pointers in the tree).
*
@@ -174,7 +114,7 @@
GtkTreeIter iter;
gint i;
gint row_count;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
row_count = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (
ctx->my_ns_store), NULL);
@@ -212,8 +152,6 @@
{
case GTK_RESPONSE_CLOSE:
default:
- if (ctx->nscreator)
- stop_generation (ctx);
free_lists_contents (ctx);
gtk_widget_destroy (GTK_WIDGET (ctx->namespace_organizer));
GNUNET_free (ctx);
@@ -325,19 +263,23 @@
*/
static void
populate_my_ns_list (void *cls, const char *name,
- const struct GNUNET_HashCode * id)
+ const struct GNUNET_PseudonymIdentifier *id)
{
struct GNUNET_GTK_NamespaceSelectorContext *ctx = cls;
- struct GNUNET_CRYPTO_HashAsciiEncoded identifier;
+ char buf[1024];
+ char *ret;
GtkTreeIter my_iter;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
gboolean is_default;
- nsid = GNUNET_malloc (sizeof (struct GNUNET_HashCode));
+ nsid = GNUNET_malloc (sizeof (struct GNUNET_PseudonymIdentifier));
*nsid = *id;
- GNUNET_CRYPTO_hash_to_enc (nsid, &identifier);
+ ret = GNUNET_STRINGS_data_to_string (nsid,
+ sizeof (struct GNUNET_PseudonymIdentifier), buf, sizeof (buf));
+ GNUNET_assert (NULL != ret);
+ ret[0] = '\0';
if (NULL == ctx->default_ns)
{
@@ -352,7 +294,7 @@
gtk_list_store_insert_with_values (ctx->my_ns_store, &my_iter, G_MAXINT,
GNUNET_GTK_MY_NAMESPACES_NAME_COLUMN, name,
- GNUNET_GTK_MY_NAMESPACES_KEY_COLUMN, identifier.encoding,
+ GNUNET_GTK_MY_NAMESPACES_KEY_COLUMN, buf,
GNUNET_GTK_MY_NAMESPACES_KEY_BINARY_COLUMN, nsid,
GNUNET_GTK_MY_NAMESPACES_USE_THIS_COLUMN, is_default,
GNUNET_GTK_MY_NAMESPACES_ACTUAL_NAME_COLUMN, NULL,
@@ -378,8 +320,7 @@
gtk_widget_set_sensitive (ctx->advertise_button, anything_selected);
gtk_widget_set_sensitive (ctx->delete_button, anything_selected);
- if (NULL == ctx->nscreator)
- gtk_widget_set_sensitive (ctx->create_button, TRUE);
+ gtk_widget_set_sensitive (ctx->create_button, TRUE);
}
/**
@@ -394,7 +335,7 @@
{
struct GNUNET_GTK_NamespaceSelectorContext *ctx = user_data;
GtkTreeIter iter;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
gboolean selected;
nsid = NULL;
@@ -430,8 +371,6 @@
ctx->main_ctx = main_ctx;
- ctx->nscreator = NULL;
-
/* initialize widget references */
ctx->my_ns = GTK_WIDGET (gtk_builder_get_object (ctx->builder,
"GNUNET_GTK_namespace_organizer_namespaces_treeview"));
@@ -541,9 +480,7 @@
struct GNUNET_GTK_NamespaceSelectorContext *ctx = user_data;
GtkTreeIter iter;
gchar *name;
- gboolean selected;
- struct GNUNET_HashCode id;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier *nsid;
nsid = NULL;
name = NULL;
@@ -596,8 +533,8 @@
GtkTreeIter iter;
gchar *name;
gboolean selected;
- struct GNUNET_HashCode id;
- struct GNUNET_HashCode *nsid;
+ struct GNUNET_PseudonymIdentifier id;
+ struct GNUNET_PseudonymIdentifier *nsid;
nsid = NULL;
name = NULL;
@@ -616,9 +553,9 @@
ns = GNUNET_FS_namespace_open_existing (GNUNET_FS_GTK_get_fs_handle (),
name);
if (ns)
{
- if (GNUNET_FS_namespace_get_public_key_hash (ns, &id))
+ if (GNUNET_FS_namespace_get_public_identifier (ns, &id))
{
- if (0 == GNUNET_CRYPTO_hash_cmp (&id, nsid))
+ if (0 == memcmp (&id, nsid, sizeof (id)))
{
GtkTreeIter first;
@@ -703,85 +640,56 @@
/**
* Called when key generation for a namespace is finished.
- * Hides the progress spinner, updates ns key hash, enables some buttons,
- * does namespace renaming, if one was queued.
*
* @param cls context
* @param ns newly-created namespace (NULL on failure)
* @param emsg error message (NULL on success)
*/
static void
-ns_created (void *cls, struct GNUNET_FS_Namespace *ns, const char *emsg)
+ns_created (void *cls, struct GNUNET_FS_Namespace *ns, char *name, const char
*emsg)
{
struct GNUNET_GTK_NamespaceSelectorContext *ctx = cls;
GtkTreeIter iter;
- gboolean found_item;
- struct GNUNET_HashCode *nsid;
- struct GNUNET_HashCode id;
+ struct GNUNET_PseudonymIdentifier *nsid;
+ struct GNUNET_PseudonymIdentifier id;
- gtk_widget_set_visible (ctx->progress_spinner, FALSE);
- gtk_widget_set_visible (ctx->progress_label, FALSE);
-
- /* We don't keep a row reference to the placeholder ns item,
- * so let's find it (it's the only one with nsid == NULL)
- */
- ctx->nscreator = NULL;
-
- found_item = find_item_being_generated (ctx, &iter);
-
/* If ns was created, get its public key hash */
nsid = NULL;
- if ((NULL != ns) && (GNUNET_OK == GNUNET_FS_namespace_get_public_key_hash
(ns, &id)))
+ if ((NULL != ns) && (GNUNET_OK == GNUNET_FS_namespace_get_public_identifier
(ns, &id)))
{
- nsid = GNUNET_malloc (sizeof (struct GNUNET_HashCode));
- memcpy (nsid, &id, sizeof (struct GNUNET_HashCode));
+ nsid = GNUNET_malloc (sizeof (struct GNUNET_PseudonymIdentifier));
+ memcpy (nsid, &id, sizeof (struct GNUNET_PseudonymIdentifier));
}
/* If anything of the above went wrong, or ns creation failed, we abort */
- if ((NULL == ns) || (NULL == nsid) || (!found_item))
+ if (NULL == nsid)
{
- /* TODO: figure out how to present an error message to the user */
- if (ns)
- GNUNET_FS_namespace_delete (ns, GNUNET_NO);
-
- if (nsid)
- GNUNET_free (nsid);
-
- if (found_item)
- gtk_list_store_remove (ctx->my_ns_store, &iter);
+ GNUNET_FS_namespace_delete (ns, GNUNET_NO);
}
else
{
- gchar *actual_name;
- gchar *name;
- struct GNUNET_CRYPTO_HashAsciiEncoded identifier;
+ char buf[1024];
+ char *ret;
+ gint row_count;
- gtk_tree_model_get (GTK_TREE_MODEL (ctx->my_ns_store), &iter,
- GNUNET_GTK_MY_NAMESPACES_NAME_COLUMN, &name,
- GNUNET_GTK_MY_NAMESPACES_ACTUAL_NAME_COLUMN, &actual_name,
- -1);
+ ret = GNUNET_STRINGS_data_to_string (nsid,
+ sizeof (struct
GNUNET_PseudonymIdentifier),
+ buf,
+ sizeof (buf));
+ GNUNET_assert (NULL != ret);
+ ret[0] = '\0';
- /* Renaming was delayed until generation is finished. */
- if (0 != strcmp (actual_name, name))
- if (GNUNET_OK != GNUNET_FS_namespace_rename (
- GNUNET_FS_GTK_get_fs_handle (), actual_name, name))
- {
- g_free (name);
- name = g_strdup (actual_name);
- }
-
- GNUNET_CRYPTO_hash_to_enc (nsid, &identifier);
-
- gtk_list_store_set (ctx->my_ns_store, &iter,
- GNUNET_GTK_MY_NAMESPACES_KEY_COLUMN, identifier.encoding,
+ gtk_list_store_insert_with_values (ctx->my_ns_store, &iter, G_MAXINT,
+ GNUNET_GTK_MY_NAMESPACES_KEY_COLUMN, buf,
GNUNET_GTK_MY_NAMESPACES_KEY_BINARY_COLUMN, nsid,
GNUNET_GTK_MY_NAMESPACES_NAME_COLUMN, name,
- GNUNET_GTK_MY_NAMESPACES_ACTUAL_NAME_COLUMN, NULL,
-1);
- g_free (actual_name);
- g_free (name);
+ row_count = gtk_tree_model_iter_n_children (
+ GTK_TREE_MODEL (ctx->my_ns_store), NULL);
+ if (row_count == 1)
+ try_make_default (ctx, &iter);
}
}
@@ -797,13 +705,8 @@
create_namespace (struct GNUNET_GTK_NamespaceSelectorContext *ctx)
{
gchar *name;
- GtkTreeIter my_iter;
struct GNUNET_FS_Namespace *ns;
- gint row_count;
- if (ctx->nscreator)
- return;
-
ns = NULL;
name = NULL;
do
@@ -814,32 +717,18 @@
name = generate_local_ns_name ();
ns = GNUNET_FS_namespace_open_existing (GNUNET_FS_GTK_get_fs_handle (),
name);
} while (NULL != ns);
-
- ctx->nscreator = GNUNET_FS_namespace_create_start (
- GNUNET_FS_GTK_get_fs_handle (), name, ns_created, ctx);
- if (NULL == ctx->nscreator)
+
+ ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name);
+
+ if (NULL == ns)
{
GNUNET_free (name);
return;
}
- gtk_list_store_insert_with_values (ctx->my_ns_store, &my_iter, G_MAXINT,
- GNUNET_GTK_MY_NAMESPACES_NAME_COLUMN, name,
- GNUNET_GTK_MY_NAMESPACES_ACTUAL_NAME_COLUMN, name,
- GNUNET_GTK_MY_NAMESPACES_KEY_COLUMN, _("Key is not ready yet"),
- GNUNET_GTK_MY_NAMESPACES_KEY_BINARY_COLUMN, NULL,
- GNUNET_GTK_MY_NAMESPACES_USE_THIS_COLUMN, FALSE,
- -1);
+ ns_created (ctx, ns, name, NULL);
GNUNET_free (name);
-
- gtk_widget_set_visible (ctx->progress_spinner, TRUE);
- gtk_widget_set_visible (ctx->progress_label, TRUE);
-
- row_count = gtk_tree_model_iter_n_children (
- GTK_TREE_MODEL (ctx->my_ns_store), NULL);
- if (row_count == 1)
- try_make_default (ctx, &my_iter);
}
/**
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c 2013-03-06 08:22:29 UTC
(rev 26329)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_publish-dialog.c 2013-03-06 08:22:36 UTC
(rev 26330)
@@ -2071,9 +2071,25 @@
{
struct MainPublishingDialogContext *ctx = cls;
- GNUNET_FS_namespace_insert_advertisement_into_metadata (
- ctx->ns, meta, "/");
+ struct GNUNET_FS_Uri *sks_uri;
+ char *emsg;
+ char *sks_uri_string;
+ emsg = NULL;
+ sks_uri = GNUNET_FS_uri_sks_create (ctx->ns, "/", &emsg);
+ GNUNET_free_non_null (emsg);
+ if (NULL == sks_uri)
+ return GNUNET_SYSERR;
+
+ sks_uri_string = GNUNET_FS_uri_to_string (sks_uri);
+ GNUNET_FS_uri_destroy (sks_uri);
+ if (NULL == sks_uri_string)
+ return GNUNET_SYSERR;
+
+ GNUNET_CONTAINER_meta_data_insert (meta, "<gnunet>",
+ EXTRACTOR_METATYPE_URI, EXTRACTOR_METAFORMAT_UTF8,
+ "text/plain", sks_uri_string, strlen (sks_uri_string) + 1);
+ GNUNET_free (sks_uri_string);
return GNUNET_SYSERR;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r26330 - in gnunet-gtk: contrib src/fs,
gnunet <=