diff options
Diffstat (limited to 'src/gns/gnunet-gns-gtk_zone.c')
-rw-r--r-- | src/gns/gnunet-gns-gtk_zone.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/gns/gnunet-gns-gtk_zone.c b/src/gns/gnunet-gns-gtk_zone.c index 90a7f76f..10d52dbb 100644 --- a/src/gns/gnunet-gns-gtk_zone.c +++ b/src/gns/gnunet-gns-gtk_zone.c | |||
@@ -40,7 +40,7 @@ enum | |||
40 | TREE_COL_VAL_AS_STR, | 40 | TREE_COL_VAL_AS_STR, |
41 | TREE_COL_VAL_COLOR, | 41 | TREE_COL_VAL_COLOR, |
42 | TREE_COL_NAME_IS_EDITABLE, | 42 | TREE_COL_NAME_IS_EDITABLE, |
43 | TREE_COL_IS_NAME_ROW, | 43 | TREE_COL_IS_RECORD_ROW = 10 |
44 | }; | 44 | }; |
45 | 45 | ||
46 | enum | 46 | enum |
@@ -69,11 +69,25 @@ GNUNET_GNS_GTK_type_cellrenderercombo_changed_cb (GtkCellRendererCombo *combo, | |||
69 | GtkTreeIter it; | 69 | GtkTreeIter it; |
70 | GtkTreeModel *tm = GTK_TREE_MODEL(gns->ts); | 70 | GtkTreeModel *tm = GTK_TREE_MODEL(gns->ts); |
71 | guint type; | 71 | guint type; |
72 | // int is_row; | ||
72 | char *type_str; | 73 | char *type_str; |
73 | char *value_str; | 74 | char *value_str; |
74 | void *data; | 75 | void *data; |
75 | size_t data_size; | 76 | size_t data_size; |
76 | 77 | ||
78 | /* check if this is a new record */ | ||
79 | /* | ||
80 | gtk_tree_model_get(tm, &it, TREE_COL_IS_NAME_ROW, &is_row, -1); | ||
81 | |||
82 | if (0 == is_row) | ||
83 | { | ||
84 | |||
85 | } | ||
86 | else | ||
87 | { | ||
88 | |||
89 | } | ||
90 | */ | ||
77 | gtk_tree_model_get(GTK_TREE_MODEL(gns->ls), new_iter, 0, &type, -1); | 91 | gtk_tree_model_get(GTK_TREE_MODEL(gns->ls), new_iter, 0, &type, -1); |
78 | gtk_tree_model_get(GTK_TREE_MODEL(gns->ls), new_iter, TYPE_LIST_TYPENAME, &type_str, -1); | 92 | gtk_tree_model_get(GTK_TREE_MODEL(gns->ls), new_iter, TYPE_LIST_TYPENAME, &type_str, -1); |
79 | 93 | ||
@@ -96,6 +110,7 @@ GNUNET_GNS_GTK_type_cellrenderercombo_changed_cb (GtkCellRendererCombo *combo, | |||
96 | else | 110 | else |
97 | gtk_tree_store_set (gns->ts, &it, TREE_COL_VAL_COLOR, NULL, -1); | 111 | gtk_tree_store_set (gns->ts, &it, TREE_COL_VAL_COLOR, NULL, -1); |
98 | } | 112 | } |
113 | GNUNET_free (value_str); | ||
99 | } | 114 | } |
100 | 115 | ||
101 | 116 | ||
@@ -219,6 +234,7 @@ GNUNET_GNS_GTK_name_cellrenderertext_edited_cb (GtkCellRendererText *renderer, | |||
219 | TREE_COL_NAME, _(NEW_RECORD_STR), | 234 | TREE_COL_NAME, _(NEW_RECORD_STR), |
220 | TREE_COL_RECORD_TYPE, 1, | 235 | TREE_COL_RECORD_TYPE, 1, |
221 | TREE_COL_NAME_IS_EDITABLE, 1, | 236 | TREE_COL_NAME_IS_EDITABLE, 1, |
237 | //TREE_COL_IS_NAME_ROW, 1 | ||
222 | -1); | 238 | -1); |
223 | #if 0 | 239 | #if 0 |
224 | gtk_tree_store_append(gns->ts, &it, NULL); | 240 | gtk_tree_store_append(gns->ts, &it, NULL); |
@@ -307,7 +323,7 @@ void zone_iteration_proc (void *cls, | |||
307 | gtk_tree_store_set(zc_ctx->gns->ts, &iter_name, | 323 | gtk_tree_store_set(zc_ctx->gns->ts, &iter_name, |
308 | TREE_COL_NAME, name, | 324 | TREE_COL_NAME, name, |
309 | TREE_COL_NAME_IS_EDITABLE, 1, | 325 | TREE_COL_NAME_IS_EDITABLE, 1, |
310 | TREE_COL_IS_NAME_ROW, 1 | 326 | TREE_COL_IS_RECORD_ROW, GNUNET_NO, |
311 | -1); | 327 | -1); |
312 | 328 | ||
313 | 329 | ||
@@ -338,7 +354,6 @@ void zone_iteration_proc (void *cls, | |||
338 | val = GNUNET_NAMESTORE_value_to_string (rd[c].record_type, | 354 | val = GNUNET_NAMESTORE_value_to_string (rd[c].record_type, |
339 | rd[c].data, | 355 | rd[c].data, |
340 | rd[c].data_size); | 356 | rd[c].data_size); |
341 | |||
342 | gtk_tree_store_insert_with_values(zc_ctx->gns->ts, &iter_record , &iter_name, 0, | 357 | gtk_tree_store_insert_with_values(zc_ctx->gns->ts, &iter_record , &iter_name, 0, |
343 | TREE_COL_NAME, "", | 358 | TREE_COL_NAME, "", |
344 | TREE_COL_RECORD_TYPE, rd[c].record_type, | 359 | TREE_COL_RECORD_TYPE, rd[c].record_type, |
@@ -347,7 +362,7 @@ void zone_iteration_proc (void *cls, | |||
347 | TREE_COL_EXP_TIME_AS_STR, exp, | 362 | TREE_COL_EXP_TIME_AS_STR, exp, |
348 | TREE_COL_EXP_TIME_IS_REL, time_is_relative, | 363 | TREE_COL_EXP_TIME_IS_REL, time_is_relative, |
349 | TREE_COL_VAL_AS_STR, val, | 364 | TREE_COL_VAL_AS_STR, val, |
350 | TREE_COL_IS_NAME_ROW, 0 | 365 | TREE_COL_IS_RECORD_ROW, GNUNET_YES, |
351 | -1); | 366 | -1); |
352 | 367 | ||
353 | GNUNET_free (exp); | 368 | GNUNET_free (exp); |
@@ -375,6 +390,7 @@ GNUNET_GNS_GTK_main_treeview_realize_cb (GtkWidget *widget, | |||
375 | TREE_COL_NAME, _(NEW_RECORD_STR), | 390 | TREE_COL_NAME, _(NEW_RECORD_STR), |
376 | TREE_COL_RECORD_TYPE, 1, | 391 | TREE_COL_RECORD_TYPE, 1, |
377 | TREE_COL_NAME_IS_EDITABLE, 1, | 392 | TREE_COL_NAME_IS_EDITABLE, 1, |
393 | TREE_COL_IS_RECORD_ROW, GNUNET_NO, | ||
378 | -1); | 394 | -1); |
379 | 395 | ||
380 | zc_ctx = GNUNET_malloc (sizeof (struct ZoneIteration_Context)); | 396 | zc_ctx = GNUNET_malloc (sizeof (struct ZoneIteration_Context)); |