[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-gtk] branch master updated: migrate gnunet-gtk logic to new (0.1
From: |
gnunet |
Subject: |
[gnunet-gtk] branch master updated: migrate gnunet-gtk logic to new (0.14.x) GNS/identity APIs |
Date: |
Fri, 18 Jun 2021 13:36:52 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet-gtk.
The following commit(s) were added to refs/heads/master by this push:
new e4dd1cf7 migrate gnunet-gtk logic to new (0.14.x) GNS/identity APIs
e4dd1cf7 is described below
commit e4dd1cf7a0bf42e238c4b791f890833fd44ed9fd
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Jun 18 13:34:01 2021 +0200
migrate gnunet-gtk logic to new (0.14.x) GNS/identity APIs
---
src/conversation/gnunet-conversation-gtk_egos.c | 8 +-
src/conversation/gnunet-conversation-gtk_import.c | 20 +-
src/fs/gnunet-fs-gtk.c | 35 ++-
src/fs/gnunet-fs-gtk.h | 54 ++---
src/fs/gnunet-fs-gtk_common.c | 17 +-
src/fs/gnunet-fs-gtk_main-window-search.c | 34 +--
src/fs/gnunet-fs-gtk_publish-dialog.c | 274 +++++++++++++++-------
src/namestore/gnunet-namestore-gtk.c | 15 +-
src/namestore/plugin_gtk_namestore_phone.c | 46 ++--
src/namestore/plugin_gtk_namestore_pkey.c | 46 ++--
src/namestore/plugin_gtk_namestore_soa.c | 52 ++--
src/setup/gnunet-setup-transport-test.c | 4 +-
src/setup/gnunet-setup.c | 13 +-
13 files changed, 362 insertions(+), 256 deletions(-)
diff --git a/src/conversation/gnunet-conversation-gtk_egos.c
b/src/conversation/gnunet-conversation-gtk_egos.c
index 91ed2de7..430eda40 100644
--- a/src/conversation/gnunet-conversation-gtk_egos.c
+++ b/src/conversation/gnunet-conversation-gtk_egos.c
@@ -171,19 +171,18 @@ gnunet_conversation_gtk_ego_copy_button_clicked_cb
(GtkButton *button,
{
struct GNUNET_IDENTITY_Ego *ego;
const gchar *label;
- const struct GNUNET_IDENTITY_PrivateKey *priv;
struct GNUNET_IDENTITY_PublicKey pub;
const char *zkey;
char *uri;
GtkClipboard *cb;
label = gtk_entry_get_text (GTK_ENTRY (
- GCG_get_main_window_object ("gnunet_conversation_gtk_ego_label_entry")));
+ GCG_get_main_window_object (
+ "gnunet_conversation_gtk_ego_label_entry")));
GNUNET_break ((NULL != label) && (0 != strlen (label)));
ego = GCG_EGOS_get_selected_ego ();
GNUNET_break (NULL != ego);
- priv = GNUNET_IDENTITY_ego_get_private_key (ego);
- GNUNET_IDENTITY_ego_get_public_key (priv, &pub);
+ GNUNET_IDENTITY_ego_get_public_key (ego, &pub);
zkey = GNUNET_GNSRECORD_pkey_to_zkey (&pub);
GNUNET_asprintf (&uri, "gnunet://gns/%s.%s/", label, zkey);
cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
@@ -227,4 +226,5 @@ GCG_EGOS_shutdown ()
}
}
+
/* end of gnunet-conversation-gtk_egos.c */
diff --git a/src/conversation/gnunet-conversation-gtk_import.c
b/src/conversation/gnunet-conversation-gtk_import.c
index 002a1f71..cc16d386 100644
--- a/src/conversation/gnunet-conversation-gtk_import.c
+++ b/src/conversation/gnunet-conversation-gtk_import.c
@@ -99,9 +99,9 @@ static int private_record;
* operation.
*
* @param cls NULL
- * @param success #GNUNET_SYSERR on failure (including timeout/queue
drop/failure to validate)
- * #GNUNET_NO if content was already there
- * #GNUNET_YES (or other positive value) on success
+ * @param success #GNUNET_SYSERR on failure (including timeout/queue
+ * drop/failure to validate) #GNUNET_NO if content was already there
#GNUNET_YES
+ * (or other positive value) on success
* @param emsg NULL on success, otherwise an error message
*/
static void
@@ -195,9 +195,9 @@ GSC_add_contact (const gchar *name, const gchar *address)
* add operation. Finish 'add phone' operation.
*
* @param cls closure
- * @param success #GNUNET_SYSERR on failure (including timeout/queue
drop/failure to validate)
- * #GNUNET_NO if content was already there or not found
- * #GNUNET_YES (or other positive value) on success
+ * @param success #GNUNET_SYSERR on failure (including timeout/queue
+ * drop/failure to validate) #GNUNET_NO if content was already there or not
+ * found #GNUNET_YES (or other positive value) on success
* @param emsg NULL on success, otherwise an error message
*/
static void
@@ -344,7 +344,7 @@ finish_shutdown ()
GNUNET_SCHEDULER_add_now (&async_disconnect, NULL);
GNUNET_free (my_rd_data);
memset (&my_rd, 0, sizeof (my_rd));
- GNUNET_CRYPTO_ecdsa_key_clear (&zone_pkey);
+ memset (&zone_pkey, 0, sizeof (zone_pkey));
}
@@ -354,9 +354,9 @@ finish_shutdown ()
* with 'add phone' operation if one is pending.
*
* @param cls closure
- * @param success #GNUNET_SYSERR on failure (including timeout/queue
drop/failure to validate)
- * #GNUNET_NO if content was already there or not found
- * #GNUNET_YES (or other positive value) on success
+ * @param success #GNUNET_SYSERR on failure (including timeout/queue
+ * drop/failure to validate) #GNUNET_NO if content was already there or not
+ * found #GNUNET_YES (or other positive value) on success
* @param emsg NULL on success, otherwise an error message
*/
static void
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c
index c4cf18af..bedefb1e 100644
--- a/src/fs/gnunet-fs-gtk.c
+++ b/src/fs/gnunet-fs-gtk.c
@@ -35,7 +35,8 @@
#include <gnunet/gnunet_arm_service.h>
/**
- * How many block requests can we have outstanding in parallel at a time by
default?
+ * How many block requests can we have outstanding in parallel at a time by
+ * default?
*/
#define DEFAULT_MAX_PARALLEL_REQUESTS 100000
@@ -205,7 +206,7 @@ main_window_save_position (GtkWidget *main_window)
"gnunet-fs-gtk",
"MAIN_WINDOW_MAXIMIZED",
(maximized == GNUNET_YES) ? "YES"
- : "NO");
+ : "NO");
cfgDefault = GNUNET_CONFIGURATION_create ();
(void) GNUNET_CONFIGURATION_load (cfgDefault, NULL); /* load defaults only */
@@ -300,11 +301,6 @@ shutdown_task (void *cls)
GNUNET_GNS_disconnect (main_context.gns);
main_context.gns = NULL;
}
- if (NULL != main_context.sks_zone)
- {
- GNUNET_free (main_context.sks_zone);
- main_context.sks_zone = NULL;
- }
}
@@ -454,6 +450,8 @@ unique_app_message_cb (UniqueApp *app,
}
return UNIQUE_RESPONSE_OK;
}
+
+
#endif
@@ -663,21 +661,22 @@ handle_sks_zone_identity (void *cls,
"No default ego specified for `fs-sks` service, will not enable
namespace search.\n"));
return;
}
- main_context.sks_zone = GNUNET_new (struct GNUNET_IDENTITY_PrivateKey);
- *main_context.sks_zone = *GNUNET_IDENTITY_ego_get_private_key (ego);
+ main_context.sks_zone = ego;
gtk_widget_show (GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object (
"main_window_search_namespace_label")));
gtk_widget_show (GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object (
"main_window_search_namespace_combobox")));
- main_context.zm = GNUNET_NAMESTORE_zone_monitor_start (main_context.cfg,
- main_context.sks_zone,
- GNUNET_YES,
- &monitor_zone_error,
- NULL,
- &monitor_zone_records,
- NULL,
- &monitor_zone_sync,
- NULL);
+ main_context.zm =
+ GNUNET_NAMESTORE_zone_monitor_start (main_context.cfg,
+ GNUNET_IDENTITY_ego_get_private_key (
+ main_context.sks_zone),
+ GNUNET_YES,
+ &monitor_zone_error,
+ NULL,
+ &monitor_zone_records,
+ NULL,
+ &monitor_zone_sync,
+ NULL);
}
diff --git a/src/fs/gnunet-fs-gtk.h b/src/fs/gnunet-fs-gtk.h
index 690e36e6..a14f81b9 100644
--- a/src/fs/gnunet-fs-gtk.h
+++ b/src/fs/gnunet-fs-gtk.h
@@ -253,7 +253,7 @@ struct GNUNET_GTK_MainWindowContext
/**
* Our zone for SKS operations. Can be NULL.
*/
- struct GNUNET_IDENTITY_PrivateKey *sks_zone;
+ struct GNUNET_IDENTITY_Ego *sks_zone;
};
@@ -263,23 +263,23 @@ struct GNUNET_GTK_MainWindowContext
enum GNUNET_GTK_FS_MAIN_WINDOW_SearchNamespaceModelColumns
{
/**
- * A gchararray.
- */
+ * A gchararray.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_NAME = 0,
/**
- * A gpointer.
- */
+ * A gpointer.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY = 1,
/**
- * A gchararray.
- */
+ * A gchararray.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_ROOT = 2,
/**
- * A gchararray.
- */
+ * A gchararray.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_TOOLTIP = 3,
};
@@ -290,23 +290,23 @@ enum GNUNET_GTK_FS_MAIN_WINDOW_SearchNamespaceModelColumns
enum GNUNET_GTK_FS_MAIN_WINDOW_MetaDataModelColumns
{
/**
- * A guint.
- */
+ * A guint.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_TYPE = 0,
/**
- * A guint.
- */
+ * A guint.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_FORMAT = 1,
/**
- * A gchararray.
- */
+ * A gchararray.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_TYPE_STRING = 2,
/**
- * A gchararray.
- */
+ * A gchararray.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_META_DATA_MC_META_VALUE = 3,
};
@@ -317,28 +317,28 @@ enum GNUNET_GTK_FS_MAIN_WINDOW_MetaDataModelColumns
enum GNUNET_GTK_FS_MAIN_WINDOW_SearchMimeModelColumns
{
/**
- * A gchararray.
- */
+ * A gchararray.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_MIME_MC_MIME = 0,
/**
- * A gchararray.
- */
+ * A gchararray.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_MIME_MC_TYPE = 1,
/**
- * A gchararray.
- */
+ * A gchararray.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_MIME_MC_EXTENSION = 2,
/**
- * A gchararray.
- */
+ * A gchararray.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_MIME_MC_LOSSYNESS = 3,
/**
- * A gchararray.
- */
+ * A gchararray.
+ */
GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_MIME_MC_FREEDOM = 4,
};
diff --git a/src/fs/gnunet-fs-gtk_common.c b/src/fs/gnunet-fs-gtk_common.c
index ebfccab0..6dd28887 100644
--- a/src/fs/gnunet-fs-gtk_common.c
+++ b/src/fs/gnunet-fs-gtk_common.c
@@ -60,7 +60,7 @@ GNUNET_FS_GTK_dubious_meta_to_utf8 (enum EXTRACTOR_MetaFormat
format,
data,
(unsigned int) data_len);
format = EXTRACTOR_METAFORMAT_C_STRING;
- /* fall-through */
+ /* fall-through */
case EXTRACTOR_METAFORMAT_C_STRING:
if (data_len > 0)
{
@@ -294,8 +294,8 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
GtkEntry *query_entry;
GtkComboBox *ns_cb;
GtkEntry *ns_entry;
- struct GNUNET_IDENTITY_PublicKey want;
-
+ struct GNUNET_CRYPTO_EcdsaPublicKey want;
+ struct GNUNET_IDENTITY_PublicKey pkey;
if (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri))
{
@@ -310,7 +310,7 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
query_entry = GTK_ENTRY (
GNUNET_FS_GTK_get_main_window_object ("main_window_search_entry"));
ns_cb = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object (
- "main_window_search_namespace_combobox"));
+ "main_window_search_namespace_combobox"));
ns_entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (ns_cb)));
if (GNUNET_FS_uri_test_sks (uri))
{
@@ -320,10 +320,12 @@ GNUNET_FS_GTK_handle_uri (const struct GNUNET_FS_Uri *uri,
GNUNET_break (0);
return;
}
+ pkey.type = GNUNET_IDENTITY_TYPE_ECDSA;
+ pkey.ecdsa_key = want;
{
const char *ns_zkey;
- ns_zkey = GNUNET_GNSRECORD_pkey_to_zkey (&want);
+ ns_zkey = GNUNET_GNSRECORD_pkey_to_zkey (&pkey);
gtk_entry_set_text (ns_entry, ns_zkey);
}
/* set search entry to the namespace identifier */
@@ -373,7 +375,7 @@ GNUNET_GTK_get_iter_from_reference (GtkTreeRowReference
*rr, GtkTreeIter *iter)
GtkTreeModel *model;
path = gtk_tree_row_reference_get_path (rr);
model = gtk_tree_row_reference_get_model (rr);
- if (path != NULL && model != NULL)
+ if ((path != NULL) && (model != NULL))
{
if (gtk_tree_model_get_iter (model, iter, path))
result = GNUNET_OK;
@@ -396,7 +398,7 @@ GtkTreeRowReference *
GNUNET_GTK_get_reference_from_iter (GtkTreeModel *model, GtkTreeIter *iter)
{
GtkTreeRowReference *result = NULL;
- if (iter != NULL && model != NULL)
+ if ((iter != NULL) && (model != NULL))
{
GtkTreePath *path = gtk_tree_model_get_path (model, iter);
if (path != NULL)
@@ -459,4 +461,5 @@ GNUNET_GTK_tree_model_get_next_flat_iter (GtkTreeModel
*model,
return FALSE;
}
+
/* end of gnunet-fs-gtk-common.c */
diff --git a/src/fs/gnunet-fs-gtk_main-window-search.c
b/src/fs/gnunet-fs-gtk_main-window-search.c
index d23cb656..438a9517 100644
--- a/src/fs/gnunet-fs-gtk_main-window-search.c
+++ b/src/fs/gnunet-fs-gtk_main-window-search.c
@@ -43,8 +43,10 @@ static void
beep ()
{
gdk_display_beep (gdk_screen_get_display (
- gdk_window_get_screen (gtk_widget_get_parent_window (GTK_WIDGET (
- GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_main_window"))))));
+ gdk_window_get_screen (gtk_widget_get_parent_window (
+ GTK_WIDGET (
+
GNUNET_FS_GTK_get_main_window_object (
+
"GNUNET_GTK_main_window"))))));
}
@@ -178,7 +180,7 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx)
GtkTreeIter iter;
mime_combo = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object (
- "main_window_search_mime_combobox"));
+ "main_window_search_mime_combobox"));
mime_model = gtk_combo_box_get_model (mime_combo);
mime_keyword = NULL;
if ((NULL != mime_model) &&
@@ -198,7 +200,7 @@ start_search (struct GNUNET_GTK_MainWindowContext *main_ctx)
GtkComboBox *namespace_box;
namespace_box = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object (
- "main_window_search_namespace_combobox"));
+ "main_window_search_namespace_combobox"));
nsid = gtk_entry_get_text (
GTK_ENTRY (gtk_bin_get_child (GTK_BIN (namespace_box))));
if ((NULL != nsid) && ((0 == strcasecmp (nsid, "<none>")) ||
@@ -362,9 +364,9 @@ abort_pseu_lookup (struct PseuLookupContext *lctx)
* operation.
*
* @param cls closure
- * @param success #GNUNET_SYSERR on failure (including timeout/queue
drop/failure to validate)
- * #GNUNET_NO if content was already there or not found
- * #GNUNET_YES (or other positive value) on success
+ * @param success #GNUNET_SYSERR on failure (including timeout/queue
+ * drop/failure to validate) #GNUNET_NO if content was already there or not
+ * found #GNUNET_YES (or other positive value) on success
* @param emsg NULL on success, otherwise an error message
*/
static void
@@ -416,13 +418,15 @@ save_pseudonym_with_nick (struct PseuLookupContext *lctx,
const char *nick)
main_ctx = GNUNET_FS_GTK_get_main_context ();
lctx->namestore = GNUNET_NAMESTORE_connect (main_ctx->cfg);
GNUNET_assert (NULL != lctx->namestore);
- lctx->qe = GNUNET_NAMESTORE_records_store (lctx->namestore,
- main_ctx->sks_zone,
- nick,
- 1,
- &rd,
- &store_continuation,
- lctx);
+ lctx->qe =
+ GNUNET_NAMESTORE_records_store (lctx->namestore,
+ GNUNET_IDENTITY_ego_get_private_key (
+ main_ctx->sks_zone),
+ nick,
+ 1,
+ &rd,
+ &store_continuation,
+ lctx);
}
@@ -667,7 +671,7 @@ GNUNET_FS_GTK_save_button_clicked_cb (GtkButton *button,
gpointer user_data)
return;
}
widget = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object (
- "main_window_search_namespace_combobox"));
+ "main_window_search_namespace_combobox"));
text = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))));
ret = GNUNET_GNSRECORD_zkey_to_pkey (text, &pkey);
if (GNUNET_OK != ret)
diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c
b/src/fs/gnunet-fs-gtk_publish-dialog.c
index 1e1ec7fa..db86cd26 100644
--- a/src/fs/gnunet-fs-gtk_publish-dialog.c
+++ b/src/fs/gnunet-fs-gtk_publish-dialog.c
@@ -431,6 +431,7 @@ gtk_tree_iter_equals (GtkTreeModel *tm, GtkTreeIter *i1,
GtkTreeIter *i2)
return (0 == ret) ? GNUNET_YES : GNUNET_NO;
}
+
/**
* Update selectivity of execute/cancel buttons in the master dialog.
*
@@ -474,6 +475,7 @@ update_selectivity_execute_cancel (struct
MainPublishingDialogContext *ctx)
gtk_widget_set_sensitive (ctx->cancel_button, FALSE);
}
+
/**
* Update selectivity of up/down/left/right buttons in the master dialog.
*
@@ -546,6 +548,7 @@ update_selectivity_edit (struct MainPublishingDialogContext
*ctx)
gtk_widget_set_sensitive (ctx->up_button, FALSE);
}
+
/**
* The selection in the file list tree view changed; update the button
* sensitivity.
@@ -563,6 +566,7 @@
GNUNET_GTK_master_publish_dialog_file_informatino_treeview_selection_changed_cb
update_selectivity_edit (ctx);
}
+
/**
* Add an empty directory to the tree model.
*
@@ -631,6 +635,7 @@ create_dir_at_iter (struct MainPublishingDialogContext *ctx,
update_selectivity_execute_cancel (ctx);
}
+
/**
* Copy an entry in the tree from the 'old' position to the 'new'
* position. All of the fields are copied, plain pointers will be
@@ -758,6 +763,7 @@ copy_entry (struct MainPublishingDialogContext *ctx,
}
}
+
/**
* Called when global ns publication checkbox is toggled.
* Adjusts execute/cancel button sensitivity.
@@ -773,6 +779,7 @@ GNUNET_GTK_master_publish_dialog_global_checkbox_toggled_cb
(
update_selectivity_execute_cancel (user_data);
}
+
/**
* Called when private ns publication checkbox is toggled.
* Adjusts execute/cancel button sensitivity.
@@ -788,6 +795,7 @@ GNUNET_GTK_master_publish_dialog_own_checkbox_toggled_cb (
update_selectivity_execute_cancel (user_data);
}
+
/**
* Called when updateability checkbox is toggled.
* Adjusts execute/cancel button sensitivity.
@@ -803,6 +811,7 @@
GNUNET_GTK_master_publish_dialog_updateable_checkbox_toggled_cb (
update_selectivity_execute_cancel (user_data);
}
+
/**
* Generates an update id from a new id.
*
@@ -840,6 +849,7 @@ generate_update_id (const gchar *new_text)
return new_update_id;
}
+
/**
* Checks whether existing update id was generated or not.
* Generates an update id from the previous id, then checks if
@@ -867,6 +877,7 @@ update_id_is_autofilled (const gchar *existing_update_id,
return result;
}
+
/**
* Generates a new update id and fills the entry, if necessary.
* Stores new identifier as previous_id in the context struct.
@@ -897,6 +908,7 @@ maybe_change_update_id (struct MainPublishingDialogContext
*ctx,
ctx->previous_id = g_strdup (new_text);
}
+
/**
* Called when identifier entry contents are changed by anything.
* Generates a new update id and fills the entry, if necessary.
@@ -920,6 +932,7 @@
GNUNET_GTK_master_publish_dialog_identifier_entry_changed_cb (
update_selectivity_execute_cancel (ctx);
}
+
/**
* The selection in the identifier tree view changed.
* Copy text into identifier entry, or
@@ -961,6 +974,7 @@
GNUNET_GTK_master_publish_dialog_previous_identifiers_treeview_selection_changed
g_free (new_text);
}
+
/**
* User has clicked on the 'right' button to move files in the master
* edit dialog tree view. Execute the move.
@@ -1015,6 +1029,7 @@ GNUNET_GTK_master_publish_dialog_right_button_clicked_cb
(GtkWidget *dummy,
&iter);
}
+
/**
* User has clicked on the 'left' button to move files in the master
* edit dialog tree view. Execute the move.
@@ -1056,6 +1071,7 @@ GNUNET_GTK_master_publish_dialog_left_button_clicked_cb
(GtkWidget *dummy,
&iter);
}
+
/**
* User has clicked on the 'up' button to move files in the master
* edit dialog tree view. Execute the move.
@@ -1116,6 +1132,7 @@ GNUNET_GTK_master_publish_dialog_up_button_clicked_cb
(GtkWidget *dummy,
&iter);
}
+
/**
* User has clicked on the 'down' button to move files in the master
* edit dialog tree view. Execute the move.
@@ -1158,6 +1175,7 @@ GNUNET_GTK_master_publish_dialog_down_button_clicked_cb
(GtkWidget *dummy,
&iter);
}
+
/**
* User has clicked on the 'new' button to add an empty directory in the master
* edit dialog tree view. Add an empty directory.
@@ -1189,6 +1207,7 @@ GNUNET_GTK_master_publish_dialog_new_button_clicked_cb
(GtkWidget *dummy,
create_dir_at_iter (ctx, "unnamed/", &bo, &iter, &pos);
}
+
/**
* Free row reference stored in the file information's
* client-info pointer.
@@ -1225,6 +1244,7 @@ free_fi_row_reference (void *cls,
return GNUNET_OK;
}
+
/**
* User has clicked on the 'delete' button to delete a file or directory in the
* master edit dialog tree view. Delete the selected entry.
@@ -1302,6 +1322,7 @@ GNUNET_GTK_master_publish_dialog_delete_button_clicked_cb
(GtkWidget *dummy,
update_selectivity_edit (ctx);
}
+
/* ******************** progress dialog / import of directories *************
*/
/**
@@ -1329,6 +1350,7 @@ destroy_progress_dialog (struct AddDirClientContext *adcc)
GNUNET_free (adcc);
}
+
/**
* User clicked on the 'cancel' button of the progress dialog.
* Cancel the operation.
@@ -1351,6 +1373,7 @@ GNUNET_FS_GTK_progress_dialog_cancel_button_clicked_cb
(GtkButton *button,
destroy_progress_dialog (adcc);
}
+
/**
* User attempted to close the progress dialog. Refuse.
*
@@ -1368,6 +1391,7 @@ GNUNET_FS_GTK_progress_dialog_delete_event_cb (GtkWidget
*widget,
return TRUE;
}
+
/**
* Display some additional information in the text area of the
* progress dialog.
@@ -1385,6 +1409,7 @@ insert_progress_dialog_text (struct AddDirClientContext
*adcc, const char *text)
adcc->textview_vertical_adjustment));
}
+
/**
* Convert a single item from the scan to an entry in the tree view.
*
@@ -1448,14 +1473,15 @@ add_item (struct AddDirClientContext *adcc,
else
{
fi =
- GNUNET_FS_file_information_create_from_file (GNUNET_FS_GTK_get_fs_handle
(),
- row_reference,
- item->filename,
- item->ksk_uri,
- item->meta,
- adcc
- ->directory_scan_do_index,
- &adcc->directory_scan_bo);
+ GNUNET_FS_file_information_create_from_file (
+ GNUNET_FS_GTK_get_fs_handle (),
+ row_reference,
+ item->filename,
+ item->ksk_uri,
+ item->meta,
+ adcc
+ ->directory_scan_do_index,
+ &adcc->directory_scan_bo);
file_size_fancy = GNUNET_STRINGS_byte_size_fancy (fsize);
}
gtk_tree_store_set (ts,
@@ -1474,13 +1500,14 @@ add_item (struct AddDirClientContext *adcc,
fi,
PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE,
(guint64)
- adcc->directory_scan_bo.expiration_time.abs_value_us,
+ adcc->directory_scan_bo.expiration_time.abs_value_us,
PUBLISH_MC_REPLICATION_LEVEL,
(guint) adcc->directory_scan_bo.replication_level,
-1);
GNUNET_free (file_size_fancy);
}
+
/**
* Recursively traverse the share tree and add it to the tree store
*
@@ -1509,6 +1536,7 @@ add_share_items_to_treestore (struct AddDirClientContext
*adcc,
}
}
+
/**
* Function called when the scanner had some trouble and we
* need to abort the scanning process (which we need to do
@@ -1529,6 +1557,7 @@ stop_scanner_task (void *cls)
}
}
+
/**
* Progress callback called from the directory scanner with
* information about our progress scanning the hierarchy.
@@ -1580,8 +1609,8 @@ directory_scan_cb (void *cls,
filename);
#if ! VERBOSE_PROGRESS
gtk_widget_show (GTK_WIDGET (
- gtk_builder_get_object (adcc->progress_dialog_builder,
-
"GNUNET_FS_GTK_progress_dialog_scrolled_window")));
+ gtk_builder_get_object (adcc->progress_dialog_builder,
+
"GNUNET_FS_GTK_progress_dialog_scrolled_window")));
#endif
insert_progress_dialog_text (adcc, s);
GNUNET_free (s);
@@ -1625,23 +1654,24 @@ directory_scan_cb (void *cls,
}
break;
case GNUNET_FS_DIRSCANNER_FINISHED: {
- struct GNUNET_FS_ShareTreeItem *directory_scan_result;
-
- insert_progress_dialog_text (adcc, _ ("Scanner has finished.\n"));
- directory_scan_result = GNUNET_FS_directory_scan_get_result (adcc->ds);
- adcc->ds = NULL;
- GNUNET_FS_share_tree_trim (directory_scan_result);
- add_share_items_to_treestore (adcc, directory_scan_result, NULL);
- GNUNET_FS_share_tree_free (directory_scan_result);
- destroy_progress_dialog (adcc);
- }
- break;
+ struct GNUNET_FS_ShareTreeItem *directory_scan_result;
+
+ insert_progress_dialog_text (adcc, _ ("Scanner has finished.\n"));
+ directory_scan_result = GNUNET_FS_directory_scan_get_result (adcc->ds);
+ adcc->ds = NULL;
+ GNUNET_FS_share_tree_trim (directory_scan_result);
+ add_share_items_to_treestore (adcc, directory_scan_result, NULL);
+ GNUNET_FS_share_tree_free (directory_scan_result);
+ destroy_progress_dialog (adcc);
+ }
+ break;
default:
GNUNET_break (0);
break;
}
}
+
/**
* Setup the context and progress dialog for scanning a file or
* directory structure (for meta data) and importing it into
@@ -1679,8 +1709,9 @@ scan_file_or_directory (struct
MainPublishingDialogContext *ctx,
gtk_builder_get_object (adcc->progress_dialog_builder,
"GNUNET_FS_GTK_progress_dialog_textview"));
adcc->textview_vertical_adjustment = GTK_ADJUSTMENT (gtk_builder_get_object (
- adcc->progress_dialog_builder,
- "GNUNET_FS_GTK_progress_dialog_textview_vertical_adjustment"));
+ adcc->
+
progress_dialog_builder,
+
"GNUNET_FS_GTK_progress_dialog_textview_vertical_adjustment"));
adcc->progress_dialog_textbuffer = GTK_TEXT_BUFFER (
gtk_builder_get_object (adcc->progress_dialog_builder,
"GNUNET_FS_GTK_progress_dialog_textbuffer"));
@@ -1702,6 +1733,7 @@ scan_file_or_directory (struct
MainPublishingDialogContext *ctx,
update_selectivity_execute_cancel (ctx);
}
+
/**
* Function called when the "open" (directory) dialog was closed.
*
@@ -1734,24 +1766,25 @@ GNUNET_GTK_publish_directory_dialog_response_cb
(GtkDialog *dialog,
}
bo.content_priority =
gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
- ctx->open_directory_builder,
- "GNUNET_GTK_publish_directory_dialog_priority_spin_button")));
+
ctx->open_directory_builder,
+
"GNUNET_GTK_publish_directory_dialog_priority_spin_button")));
bo.replication_level =
gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
- ctx->open_directory_builder,
- "GNUNET_GTK_publish_directory_dialog_replication_spin_button")));
+
ctx->open_directory_builder,
+
"GNUNET_GTK_publish_directory_dialog_replication_spin_button")));
{
GtkSpinButton *sb;
sb = GTK_SPIN_BUTTON (gtk_builder_get_object (
- ctx->open_directory_builder,
- "GNUNET_GTK_publish_directory_dialog_expiration_year_spin_button"));
+ ctx->open_directory_builder,
+
"GNUNET_GTK_publish_directory_dialog_expiration_year_spin_button"));
bo.expiration_time = GNUNET_GTK_get_expiration_time (sb);
}
do_index =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (
- ctx->open_directory_builder,
- "GNUNET_GTK_publish_directory_dialog_do_index_checkbutton")));
+ ctx->
+
open_directory_builder,
+
"GNUNET_GTK_publish_directory_dialog_do_index_checkbutton")));
scan_file_or_directory (ctx, filename, &bo, do_index);
g_free (filename);
}
@@ -1760,6 +1793,7 @@ GNUNET_GTK_publish_directory_dialog_response_cb
(GtkDialog *dialog,
ctx->open_directory_builder = NULL;
}
+
/**
* Function called when the "open" (file) dialog was closed.
*
@@ -1792,24 +1826,24 @@ GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog
*dialog,
}
bo.content_priority =
gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
- ctx->open_file_builder,
- "GNUNET_GTK_publish_file_dialog_priority_spin_button")));
+ ctx->open_file_builder,
+
"GNUNET_GTK_publish_file_dialog_priority_spin_button")));
{
GtkSpinButton *sb;
sb = GTK_SPIN_BUTTON (gtk_builder_get_object (
- ctx->open_file_builder,
- "GNUNET_GTK_publish_file_dialog_expiration_year_spin_button"));
+ ctx->open_file_builder,
+
"GNUNET_GTK_publish_file_dialog_expiration_year_spin_button"));
bo.expiration_time = GNUNET_GTK_get_expiration_time (sb);
}
bo.replication_level =
gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
- ctx->open_file_builder,
- "GNUNET_GTK_publish_file_dialog_replication_spin_button")));
+ ctx->open_file_builder,
+
"GNUNET_GTK_publish_file_dialog_replication_spin_button")));
do_index =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (
- ctx->open_file_builder,
- "GNUNET_GTK_publish_file_dialog_do_index_checkbutton")));
+
ctx->open_file_builder,
+
"GNUNET_GTK_publish_file_dialog_do_index_checkbutton")));
scan_file_or_directory (ctx, filename, &bo, do_index);
g_free (filename);
@@ -1819,6 +1853,7 @@ GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog
*dialog,
ctx->open_file_builder = NULL;
}
+
/**
* User clicked on the 'add' button in the master publish dialog.
* Create the dialog to allow the user to select a file to add.
@@ -1842,18 +1877,18 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb
(GtkWidget *dummy,
* TRUE */
gtk_spin_button_set_value (
GTK_SPIN_BUTTON (gtk_builder_get_object (
- ctx->open_file_builder,
- "GNUNET_GTK_publish_file_dialog_priority_spin_button")),
+ ctx->open_file_builder,
+ "GNUNET_GTK_publish_file_dialog_priority_spin_button")),
1000);
gtk_spin_button_set_value (
GTK_SPIN_BUTTON (gtk_builder_get_object (
- ctx->open_file_builder,
- "GNUNET_GTK_publish_file_dialog_replication_spin_button")),
+ ctx->open_file_builder,
+
"GNUNET_GTK_publish_file_dialog_replication_spin_button")),
0);
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (gtk_builder_get_object (
- ctx->open_file_builder,
- "GNUNET_GTK_publish_file_dialog_do_index_checkbutton")),
+ ctx->open_file_builder,
+
"GNUNET_GTK_publish_file_dialog_do_index_checkbutton")),
TRUE);
{
@@ -1877,6 +1912,7 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb
(GtkWidget *dummy,
}
}
+
/**
* User clicked on the 'open' button in the master publish dialog.
* Create the dialog to allow the user to select a directory.
@@ -1901,26 +1937,26 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb
(GtkWidget *dummy,
* TRUE */
gtk_spin_button_set_value (
GTK_SPIN_BUTTON (gtk_builder_get_object (
- ctx->open_directory_builder,
- "GNUNET_GTK_publish_directory_dialog_priority_spin_button")),
+ ctx->open_directory_builder,
+
"GNUNET_GTK_publish_directory_dialog_priority_spin_button")),
1000);
gtk_spin_button_set_value (
GTK_SPIN_BUTTON (gtk_builder_get_object (
- ctx->open_directory_builder,
- "GNUNET_GTK_publish_directory_dialog_replication_spin_button")),
+ ctx->open_directory_builder,
+
"GNUNET_GTK_publish_directory_dialog_replication_spin_button")),
0);
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (gtk_builder_get_object (
- ctx->open_directory_builder,
- "GNUNET_GTK_publish_directory_dialog_do_index_checkbutton")),
+ ctx->open_directory_builder,
+
"GNUNET_GTK_publish_directory_dialog_do_index_checkbutton")),
TRUE);
{
GtkComboBox *combo;
combo = GTK_COMBO_BOX (gtk_builder_get_object (
- ctx->open_directory_builder,
- "GNUNET_GTK_publish_directory_dialog_anonymity_combobox"));
+ ctx->open_directory_builder,
+
"GNUNET_GTK_publish_directory_dialog_anonymity_combobox"));
gtk_combo_box_set_model (combo,
GNUNET_FS_GTK_get_anonymity_level_list_store ());
}
@@ -1937,6 +1973,7 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb
(GtkWidget *dummy,
}
}
+
/* ********************************* editing sub-dialog *********************
*/
/**
@@ -2013,6 +2050,7 @@ update_treeview_after_edit (void *cls,
return GNUNET_SYSERR;
}
+
/**
* Function called when the edit publish dialog has been closed.
*
@@ -2032,6 +2070,7 @@ master_publish_edit_publish_dialog_cb (gpointer cls, gint
ret, const char *root)
GNUNET_free (epc);
}
+
/**
* The user clicked on the "edit" button in the master dialog. Edit
* the selected tree item.
@@ -2068,6 +2107,7 @@ GNUNET_GTK_master_publish_dialog_edit_button_clicked_cb
(GtkWidget *dummy,
epc);
}
+
/* ******************** master edit dialog shutdown *********************** */
/**
@@ -2105,6 +2145,7 @@ get_file_information (GtkTreeModel *tm, GtkTreeIter *iter)
return fi;
}
+
/**
* Recursively clean up the tree store with the file information in it.
*
@@ -2130,6 +2171,7 @@ free_file_information_tree_store (GtkTreeModel *tm,
GtkTreeIter *iter)
}
}
+
/**
* Close the master publish dialog. If the response code was OK, starts
* the publishing operation. Otherwise, this function just cleans up the
@@ -2167,6 +2209,7 @@ close_master_publish_dialog (struct
MainPublishingDialogContext *ctx)
return GNUNET_YES;
}
+
/**
* Insert namespace advertisement into metadata when
* publishing in both private namespace and global namespace.
@@ -2203,7 +2246,13 @@ insert_advertisement (void *cls,
if (NULL == ctx->ns)
return GNUNET_SYSERR;
GNUNET_IDENTITY_ego_get_public_key (ctx->ns, &pub);
- sks_uri = GNUNET_FS_uri_sks_create (&pub, "/");
+ if (GNUNET_IDENTITY_TYPE_ECDSA != pub.type)
+ {
+ GNUNET_break (0); /* FIXME: EDDSA keys not yet
+ supported for file-sharing! */
+ return GNUNET_SYSERR;
+ }
+ sks_uri = GNUNET_FS_uri_sks_create (&pub.ecdsa_key, "/");
sks_uri_string = GNUNET_FS_uri_to_string (sks_uri);
GNUNET_FS_uri_destroy (sks_uri);
if (NULL == sks_uri_string)
@@ -2220,6 +2269,7 @@ insert_advertisement (void *cls,
return GNUNET_SYSERR;
}
+
/**
* The user pushed the 'execute' button. Start the publishing
* operation and clean up the memory and the window itself.
@@ -2308,14 +2358,29 @@
GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton *button,
clear_keywords_from_tm (ctx);
do
{
+ const struct GNUNET_IDENTITY_PrivateKey *pk;
+
+ if (NULL != ns)
+ {
+ pk = GNUNET_IDENTITY_ego_get_private_key (ns);
+ if (GNUNET_IDENTITY_TYPE_ECDSA != pk->type)
+ {
+ GNUNET_break (0); /* FIXME: EDDSA keys not yet supported by FS */
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ctx->own_checkbox),
+ FALSE);
+ return;
+ }
+ }
+ else
+ {
+ pk = NULL;
+ }
fi = get_file_information (ctx->file_info_treemodel, &iter);
if (do_global && do_own && ! disable_ads_insertion)
GNUNET_FS_file_information_inspect (fi, insert_advertisement, ctx);
GNUNET_FS_publish_start (GNUNET_FS_GTK_get_fs_handle (),
fi,
- (NULL == ns)
- ? NULL
- : GNUNET_IDENTITY_ego_get_private_key (ns),
+ (NULL == pk) ? NULL : &pk->ecdsa_key,
namespace_id,
namespace_uid,
GNUNET_FS_PUBLISH_OPTION_NONE);
@@ -2330,6 +2395,7 @@
GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton *button,
GNUNET_break (GNUNET_YES == close_master_publish_dialog (ctx));
}
+
/**
* Function called on entries in a `struct GNUNET_FS_FileInformation` for
* publishing.
@@ -2363,6 +2429,7 @@ clear_keywords_in_file_information (void *cls,
return GNUNET_OK;
}
+
/**
* Remove all of the keywords from the file information item in the tree store
*
@@ -2393,6 +2460,7 @@ clear_keywords_from_file_information_in_tree_store
(GtkTreeModel *tm,
}
}
+
/**
* Remove all of the keywords from all file information structs in the tree
* store
@@ -2409,11 +2477,12 @@ clear_keywords_from_tm (struct
MainPublishingDialogContext *ctx)
do
{
clear_keywords_from_file_information_in_tree_store (ctx
-
->file_info_treemodel,
+
->file_info_treemodel,
&iter);
} while (gtk_tree_model_iter_next (ctx->file_info_treemodel, &iter));
}
+
/**
* The user pushed the 'clear' button. Remove all keywords.
*
@@ -2427,6 +2496,7 @@ GNUNET_GTK_master_publish_dialog_clear_button_clicked_cb
(GtkButton *button,
clear_keywords_from_tm (user_data);
}
+
/**
* The user pushed the 'cancel' button. Close the master publish dialog.
*
@@ -2442,6 +2512,7 @@ GNUNET_GTK_master_publish_dialog_cancel_button_clicked_cb
(GtkButton *button,
GNUNET_break (GNUNET_YES == close_master_publish_dialog (ctx));
}
+
/**
* The user attempted to close the publish window. Check if this is
* allowed and if so, close it.
@@ -2464,6 +2535,7 @@ GNUNET_GTK_master_publish_dialog_delete_event_cb
(GtkWidget *widget,
return FALSE;
}
+
/**
* Called when expander changes its state (expanded/hidden).
* Hides the widget, adjusts the paned position to compensate,
@@ -2501,6 +2573,7 @@ expander_callback (GObject *object, GParamSpec
*param_spec, gpointer user_data)
gtk_paned_set_position (GTK_PANED (ctx->vpaned), paned_pos);
}
+
/* ******************** master edit dialog initialization *******************
*/
/**
@@ -2676,7 +2749,8 @@ add_updateable_to_ts (void *cls,
}
g_free (displaytext);
- if (NULL == spath)
+ if (NULL != spath)
+ return;
{
GtkTreePath *path;
char *gspath;
@@ -2687,26 +2761,33 @@ add_updateable_to_ts (void *cls,
* map */
gspath = GNUNET_strdup (spath);
if (GNUNET_SYSERR == GNUNET_CONTAINER_multihashmap_put (
- uc->seen,
- &hc,
- gspath,
- GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))
+ uc->seen,
+ &hc,
+ gspath,
+ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))
GNUNET_free (gspath);
}
- else
- return;
sc.parent = &iter;
sc.ts = uc->ts;
sc.ns = uc->ns;
sc.seen = uc->seen;
sc.update_called = GNUNET_NO;
- GNUNET_FS_namespace_list_updateable (GNUNET_FS_GTK_get_fs_handle (),
- GNUNET_IDENTITY_ego_get_private_key (
- uc->ns),
- next_id,
- &add_updateable_to_ts,
- &sc);
+ {
+ const struct GNUNET_IDENTITY_PrivateKey *pk;
+
+ pk = GNUNET_IDENTITY_ego_get_private_key (uc->ns);
+ if (GNUNET_IDENTITY_TYPE_ECDSA != pk->type)
+ {
+ GNUNET_break (0);
+ return;
+ }
+ GNUNET_FS_namespace_list_updateable (GNUNET_FS_GTK_get_fs_handle (),
+ &pk->ecdsa_key,
+ next_id,
+ &add_updateable_to_ts,
+ &sc);
+ }
if ((sc.update_called == GNUNET_NO) && (NULL != next_id) &&
(strlen (next_id) > 0))
{
@@ -2731,6 +2812,7 @@ add_updateable_to_ts (void *cls,
}
}
+
/**
* Called by a hashmap iterator.
* Frees its argument with GNUNET_free().
@@ -2747,6 +2829,7 @@ free_seen_paths (void *cls, const struct GNUNET_HashCode
*key, void *value)
return GNUNET_YES;
}
+
/**
* User changed the selected namespace. Check if it is valid,
* and if so, update the rest of the dialog accordingly.
@@ -2798,13 +2881,25 @@
GNUNET_GTK_master_publish_dialog_ego_combobox_changed_cb (GtkComboBox *combo,
uc.ns = ego;
uc.update_called = GNUNET_NO;
uc.seen = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO);
+ {
+ const struct GNUNET_IDENTITY_PrivateKey *pk;
- GNUNET_FS_namespace_list_updateable (GNUNET_FS_GTK_get_fs_handle (),
- GNUNET_IDENTITY_ego_get_private_key (
- ego),
- NULL,
- &add_updateable_to_ts,
- &uc);
+ pk = GNUNET_IDENTITY_ego_get_private_key (ego);
+ if (GNUNET_IDENTITY_TYPE_ECDSA != pk->type)
+ {
+ GNUNET_break (0);
+ gtk_widget_set_sensitive (ctx->identifier_entry, FALSE);
+ gtk_widget_set_sensitive (ctx->updateable_checkbox, FALSE);
+ gtk_widget_set_sensitive (ctx->update_id_entry, FALSE);
+ update_selectivity_execute_cancel (ctx);
+ return;
+ }
+ GNUNET_FS_namespace_list_updateable (GNUNET_FS_GTK_get_fs_handle (),
+ &pk->ecdsa_key,
+ NULL,
+ &add_updateable_to_ts,
+ &uc);
+ }
GNUNET_CONTAINER_multihashmap_iterate (uc.seen, &free_seen_paths, NULL);
GNUNET_CONTAINER_multihashmap_destroy (uc.seen);
gtk_widget_set_sensitive (ctx->identifier_entry, TRUE);
@@ -2813,6 +2908,7 @@ GNUNET_GTK_master_publish_dialog_ego_combobox_changed_cb
(GtkComboBox *combo,
update_selectivity_execute_cancel (ctx);
}
+
/**
* Add all updateable entries of the current namespace to the
* tree store.
@@ -2883,6 +2979,7 @@ add_namespace_to_ts (void *cls,
gtk_widget_set_sensitive (ctx->update_id_entry, have_ns);
}
+
/**
* Run the file-publishing operation (by opening the master publishing dialog).
*
@@ -2936,8 +3033,8 @@ GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget
*dummy,
gtk_builder_get_object (ctx->builder,
"GNUNET_GTK_master_publish_dialog_cancel_button"));
ctx->file_info_treeview = GTK_TREE_VIEW (gtk_builder_get_object (
- ctx->builder,
- "GNUNET_GTK_master_publish_dialog_file_information_tree_view"));
+ ctx->builder,
+
"GNUNET_GTK_master_publish_dialog_file_information_tree_view"));
ctx->file_info_selection =
gtk_tree_view_get_selection (ctx->file_info_treeview);
ctx->file_info_treemodel = gtk_tree_view_get_model (ctx->file_info_treeview);
@@ -2951,8 +3048,8 @@ GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget
*dummy,
gtk_builder_get_object (ctx->builder,
"GNUNET_GTK_master_publish_dialog_own_checkbox"));
ctx->updateable_checkbox = GTK_WIDGET (gtk_builder_get_object (
- ctx->builder,
- "GNUNET_GTK_master_publish_dialog_updateable_checkbox"));
+ ctx->builder,
+
"GNUNET_GTK_master_publish_dialog_updateable_checkbox"));
ctx->update_id_entry = GTK_WIDGET (
gtk_builder_get_object (ctx->builder,
"GNUNET_GTK_master_publish_dialog_update_id_entry"));
@@ -2965,8 +3062,8 @@ GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget
*dummy,
"GNUNET_GTK_master_publish_dialog_update_id_hbox"));
ctx->identifiers_expander = GTK_WIDGET (gtk_builder_get_object (
- ctx->builder,
- "GNUNET_GTK_master_publish_dialog_previous_identifiers_expander"));
+ ctx->builder,
+
"GNUNET_GTK_master_publish_dialog_previous_identifiers_expander"));
ctx->vpaned = GTK_WIDGET (
gtk_builder_get_object (ctx->builder,
"GNUNET_GTK_master_publish_dialog_vpaned"));
@@ -2978,11 +3075,11 @@ GNUNET_GTK_main_menu_file_publish_activate_cb
(GtkWidget *dummy,
gtk_builder_get_object (ctx->builder,
"GNUNET_GTK_master_publish_dialog_identifier_entry"));
ctx->identifiers_scrolled = GTK_WIDGET (gtk_builder_get_object (
- ctx->builder,
- "GNUNET_GTK_master_publish_dialog_previous_identifiers_scrolled"));
+ ctx->builder,
+
"GNUNET_GTK_master_publish_dialog_previous_identifiers_scrolled"));
ctx->identifiers_treeview = GTK_TREE_VIEW (gtk_builder_get_object (
- ctx->builder,
- "GNUNET_GTK_master_publish_dialog_previous_identifiers_treeview"));
+ ctx->builder,
+
"GNUNET_GTK_master_publish_dialog_previous_identifiers_treeview"));
ctx->identifiers_treemodel =
gtk_tree_view_get_model (ctx->identifiers_treeview);
ctx->identifiers_selection =
@@ -3033,4 +3130,5 @@ GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget
*dummy,
gtk_window_present (GTK_WINDOW (ctx->master_pubdialog));
}
+
/* end of gnunet-fs-gtk_publish-dialog.c */
diff --git a/src/namestore/gnunet-namestore-gtk.c
b/src/namestore/gnunet-namestore-gtk.c
index 15167f31..ea61d71f 100644
--- a/src/namestore/gnunet-namestore-gtk.c
+++ b/src/namestore/gnunet-namestore-gtk.c
@@ -416,7 +416,7 @@ static GtkTreeView *tv;
/**
* Private key of the zone we are currently editing.
*/
-static struct GNUNET_IDENTITY_PrivateKey *pkey;
+static const struct GNUNET_IDENTITY_PrivateKey *pkey;
/**
* Public key of the zone we are currently editing.
@@ -2390,8 +2390,7 @@ zone_iteration_proc (void *cls,
GtkTreePath *sel_path;
(void) cls;
- if (0 !=
- memcmp (zone_key, pkey, sizeof (struct GNUNET_IDENTITY_PrivateKey)))
+ if (0 != memcmp (zone_key, pkey, sizeof (struct GNUNET_IDENTITY_PrivateKey)))
{
GNUNET_break (0);
return;
@@ -2608,9 +2607,8 @@ load_zone (const char *name, struct GNUNET_IDENTITY_Ego
*ego)
if (NULL == name)
return; /* empty zone */
current_pseudonym = GNUNET_strdup (name);
- pkey = GNUNET_new (struct GNUNET_IDENTITY_PrivateKey);
- *pkey = *GNUNET_IDENTITY_ego_get_private_key (ego);
- GNUNET_IDENTITY_ego_get_public_key (pkey, &pubkey);
+ pkey = GNUNET_IDENTITY_ego_get_private_key (ego);
+ GNUNET_IDENTITY_ego_get_public_key (ego, &pubkey);
label = g_markup_printf_escaped ("<b>%s</b>", GNUNET_GNSRECORD_z2s
(&pubkey));
gtk_label_set_markup (GTK_LABEL (
get_object ("gnunet_namestore_gtk_zone_label")),
@@ -2787,11 +2785,6 @@ cleanup_task (void *cls)
GNUNET_free (moc);
}
gtk_tree_store_clear (ts);
- if (NULL != pkey)
- {
- GNUNET_free (pkey);
- pkey = NULL;
- }
if (NULL != current_pseudonym)
{
GNUNET_free (current_pseudonym);
diff --git a/src/namestore/plugin_gtk_namestore_phone.c
b/src/namestore/plugin_gtk_namestore_phone.c
index 9d1576eb..843f4a15 100644
--- a/src/namestore/plugin_gtk_namestore_phone.c
+++ b/src/namestore/plugin_gtk_namestore_phone.c
@@ -1,22 +1,22 @@
/*
- * This file is part of GNUnet
- * Copyright (C) 2009-2013 GNUnet e.V.
- *
- * GNUnet is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 3, or (at your
- * option) any later version.
- *
- * GNUnet is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNUnet; see the file COPYING. If not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
+ * This file is part of GNUnet
+ * Copyright (C) 2009-2013 GNUnet e.V.
+ *
+ * GNUnet is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 3, or (at your
+ * option) any later version.
+ *
+ * GNUnet is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNUnet; see the file COPYING. If not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
/**
* @file namestore/plugin_gtk_namestore_phone.c
@@ -133,8 +133,9 @@ phone_validate (void *cls, GtkBuilder *builder)
(GNUNET_OK !=
GNUNET_CRYPTO_ecdsa_public_key_from_string (preedit,
strlen (preedit),
- &pub)))
+ &pub.ecdsa_key)))
return GNUNET_SYSERR;
+ pub.type = GNUNET_IDENTITY_TYPE_ECDSA;
return GNUNET_OK;
}
@@ -151,9 +152,9 @@ libgnunet_plugin_gtk_namestore_phone_init (void *cls)
struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls;
struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin;
static struct GNUNET_GTK_NAMESTORE_Symbol symbols[] =
- {{"GNS_edit_dialog_phone_peer_entry_changed_cb",
- G_CALLBACK (GNS_edit_dialog_phone_peer_entry_changed_cb)},
- {NULL, NULL}};
+ {{"GNS_edit_dialog_phone_peer_entry_changed_cb",
+ G_CALLBACK (GNS_edit_dialog_phone_peer_entry_changed_cb)},
+ {NULL, NULL}};
plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions);
plugin->cls = env;
@@ -182,4 +183,5 @@ libgnunet_plugin_gtk_namestore_phone_done (void *cls)
return NULL;
}
+
/* end of plugin_gtk_namestore_phone.c */
diff --git a/src/namestore/plugin_gtk_namestore_pkey.c
b/src/namestore/plugin_gtk_namestore_pkey.c
index c31ca79b..3e5d0321 100644
--- a/src/namestore/plugin_gtk_namestore_pkey.c
+++ b/src/namestore/plugin_gtk_namestore_pkey.c
@@ -1,22 +1,22 @@
/*
- * This file is part of GNUnet
- * Copyright (C) 2009-2013 GNUnet e.V.
- *
- * GNUnet is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 3, or (at your
- * option) any later version.
- *
- * GNUnet is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNUnet; see the file COPYING. If not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
+ * This file is part of GNUnet
+ * Copyright (C) 2009-2013 GNUnet e.V.
+ *
+ * GNUnet is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 3, or (at your
+ * option) any later version.
+ *
+ * GNUnet is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNUnet; see the file COPYING. If not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
/**
* @file namestore/plugin_gtk_namestore_pkey.c
@@ -108,8 +108,9 @@ pkey_validate (void *cls, GtkBuilder *builder)
(GNUNET_OK !=
GNUNET_CRYPTO_ecdsa_public_key_from_string (preedit,
strlen (preedit),
- &pub)))
+ &pub.ecdsa_key)))
return GNUNET_SYSERR;
+ pub.type = GNUNET_IDENTITY_TYPE_ECDSA;
return GNUNET_OK;
}
@@ -126,9 +127,9 @@ libgnunet_plugin_gtk_namestore_pkey_init (void *cls)
struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls;
struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin;
static struct GNUNET_GTK_NAMESTORE_Symbol symbols[] =
- {{"GNS_edit_dialog_pkey_entry_changed_cb",
- G_CALLBACK (GNS_edit_dialog_pkey_entry_changed_cb)},
- {NULL, NULL}};
+ {{"GNS_edit_dialog_pkey_entry_changed_cb",
+ G_CALLBACK (GNS_edit_dialog_pkey_entry_changed_cb)},
+ {NULL, NULL}};
plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions);
plugin->cls = env;
@@ -157,4 +158,5 @@ libgnunet_plugin_gtk_namestore_pkey_done (void *cls)
return NULL;
}
+
/* end of plugin_gtk_namestore_pkey.c */
diff --git a/src/namestore/plugin_gtk_namestore_soa.c
b/src/namestore/plugin_gtk_namestore_soa.c
index 0dfc893e..171b6eaa 100644
--- a/src/namestore/plugin_gtk_namestore_soa.c
+++ b/src/namestore/plugin_gtk_namestore_soa.c
@@ -106,24 +106,24 @@ soa_load (void *cls, gchar *n_value, GtkBuilder *builder)
gtk_builder_get_object (builder, "edit_dialog_soa_contact_email_entry")),
soa_mname);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
- builder,
- "edit_dialog_soa_serial_number_spinbutton")),
+ builder,
+
"edit_dialog_soa_serial_number_spinbutton")),
soa_serial);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
- builder,
- "edit_dialog_soa_refresh_time_spinbutton")),
+ builder,
+
"edit_dialog_soa_refresh_time_spinbutton")),
soa_refresh);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
- builder,
- "edit_dialog_soa_retry_time_spinbutton")),
+ builder,
+
"edit_dialog_soa_retry_time_spinbutton")),
soa_retry);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
- builder,
- "edit_dialog_soa_expire_time_spinbutton")),
+ builder,
+
"edit_dialog_soa_expire_time_spinbutton")),
soa_expire);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
- builder,
- "edit_dialog_soa_minimum_ttl_spinbutton")),
+ builder,
+
"edit_dialog_soa_minimum_ttl_spinbutton")),
soa_min);
}
@@ -156,21 +156,22 @@ soa_store (void *cls, GtkBuilder *builder)
gtk_builder_get_object (builder, "edit_dialog_soa_contact_email_entry"));
contact_email = gtk_entry_get_text (entry);
soa_serial = gtk_spin_button_get_value (GTK_SPIN_BUTTON (
- gtk_builder_get_object (builder,
- "edit_dialog_soa_serial_number_spinbutton")));
+ gtk_builder_get_object (builder,
+
"edit_dialog_soa_serial_number_spinbutton")));
soa_refresh = gtk_spin_button_get_value (GTK_SPIN_BUTTON (
- gtk_builder_get_object (builder,
- "edit_dialog_soa_refresh_time_spinbutton")));
+ gtk_builder_get_object (builder,
+
"edit_dialog_soa_refresh_time_spinbutton")));
soa_retry = gtk_spin_button_get_value (GTK_SPIN_BUTTON (
- gtk_builder_get_object (builder,
"edit_dialog_soa_retry_time_spinbutton")));
+ gtk_builder_get_object (builder,
+
"edit_dialog_soa_retry_time_spinbutton")));
soa_expire = gtk_spin_button_get_value (GTK_SPIN_BUTTON (
- gtk_builder_get_object (builder,
- "edit_dialog_soa_expire_time_spinbutton")));
+ gtk_builder_get_object (builder,
+
"edit_dialog_soa_expire_time_spinbutton")));
soa_min = gtk_spin_button_get_value (GTK_SPIN_BUTTON (
- gtk_builder_get_object (builder,
- "edit_dialog_soa_minimum_ttl_spinbutton")));
+ gtk_builder_get_object (builder,
+
"edit_dialog_soa_minimum_ttl_spinbutton")));
GNUNET_asprintf (&result,
- "rname=%s mname=%s %lu,%lu,%lu,%lu,%lu",
+ "rname=%s mname=%s %u,%u,%u,%u,%u",
source_host,
contact_email,
soa_serial,
@@ -231,11 +232,11 @@ libgnunet_plugin_gtk_namestore_soa_init (void *cls)
struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls;
struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin;
static struct GNUNET_GTK_NAMESTORE_Symbol symbols[] =
- {{"GNS_edit_dialog_soa_contact_email_entry_changed_cb",
- G_CALLBACK (GNS_edit_dialog_soa_contact_email_entry_changed_cb)},
- {"GNS_edit_dialog_soa_source_host_entry_changed_cb",
- G_CALLBACK (GNS_edit_dialog_soa_source_host_entry_changed_cb)},
- {NULL, NULL}};
+ {{"GNS_edit_dialog_soa_contact_email_entry_changed_cb",
+ G_CALLBACK (GNS_edit_dialog_soa_contact_email_entry_changed_cb)},
+ {"GNS_edit_dialog_soa_source_host_entry_changed_cb",
+ G_CALLBACK (GNS_edit_dialog_soa_source_host_entry_changed_cb)},
+ {NULL, NULL}};
plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions);
plugin->cls = env;
@@ -264,4 +265,5 @@ libgnunet_plugin_gtk_namestore_soa_done (void *cls)
return NULL;
}
+
/* end of plugin_gtk_namestore_soa.c */
diff --git a/src/setup/gnunet-setup-transport-test.c
b/src/setup/gnunet-setup-transport-test.c
index fd08c633..89df2d23 100644
--- a/src/setup/gnunet-setup-transport-test.c
+++ b/src/setup/gnunet-setup-transport-test.c
@@ -122,8 +122,7 @@ start_service (const char *name)
path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBEXECDIR);
GNUNET_asprintf (&filename, "%s/%s", path, binary);
GNUNET_free (path);
- proc = GNUNET_OS_start_process (GNUNET_NO,
- GNUNET_OS_INHERIT_STD_ERR,
+ proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR,
NULL,
NULL,
NULL,
@@ -301,4 +300,5 @@ GNUNET_setup_transport_test (const char *section_name,
GNUNET_NAT_AUTO_test_start (cfg, proto, section_name, &result_callback,
tc);
}
+
/* end of gnunet-setup-transport-test.c */
diff --git a/src/setup/gnunet-setup.c b/src/setup/gnunet-setup.c
index a2c26f73..262645a1 100644
--- a/src/setup/gnunet-setup.c
+++ b/src/setup/gnunet-setup.c
@@ -247,7 +247,8 @@ load_options ()
#ifndef LINUX
gtk_widget_hide (GTK_WIDGET (
- GNUNET_SETUP_get_object ("GNUNET_setup_gns_hijack_checkbutton")));
+ GNUNET_SETUP_get_object (
+ "GNUNET_setup_gns_hijack_checkbutton")));
#endif
for (unsigned int i = 0; NULL != option_specifications[i].widget_name; i++)
{
@@ -396,7 +397,6 @@ try_gksu (const char *username)
struct GNUNET_OS_Process *proc;
proc = GNUNET_OS_start_process (
- GNUNET_NO,
GNUNET_OS_INHERIT_STD_ALL,
NULL,
NULL,
@@ -417,6 +417,8 @@ try_gksu (const char *username)
GNUNET_OS_process_destroy (proc);
return GNUNET_OK;
}
+
+
#endif
@@ -430,8 +432,7 @@ GNUNET_setup_launch_edit_friends_button_clicked_cb
(GtkButton *button,
{
struct GNUNET_OS_Process *proc;
- proc = GNUNET_OS_start_process (GNUNET_NO,
- GNUNET_OS_INHERIT_STD_ALL,
+ proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL,
NULL,
NULL,
NULL,
@@ -543,7 +544,8 @@ main (int argc, char *const *argv)
"run as user 'gnunet', if necessary by executing gksu to elevate
rights"),
&do_gksu),
#endif
- GNUNET_GETOPT_OPTION_END};
+ GNUNET_GETOPT_OPTION_END
+ };
int ret;
if (GNUNET_OK == GNUNET_GTK_main_loop_start ("gnunet-setup",
@@ -559,4 +561,5 @@ main (int argc, char *const *argv)
return ret;
}
+
/* end of gnunet-setup.c */
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet-gtk] branch master updated: migrate gnunet-gtk logic to new (0.14.x) GNS/identity APIs,
gnunet <=