gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis-gtk] 02/07: fix


From: gnunet
Subject: [taler-anastasis-gtk] 02/07: fix
Date: Fri, 09 Oct 2020 12:03:38 +0200

This is an automated email from the git hooks/post-receive script.

dennis-neufeld pushed a commit to branch master
in repository anastasis-gtk.

commit b4601ac18969c4c314cc342cc527b092acdb7425
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Wed Oct 7 10:48:40 2020 +0200

    fix
---
 contrib/anastasis_gtk_main_window.glade |  3 ++
 src/anastasis/anastasis-gtk.c           | 50 +++++++++++++--------------------
 src/anastasis/anastasis-gtk_helper.c    |  1 +
 3 files changed, 23 insertions(+), 31 deletions(-)

diff --git a/contrib/anastasis_gtk_main_window.glade 
b/contrib/anastasis_gtk_main_window.glade
index 7c8cab4..00a2901 100644
--- a/contrib/anastasis_gtk_main_window.glade
+++ b/contrib/anastasis_gtk_main_window.glade
@@ -1010,11 +1010,14 @@
       <column type="gchararray"/>
       <!-- column-name country_code -->
       <column type="gchararray"/>
+      <!-- column-name country_currency -->
+      <column type="gchararray"/>
     </columns>
     <data>
       <row>
         <col id="0" translatable="yes">Germany</col>
         <col id="1" translatable="yes">de</col>
+        <col id="2" translatable="yes"/>
       </row>
     </data>
   </object>
