gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis-gtk] branch master updated (b289c6b -> d6961fe)


From: gnunet
Subject: [taler-anastasis-gtk] branch master updated (b289c6b -> d6961fe)
Date: Fri, 18 Sep 2020 13:38:16 +0200

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

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

    from b289c6b  worked on back-/forward-buttons
     new 58e8a65  removed optional attributes logic
     new 7652f0e  authentication frame (backup)
     new d6961fe  modified authentication frame (backup)

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 contrib/anastasis_gtk_main_window.glade | 205 +++++++++++++++++++++++++++++---
 src/anastasis/anastasis-gtk_helper.c    |  98 ++++++++-------
 2 files changed, 246 insertions(+), 57 deletions(-)

diff --git a/contrib/anastasis_gtk_main_window.glade 
b/contrib/anastasis_gtk_main_window.glade
index 1106192..124ce6f 100644
--- a/contrib/anastasis_gtk_main_window.glade
+++ b/contrib/anastasis_gtk_main_window.glade
@@ -294,13 +294,14 @@
                                     <child>
                                       <object class="GtkBox" 
id="anastasis_gtk_ia_full_name">
                                         <property 
name="can_focus">False</property>
+                                        <property 
name="homogeneous">True</property>
                                         <child>
                                           <object class="GtkLabel" 
id="anastasis_gtk_ia_full_name_label">
                                             <property 
name="visible">True</property>
                                             <property 
name="can_focus">False</property>
                                             <property 
name="halign">start</property>
                                             <property 
name="valign">center</property>
-                                            <property 
name="margin_start">10</property>
+                                            <property 
name="margin_start">20</property>
                                             <property 
name="hexpand">True</property>
                                             <property name="label" 
translatable="yes">Full name:</property>
                                           </object>
@@ -334,13 +335,14 @@
                                     <child>
                                       <object class="GtkBox" 
id="anastasis_gtk_ia_ahv">
                                         <property 
name="can_focus">False</property>
+                                        <property 
name="homogeneous">True</property>
                                         <child>
                                           <object class="GtkLabel" 
id="anastasis_gtk_ia_ahv_label">
                                             <property 
name="visible">True</property>
                                             <property 
name="can_focus">False</property>
                                             <property 
name="halign">start</property>
                                             <property 
name="valign">center</property>
-                                            <property 
name="margin_start">10</property>
+                                            <property 
name="margin_start">20</property>
                                             <property 
name="hexpand">True</property>
                                             <property name="label" 
translatable="yes">AHV number:</property>
                                           </object>
@@ -374,13 +376,14 @@
                                     <child>
                                       <object class="GtkBox" 
id="anastasis_gtk_ia_ssn">
                                         <property 
name="can_focus">False</property>
+                                        <property 
name="homogeneous">True</property>
                                         <child>
                                           <object class="GtkLabel" 
id="anastasis_gtk_ia_ssn_label">
                                             <property 
name="visible">True</property>
                                             <property 
name="can_focus">False</property>
                                             <property 
name="halign">start</property>
                                             <property 
name="valign">center</property>
-                                            <property 
name="margin_start">10</property>
+                                            <property 
name="margin_start">20</property>
                                             <property 
name="hexpand">True</property>
                                             <property name="label" 
translatable="yes">Social security number:</property>
                                           </object>
@@ -414,10 +417,13 @@
                                     <child>
                                       <object class="GtkBox" 
id="anastasis_gtk_ia_birthdate">
                                         <property 
name="can_focus">False</property>
+                                        <property 
name="homogeneous">True</property>
                                         <child>
                                           <object class="GtkLabel" 
id="anastasis_gtk_ia_birthdate_label">
                                             <property 
name="visible">True</property>
                                             <property 
name="can_focus">False</property>
+                                            <property 
name="halign">start</property>
+                                            <property 
name="margin_start">20</property>
                                             <property 
name="hexpand">True</property>
                                             <property name="label" 
translatable="yes">Birthdate:</property>
                                           </object>
@@ -433,7 +439,6 @@
                                             <property 
name="can_focus">True</property>
                                             <property 
name="hexpand">True</property>
                                             <property 
name="year">2020</property>
-                                            <property name="month">8</property>
                                             <property 
name="show_day_names">False</property>
                                             <signal name="day-selected" 
handler="anastasis_gtk_ia_birthdate_cal_day_selected_cb" swapped="no"/>
                                           </object>
@@ -469,7 +474,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkFrame" 
id="anastasis_gtk_provider_frame">
+                          <object class="GtkFrame" 
id="anastasis_gtk_b_authentication_frame">
                             <property name="can_focus">False</property>
                             <property name="label_xalign">0</property>
                             <property name="shadow_type">none</property>
