gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis-gtk] branch master updated: show policy expiration in G


From: gnunet
Subject: [taler-anastasis-gtk] branch master updated: show policy expiration in Gtk+
Date: Mon, 19 Jul 2021 14:23:12 +0200

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

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

The following commit(s) were added to refs/heads/master by this push:
     new 5ea0e6b  show policy expiration in Gtk+
5ea0e6b is described below

commit 5ea0e6b228e7a3a58187e3f737a0fdce5f436d81
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Jul 19 14:23:09 2021 +0200

    show policy expiration in Gtk+
---
 contrib/anastasis_gtk_main_window.glade | 45 ++++++++++++++++++++++++++++++++-
 src/anastasis/anastasis-gtk_action.c    | 23 ++++++++++-------
 2 files changed, 58 insertions(+), 10 deletions(-)

diff --git a/contrib/anastasis_gtk_main_window.glade 
b/contrib/anastasis_gtk_main_window.glade
index 593fcfd..010a12c 100644
--- a/contrib/anastasis_gtk_main_window.glade
+++ b/contrib/anastasis_gtk_main_window.glade
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.2
+<!-- Generated with glade 3.38.2 
 
 Copyright (C) Anastasis SARL
 
@@ -3244,6 +3244,49 @@ date for the recovery policy.</property>
                                                 <property 
name="position">2</property>
                                               </packing>
                                             </child>
+                                            <child>
+                                              <object class="GtkBox" 
id="recovery_expiration_box">
+                                                <property 
name="visible">True</property>
+                                                <property 
name="can-focus">False</property>
+                                                <property 
name="orientation">vertical</property>
+                                                <property 
name="spacing">5</property>
+                                                <child>
+                                                  <object class="GtkLabel" 
id="backup_expiration_label">
+                                                    <property 
name="visible">True</property>
+                                                    <property 
name="can-focus">False</property>
+                                                    <property 
name="halign">start</property>
+                                                    <property name="label" 
translatable="yes">Your backup is valid until:</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property 
name="expand">False</property>
+                                                    <property 
name="fill">True</property>
+                                                    <property 
name="padding">5</property>
+                                                    <property 
name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkLabel" 
id="backup_expiration_date_label">
+                                                    <property 
name="can-focus">False</property>
+                                                    <property 
name="label">DYNAMICALLY GENERATED</property>
+                                                    <attributes>
+                                                      <attribute name="weight" 
value="bold"/>
+                                                    </attributes>
+                                                  </object>
+                                                  <packing>
+                                                    <property 
name="expand">False</property>
+                                                    <property 
name="fill">True</property>
+                                                    <property 
name="padding">5</property>
+                                                    <property 
name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property 
name="expand">False</property>
+                                                <property 
name="fill">True</property>
+                                                <property 
name="padding">20</property>
+                                                <property 
name="position">3</property>
+                                              </packing>
+                                            </child>
                                           </object>
                                           <packing>
                                             <property 
name="expand">True</property>
diff --git a/src/anastasis/anastasis-gtk_action.c 
b/src/anastasis/anastasis-gtk_action.c
index 1b35e79..994be34 100644
--- a/src/anastasis/anastasis-gtk_action.c
+++ b/src/anastasis/anastasis-gtk_action.c
@@ -1616,26 +1616,28 @@ action_policies_paying (void)
 static void
 action_backup_finished (void)
 {
-  json_t *arr;
+  json_t *det;
   json_t *se;
-  size_t index;
+  const char *url;
   GtkListStore *ls;
+  struct GNUNET_TIME_Absolute mexp;
 
   AG_hide_all_frames ();
-  arr = json_object_get (AG_redux_state,
+  det = json_object_get (AG_redux_state,
                          "success_details");
   ls = GTK_LIST_STORE (GCG_get_main_window_object (
                          "backup_provider_liststore"));
   gtk_list_store_clear (ls);
-  json_array_foreach (arr, index, se)
+  mexp = GNUNET_TIME_UNIT_FOREVER_ABS;
+  json_object_foreach (det, url, se)
   {
-    const char *url;
+    struct GNUNET_TIME_Absolute pexp;
     uint64_t version;
     struct GNUNET_JSON_Specification spec[] = {
       GNUNET_JSON_spec_uint64 ("policy_version",
                                &version),
-      GNUNET_JSON_spec_string ("provider_url",
-                               &url),
+      GNUNET_JSON_spec_absolute_time ("policy_expiration",
+                                      &pexp),
       GNUNET_JSON_spec_end ()
     };
 
@@ -1648,6 +1650,8 @@ action_backup_finished (void)
       AG_error ("State did not parse correctly");
       return;
     }
+    mexp = GNUNET_TIME_absolute_min (mexp,
+                                     pexp);
     gtk_list_store_insert_with_values (
       ls,
       NULL,
@@ -1657,12 +1661,13 @@ action_backup_finished (void)
       AG_BPC_BACKUP_VERSION,
       (guint64) version,
       AG_BPC_EXPIRATION_TIME_STR,
-      GNUNET_STRINGS_absolute_time_to_string (
-        GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_YEARS)),
+      GNUNET_STRINGS_absolute_time_to_string (pexp),
       AG_BPC_SUCCESS_FLAG,
       true,
       -1);
   }
+  update_label ("backup_expiration_date_label",
+                GNUNET_STRINGS_absolute_time_to_string (mexp));
   AG_hide ("anastasis_gtk_progress_vbox");
   AG_hide ("anastasis_gtk_backup_progress_scrolled_window");
   AG_show ("anastasis_gtk_completed_frame");

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