aboutsummaryrefslogtreecommitdiff
path: root/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c')
-rw-r--r--src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c92
1 files changed, 16 insertions, 76 deletions
diff --git a/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c b/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c
index 4c4eab9..a4b6a64 100644
--- a/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c
+++ b/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c
@@ -36,39 +36,8 @@
/**
- * Function called on each selected currency. Appends
- * the currency to the JSON array.
- *
- * @param model the model of the currencies
- * @param path a path (unused)
- * @param iter selected currency position
- * @param data a `json *` with the JSON array to expand
- */
-static void
-append_currency (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data)
-{
- json_t *currencies = data;
- gchar *currency;
-
- (void) path;
- gtk_tree_model_get (model,
- iter,
- AG_CMC_CURRENCY_NAME,
- &currency,
- -1);
- GNUNET_break (0 ==
- json_array_append_new (currencies,
- json_string (currency)));
- g_free (currency);
-}
-
-
-/**
* The user selected the 'forward' button. Move on with the
- * country and currency selection.
+ * country selection.
*/
static void
forward_country_selecting (void)
@@ -80,7 +49,6 @@ forward_country_selecting (void)
gchar *country_name;
gchar *country_code;
json_t *arguments;
- json_t *currencies;
tv = GTK_TREE_VIEW (GCG_get_main_window_object (
"anastasis_gtk_country_treeview"));
@@ -92,13 +60,6 @@ forward_country_selecting (void)
GNUNET_break (0);
return;
}
- currencies = json_array ();
- GNUNET_assert (NULL != currencies);
- gtk_tree_selection_selected_foreach (
- GTK_TREE_SELECTION (
- GCG_get_main_window_object ("anastasis_gtk_currency_selection")),
- &append_currency,
- currencies);
gtk_tree_model_get (model,
&iter,
AG_CCMC_COUNTRY_NAME, &country_name,
@@ -108,9 +69,7 @@ forward_country_selecting (void)
GNUNET_JSON_pack_string ("country",
country_name),
GNUNET_JSON_pack_string ("country_code",
- country_code),
- GNUNET_JSON_pack_array_steal ("currencies",
- currencies));
+ country_code));
g_free (country_name);
g_free (country_code);
AG_freeze ();
@@ -449,13 +408,9 @@ forward_secret_selecting (void)
gchar *secret_name;
gint version;
gint mask;
+ const json_t *providers;
AG_freeze ();
- if (NULL != AG_pd)
- {
- ANASTASIS_policy_discovery_stop (AG_pd);
- AG_pd = NULL;
- }
AG_stop_long_action ();
selection = GTK_TREE_SELECTION (
GCG_get_main_window_object (
@@ -475,41 +430,26 @@ forward_secret_selecting (void)
AG_SSMC_POLICY_VERSION, &version,
AG_SSMC_ATTRIBUTE_MASK, &mask,
AG_SSMC_SECRET_NAME, &secret_name,
+ AG_SSMC_POLICY_PROVIDER_JSON, &providers,
-1);
- {
- json_t *providers;
-
- providers = json_array ();
- /* FIXME #7221: should build array with _all_ providers
- that provide the same policy here, instead of
- just picking one of them...
- => requires change in tree model or different
- lookup. */
- GNUNET_assert (NULL != providers);
- GNUNET_assert (
- 0 ==
- json_array_append (
- providers,
- GNUNET_JSON_PACK (
- GNUNET_JSON_pack_string ("url",
- provider_url),
- GNUNET_JSON_pack_uint64 ("version",
- version))));
- args = GNUNET_JSON_PACK (
- GNUNET_JSON_pack_array_steal ("providers",
- providers),
- GNUNET_JSON_pack_uint64 ("attribute_mask",
- mask),
- GNUNET_JSON_pack_string ("secret_name",
- secret_name)
- );
- }
+ args = GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_array_incref ("providers",
+ (json_t *) providers),
+ GNUNET_JSON_pack_uint64 ("attribute_mask",
+ mask),
+ GNUNET_JSON_pack_string ("secret_name",
+ secret_name));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Proceeding with policy version %u at provider %s\n",
(unsigned int) version,
provider_url);
g_free (provider_url);
g_free (secret_name);
+ if (NULL != AG_pd)
+ {
+ ANASTASIS_policy_discovery_stop (AG_pd);
+ AG_pd = NULL;
+ }
AG_ra = ANASTASIS_redux_action (AG_redux_state,
"select_version",
args,