@@ -484,16 +489,36 @@
                                     <property name="can_focus">False</property>
                                     <property 
name="orientation">vertical</property>
                                     <child>
-                                      <object class="GtkComboBoxText" 
id="anastasis_gtk_provider_combo">
+                                      <object class="GtkBox">
                                         <property 
name="visible">True</property>
                                         <property 
name="can_focus">False</property>
-                                        <property 
name="hexpand">True</property>
-                                        <property name="active">0</property>
-                                        <items>
-                                          <item translatable="yes">a</item>
-                                          <item translatable="yes">b</item>
-                                          <item translatable="yes">c</item>
-                                        </items>
+                                        <child>
+                                          <object class="GtkTextView">
+                                            <property 
name="name">anastasis_gtk_b_authentication_methods_text</property>
+                                            <property 
name="visible">True</property>
+                                            <property 
name="can_focus">True</property>
+                                            <property 
name="hexpand">True</property>
+                                            <property 
name="vexpand">True</property>
+                                            <property 
name="editable">False</property>
+                                          </object>
+                                          <packing>
+                                            <property 
name="expand">False</property>
+                                            <property 
name="fill">True</property>
+                                            <property 
name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkScrollbar">
+                                            <property 
name="visible">True</property>
+                                            <property 
name="can_focus">False</property>
+                                            <property 
name="orientation">vertical</property>
+                                          </object>
+                                          <packing>
+                                            <property 
name="expand">False</property>
+                                            <property 
name="fill">True</property>
+                                            <property 
name="position">1</property>
+                                          </packing>
+                                        </child>
                                       </object>
                                       <packing>
                                         <property 
name="expand">False</property>
@@ -502,10 +527,158 @@
                                       </packing>
                                     </child>
                                     <child>
-                                      <placeholder/>
+                                      <object class="GtkSeparator">
+                                        <property 
name="visible">True</property>
+                                        <property 
name="can_focus">False</property>
+                                      </object>
+                                      <packing>
+                                        <property 
name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
                                     </child>
                                     <child>
-                                      <placeholder/>
+                                      <object class="GtkAlignment">
+                                        <property 
name="visible">True</property>
+                                        <property 
name="can_focus">False</property>
+                                        <child>
+                                          <object class="GtkBox">
+                                            <property 
name="visible">True</property>
+                                            <property 
name="can_focus">False</property>
+                                            <child>
+                                              <object class="GtkFrame">
+                                                <property 
name="visible">True</property>
+                                                <property 
name="can_focus">False</property>
+                                                <property 
name="margin_end">50</property>
+                                                <property 
name="hexpand">True</property>
+                                                <property 
name="label_xalign">0</property>
+                                                <property 
name="shadow_type">none</property>
+                                                <child>
+                                                  <object class="GtkBox">
+                                                    <property 
name="visible">True</property>
+                                                    <property 
name="can_focus">False</property>
+                                                    <property 
name="spacing">8</property>
+                                                    <property 
name="homogeneous">True</property>
+                                                    <child>
+                                                      <object 
class="GtkButton">
+                                                        <property name="label" 
translatable="yes">SMS</property>
+                                                        <property 
name="visible">True</property>
+                                                        <property 
name="can_focus">True</property>
+                                                        <property 
name="receives_default">True</property>
+                                                      </object>
+                                                      <packing>
+                                                        <property 
name="expand">False</property>
+                                                        <property 
name="fill">True</property>
+                                                        <property 
name="position">0</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <object 
class="GtkButton">
+                                                        <property name="label" 
translatable="yes">EMAIL</property>
+                                                        <property 
name="visible">True</property>
+                                                        <property 
name="can_focus">True</property>
+                                                        <property 
name="receives_default">True</property>
+                                                      </object>
+                                                      <packing>
+                                                        <property 
name="expand">False</property>
+                                                        <property 
name="fill">True</property>
+                                                        <property 
name="position">1</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <object 
class="GtkButton">
+                                                        <property name="label" 
translatable="yes">SECURE
+QUESTION</property>
+                                                        <property 
name="visible">True</property>
+                                                        <property 
name="can_focus">True</property>
+                                                        <property 
name="receives_default">True</property>
+                                                      </object>
+                                                      <packing>
+                                                        <property 
name="expand">False</property>
+                                                        <property 
name="fill">True</property>
+                                                        <property 
name="position">2</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <object 
class="GtkButton">
+                                                        <property name="label" 
translatable="yes">POST</property>
+                                                        <property 
name="visible">True</property>
+                                                        <property 
name="can_focus">True</property>
+                                                        <property 
name="receives_default">True</property>
+                                                      </object>
+                                                      <packing>
+                                                        <property 
name="expand">False</property>
+                                                        <property 
name="fill">True</property>
+                                                        <property 
name="position">3</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <object 
class="GtkButton">
+                                                        <property name="label" 
translatable="yes">VIDEO AUTH</property>
+                                                        <property 
name="visible">True</property>
+                                                        <property 
name="can_focus">True</property>
+                                                        <property 
name="receives_default">True</property>
+                                                      </object>
+                                                      <packing>
+                                                        <property 
name="expand">False</property>
+                                                        <property 
name="fill">True</property>
+                                                        <property 
name="position">4</property>
+                                                      </packing>
+                                                    </child>
+                                                  </object>
+                                                </child>
+                                                <child type="label">
+                                                  <object class="GtkLabel">
+                                                    <property 
name="visible">True</property>
+                                                    <property 
name="can_focus">False</property>
+                                                    <property name="label" 
translatable="yes">Add Method</property>
+                                                  </object>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property 
name="expand">True</property>
+                                                <property 
name="fill">True</property>
+                                                <property 
name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkBox">
+                                                <property 
name="visible">True</property>
+                                                <property 
name="can_focus">False</property>
+                                                <property 
name="homogeneous">True</property>
+                                                <child>
+                                                  <placeholder/>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkButton">
+                                                    <property name="label" 
translatable="yes">Edit
+Provider</property>
+                                                    <property 
name="visible">True</property>
+                                                    <property 
name="can_focus">True</property>
+                                                    <property 
name="receives_default">True</property>
+                                                    <property 
name="halign">end</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property 
name="expand">False</property>
+                                                    <property 
name="fill">False</property>
+                                                    <property 
name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property 
name="expand">False</property>
+                                                <property 
name="fill">True</property>
+                                                <property 
name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property 
name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">2</property>
+                                      </packing>
                                     </child>
                                   </object>
                                 </child>