diff --git a/src/anastasis/anastasis-gtk.c b/src/anastasis/anastasis-gtk.c
index 1891069..8808e6b 100644
--- a/src/anastasis/anastasis-gtk.c
+++ b/src/anastasis/anastasis-gtk.c
@@ -240,7 +240,7 @@ anastasis_gtk_continent_activated (GtkTreeView *tree_view,
             gtk_tree_model_get (model, &iter, 0, &continent_name, -1);
             json_object_set (arguments, "continent", json_string 
(continent_name));
 
-            if (check_state (redux_state, "ReduxContinentSelectedState"))
+            if (check_state (redux_state, "ContinentSelectionState"))
                 redux_state = ANASTASIS_backup_start (cfg);
             ANASTASIS_redux_action (redux_state,
                                      "select_continent",
@@ -273,6 +273,7 @@ anastasis_gtk_country_activated (GtkTreeView *tree_view,
         {
             gchar *country_name;
             gchar *country_code;
+            gchar *country_currency;
             json_t *arguments = json_object ();
 
             if (NULL == arguments)
@@ -281,12 +282,14 @@ anastasis_gtk_country_activated (GtkTreeView *tree_view,
             }
             gtk_tree_model_get (model, &iter, 
                                 0, &country_name, 
-                                1, &country_code, 
+                                1, &country_code,
+                                2, &country_currency, 
                                 -1);
             json_object_set (arguments, "country", json_string (country_name));
             json_object_set (arguments, "country_code", json_string 
(country_code));
+            json_object_set (arguments, "currency", json_string 
(country_currency));
 
-            if (check_state (redux_state, "ReduxCountrySelectionState"))
+            if (check_state (redux_state, "CountrySelectionState"))
                 ANASTASIS_redux_action (redux_state,
                                         "select_country",
                                         arguments,
@@ -401,17 +404,15 @@ anastasis_gtk_main_window_forward_clicked (GObject 
*object,
     {
         GList *children, *iter;
         json_t *arguments = json_object ();
-        json_t *attributes = json_array ();
+        json_t *id_attr = json_object ();
 
         children = gtk_container_get_children (GTK_CONTAINER 
(GCG_get_main_window_object (
                                                                 
"anastasis_gtk_identity_vbox")));
         for (iter = children; iter != NULL; iter = g_list_next (iter))
         {
-            bool isset = false;
             char *entry_widget;
             char *cal_widget;
             const char *widget = gtk_buildable_get_name (iter->data);
-            json_t *id_attr = json_object ();
 
             GNUNET_asprintf (&entry_widget,
                              "%s_entry",
@@ -423,17 +424,14 @@ anastasis_gtk_main_window_forward_clicked (GObject 
*object,
             if (GCG_get_main_window_object (entry_widget))
             {
                 const char *value = gtk_entry_get_text (GTK_ENTRY 
(GCG_get_main_window_object (entry_widget)));
-                if (strlen (value) > 0)
-                    isset = true;
-                json_object_set_new (id_attr, "type", json_string ("string"));
+                if (0 == strlen (value))
+                    break;
                 if (strstr (widget, "ia_ahv"))
-                    json_object_set_new (id_attr, "name", json_string 
("ahv_number"));
+                    json_object_set_new (id_attr, "ahv_number", json_string 
(value));
                 if (strstr (widget, "ia_ssn"))
-                    json_object_set_new (id_attr, "name", json_string 
("social_security_number"));
+                    json_object_set_new (id_attr, "social_security_number", 
json_string (value));
                 if (strstr (widget, "ia_full_name"))
-                    json_object_set_new (id_attr, "name", json_string 
("full_name"));
-                json_object_set_new (id_attr, "value", json_string (value));
-                json_object_set_new (id_attr, "widget", json_string 
(entry_widget));
+                    json_object_set_new (id_attr, "full_name", json_string 
(value));
             }
             if (GCG_get_main_window_object (cal_widget))
             {
@@ -441,32 +439,22 @@ anastasis_gtk_main_window_forward_clicked (GObject 
*object,
                 guint month;
                 guint year;
 
-                json_object_set_new (id_attr, "type", json_string ("date"));
                 gtk_calendar_get_date (GTK_CALENDAR 
(GCG_get_main_window_object (cal_widget)),
                                        &year,
                                        &month,
                                        &day);
-                json_object_set_new (id_attr, "year", json_integer (year));
-                json_object_set_new (id_attr, "month", json_integer (month));
-                json_object_set_new (id_attr, "day", json_integer (day));
-                json_object_set_new (id_attr, "widget", json_string 
(cal_widget));
+                json_object_set_new (id_attr, "birth_year", json_integer 
(year));
+                json_object_set_new (id_attr, "birth_month", json_integer 
(month));
+                json_object_set_new (id_attr, "birth_day", json_integer (day));
             }
-            if (isset)
-                json_array_append_new (attributes, id_attr);
             GNUNET_free (entry_widget);
             GNUNET_free (cal_widget);
         }
-        json_object_set_new (arguments, "identity", attributes);
+        json_object_set_new (arguments, "identity_attributes", id_attr);
 
-        if (check_state (redux_state, "ReduxCountrySelectedState"))
+        if (check_state (redux_state, "UserAttributesCollectionState"))
             ANASTASIS_redux_action (redux_state,
-                                    "entering_user_attributes",
-                                    arguments,
-                                    &action_cb,
-                                    NULL);
-        else
-            ANASTASIS_redux_action (redux_state,
-                                    "editing_user_attributes",
+                                    "enter_user_attributes",
                                     arguments,
                                     &action_cb,
                                     NULL);
@@ -483,7 +471,7 @@ anastasis_gtk_main_window_forward_clicked (GObject *object,
     if (gtk_widget_is_visible (GTK_WIDGET (GCG_get_main_window_object (
                                         
"anastasis_gtk_b_authentication_frame"))))
     {
-        if (check_state (redux_state, "ReduxUserAttributesAddedState"))
+        if (check_state (redux_state, "AuthenticationsEditingState"))
         {
             GList *children;
 
diff --git a/src/anastasis/anastasis-gtk_helper.c 
b/src/anastasis/anastasis-gtk_helper.c
index 65610d5..2316ed2 100644
--- a/src/anastasis/anastasis-gtk_helper.c
+++ b/src/anastasis/anastasis-gtk_helper.c
@@ -339,6 +339,7 @@ init_country_list (json_t *state,
         gtk_list_store_set (country_liststore, &iter,
                             0, json_string_value (json_object_get (country, 
"name")), //FIXME implement i18n
                             1, json_string_value (json_object_get (country, 
"code")),
+                            2, json_string_value (json_object_get (country, 
"currency")),
                             -1);
     }
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]