aboutsummaryrefslogtreecommitdiff
path: root/src/setup/gnunet-setup-gns-edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/setup/gnunet-setup-gns-edit.c')
-rw-r--r--src/setup/gnunet-setup-gns-edit.c50
1 files changed, 41 insertions, 9 deletions
diff --git a/src/setup/gnunet-setup-gns-edit.c b/src/setup/gnunet-setup-gns-edit.c
index fc3c273e..c5d5bb3e 100644
--- a/src/setup/gnunet-setup-gns-edit.c
+++ b/src/setup/gnunet-setup-gns-edit.c
@@ -190,6 +190,12 @@ GNS_edit_dialog_expiration_absolute_radiobutton_toggled_cb (GtkToggleButton *but
190static void 190static void
191edit_dialog_setup_common_elements (struct EditDialogContext *edc) 191edit_dialog_setup_common_elements (struct EditDialogContext *edc)
192{ 192{
193 GtkComboBox *cb;
194 GtkTreeModel *tm;
195 GtkListStore *ls;
196 GtkTreeIter iter;
197 gchar *opt;
198
193 if (GNUNET_YES != 199 if (GNUNET_YES !=
194 edc->old_record_in_namestore) 200 edc->old_record_in_namestore)
195 { 201 {
@@ -223,9 +229,6 @@ edit_dialog_setup_common_elements (struct EditDialogContext *edc)
223 if (edc->n_is_relative) 229 if (edc->n_is_relative)
224 { 230 {
225 struct GNUNET_TIME_Relative rt; 231 struct GNUNET_TIME_Relative rt;
226 GtkComboBox *cb;
227 GtkListStore *ls;
228 GtkTreeIter iter;
229 232
230 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, 233 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder,
231 "edit_dialog_expiration_relative_radiobutton")), 234 "edit_dialog_expiration_relative_radiobutton")),
@@ -324,7 +327,7 @@ edit_dialog_putes_common_elements (struct EditDialogContext *edc)
324 GtkComboBox *cb; 327 GtkComboBox *cb;
325 GtkTreeModel *tm; 328 GtkTreeModel *tm;
326 GtkTreeIter iter; 329 GtkTreeIter iter;
327 gchararray *opt; 330 gchar *opt;
328 331
329 /* record name */ 332 /* record name */
330 entry = GTK_ENTRY (gtk_builder_get_object (edc->builder, 333 entry = GTK_ENTRY (gtk_builder_get_object (edc->builder,
@@ -373,9 +376,38 @@ edit_dialog_putes_common_elements (struct EditDialogContext *edc)
373 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder, 376 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (edc->builder,
374 "edit_dialog_expiration_absolute_radiobutton")))) 377 "edit_dialog_expiration_absolute_radiobutton"))))
375 { 378 {
376 /* FIXME: implement! */ 379 guint year;
377 380 guint month;
378 GNUNET_break (0); 381 guint day;
382 guint hour;
383 guint minute;
384 guint second;
385 char fancydate[128];
386 struct GNUNET_TIME_Absolute atime;
387
388 gtk_calendar_get_date (GTK_CALENDAR (gtk_builder_get_object (edc->builder,
389 "edit_dialog_expiration_absolute_calendar")),
390 &year, &month, &day);
391 hour = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (edc->builder,
392 "edit_dialog_expiration_absolute_hours_spinbutton")));
393 minute = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (edc->builder,
394 "edit_dialog_expiration_absolute_minutes_spinbutton")));
395 second = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (edc->builder,
396 "edit_dialog_expiration_absolute_seconds_spinbutton")));
397 GNUNET_snprintf (fancydate,
398 sizeof (fancydate),
399 "%u-%u-%u %u:%u:%u",
400 (unsigned int) year,
401 (unsigned int) month + 1,
402 (unsigned int) day,
403 (unsigned int) hour,
404 (unsigned int) minute,
405 (unsigned int) second);
406 GNUNET_break (GNUNET_OK ==
407 GNUNET_STRINGS_fancy_time_to_absolute (fancydate,
408 &atime));
409 edc->n_exp_time = atime.abs_value;
410 edc->n_is_relative = FALSE;
379 } 411 }
380 412
381 /* extract target zone! */ 413 /* extract target zone! */
@@ -395,8 +427,8 @@ edit_dialog_putes_common_elements (struct EditDialogContext *edc)
395 GNUNET_break (0); 427 GNUNET_break (0);
396 else 428 else
397 { 429 {
398 GNUNET_free (edc->new_zone_option); 430 g_free (edc->new_zone_option);
399 edc->new_zone_option = GNUNET_strdup (opt); 431 edc->new_zone_option = g_strdup (opt);
400 g_free (opt); 432 g_free (opt);
401 } 433 }
402 } 434 }