@@ -515,7 +688,7 @@
                               <object class="GtkLabel">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="label" 
translatable="yes">Please select Anastasis provider:</property>
+                                <property name="label" 
translatable="yes">Authentication Methods</property>
                               </object>
                             </child>
                           </object>
diff --git a/src/anastasis/anastasis-gtk_helper.c 
b/src/anastasis/anastasis-gtk_helper.c
index cdae465..1b9b6b6 100644
--- a/src/anastasis/anastasis-gtk_helper.c
+++ b/src/anastasis/anastasis-gtk_helper.c
@@ -47,48 +47,51 @@ check_attributes_fullfilled ()
 
     json_array_foreach (id_attributes, index, id_attr)
     {
-        if (json_is_true (json_object_get (id_attr, "required")))
+        const char *type = json_string_value (json_object_get (id_attr, 
"type"));
+        const char *widget_name = json_string_value (json_object_get (id_attr, 
"widget"));
+        if (0 == strcmp (type, "string"))
         {
-            const char *type = json_string_value (json_object_get (id_attr, 
"type"));
-            const char *widget_name = json_string_value (json_object_get 
(id_attr, "widget"));
-            if (0 == strcmp (type, "string"))
+            char *entry_widget;
+            if (widget_name)
             {
-                char *entry_widget;
-                if (widget_name)
-                {
-                    GNUNET_asprintf (&entry_widget,
-                                    "%s_entry",
-                                    widget_name);
-                }
-                else
-                {
-                    /** FIXME: create a new GtkEntry here */
-                }
-                
-                GObject *entry = GCG_get_main_window_object (entry_widget);
-                if (0 == gtk_entry_get_text_length (GTK_ENTRY (entry)))
-                    fullfilled = false;
-                GNUNET_free (entry_widget);
+                GNUNET_asprintf (&entry_widget,
+                                "%s_entry",
+                                widget_name);
             }
-            if (0 == strcmp (type, "date"))
+            else
             {
-                guint day;
-                char *cal_widget;
-                if (widget_name)
-                {
-                    GNUNET_asprintf (&cal_widget,
-                                    "%s_cal",
-                                    widget_name);
-                }
-                else
-                {
-                    /** FIXME: create a new GtkCalendar here */
-                }
-                GObject *cal = GCG_get_main_window_object (cal_widget);
-                GNUNET_free (cal_widget);
-                if (!gtk_calendar_get_day_is_marked (GTK_CALENDAR (cal), day))
-                    fullfilled = false;
+                /** FIXME: create a new GtkEntry here */
+            }
+            
+            GObject *entry = GCG_get_main_window_object (entry_widget);
+            if (0 == gtk_entry_get_text_length (GTK_ENTRY (entry)))
+                fullfilled = false;
+            GNUNET_free (entry_widget);
+        }
+        if (0 == strcmp (type, "date"))
+        {
+            guint day;
+            guint month;
+            guint year;
+            char *cal_widget;
+            if (widget_name)
+            {
+                GNUNET_asprintf (&cal_widget,
+                                "%s_cal",
+                                widget_name);
             }
+            else
+            {
+                /** FIXME: create a new GtkCalendar here */
+            }
+            GObject *cal = GCG_get_main_window_object (cal_widget);
+            gtk_calendar_get_date (GTK_CALENDAR (cal),
+                                   &year,
+                                   &month,
+                                   &day);
+            if (! (day && month && day))
+                fullfilled = false;
+            GNUNET_free (cal_widget);
         }
     }
     return fullfilled;
