aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-gns-gtk_zone.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/gnunet-gns-gtk_zone.c')
-rw-r--r--src/gns/gnunet-gns-gtk_zone.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/gns/gnunet-gns-gtk_zone.c b/src/gns/gnunet-gns-gtk_zone.c
index cc306e67..147d8cef 100644
--- a/src/gns/gnunet-gns-gtk_zone.c
+++ b/src/gns/gnunet-gns-gtk_zone.c
@@ -43,7 +43,8 @@ enum TREESTORE_COLUMNS
43 TREE_COL_NAME_IS_VISIBLE, 43 TREE_COL_NAME_IS_VISIBLE,
44 TREE_COL_IS_RECORD_ROW, 44 TREE_COL_IS_RECORD_ROW,
45 TREE_COL_NOT_DUMMY_ROW, 45 TREE_COL_NOT_DUMMY_ROW,
46 TREE_COL_EXP_TIME_COLOR 46 TREE_COL_EXP_TIME_COLOR,
47 TREE_COL_NAME_COLOR
47}; 48};
48 49
49enum LIST_COLUMNS 50enum LIST_COLUMNS
@@ -153,7 +154,9 @@ check_name_validity_and_commit (struct GNUNET_GNS_Context *gns, gchar *path)
153 154
154 /* valid name */ 155 /* valid name */
155 if (NULL == n_name) 156 if (NULL == n_name)
156 valid = GNUNET_NO; 157 valid = GNUNET_NO;
158 else if (GNUNET_SYSERR == GNUNET_NAMESTORE_check_name (n_value))
159 valid = GNUNET_NO;
157 160
158 /* valid record type */ 161 /* valid record type */
159 if (0 == n_type) 162 if (0 == n_type)
@@ -224,16 +227,16 @@ check_name_validity_and_remove_proc (void *cls,
224 if (GNUNET_SYSERR == success) 227 if (GNUNET_SYSERR == success)
225 { 228 {
226 char * message = _("Record could not be deleted:"); 229 char * message = _("Record could not be deleted:");
227 dialog = gtk_message_dialog_new (GTK_WINDOW (rcc->gns->main_window), 230 dialog = GTK_DIALOG(gtk_message_dialog_new (GTK_WINDOW (rcc->gns->main_window),
228 GTK_DIALOG_DESTROY_WITH_PARENT, 231 GTK_DIALOG_DESTROY_WITH_PARENT,
229 GTK_MESSAGE_ERROR, 232 GTK_MESSAGE_ERROR,
230 GTK_BUTTONS_CLOSE, 233 GTK_BUTTONS_CLOSE,
231 _("%s\n%s\n"), 234 _("%s\n%s\n"),
232 message, 235 message,
233 emsg); 236 emsg));
234 237
235 g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), rcc->gns); 238 g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), rcc->gns);
236 gtk_widget_show_all (dialog); 239 gtk_widget_show_all (GTK_WIDGET(dialog));
237 } 240 }
238 else 241 else
239 { 242 {
@@ -318,7 +321,7 @@ check_name_validity_and_remove (struct GNUNET_GNS_Context *gns, gchar *path)
318 rcc->gns = gns; 321 rcc->gns = gns;
319 rcc->path = strdup (path); 322 rcc->path = strdup (path);
320 GNUNET_NAMESTORE_record_remove(gns->ns, gns->pkey, name, &rd, &check_name_validity_and_remove_proc, rcc); 323 GNUNET_NAMESTORE_record_remove(gns->ns, gns->pkey, name, &rd, &check_name_validity_and_remove_proc, rcc);
321 GNUNET_free (rd.data); 324 GNUNET_free ((void *) rd.data);
322 } 325 }
323 g_free (n_name); 326 g_free (n_name);
324 g_free (n_exp_color); 327 g_free (n_exp_color);
@@ -621,6 +624,20 @@ GNUNET_GNS_GTK_name_cellrenderertext_edited_cb (GtkCellRendererText *renderer,
621 /* update name */ 624 /* update name */
622 gtk_tree_store_set (gns->ts, &it, TREE_COL_NAME, new_text, -1); 625 gtk_tree_store_set (gns->ts, &it, TREE_COL_NAME, new_text, -1);
623 } 626 }
627
628 if (GNUNET_SYSERR == GNUNET_NAMESTORE_check_name (new_text))
629 {
630 gtk_tree_store_set (gns->ts, &it,
631 TREE_COL_NAME_COLOR, "red",
632 -1);
633 }
634 else
635 {
636 gtk_tree_store_set (gns->ts, &it,
637 TREE_COL_NAME_COLOR, NULL,
638 -1);
639 }
640
624 check_name_validity_and_commit (gns, path); 641 check_name_validity_and_commit (gns, path);
625} 642}
626 643