diff options
Diffstat (limited to 'src/anastasis/anastasis-gtk_handle-country-activated.c')
-rw-r--r-- | src/anastasis/anastasis-gtk_handle-country-activated.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/anastasis/anastasis-gtk_handle-country-activated.c b/src/anastasis/anastasis-gtk_handle-country-activated.c index 2c80b61..afb65f3 100644 --- a/src/anastasis/anastasis-gtk_handle-country-activated.c +++ b/src/anastasis/anastasis-gtk_handle-country-activated.c | |||
@@ -41,11 +41,8 @@ void | |||
41 | anastasis_gtk_country_selection_changed_cb (GtkTreeSelection *treeselection, | 41 | anastasis_gtk_country_selection_changed_cb (GtkTreeSelection *treeselection, |
42 | gpointer user_data) | 42 | gpointer user_data) |
43 | { | 43 | { |
44 | GtkTreeSelection *currency_selection; | ||
45 | GtkTreeModel *currency_model; | ||
46 | GtkTreeModel *model; | 44 | GtkTreeModel *model; |
47 | GtkTreeIter iter; | 45 | GtkTreeIter iter; |
48 | char *scode; | ||
49 | 46 | ||
50 | (void) user_data; | 47 | (void) user_data; |
51 | if (! gtk_tree_selection_get_selected (treeselection, | 48 | if (! gtk_tree_selection_get_selected (treeselection, |
@@ -56,61 +53,4 @@ anastasis_gtk_country_selection_changed_cb (GtkTreeSelection *treeselection, | |||
56 | return; | 53 | return; |
57 | } | 54 | } |
58 | AG_enable_next (); | 55 | AG_enable_next (); |
59 | gtk_tree_model_get (model, | ||
60 | &iter, | ||
61 | AG_CCMC_COUNTRY_CODE, | ||
62 | &scode, | ||
63 | -1); | ||
64 | /* select all currencies matching current country */ | ||
65 | currency_selection = GTK_TREE_SELECTION ( | ||
66 | GCG_get_main_window_object ("anastasis_gtk_currency_selection")); | ||
67 | gtk_tree_selection_unselect_all (currency_selection); | ||
68 | currency_model = GTK_TREE_MODEL ( | ||
69 | GCG_get_main_window_object ("currency_liststore")); | ||
70 | { | ||
71 | json_t *countries; | ||
72 | json_t *country; | ||
73 | size_t index; | ||
74 | |||
75 | countries = json_object_get (AG_redux_state, | ||
76 | "countries"); | ||
77 | json_array_foreach (countries, index, country) | ||
78 | { | ||
79 | const char *code; | ||
80 | const char *currency; | ||
81 | |||
82 | code = json_string_value (json_object_get (country, | ||
83 | "code")); | ||
84 | GNUNET_assert (NULL != code); | ||
85 | if (0 != strcmp (code, | ||
86 | scode)) | ||
87 | continue; | ||
88 | currency = json_string_value (json_object_get (country, | ||
89 | "currency")); | ||
90 | GNUNET_assert (NULL != currency); | ||
91 | { | ||
92 | GtkTreeIter citer; | ||
93 | char *pcur; | ||
94 | |||
95 | if (gtk_tree_model_get_iter_first (currency_model, | ||
96 | &citer)) | ||
97 | do { | ||
98 | gtk_tree_model_get (currency_model, | ||
99 | &citer, | ||
100 | AG_CMC_CURRENCY_NAME, | ||
101 | &pcur, | ||
102 | -1); | ||
103 | if (0 == strcasecmp (pcur, | ||
104 | currency)) | ||
105 | { | ||
106 | gtk_tree_selection_select_iter (currency_selection, | ||
107 | &citer); | ||
108 | } | ||
109 | g_free (pcur); | ||
110 | } while (gtk_tree_model_iter_next (currency_model, | ||
111 | &citer)); | ||
112 | } | ||
113 | } | ||
114 | } | ||
115 | g_free (scode); | ||
116 | } | 56 | } |