[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis-gtk] branch master updated: add multi-currency support
From: |
gnunet |
Subject: |
[taler-anastasis-gtk] branch master updated: add multi-currency support |
Date: |
Fri, 02 Apr 2021 21:26:09 +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 6759920 add multi-currency support
6759920 is described below
commit 6759920814b72fbf95e384bfd97bdd6051c0961b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Apr 2 21:26:04 2021 +0200
add multi-currency support
---
contrib/anastasis_gtk_edit_providers.glade | 13 +
contrib/anastasis_gtk_main_window.glade | 465 +++++++++++++++++----
src/anastasis/Makefile.am | 5 +-
src/anastasis/anastasis-gtk_action.c | 9 +-
...anastasis-gtk_handle-challenge-row-activated.c} | 41 +-
...c => anastasis-gtk_handle-continent-selected.c} | 31 +-
.../anastasis-gtk_handle-country-activated.c | 87 +++-
...d.c => anastasis-gtk_handle-currency-changed.c} | 51 ++-
...stasis-gtk_handle-main-window-forward-clicked.c | 56 ++-
...stasis-gtk_handle-main-window-forward-clicked.h | 4 -
src/anastasis/anastasis-gtk_helper.h | 127 +++++-
11 files changed, 713 insertions(+), 176 deletions(-)
diff --git a/contrib/anastasis_gtk_edit_providers.glade
b/contrib/anastasis_gtk_edit_providers.glade
index 593aa01..adbd5d0 100644
--- a/contrib/anastasis_gtk_edit_providers.glade
+++ b/contrib/anastasis_gtk_edit_providers.glade
@@ -28,6 +28,8 @@ along with Anastasis-gtk. If not, see
<http://www.gnu.org/licenses/>.
<columns>
<!-- column-name url -->
<column type="gchararray"/>
+ <!-- column-name status -->
+ <column type="gchararray"/>
</columns>
</object>
<object class="GtkDialog" id="edit_provider_dialog">
@@ -196,6 +198,17 @@ along with Anastasis-gtk. If not, see
<http://www.gnu.org/licenses/>.
</child>
</object>
</child>
+ <child>
+ <object class="GtkTreeViewColumn">
+ <property name="title"
translatable="yes">Status</property>
+ <child>
+ <object class="GtkCellRendererText"
id="status"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/contrib/anastasis_gtk_main_window.glade
b/contrib/anastasis_gtk_main_window.glade
index 32a505e..9e55f78 100644
--- a/contrib/anastasis_gtk_main_window.glade
+++ b/contrib/anastasis_gtk_main_window.glade
@@ -55,6 +55,42 @@ Author: Christian Grothoff, Dennis Neufeld
<column type="gchararray"/>
<!-- column-name policy_version -->
<column type="guint64"/>
+ <!-- column-name expiration_time_str -->
+ <column type="gchararray"/>
+ <!-- column-name failure_flag -->
+ <column type="gboolean"/>
+ <!-- column-name error_message -->
+ <column type="gchararray"/>
+ <!-- column-name success_flag -->
+ <column type="gboolean"/>
+ </columns>
+ </object>
+ <object class="GtkListStore" id="challenge_status_liststore">
+ <columns>
+ <!-- column-name challenge_offset -->
+ <column type="guint"/>
+ <!-- column-name challenge_uuid -->
+ <column type="gchararray"/>
+ <!-- column-name solved -->
+ <column type="gboolean"/>
+ <!-- column-name challenge_status -->
+ <column type="gchararray"/>
+ <!-- column-name payment_qr_code -->
+ <column type="GdkPixbuf"/>
+ <!-- column-name error_message -->
+ <column type="gchararray"/>
+ <!-- column-name payto_uri -->
+ <column type="gchararray"/>
+ <!-- column-name paying -->
+ <column type="gboolean"/>
+ <!-- column-name has_error -->
+ <column type="gboolean"/>
+ <!-- column-name cost -->
+ <column type="gchararray"/>
+ <!-- column-name redirect_url -->
+ <column type="gchararray"/>
+ <!-- column-name have_redirect -->
+ <column type="gboolean"/>
</columns>
</object>
<object class="GtkListStore" id="continent_liststore">
@@ -69,9 +105,30 @@ Author: Christian Grothoff, Dennis Neufeld
<column type="gchararray"/>
<!-- column-name country_code -->
<column type="gchararray"/>
- <!-- column-name country_currency -->
+ </columns>
+ </object>
+ <object class="GtkListStore" id="currency_liststore">
+ <columns>
+ <!-- column-name currency_name -->
<column type="gchararray"/>
</columns>
+ <data>
+ <row>
+ <col id="0">CHF</col>
+ </row>
+ <row>
+ <col id="0">EUR</col>
+ </row>
+ <row>
+ <col id="0">USD</col>
+ </row>
+ <row>
+ <col id="0">KUDOS</col>
+ </row>
+ <row>
+ <col id="0">TESTKUDOS</col>
+ </row>
+ </data>
</object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
@@ -93,6 +150,8 @@ Author: Christian Grothoff, Dennis Neufeld
<column type="gchararray"/>
<!-- column-name provider_url -->
<column type="gchararray"/>
+ <!-- column-name expiration_time_str -->
+ <column type="gchararray"/>
</columns>
</object>
<object class="GtkAdjustment" id="policy_version_adjustment">
@@ -350,27 +409,33 @@ Author: Christian Grothoff, Dennis Neufeld
<property
name="visible">True</property>
<property
name="can-focus">False</property>
<child>
- <object class="GtkTreeView"
id="anastasis_gtk_continent_treeview">
+ <object class="GtkScrolledWindow">
<property
name="visible">True</property>
<property
name="can-focus">True</property>
- <property
name="model">continent_liststore</property>
- <property
name="enable-search">False</property>
- <property
name="search-column">0</property>
- <property
name="activate-on-single-click">True</property>
- <signal name="row-activated"
handler="anastasis_gtk_continent_activated" swapped="no"/>
- <child internal-child="selection">
- <object class="GtkTreeSelection">
- <signal name="changed"
handler="anastasis_gtk_continent_unselected" swapped="no"/>
- </object>
- </child>
+ <property
name="shadow-type">in</property>
<child>
- <object
class="GtkTreeViewColumn" id="continent_column">
- <property name="title"
translatable="yes">Continent</property>
+ <object class="GtkTreeView"
id="anastasis_gtk_continent_treeview">
+ <property
name="visible">True</property>
+ <property
name="can-focus">True</property>
+ <property
name="model">continent_liststore</property>
+ <property
name="enable-search">False</property>
+ <property
name="search-column">0</property>
+ <property
name="activate-on-single-click">True</property>
+ <child
internal-child="selection">
+ <object
class="GtkTreeSelection" id="anastasis_gtk_continent_selection">
+ <signal name="changed"
handler="anastasis_gtk_continent_selection_changed_cb" swapped="no"/>
+ </object>
+ </child>
<child>
- <object
class="GtkCellRendererText" id="continent_name_cell_renderer"/>
- <attributes>
- <attribute
name="text">0</attribute>
- </attributes>
+ <object
class="GtkTreeViewColumn" id="continent_column">
+ <property name="title"
translatable="yes">Continent</property>
+ <child>
+ <object
class="GtkCellRendererText" id="continent_name_cell_renderer"/>
+ <attributes>
+ <attribute
name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
</child>
</object>
</child>
@@ -378,31 +443,76 @@ Author: Christian Grothoff, Dennis Neufeld
<packing>
<property
name="expand">True</property>
<property
name="fill">True</property>
+ <property
name="padding">5</property>
<property
name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkTreeView"
id="anastasis_gtk_country_treeview">
+ <object class="GtkScrolledWindow">
<property
name="visible">True</property>
<property
name="can-focus">True</property>
- <property
name="model">country_liststore</property>
- <property
name="enable-search">False</property>
- <property
name="search-column">0</property>
- <property
name="activate-on-single-click">True</property>
- <signal name="row-activated"
handler="anastasis_gtk_country_activated" swapped="no"/>
- <child internal-child="selection">
- <object class="GtkTreeSelection">
- <signal name="changed"
handler="anastasis_gtk_country_unselected" swapped="no"/>
+ <property
name="shadow-type">in</property>
+ <child>
+ <object class="GtkTreeView"
id="anastasis_gtk_country_treeview">
+ <property
name="visible">True</property>
+ <property
name="can-focus">True</property>
+ <property
name="model">country_liststore</property>
+ <property
name="enable-search">False</property>
+ <property
name="search-column">0</property>
+ <property
name="activate-on-single-click">True</property>
+ <child
internal-child="selection">
+ <object
class="GtkTreeSelection" id="anastasis_gtk_country_selection">
+ <signal name="changed"
handler="anastasis_gtk_country_selection_changed_cb" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object
class="GtkTreeViewColumn" id="country_column">
+ <property name="title"
translatable="yes">Country</property>
+ <child>
+ <object
class="GtkCellRendererText" id="country_name_cell_renderer"/>
+ <attributes>
+ <attribute
name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
</object>
</child>
+ </object>
+ <packing>
+ <property
name="expand">True</property>
+ <property
name="fill">True</property>
+ <property
name="padding">5</property>
+ <property
name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property
name="visible">True</property>
+ <property
name="can-focus">True</property>
+ <property
name="shadow-type">in</property>
<child>
- <object
class="GtkTreeViewColumn" id="country_column">
- <property name="title"
translatable="yes">Country</property>
+ <object class="GtkTreeView"
id="anastasis_gtk_currency_treeview">
+ <property
name="visible">True</property>
+ <property
name="can-focus">True</property>
+ <property
name="model">currency_liststore</property>
+ <child
internal-child="selection">
+ <object
class="GtkTreeSelection" id="anastasis_gtk_currency_selection">
+ <property
name="mode">multiple</property>
+ <signal name="changed"
handler="anastasis_gtk_currency_selection_changed_cb" swapped="no"/>
+ </object>
+ </child>
<child>
- <object
class="GtkCellRendererText" id="country_name_cell_renderer"/>
- <attributes>
- <attribute
name="text">0</attribute>
- </attributes>
+ <object
class="GtkTreeViewColumn">
+ <property name="title"
translatable="yes">Currencies</property>
+ <property
name="sort-column-id">0</property>
+ <child>
+ <object
class="GtkCellRendererText" id="currency"/>
+ <attributes>
+ <attribute
name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
</child>
</object>
</child>
@@ -410,7 +520,8 @@ Author: Christian Grothoff, Dennis Neufeld
<packing>
<property
name="expand">True</property>
<property
name="fill">True</property>
- <property
name="position">1</property>
+ <property
name="padding">5</property>
+ <property
name="position">2</property>
</packing>
</child>
</object>
@@ -421,11 +532,12 @@ Author: Christian Grothoff, Dennis Neufeld
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="tooltip-text"
translatable="yes">These questions determine which personal attributes we can
ask you for, and which backup providers could be used.</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
- <property name="label"
translatable="yes">Where do you live?</property>
+ <property name="label"
translatable="yes">Where do you live? In which currencies do you want to
pay?</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -1143,11 +1255,12 @@ Author: Christian Grothoff, Dennis Neufeld
</object>
</child>
<child>
- <object
class="GtkTreeViewColumn" id="policy_cost">
- <property
name="sizing">autosize</property>
+ <object
class="GtkTreeViewColumn" id="cost_column">
<property name="title"
translatable="yes">Cost</property>
<child>
- <object
class="GtkCellRendererText" id="cost_column"/>
+ <object
class="GtkCellRendererText" id="cost_text_column">
+ <property
name="ellipsize">end</property>
+ </object>
<attributes>
<attribute
name="text">2</attribute>
</attributes>
@@ -1167,6 +1280,17 @@ Author: Christian Grothoff, Dennis Neufeld
</child>
</object>
</child>
+ <child>
+ <object
class="GtkTreeViewColumn">
+ <property name="title"
translatable="yes">Expiration</property>
+ <child>
+ <object
class="GtkCellRendererText" id="expiration_time_str"/>
+ <attributes>
+ <attribute
name="text">4</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
@@ -1260,6 +1384,7 @@ Author: Christian Grothoff, Dennis Neufeld
<object class="GtkLabel">
<property
name="visible">True</property>
<property
name="can-focus">False</property>
+ <property
name="tooltip-text" translatable="yes">This is the URL of the provider from
which we downloaded the recovery document.</property>
<property name="label"
translatable="yes">Provider URL:</property>
</object>
<packing>
@@ -1271,7 +1396,8 @@ Author: Christian Grothoff, Dennis Neufeld
<object class="GtkLabel">
<property
name="visible">True</property>
<property
name="can-focus">False</property>
- <property name="label"
translatable="yes">Policy version:</property>
+ <property
name="tooltip-text" translatable="yes">This is the version of the backup at the
provider. By default, the latest available backup version is
obtained.</property>
+ <property name="label"
translatable="yes">Backup version:</property>
</object>
<packing>
<property
name="left-attach">0</property>
@@ -1347,73 +1473,201 @@ Author: Christian Grothoff, Dennis Neufeld
</packing>
</child>
<child>
- <object class="GtkAlignment">
+ <object class="GtkFrame">
<property
name="visible">True</property>
<property
name="can-focus">False</property>
- <property
name="top-padding">10</property>
- <property
name="bottom-padding">10</property>
- <property
name="left-padding">12</property>
+ <property
name="label-xalign">0</property>
+ <property
name="shadow-type">none</property>
<child>
- <object
class="GtkScrolledWindow">
+ <object class="GtkAlignment">
<property
name="visible">True</property>
- <property
name="can-focus">True</property>
- <property
name="shadow-type">in</property>
+ <property
name="can-focus">False</property>
+ <property
name="left-padding">12</property>
<child>
- <object class="GtkTreeView"
id="anastasis_gtk_choose_policy_treeview">
+ <object
class="GtkScrolledWindow">
<property
name="visible">True</property>
<property
name="can-focus">True</property>
- <property
name="model">policy_review_treestore</property>
- <property
name="enable-search">False</property>
- <property
name="search-column">0</property>
- <child
internal-child="selection">
- <object
class="GtkTreeSelection"/>
- </child>
+ <property
name="shadow-type">in</property>
<child>
- <object
class="GtkTreeViewColumn" id="policy_name_column1">
- <property
name="sizing">autosize</property>
- <property name="title"
translatable="yes">Policy</property>
+ <object
class="GtkTreeView" id="anastasis_gtk_challenge_status_treeview">
+ <property
name="visible">True</property>
+ <property
name="can-focus">True</property>
+ <property
name="tooltip-text" translatable="yes">Here you can see your progress in
satisfying authorization challenges and possible next steps.</property>
+ <property
name="model">challenge_status_liststore</property>
+ <signal
name="row-activated"
handler="anastasis_gtk_challenge_status_treeview_row_activated_cb"
swapped="no"/>
+ <child
internal-child="selection">
+ <object
class="GtkTreeSelection" id="anastasis_gtk_challenge_status_treeselection">
+ <signal
name="changed"
handler="anastasis_gtk_challenge_status_treeselection_changed_cb" swapped="no"/>
+ </object>
+ </child>
<child>
- <object
class="GtkCellRendererText" id="policy_name_column2"/>
- <attributes>
+ <object
class="GtkTreeViewColumn">
+ <property
name="title" translatable="yes">#</property>
+ <property
name="sort-column-id">0</property>
+ <child>
+ <object
class="GtkCellRendererToggle" id="solved">
+ <property
name="activatable">False</property>
+ </object>
+ <attributes>
+ <attribute
name="visible">2</attribute>
+ <attribute
name="active">2</attribute>
+ </attributes>
+ </child>
+ <child>
+ <object
class="GtkCellRendererText" id="challenge_number"/>
+ <attributes>
<attribute
name="text">0</attribute>
- </attributes>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object
class="GtkTreeViewColumn">
+ <property
name="title" translatable="yes">Status</property>
+ <child>
+ <object
class="GtkCellRendererText" id="status_text"/>
+ <attributes>
+ <attribute
name="text">3</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object
class="GtkTreeViewColumn">
+ <property
name="title" translatable="yes">Cost</property>
+ <child>
+ <object
class="GtkCellRendererText" id="cost"/>
+ <attributes>
+ <attribute
name="text">9</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object
class="GtkTreeViewColumn">
+ <property
name="title" translatable="yes">Details</property>
+ <child>
+ <object
class="GtkCellRendererText" id="emsg"/>
+ <attributes>
+ <attribute
name="visible">8</attribute>
+ <attribute
name="text">5</attribute>
+ </attributes>
+ </child>
+ <child>
+ <object
class="GtkCellRendererPixbuf" id="qrcode"/>
+ <attributes>
+ <attribute
name="visible">7</attribute>
+ <attribute
name="pixbuf">4</attribute>
+ </attributes>
+ </child>
+ <child>
+ <object
class="GtkCellRendererText" id="redirect_url"/>
+ <attributes>
+ <attribute
name="visible">11</attribute>
+ <attribute
name="text">10</attribute>
+ </attributes>
+ </child>
+ </object>
</child>
</object>
</child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel">
+ <property
name="visible">True</property>
+ <property
name="can-focus">False</property>
+ <property name="tooltip-text"
translatable="yes">Here you can see your progress in satisfying authorization
challenges and possible next steps.</property>
+ <property
name="margin-start">5</property>
+ <property
name="margin-end">5</property>
+ <property
name="margin-top">5</property>
+ <property
name="margin-bottom">5</property>
+ <property name="label"
translatable="yes">Challenge status:</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property
name="expand">False</property>
+ <property
name="fill">True</property>
+ <property
name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame">
+ <property
name="visible">True</property>
+ <property
name="can-focus">False</property>
+ <property
name="label-xalign">0</property>
+ <property
name="shadow-type">none</property>
+ <child>
+ <object class="GtkAlignment">
+ <property
name="visible">True</property>
+ <property
name="can-focus">False</property>
+ <property
name="left-padding">12</property>
+ <child>
+ <object
class="GtkScrolledWindow">
+ <property
name="visible">True</property>
+ <property
name="can-focus">True</property>
+ <property
name="shadow-type">in</property>
<child>
- <object
class="GtkTreeViewColumn" id="challenge_type_column2">
- <property
name="sizing">autosize</property>
- <property name="title"
translatable="yes">Type</property>
+ <object
class="GtkTreeView" id="anastasis_gtk_choose_policy_treeview">
+ <property
name="visible">True</property>
+ <property
name="can-focus">True</property>
+ <property
name="tooltip-text" translatable="yes">This table shows possible ways to
recover the secret. For each policy, the challenges that must still be
satisfied are listed.</property>
+ <property
name="enable-search">False</property>
+ <property
name="search-column">0</property>
+ <child
internal-child="selection">
+ <object
class="GtkTreeSelection"/>
+ </child>
<child>
- <object
class="GtkCellRendererText" id="challenge_type_column3"/>
- <attributes>
+ <object
class="GtkTreeViewColumn" id="policy_name_column1">
+ <property
name="sizing">autosize</property>
+ <property
name="title" translatable="yes">Policy</property>
+ <child>
+ <object
class="GtkCellRendererText" id="policy_name_column2"/>
+ <attributes>
+ <attribute
name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object
class="GtkTreeViewColumn" id="challenge_type_column2">
+ <property
name="sizing">autosize</property>
+ <property
name="title" translatable="yes">Type</property>
+ <child>
+ <object
class="GtkCellRendererText" id="challenge_type_column3"/>
+ <attributes>
<attribute
name="text">1</attribute>
- </attributes>
+ </attributes>
+ </child>
+ </object>
</child>
- </object>
- </child>
- <child>
- <object
class="GtkTreeViewColumn" id="policy_cost1">
- <property
name="sizing">autosize</property>
- <property name="title"
translatable="yes">Cost</property>
<child>
- <object
class="GtkCellRendererText" id="cost_column1"/>
- <attributes>
+ <object
class="GtkTreeViewColumn" id="policy_cost1">
+ <property
name="sizing">autosize</property>
+ <property
name="title" translatable="yes">Cost</property>
+ <child>
+ <object
class="GtkCellRendererText" id="cost_column1"/>
+ <attributes>
<attribute
name="text">2</attribute>
- </attributes>
+ </attributes>
+ </child>
+ </object>
</child>
- </object>
- </child>
- <child>
- <object
class="GtkTreeViewColumn" id="provider_column1">
- <property name="title"
translatable="yes">Provider</property>
<child>
- <object
class="GtkCellRendererText" id="provider_url_column1">
+ <object
class="GtkTreeViewColumn" id="provider_column1">
+ <property
name="title" translatable="yes">Provider</property>
+ <child>
+ <object
class="GtkCellRendererText" id="provider_url_column1">
<property
name="ellipsize">end</property>
- </object>
- <attributes>
+ </object>
+ <attributes>
<attribute
name="text">3</attribute>
- </attributes>
+ </attributes>
+ </child>
+ </object>
</child>
</object>
</child>
@@ -1421,11 +1675,23 @@ Author: Christian Grothoff, Dennis Neufeld
</child>
</object>
</child>
+ <child type="label">
+ <object class="GtkLabel">
+ <property
name="visible">True</property>
+ <property
name="can-focus">False</property>
+ <property name="tooltip-text"
translatable="yes">This table shows possible ways to recover the secret. For
each policy, the challenges that must still be satisfied are listed.</property>
+ <property
name="margin-start">5</property>
+ <property
name="margin-end">5</property>
+ <property
name="margin-top">5</property>
+ <property
name="margin-bottom">5</property>
+ <property name="label"
translatable="yes">Recovery policies:</property>
+ </object>
+ </child>
</object>
<packing>
- <property
name="expand">True</property>
+ <property
name="expand">False</property>
<property
name="fill">True</property>
- <property
name="position">1</property>
+ <property
name="position">2</property>
</packing>
</child>
</object>
@@ -1797,11 +2063,34 @@ Author: Christian Grothoff, Dennis Neufeld
<child>
<object
class="GtkCellRendererText" id="policy_version"/>
<attributes>
+ <attribute
name="visible">5</attribute>
<attribute
name="text">1</attribute>
</attributes>
</child>
</object>
</child>
+ <child>
+ <object
class="GtkTreeViewColumn">
+ <property name="title"
translatable="yes">Expiration time</property>
+ <child>
+ <object
class="GtkCellRendererText" id="expiration"/>
+ <attributes>
+ <attribute
name="visible">5</attribute>
+ <attribute
name="text">2</attribute>
+ <attribute
name="max-width-chars">5</attribute>
+ </attributes>
+ </child>
+ <child>
+ <object
class="GtkCellRendererText" id="error_message">
+ <property
name="foreground-gdk">#a5a51d1d2d2d</property>
+ </object>
+ <attributes>
+ <attribute
name="visible">3</attribute>
+ <attribute
name="text">4</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
@@ -2184,7 +2473,7 @@ Author: Christian Grothoff, Dennis Neufeld
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -2195,7 +2484,7 @@ Author: Christian Grothoff, Dennis Neufeld
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
@@ -2212,7 +2501,7 @@ Author: Christian Grothoff, Dennis Neufeld
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
</object>
diff --git a/src/anastasis/Makefile.am b/src/anastasis/Makefile.am
index bfbdaef..916ddc2 100644
--- a/src/anastasis/Makefile.am
+++ b/src/anastasis/Makefile.am
@@ -21,11 +21,12 @@ anastasis_gtk_SOURCES = \
anastasis-gtk_handle-auth-edit-provider-clicked.c \
anastasis-gtk_handle-backup-button-clicked.c \
anastasis-gtk_handle-challenge-code.c \
+ anastasis-gtk_handle-challenge-row-activated.c \
anastasis-gtk_handle-challenge-question.c \
- anastasis-gtk_handle-continent-activated.c \
- anastasis-gtk_handle-continent-unselected.c \
+ anastasis-gtk_handle-continent-selected.c \
anastasis-gtk_handle-country-activated.c \
anastasis-gtk_handle-country-unselected.c \
+ anastasis-gtk_handle-currency-changed.c \
anastasis-gtk_handle-core-secret-changed.c \
anastasis-gtk_handle-identity-changed.c \
anastasis-gtk_handle-identity-changed.h \
diff --git a/src/anastasis/anastasis-gtk_action.c
b/src/anastasis/anastasis-gtk_action.c
index 5c47574..e47b590 100644
--- a/src/anastasis/anastasis-gtk_action.c
+++ b/src/anastasis/anastasis-gtk_action.c
@@ -127,8 +127,6 @@ action_country_selecting (void)
json_string_value (json_object_get (country, "name")),
AG_CCMC_COUNTRY_CODE,
code,
- AG_CCMC_COUNTRY_CURRENCY,
- json_string_value (json_object_get (country, "currency")),
-1);
if ( (NULL != selected_country) &&
(NULL != code) &&
@@ -726,11 +724,8 @@ action_policies_reviewing (void)
json_array_foreach (policies, pindex, policy)
{
GtkTreeIter piter;
- struct TALER_Amount recovery_cost;
json_t *methods;
struct GNUNET_JSON_Specification pspec[] = {
- TALER_JSON_spec_amount ("recovery_cost",
- &recovery_cost),
GNUNET_JSON_spec_json ("methods",
&methods),
GNUNET_JSON_spec_end ()
@@ -751,8 +746,6 @@ action_policies_reviewing (void)
&piter,
NULL, /* no parent */
-1, /* append */
- AG_PRMC_COST,
- TALER_amount2s (&recovery_cost),
-1);
summary = NULL;
@@ -818,7 +811,7 @@ action_policies_reviewing (void)
AG_PRMC_METHOD_TYPE,
type,
AG_PRMC_COST,
- TALER_amount2s (&recovery_cost),
+ TALER_amount2s (&method_cost),
AG_PRMC_PROVIDER_URL,
provider,
-1);
diff --git a/src/anastasis/anastasis-gtk_handle-continent-unselected.c
b/src/anastasis/anastasis-gtk_handle-challenge-row-activated.c
similarity index 53%
rename from src/anastasis/anastasis-gtk_handle-continent-unselected.c
rename to src/anastasis/anastasis-gtk_handle-challenge-row-activated.c
index c040e11..f541a76 100644
--- a/src/anastasis/anastasis-gtk_handle-continent-unselected.c
+++ b/src/anastasis/anastasis-gtk_handle-challenge-row-activated.c
@@ -1,6 +1,6 @@
/*
This file is part of anastasis-gtk.
- Copyright (C) 2020 Anastasis SARL
+ Copyright (C) 2021 Anastasis SARL
Anastasis is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -18,38 +18,35 @@
Boston, MA 02110-1301, USA.
*/
/**
- * @file src/anastasis/anastasis-gtk_handle-continent-unselected.c
+ * @file src/anastasis/anastasis-gtk_handle-challenge-row-activated.c
* @brief
* @author Christian Grothoff
- * @author Dennis Neufeld
*/
#include <gnunet/platform.h>
#include <gnunet/gnunet_util_lib.h>
#include "anastasis-gtk_helper.h"
#include "anastasis-gtk_action.h"
+#include "anastasis-gtk_attributes.h"
+#include "anastasis-gtk_handle-identity-changed.h"
#include <jansson.h>
-/**
- * Callback invoked if a continent is unselected (unselected signal).
- *
- * @param selection A GtkTreeSelection.
- * @param user_data user data set when the signal handler was connected.
- */
void
-anastasis_gtk_continent_unselected (GtkTreeSelection *selection,
- gpointer user_data)
+anastasis_gtk_challenge_status_treeview_row_activated_cb (
+ GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data)
{
- GtkTreeModel *model;
+ // FIXME: if possible, start selected challenge (not if solved, paying, etc.)
+ GNUNET_break (0); // FIXME
+}
- if (gtk_tree_selection_get_selected (selection,
- &model,
- NULL))
- return;
- AG_freeze ();
- AG_ra = ANASTASIS_redux_action (AG_redux_state,
- "unselect_continent",
- NULL,
- &AG_action_cb,
- NULL);
+
+void
+anastasis_gtk_challenge_status_treeselection_changed_cb (GtkTreeSelection
*treeselection,
+ gpointer user_data)
+{
+ GNUNET_break (0); // FIXME: update clipboard with payto URI and/or redirect
URI
+ // (if applicable)
}
diff --git a/src/anastasis/anastasis-gtk_handle-continent-activated.c
b/src/anastasis/anastasis-gtk_handle-continent-selected.c
similarity index 70%
rename from src/anastasis/anastasis-gtk_handle-continent-activated.c
rename to src/anastasis/anastasis-gtk_handle-continent-selected.c
index b058454..8122893 100644
--- a/src/anastasis/anastasis-gtk_handle-continent-activated.c
+++ b/src/anastasis/anastasis-gtk_handle-continent-selected.c
@@ -18,7 +18,7 @@
Boston, MA 02110-1301, USA.
*/
/**
- * @file src/anastasis/anastasis-gtk_handle-continent-activated.c
+ * @file src/anastasis/anastasis-gtk_handle-continent-selected.c
* @brief
* @author Christian Grothoff
* @author Dennis Neufeld
@@ -31,29 +31,30 @@
/**
- * Callback invoked if a continent is selected (row-activated signal).
+ * Callback invoked if a continent is selected.
*
- * @param tree_view the object on which the signal is emitted
- * @param path the GtkTreePath for the activated row
- * @param column the GtkTreeViewColumn in which the activation occurred
- * @param user_data user data set when the signal handler was connected
(unused)
+ * @param selection A GtkTreeSelection.
+ * @param user_data user data set when the signal handler was connected.
*/
void
-anastasis_gtk_continent_activated (GtkTreeView *tree_view,
- GtkTreePath *path,
- GtkTreeViewColumn *column,
- gpointer user_data)
+anastasis_gtk_continent_selection_changed_cb (GtkTreeSelection *treeselection,
+ gpointer user_data)
{
- GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
+ GtkTreeModel *model;
GtkTreeIter iter;
gchar *continent_name;
json_t *arguments;
- if (! gtk_tree_model_get_iter (model,
- &iter,
- path))
+ if (! gtk_tree_selection_get_selected (treeselection,
+ &model,
+ &iter))
{
- GNUNET_break (0);
+ AG_freeze ();
+ AG_ra = ANASTASIS_redux_action (AG_redux_state,
+ "unselect_continent",
+ NULL,
+ &AG_action_cb,
+ NULL);
return;
}
gtk_tree_model_get (model,
diff --git a/src/anastasis/anastasis-gtk_handle-country-activated.c
b/src/anastasis/anastasis-gtk_handle-country-activated.c
index 0ad33bf..dc16e97 100644
--- a/src/anastasis/anastasis-gtk_handle-country-activated.c
+++ b/src/anastasis/anastasis-gtk_handle-country-activated.c
@@ -32,18 +32,85 @@
/**
- * Callback invoked if a country is activated (row-activated signal).
+ * Callback invoked if a country is selected.
*
- * @param tree_view the object on which the signal is emitted
- * @param path the GtkTreePath for the activated row
- * @param column the GtkTreeViewColumn in which the activation occurred
- * @param user_data user data set when the signal handler was connected
(unused)
+ * @param treeselection selection object
+ * @param user_data NULL
*/
void
-anastasis_gtk_country_activated (GtkTreeView *tree_view,
- GtkTreePath *path,
- GtkTreeViewColumn *column,
- gpointer user_data)
+anastasis_gtk_country_selection_changed_cb (GtkTreeSelection *treeselection,
+ gpointer user_data)
{
- AG_forward_country_selecting ();
+ GtkTreeSelection *currency_selection;
+ GtkTreeModel *currency_model;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ char *scode;
+
+ (void) user_data;
+ if (! gtk_tree_selection_get_selected (treeselection,
+ &model,
+ &iter))
+ {
+ AG_insensitive ("anastasis_gtk_main_window_forward_button");
+ return;
+ }
+ AG_sensitive ("anastasis_gtk_main_window_forward_button");
+ gtk_tree_model_get (model,
+ &iter,
+ AG_CCMC_COUNTRY_CODE,
+ &scode,
+ -1);
+ /* select all currencies matching current country */
+ currency_selection = GTK_TREE_SELECTION (
+ GCG_get_main_window_object ("anastasis_gtk_currency_selection"));
+ gtk_tree_selection_unselect_all (currency_selection);
+ currency_model = GTK_TREE_MODEL (
+ GCG_get_main_window_object ("currency_liststore"));
+ {
+ json_t *countries;
+ json_t *country;
+ size_t index;
+
+ countries = json_object_get (AG_redux_state,
+ "countries");
+ json_array_foreach (countries, index, country)
+ {
+ const char *code;
+ const char *currency;
+
+ code = json_string_value (json_object_get (country,
+ "code"));
+ GNUNET_assert (NULL != code);
+ if (0 != strcmp (code,
+ scode))
+ continue;
+ currency = json_string_value (json_object_get (country,
+ "currency"));
+ GNUNET_assert (NULL != currency);
+ {
+ GtkTreeIter citer;
+ char *pcur;
+
+ if (gtk_tree_model_get_iter_first (currency_model,
+ &citer))
+ do {
+ gtk_tree_model_get (currency_model,
+ &citer,
+ AG_CMC_CURRENCY_NAME,
+ &pcur,
+ -1);
+ if (0 == strcasecmp (pcur,
+ currency))
+ {
+ gtk_tree_selection_select_iter (currency_selection,
+ &citer);
+ }
+ g_free (pcur);
+ } while (gtk_tree_model_iter_next (currency_model,
+ &citer));
+ }
+ }
+ }
+ g_free (scode);
}
diff --git a/src/anastasis/anastasis-gtk_handle-country-activated.c
b/src/anastasis/anastasis-gtk_handle-currency-changed.c
similarity index 51%
copy from src/anastasis/anastasis-gtk_handle-country-activated.c
copy to src/anastasis/anastasis-gtk_handle-currency-changed.c
index 0ad33bf..75be227 100644
--- a/src/anastasis/anastasis-gtk_handle-country-activated.c
+++ b/src/anastasis/anastasis-gtk_handle-currency-changed.c
@@ -1,6 +1,6 @@
/*
This file is part of anastasis-gtk.
- Copyright (C) 2020 Anastasis SARL
+ Copyright (C) 2021 Anastasis SARL
Anastasis is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -32,18 +32,47 @@
/**
- * Callback invoked if a country is activated (row-activated signal).
+ * Function called on each selected item.
+ * Sets @a data to true if called.
*
- * @param tree_view the object on which the signal is emitted
- * @param path the GtkTreePath for the activated row
- * @param column the GtkTreeViewColumn in which the activation occurred
- * @param user_data user data set when the signal handler was connected
(unused)
+ * @param model unused
+ * @param path unused
+ * @param iter unused
+ * @param[out] data pointer to a `bool` to set to true
+ */
+static void
+select_cb (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer data)
+{
+ bool *ptr = data;
+
+ (void) model;
+ (void) path;
+ (void) iter;
+ *ptr = true;
+}
+
+
+/**
+ * Callback invoked if the currency selection changed.
+ *
+ * @param treeselection selection object
+ * @param user_data NULL
*/
void
-anastasis_gtk_country_activated (GtkTreeView *tree_view,
- GtkTreePath *path,
- GtkTreeViewColumn *column,
- gpointer user_data)
+anastasis_gtk_currency_selection_changed_cb (GtkTreeSelection *treeselection,
+ gpointer user_data)
{
- AG_forward_country_selecting ();
+ bool have_sel = false;
+
+ (void) user_data;
+ gtk_tree_selection_selected_foreach (treeselection,
+ &select_cb,
+ &have_sel);
+ if (have_sel)
+ AG_sensitive ("anastasis_gtk_main_window_forward_button");
+ else
+ AG_insensitive ("anastasis_gtk_main_window_forward_button");
}
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 db647b9..58550ac 100644
--- a/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c
+++ b/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.c
@@ -32,8 +32,43 @@
#include <jansson.h>
-void
-AG_forward_country_selecting (void)
+/**
+ * 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,
+ ¤cy,
+ -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.
+ */
+static void
+forward_country_selecting (void)
{
GtkTreeIter iter;
GtkTreeView *tv;
@@ -41,8 +76,8 @@ AG_forward_country_selecting (void)
GtkTreeSelection *sel;
gchar *country_name;
gchar *country_code;
- gchar *country_currency;
json_t *arguments;
+ json_t *currencies;
tv = GTK_TREE_VIEW (GCG_get_main_window_object (
"anastasis_gtk_country_treeview"));
@@ -54,20 +89,25 @@ AG_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,
AG_CCMC_COUNTRY_CODE, &country_code,
- AG_CCMC_COUNTRY_CURRENCY, &country_currency,
-1);
- arguments = json_pack ("{s:s, s:s, s:s}",
+ arguments = json_pack ("{s:s, s:s, s:o}",
"country", country_name,
"country_code", country_code,
- "currency", country_currency);
+ "currencies", currencies);
GNUNET_assert (NULL != arguments);
g_free (country_name);
g_free (country_code);
- g_free (country_currency);
AG_freeze ();
AG_ra = ANASTASIS_redux_action (AG_redux_state,
"select_country",
@@ -155,7 +195,7 @@ anastasis_gtk_main_window_forward_clicked (GObject *object,
{
struct DispatchItem actions[] = {
{ .state = "COUNTRY_SELECTING",
- .action = &AG_forward_country_selecting },
+ .action = &forward_country_selecting },
{ .state = "USER_ATTRIBUTES_COLLECTING",
.action = &AG_forward_user_attributes_collecting },
{ .state = "AUTHENTICATIONS_EDITING",
diff --git a/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.h
b/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.h
index 27140fe..ce5f0ee 100644
--- a/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.h
+++ b/src/anastasis/anastasis-gtk_handle-main-window-forward-clicked.h
@@ -27,10 +27,6 @@
#define ANASTASIS_GTK_HANDLE_MAIN_WINDOW_FORDWARD_CLICKED_H
-void
-AG_forward_country_selecting (void);
-
-
void
AG_forward_user_attributes_collecting (void);
diff --git a/src/anastasis/anastasis-gtk_helper.h
b/src/anastasis/anastasis-gtk_helper.h
index 9cbecfa..fc2a9ae 100644
--- a/src/anastasis/anastasis-gtk_helper.h
+++ b/src/anastasis/anastasis-gtk_helper.h
@@ -45,6 +45,85 @@ enum AG_ContinentsModelColumns
};
+/**
+ * Columns of the currency_liststore.
+ */
+enum AG_CurrencyModelColumns
+{
+ /**
+ * A gchararray.
+ */
+ AG_CMC_CURRENCY_NAME = 0
+};
+
+
+/**
+ * Columns of the challenge_status_liststore.
+ */
+enum AG_ChallengeStatusModelColumns
+{
+ /**
+ * A guint.
+ */
+ AG_CSM_CHALLENGE_OFFSET = 0,
+
+ /**
+ * A gchararray.
+ */
+ AG_CSM_CHALLENGE_UUID = 1,
+
+ /**
+ * A gboolean
+ */
+ AG_CSM_SOLVED = 2,
+
+ /**
+ * A gchararray.
+ */
+ AG_CSM_STATUS = 3,
+
+ /**
+ * A GdkPixBuf.
+ */
+ AG_CSM_PAYMENT_QR_CODE = 4,
+
+ /**
+ * A gchararray.
+ */
+ AG_CSM_ERROR_MESSAGE = 5,
+
+ /**
+ * A gchararray.
+ */
+ AG_CSM_PAYTO_URI = 6,
+
+ /**
+ * A gboolean.
+ */
+ AG_CSM_PAYING = 7,
+
+ /**
+ * A gboolean.
+ */
+ AG_CSM_HAS_ERROR = 8,
+
+ /**
+ * A gchararray.
+ */
+ AG_CSM_COST = 9,
+
+ /**
+ * A gchararray.
+ */
+ AG_CSM_REDIRECT_URL = 10,
+
+ /**
+ * A gboolean.
+ */
+ AG_CSM_HAVE_REDIRECT = 11
+};
+
+
/**
* Columns of the provider_liststore.
*/
@@ -53,7 +132,12 @@ enum AG_ProviderModelColumns
/**
* A gchararray.
*/
- AG_PMC_PROVIDER_URL = 0
+ AG_PMC_PROVIDER_URL = 0,
+
+ /**
+ * A gchararray. FIXME: initialize! -- #6809
+ */
+ AG_PMC_PROVIDER_STATUS = 1
};
@@ -70,7 +154,28 @@ enum AG_BackupProviderColumns
/**
* A guint64
*/
- AG_BPC_BACKUP_VERSION = 1
+ AG_BPC_BACKUP_VERSION = 1,
+
+ /**
+ * A gchararray. // FIXME: #6823
+ */
+ AG_BPC_EXPIRATION_TIME_STR = 2,
+
+ /**
+ * A gboolean. // FIXME: #6828
+ */
+ AG_BPC_FAILURE_FLAG = 3,
+
+ /**
+ * A gchararray. // FIXME: #6828
+ */
+ AG_BPC_ERROR_MESSAGE = 4,
+
+ /**
+ * A gboolean. // FIXME: #6828
+ */
+ AG_BPC_SUCCESS_FLAG = 5
+
};
/**
@@ -82,14 +187,12 @@ enum AG_CountryCodeModelColumns
* A gchararray.
*/
AG_CCMC_COUNTRY_NAME = 0,
+
/**
* A gchararray.
*/
- AG_CCMC_COUNTRY_CODE = 1,
- /**
- * A gchararray.
- */
- AG_CCMC_COUNTRY_CURRENCY = 2
+ AG_CCMC_COUNTRY_CODE = 1
+
};
/**
@@ -141,18 +244,26 @@ enum AG_PolicyReviewModelColumns
* A gchararray.
*/
AG_PRMC_POLICY_NAME = 0,
+
/**
* A gchararray.
*/
AG_PRMC_METHOD_TYPE = 1,
+
/**
* A gchararray.
*/
AG_PRMC_COST = 2,
+
/**
* A gchararray.
*/
- AG_PRMC_PROVIDER_URL = 3
+ AG_PRMC_PROVIDER_URL = 3,
+
+ /**
+ * A gchararray. // FIXME: #6823
+ */
+ AG_PRMC_EXPIRATION_TIME_STR = 4
};
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis-gtk] branch master updated: add multi-currency support,
gnunet <=