diff options
Diffstat (limited to 'src/namestore/gnunet-namestore-gtk.c')
-rw-r--r-- | src/namestore/gnunet-namestore-gtk.c | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c index 04145ac2..9f21abbd 100644 --- a/src/namestore/gnunet-namestore-gtk.c +++ b/src/namestore/gnunet-namestore-gtk.c | |||
@@ -160,7 +160,13 @@ enum GNSTreestoreColumn | |||
160 | /** | 160 | /** |
161 | * A guint; offset of this record in the array. | 161 | * A guint; offset of this record in the array. |
162 | */ | 162 | */ |
163 | GNS_TREESTORE_COL_RECORD_OFFSET | 163 | GNS_TREESTORE_COL_RECORD_OFFSET, |
164 | |||
165 | /** | ||
166 | * A gboolean; TRUE if the record is pending approval | ||
167 | * and thus not usable for anyone right now. | ||
168 | */ | ||
169 | GNS_TREESTORE_COL_IS_PENDING | ||
164 | }; | 170 | }; |
165 | 171 | ||
166 | 172 | ||
@@ -203,7 +209,7 @@ enum ZONE_COLUMNS | |||
203 | 209 | ||
204 | 210 | ||
205 | /** | 211 | /** |
206 | * Closure for 'operation_done_cont'. | 212 | * Closure for #operation_done_cont(). |
207 | */ | 213 | */ |
208 | struct OperationContext | 214 | struct OperationContext |
209 | { | 215 | { |
@@ -227,7 +233,7 @@ struct OperationContext | |||
227 | 233 | ||
228 | 234 | ||
229 | /** | 235 | /** |
230 | * Closure for 'merge_with_existing_records'. | 236 | * Closure for #merge_with_existing_records(). |
231 | */ | 237 | */ |
232 | struct MoveOperationContext | 238 | struct MoveOperationContext |
233 | { | 239 | { |
@@ -258,6 +264,8 @@ struct MoveOperationContext | |||
258 | struct GNUNET_CRYPTO_EcdsaPrivateKey pk; | 264 | struct GNUNET_CRYPTO_EcdsaPrivateKey pk; |
259 | 265 | ||
260 | /** | 266 | /** |
267 | |||
268 | |||
261 | * Data to free. | 269 | * Data to free. |
262 | */ | 270 | */ |
263 | void *data; | 271 | void *data; |
@@ -614,6 +622,9 @@ gnunet_namestore_gtk_qr_save_as_dialog_response_cb (GtkDialog *dialog, | |||
614 | /** | 622 | /** |
615 | * User clicked on 'save as' to extract the QR code. Open 'save as' | 623 | * User clicked on 'save as' to extract the QR code. Open 'save as' |
616 | * dialog to get the desired filename and file type. | 624 | * dialog to get the desired filename and file type. |
625 | * | ||
626 | * @param button the 'save as' button | ||
627 | * @param user_data unused | ||
617 | */ | 628 | */ |
618 | void | 629 | void |
619 | gnunet_namestore_gtk_qr_saveas_button_clicked_cb (GtkButton *button, | 630 | gnunet_namestore_gtk_qr_saveas_button_clicked_cb (GtkButton *button, |
@@ -975,6 +986,8 @@ edit_dialog_continuation (struct GNUNET_GTK_NAMESTORE_PluginEnvironment *edc, | |||
975 | rd.flags = GNUNET_GNSRECORD_RF_PRIVATE; | 986 | rd.flags = GNUNET_GNSRECORD_RF_PRIVATE; |
976 | if (edc->n_is_shadow) | 987 | if (edc->n_is_shadow) |
977 | rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; | 988 | rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; |
989 | if (edc->n_is_pending) | ||
990 | rd.flags |= GNUNET_GNSRECORD_RF_PENDING; | ||
978 | rd.record_type = edc->record_type; | 991 | rd.record_type = edc->record_type; |
979 | rd.expiration_time = edc->n_exp_time; | 992 | rd.expiration_time = edc->n_exp_time; |
980 | if (edc->n_is_relative) | 993 | if (edc->n_is_relative) |
@@ -1224,6 +1237,10 @@ edit_dialog_setup_common_elements (struct GNUNET_GTK_NAMESTORE_PluginEnvironment | |||
1224 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | 1237 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, |
1225 | "edit_dialog_options_shadow_checkbutton")), | 1238 | "edit_dialog_options_shadow_checkbutton")), |
1226 | edc->n_is_shadow); | 1239 | edc->n_is_shadow); |
1240 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | ||
1241 | "edit_dialog_options_pending_checkbutton")), | ||
1242 | edc->n_is_pending); | ||
1243 | |||
1227 | if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == edc->n_exp_time) | 1244 | if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == edc->n_exp_time) |
1228 | { | 1245 | { |
1229 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | 1246 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, |
@@ -1322,6 +1339,9 @@ edit_dialog_putes_common_elements (struct GNUNET_GTK_NAMESTORE_PluginEnvironment | |||
1322 | /* is shadow flag */ | 1339 | /* is shadow flag */ |
1323 | edc->n_is_shadow = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | 1340 | edc->n_is_shadow = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, |
1324 | "edit_dialog_options_shadow_checkbutton"))); | 1341 | "edit_dialog_options_shadow_checkbutton"))); |
1342 | /* is pending flag */ | ||
1343 | edc->n_is_pending = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | ||
1344 | "edit_dialog_options_pending_checkbutton"))); | ||
1325 | 1345 | ||
1326 | /* 'forever' expiration time */ | 1346 | /* 'forever' expiration time */ |
1327 | if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, | 1347 | if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, |
@@ -1568,6 +1588,7 @@ launch_edit_dialog (gint n_type, | |||
1568 | edc->n_public = (0 == (rd_old[off].flags & GNUNET_GNSRECORD_RF_PRIVATE)); | 1588 | edc->n_public = (0 == (rd_old[off].flags & GNUNET_GNSRECORD_RF_PRIVATE)); |
1569 | edc->n_is_relative = (0 != (rd_old[off].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)); | 1589 | edc->n_is_relative = (0 != (rd_old[off].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)); |
1570 | edc->n_is_shadow = (0 != (rd_old[off].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)); | 1590 | edc->n_is_shadow = (0 != (rd_old[off].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)); |
1591 | edc->n_is_pending = (0 != (rd_old[off].flags & GNUNET_GNSRECORD_RF_PENDING)); | ||
1571 | edc->n_exp_time = rd_old[off].expiration_time; | 1592 | edc->n_exp_time = rd_old[off].expiration_time; |
1572 | edc->old_record_in_namestore = GNUNET_YES; | 1593 | edc->old_record_in_namestore = GNUNET_YES; |
1573 | } | 1594 | } |
@@ -1943,8 +1964,8 @@ gnunet_namestore_gtk_treeview_button_press_event_cb (GtkWidget *widget, | |||
1943 | */ | 1964 | */ |
1944 | gboolean | 1965 | gboolean |
1945 | gnunet_namestore_gtk_treeview_key_press_event_cb (GtkWidget *widget, | 1966 | gnunet_namestore_gtk_treeview_key_press_event_cb (GtkWidget *widget, |
1946 | GdkEventKey *event, | 1967 | GdkEventKey *event, |
1947 | gpointer user_data) | 1968 | gpointer user_data) |
1948 | { | 1969 | { |
1949 | GtkTreeIter iter; | 1970 | GtkTreeIter iter; |
1950 | GtkTreeSelection *sel; | 1971 | GtkTreeSelection *sel; |
@@ -1988,6 +2009,7 @@ gnunet_namestore_gtk_treeview_key_press_event_cb (GtkWidget *widget, | |||
1988 | guint64 n_exp_time; | 2009 | guint64 n_exp_time; |
1989 | gboolean n_is_relative; | 2010 | gboolean n_is_relative; |
1990 | gboolean n_is_shadow; | 2011 | gboolean n_is_shadow; |
2012 | gboolean n_is_pending; | ||
1991 | char *n_value; | 2013 | char *n_value; |
1992 | 2014 | ||
1993 | /* Removing a single record */ | 2015 | /* Removing a single record */ |
@@ -2005,6 +2027,7 @@ gnunet_namestore_gtk_treeview_key_press_event_cb (GtkWidget *widget, | |||
2005 | GNS_TREESTORE_COL_EXP_TIME, &n_exp_time, | 2027 | GNS_TREESTORE_COL_EXP_TIME, &n_exp_time, |
2006 | GNS_TREESTORE_COL_EXP_TIME_IS_REL, &n_is_relative, | 2028 | GNS_TREESTORE_COL_EXP_TIME_IS_REL, &n_is_relative, |
2007 | GNS_TREESTORE_COL_IS_SHADOW, &n_is_shadow, | 2029 | GNS_TREESTORE_COL_IS_SHADOW, &n_is_shadow, |
2030 | GNS_TREESTORE_COL_IS_PENDING, &n_is_pending, | ||
2008 | GNS_TREESTORE_COL_VAL_AS_STR, &n_value, | 2031 | GNS_TREESTORE_COL_VAL_AS_STR, &n_value, |
2009 | -1); | 2032 | -1); |
2010 | /* valid name */ | 2033 | /* valid name */ |
@@ -2016,6 +2039,8 @@ gnunet_namestore_gtk_treeview_key_press_event_cb (GtkWidget *widget, | |||
2016 | rd.flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; | 2039 | rd.flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; |
2017 | if (n_is_shadow) | 2040 | if (n_is_shadow) |
2018 | rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; | 2041 | rd.flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; |
2042 | if (n_is_pending) | ||
2043 | rd.flags |= GNUNET_GNSRECORD_RF_PENDING; | ||
2019 | rd.record_type = n_type; | 2044 | rd.record_type = n_type; |
2020 | rd.expiration_time = n_exp_time; | 2045 | rd.expiration_time = n_exp_time; |
2021 | if (GNUNET_OK != | 2046 | if (GNUNET_OK != |
@@ -2235,7 +2260,9 @@ zone_iteration_proc (void *cls, | |||
2235 | char *val; | 2260 | char *val; |
2236 | char *type_str; | 2261 | char *type_str; |
2237 | gboolean time_is_relative; | 2262 | gboolean time_is_relative; |
2238 | gboolean public; | 2263 | gboolean is_public; |
2264 | gboolean is_pending; | ||
2265 | gboolean is_shadow; | ||
2239 | guint64 exp_t; | 2266 | guint64 exp_t; |
2240 | GtkEntry *pseu_entry; | 2267 | GtkEntry *pseu_entry; |
2241 | struct GNUNET_HashCode name_hash; | 2268 | struct GNUNET_HashCode name_hash; |
@@ -2345,7 +2372,11 @@ zone_iteration_proc (void *cls, | |||
2345 | rd[c].data_size); | 2372 | rd[c].data_size); |
2346 | 2373 | ||
2347 | /* Set public toggle */ | 2374 | /* Set public toggle */ |
2348 | public = ((rd[c].flags & GNUNET_GNSRECORD_RF_PRIVATE) != GNUNET_GNSRECORD_RF_PRIVATE); | 2375 | is_public = ((rd[c].flags & GNUNET_GNSRECORD_RF_PRIVATE) != GNUNET_GNSRECORD_RF_PRIVATE); |
2376 | /* Set shadow toggle */ | ||
2377 | is_shadow = ((rd[c].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD) == GNUNET_GNSRECORD_RF_SHADOW_RECORD); | ||
2378 | /* Set pending toggle */ | ||
2379 | is_pending = ((rd[c].flags & GNUNET_GNSRECORD_RF_PENDING) == GNUNET_GNSRECORD_RF_PENDING); | ||
2349 | /* Expiration time */ | 2380 | /* Expiration time */ |
2350 | time_is_relative = (0 != (rd[c].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)); | 2381 | time_is_relative = (0 != (rd[c].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)); |
2351 | 2382 | ||
@@ -2392,7 +2423,9 @@ zone_iteration_proc (void *cls, | |||
2392 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, FALSE, | 2423 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, FALSE, |
2393 | GNS_TREESTORE_COL_RECORD_TYPE, rd[c].record_type, | 2424 | GNS_TREESTORE_COL_RECORD_TYPE, rd[c].record_type, |
2394 | GNS_TREESTORE_COL_RECORD_TYPE_AS_STR, type_str, | 2425 | GNS_TREESTORE_COL_RECORD_TYPE_AS_STR, type_str, |
2395 | GNS_TREESTORE_COL_IS_PUBLIC, public, | 2426 | GNS_TREESTORE_COL_IS_PUBLIC, is_public, |
2427 | GNS_TREESTORE_COL_IS_SHADOW, is_shadow, | ||
2428 | GNS_TREESTORE_COL_IS_PENDING, is_pending, | ||
2396 | GNS_TREESTORE_COL_EXP_TIME, exp_t, | 2429 | GNS_TREESTORE_COL_EXP_TIME, exp_t, |
2397 | GNS_TREESTORE_COL_EXP_TIME_AS_STR, exp, | 2430 | GNS_TREESTORE_COL_EXP_TIME_AS_STR, exp, |
2398 | GNS_TREESTORE_COL_EXP_TIME_IS_REL, time_is_relative, | 2431 | GNS_TREESTORE_COL_EXP_TIME_IS_REL, time_is_relative, |