diff options
-rw-r--r-- | contrib/gnunet_setup_gns_edit_a.glade | 49 | ||||
-rw-r--r-- | src/setup/gnunet-setup-gns-edit.c | 116 |
2 files changed, 146 insertions, 19 deletions
diff --git a/contrib/gnunet_setup_gns_edit_a.glade b/contrib/gnunet_setup_gns_edit_a.glade index 0e41153d..d769173b 100644 --- a/contrib/gnunet_setup_gns_edit_a.glade +++ b/contrib/gnunet_setup_gns_edit_a.glade | |||
@@ -17,6 +17,23 @@ | |||
17 | <property name="step_increment">1</property> | 17 | <property name="step_increment">1</property> |
18 | <property name="page_increment">10</property> | 18 | <property name="page_increment">10</property> |
19 | </object> | 19 | </object> |
20 | <object class="GtkListStore" id="edit_dialog_expiration_relative_liststore"> | ||
21 | <columns> | ||
22 | <!-- column-name relativetime --> | ||
23 | <column type="gchararray"/> | ||
24 | </columns> | ||
25 | <data> | ||
26 | <row> | ||
27 | <col id="0">7 days</col> | ||
28 | </row> | ||
29 | <row> | ||
30 | <col id="0">1 day</col> | ||
31 | </row> | ||
32 | <row> | ||
33 | <col id="0">1 h</col> | ||
34 | </row> | ||
35 | </data> | ||
36 | </object> | ||
20 | <object class="GtkDialog" id="edit_a_dialog"> | 37 | <object class="GtkDialog" id="edit_a_dialog"> |
21 | <property name="can_focus">False</property> | 38 | <property name="can_focus">False</property> |
22 | <property name="border_width">5</property> | 39 | <property name="border_width">5</property> |
@@ -117,6 +134,7 @@ | |||
117 | <property name="secondary_icon_activatable">False</property> | 134 | <property name="secondary_icon_activatable">False</property> |
118 | <property name="primary_icon_sensitive">True</property> | 135 | <property name="primary_icon_sensitive">True</property> |
119 | <property name="secondary_icon_sensitive">True</property> | 136 | <property name="secondary_icon_sensitive">True</property> |
137 | <signal name="changed" handler="GNS_edit_dialog_name_entry_changed_cb" swapped="no"/> | ||
120 | </object> | 138 | </object> |
121 | <packing> | 139 | <packing> |
122 | <property name="expand">True</property> | 140 | <property name="expand">True</property> |
@@ -145,10 +163,16 @@ | |||
145 | <property name="model">zone_liststore</property> | 163 | <property name="model">zone_liststore</property> |
146 | <property name="active">0</property> | 164 | <property name="active">0</property> |
147 | <property name="entry_text_column">0</property> | 165 | <property name="entry_text_column">0</property> |
166 | <child> | ||
167 | <object class="GtkCellRendererText" id="edit_dialog_zone_combobox_cellrenderertext"/> | ||
168 | <attributes> | ||
169 | <attribute name="text">0</attribute> | ||
170 | </attributes> | ||
171 | </child> | ||
148 | </object> | 172 | </object> |
149 | <packing> | 173 | <packing> |
150 | <property name="expand">False</property> | 174 | <property name="expand">True</property> |
151 | <property name="fill">False</property> | 175 | <property name="fill">True</property> |
152 | <property name="position">2</property> | 176 | <property name="position">2</property> |
153 | </packing> | 177 | </packing> |
154 | </child> | 178 | </child> |
@@ -325,6 +349,7 @@ | |||
325 | <property name="tooltip_text" translatable="yes">Records with a relative expiration time (such as 1 week) are always valid for at least that time period into the future. In other words, the auto-renew their own expiration to the given time period into the future. When you convert a public record with a relative expiration time to one with an absolute expiration time, the earliest possible expiration will be the respective relative time in the future. Use relative expiration times for entries for which you do not know a specific date when they will expire.</property> | 349 | <property name="tooltip_text" translatable="yes">Records with a relative expiration time (such as 1 week) are always valid for at least that time period into the future. In other words, the auto-renew their own expiration to the given time period into the future. When you convert a public record with a relative expiration time to one with an absolute expiration time, the earliest possible expiration will be the respective relative time in the future. Use relative expiration times for entries for which you do not know a specific date when they will expire.</property> |
326 | <property name="active">True</property> | 350 | <property name="active">True</property> |
327 | <property name="draw_indicator">True</property> | 351 | <property name="draw_indicator">True</property> |
352 | <signal name="toggled" handler="GNS_edit_dialog_expiration_relative_radiobutton_toggled_cb" swapped="no"/> | ||
328 | </object> | 353 | </object> |
329 | <packing> | 354 | <packing> |
330 | <property name="expand">False</property> | 355 | <property name="expand">False</property> |
@@ -343,6 +368,7 @@ | |||
343 | <property name="active">True</property> | 368 | <property name="active">True</property> |
344 | <property name="draw_indicator">True</property> | 369 | <property name="draw_indicator">True</property> |
345 | <property name="group">edit_dialog_expiration_relative_radiobutton</property> | 370 | <property name="group">edit_dialog_expiration_relative_radiobutton</property> |
371 | <signal name="toggled" handler="GNS_edit_dialog_expiration_absolute_radiobutton_toggled_cb" swapped="no"/> | ||
346 | </object> | 372 | </object> |
347 | <packing> | 373 | <packing> |
348 | <property name="expand">False</property> | 374 | <property name="expand">False</property> |
@@ -506,6 +532,8 @@ | |||
506 | <property name="model">edit_dialog_expiration_relative_liststore</property> | 532 | <property name="model">edit_dialog_expiration_relative_liststore</property> |
507 | <property name="has_entry">True</property> | 533 | <property name="has_entry">True</property> |
508 | <property name="entry_text_column">0</property> | 534 | <property name="entry_text_column">0</property> |
535 | <signal name="changed" handler="GNS_edit_dialog_expiration_relative_combobox_changed_cb" swapped="no"/> | ||
536 | <signal name="editing-done" handler="GNS_edit_dialog_expiration_relative_combobox_editing_done_cb" swapped="no"/> | ||
509 | </object> | 537 | </object> |
510 | <packing> | 538 | <packing> |
511 | <property name="expand">True</property> | 539 | <property name="expand">True</property> |
@@ -540,23 +568,6 @@ | |||
540 | <action-widget response="-5">edit_dialog_save_button</action-widget> | 568 | <action-widget response="-5">edit_dialog_save_button</action-widget> |
541 | </action-widgets> | 569 | </action-widgets> |
542 | </object> | 570 | </object> |
543 | <object class="GtkListStore" id="edit_dialog_expiration_relative_liststore"> | ||
544 | <columns> | ||
545 | <!-- column-name relativetime --> | ||
546 | <column type="gchararray"/> | ||
547 | </columns> | ||
548 | <data> | ||
549 | <row> | ||
550 | <col id="0">7 days</col> | ||
551 | </row> | ||
552 | <row> | ||
553 | <col id="0">1 day</col> | ||
554 | </row> | ||
555 | <row> | ||
556 | <col id="0">1 h</col> | ||
557 | </row> | ||
558 | </data> | ||
559 | </object> | ||
560 | <object class="GtkListStore" id="zone_liststore"> | 571 | <object class="GtkListStore" id="zone_liststore"> |
561 | <columns> | 572 | <columns> |
562 | <!-- column-name zonename --> | 573 | <!-- column-name zonename --> |
diff --git a/src/setup/gnunet-setup-gns-edit.c b/src/setup/gnunet-setup-gns-edit.c index f4e6de65..7dc8e41e 100644 --- a/src/setup/gnunet-setup-gns-edit.c +++ b/src/setup/gnunet-setup-gns-edit.c | |||
@@ -77,6 +77,122 @@ edit_dialog_enable_save (struct EditDialogContext *edc) | |||
77 | 77 | ||
78 | 78 | ||
79 | /** | 79 | /** |
80 | * The user has edited the A record value. Enable/disable 'save' | ||
81 | * button depending on the validity of the value. | ||
82 | * | ||
83 | * @param entry editing widget | ||
84 | * @param preedit new value | ||
85 | * @param user_data the 'struct EditDialogContext' of the dialog | ||
86 | */ | ||
87 | void | ||
88 | GNS_edit_dialog_name_entry_changed_cb (GtkEditable *entry, | ||
89 | gpointer user_data) | ||
90 | { | ||
91 | struct EditDialogContext *edc = user_data; | ||
92 | const gchar *preedit; | ||
93 | struct in_addr v4; | ||
94 | |||
95 | preedit = gtk_editable_get_chars (entry, 0, -1); | ||
96 | #if 0 | ||
97 | /* FIXME: need a way to check if _rest_ of the dialog is | ||
98 | also consistent (like the _value_!) */ | ||
99 | if (1) | ||
100 | edit_dialog_enable_save (edc); | ||
101 | else | ||
102 | edit_dialog_disable_save (edc); | ||
103 | #endif | ||
104 | GNUNET_break (0); | ||
105 | } | ||
106 | |||
107 | |||
108 | /** | ||
109 | * The user has changed the relative expiration time. | ||
110 | * | ||
111 | * @param widget the combo box | ||
112 | * @param user_data the 'struct EditDialogContext' of the dialog | ||
113 | */ | ||
114 | void | ||
115 | GNS_edit_dialog_expiration_relative_combobox_changed_cb (GtkComboBox *widget, | ||
116 | gpointer user_data) | ||
117 | { | ||
118 | struct EditDialogContext *edc = user_data; | ||
119 | |||
120 | /* not sure if we need to do anything here */ | ||
121 | // FIXME | ||
122 | GNUNET_break (0); | ||
123 | } | ||
124 | |||
125 | |||
126 | /** | ||
127 | * The user finished adding an expiration value from hand. Add | ||
128 | * it to the model and select it -- if it is a valid value. | ||
129 | * | ||
130 | * @param cell_editable the changed cell | ||
131 | * @param user_data the 'struct EditDialogContext' of the dialog | ||
132 | */ | ||
133 | void | ||
134 | GNS_edit_dialog_expiration_relative_combobox_editing_done_cb (GtkCellEditable *cell_editable, | ||
135 | gpointer user_data) | ||
136 | { | ||
137 | struct EditDialogContext *edc = user_data; | ||
138 | |||
139 | // FIXME | ||
140 | GNUNET_break (0); | ||
141 | } | ||
142 | |||
143 | |||
144 | /** | ||
145 | * The 'relative' expiration time radiobutton was toggled (on or off). | ||
146 | * | ||
147 | * @param button the button | ||
148 | * @param user_data the 'struct EditDialogContext' of the dialog | ||
149 | */ | ||
150 | void | ||
151 | GNS_edit_dialog_expiration_relative_radiobutton_toggled_cb (GtkToggleButton *button, | ||
152 | gpointer user_data) | ||
153 | { | ||
154 | struct EditDialogContext *edc = user_data; | ||
155 | |||
156 | // FIXME | ||
157 | GNUNET_break (0); | ||
158 | } | ||
159 | |||
160 | |||
161 | /** | ||
162 | * The 'forever' expiration time radiobutton was toggled (on or off). | ||
163 | * | ||
164 | * @param button the button | ||
165 | * @param user_data the 'struct EditDialogContext' of the dialog | ||
166 | */ | ||
167 | void | ||
168 | GNS_edit_dialog_expiration_forever_radiobutton_toggled_cb (GtkToggleButton *button, | ||
169 | gpointer user_data) | ||
170 | { | ||
171 | struct EditDialogContext *edc = user_data; | ||
172 | |||
173 | // FIXME | ||
174 | GNUNET_break (0); | ||
175 | } | ||
176 | |||
177 | |||
178 | /** | ||
179 | * The 'absolute' expiration time radiobutton was toggled (on or off). | ||
180 | * | ||
181 | * @param button the button | ||
182 | * @param user_data the 'struct EditDialogContext' of the dialog | ||
183 | */ | ||
184 | void | ||
185 | GNS_edit_dialog_expiration_absolute_radiobutton_toggled_cb (GtkToggleButton *button, | ||
186 | gpointer user_data) | ||
187 | { | ||
188 | struct EditDialogContext *edc = user_data; | ||
189 | |||
190 | // FIXME | ||
191 | GNUNET_break (0); | ||
192 | } | ||
193 | |||
194 | |||
195 | /** | ||
80 | * Initialize widgets of the edit dialog that are the same regardless of | 196 | * Initialize widgets of the edit dialog that are the same regardless of |
81 | * the type of the record. | 197 | * the type of the record. |
82 | * | 198 | * |