@@ -111,6 +114,7 @@ GCG_get_main_window_object (const char *name)
 
 /**
  * Function to persist a state.
+ * FIXME: Don't use this like its used right now (=>PRIVACY)!
  * 
  * @param state state to persist
  */
@@ -536,12 +540,12 @@ anastasis_gtk_main_window_back_clicked (GObject *object,
                                         "anastasis_gtk_identity_frame")));
     }
     if (gtk_widget_is_visible (GTK_WIDGET (GCG_get_main_window_object (
-                                        "anastasis_gtk_provider_frame"))))
+                                        
"anastasis_gtk_b_authentication_frame"))))
     {
         gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object (
                                         "anastasis_gtk_identity_frame")));
         gtk_widget_hide (GTK_WIDGET (GCG_get_main_window_object (
-                                        "anastasis_gtk_provider_frame")));
+                                        
"anastasis_gtk_b_authentication_frame")));
         if (check_attributes_fullfilled ())
             gtk_widget_set_sensitive (GTK_WIDGET (GCG_get_main_window_object (
                                         
"anastasis_gtk_main_window_forward_button")), true);
@@ -559,6 +563,7 @@ void
 anastasis_gtk_main_window_forward_clicked (GObject *object,
                                            gpointer user_data)
 {
+    //show identity frame, hide continent frame
     if (check_state (redux_state, "ReduxCountrySelectedState") &&
             gtk_widget_is_visible (GTK_WIDGET (GCG_get_main_window_object (
                                         "anastasis_gtk_continent_frame"))))
@@ -571,6 +576,7 @@ anastasis_gtk_main_window_forward_clicked (GObject *object,
                                         
"anastasis_gtk_main_window_forward_button")), false);
     }
 
+    //show provider frame, hide identity frame
     if (gtk_widget_is_visible (GTK_WIDGET (GCG_get_main_window_object (
                                         "anastasis_gtk_identity_frame"))) &&
                 check_attributes_fullfilled ())
@@ -583,6 +589,7 @@ anastasis_gtk_main_window_forward_clicked (GObject *object,
                                                                 
"anastasis_gtk_identity_vbox")));
         for (iter = children; iter != NULL; iter = g_list_next (iter))
         {
+            bool isset = false;
             const char *entry_widget;
             const char *cal_widget;
             const char *widget = gtk_buildable_get_name (iter->data);
@@ -598,7 +605,15 @@ 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 (strstr (widget, "ia_ahv"))
+                    json_object_set_new (id_attr, "name", json_string 
("ahv_number"));
+                if (strstr (widget, "ia_ssn"))
+                    json_object_set_new (id_attr, "name", json_string 
("social_security_number"));
+                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));
             }
@@ -618,7 +633,8 @@ anastasis_gtk_main_window_forward_clicked (GObject *object,
                 json_object_set_new (id_attr, "day", json_integer (day));
                 json_object_set_new (id_attr, "widget", json_string 
(cal_widget));
             }
-            json_array_append_new (attributes, id_attr);
+            if (isset)
+                json_array_append_new (attributes, id_attr);
             GNUNET_free (entry_widget);
             GNUNET_free (cal_widget);
         }
@@ -640,7 +656,7 @@ anastasis_gtk_main_window_forward_clicked (GObject *object,
         gtk_widget_hide (GTK_WIDGET (GCG_get_main_window_object (
                                         "anastasis_gtk_identity_frame")));
         gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object (
-                                        "anastasis_gtk_provider_frame")));
+                                        
"anastasis_gtk_b_authentication_frame")));
         gtk_widget_set_sensitive (GTK_WIDGET (GCG_get_main_window_object (
                                         
"anastasis_gtk_main_window_forward_button")), false);
     }

-- 
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]