aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-03-16 15:05:23 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-03-16 15:05:23 +0000
commit6dd3df4d8ee1c394a79f3440811abd558551fc27 (patch)
tree2fa5b77a6820592029794a026ad53f2a385cd051
parentd7478e3a7043849a3dadf13a8cf6715386470489 (diff)
downloadgnunet-gtk-6dd3df4d8ee1c394a79f3440811abd558551fc27.tar.gz
gnunet-gtk-6dd3df4d8ee1c394a79f3440811abd558551fc27.zip
- more changes
-rw-r--r--contrib/gnunet_gns_gtk_main_window.glade102
-rw-r--r--src/gns/gnunet-gns-gtk_zone.c24
2 files changed, 71 insertions, 55 deletions
diff --git a/contrib/gnunet_gns_gtk_main_window.glade b/contrib/gnunet_gns_gtk_main_window.glade
index 165267c0..2ce2dc29 100644
--- a/contrib/gnunet_gns_gtk_main_window.glade
+++ b/contrib/gnunet_gns_gtk_main_window.glade
@@ -2,6 +2,56 @@
2<interface> 2<interface>
3 <requires lib="gtk+" version="2.20"/> 3 <requires lib="gtk+" version="2.20"/>
4 <!-- interface-naming-policy project-wide --> 4 <!-- interface-naming-policy project-wide -->
5 <object class="GtkListStore" id="GNUNET_GNS_GTK_type_liststore">
6 <columns>
7 <!-- column-name type -->
8 <column type="guint"/>
9 <!-- column-name typename -->
10 <column type="gchararray"/>
11 </columns>
12 <data>
13 <row>
14 <col id="0">1</col>
15 <col id="1" translatable="yes">A</col>
16 </row>
17 <row>
18 <col id="0">2</col>
19 <col id="1" translatable="yes">NS</col>
20 </row>
21 <row>
22 <col id="0">5</col>
23 <col id="1" translatable="yes">CNAME</col>
24 </row>
25 <row>
26 <col id="0">6</col>
27 <col id="1" translatable="yes">SOA</col>
28 </row>
29 <row>
30 <col id="0">12</col>
31 <col id="1" translatable="yes">PTR</col>
32 </row>
33 <row>
34 <col id="0">15</col>
35 <col id="1" translatable="yes">MX</col>
36 </row>
37 <row>
38 <col id="0">16</col>
39 <col id="1" translatable="yes">TXT</col>
40 </row>
41 <row>
42 <col id="0">28</col>
43 <col id="1" translatable="yes">AAAA</col>
44 </row>
45 <row>
46 <col id="0">65536</col>
47 <col id="1" translatable="yes">PKEY</col>
48 </row>
49 <row>
50 <col id="0">65537</col>
51 <col id="1" translatable="yes">PSEU</col>
52 </row>
53 </data>
54 </object>
5 <object class="GtkWindow" id="GNUNET_GNS_GTK_main_window"> 55 <object class="GtkWindow" id="GNUNET_GNS_GTK_main_window">
6 <property name="can_focus">False</property> 56 <property name="can_focus">False</property>
7 <property name="default_height">500</property> 57 <property name="default_height">500</property>
@@ -353,58 +403,8 @@
353 <column type="gchararray"/> 403 <column type="gchararray"/>
354 <!-- column-name name_is_editable --> 404 <!-- column-name name_is_editable -->
355 <column type="gboolean"/> 405 <column type="gboolean"/>
356 <!-- column-name name_row --> 406 <!-- column-name name_is_row -->
357 <column type="gboolean"/> 407 <column type="gboolean"/>
358 </columns> 408 </columns>
359 </object> 409 </object>
360 <object class="GtkListStore" id="GNUNET_GNS_GTK_type_liststore">
361 <columns>
362 <!-- column-name type -->
363 <column type="guint"/>
364 <!-- column-name typename -->
365 <column type="gchararray"/>
366 </columns>
367 <data>
368 <row>
369 <col id="0">1</col>
370 <col id="1" translatable="yes">A</col>
371 </row>
372 <row>
373 <col id="0">2</col>
374 <col id="1" translatable="yes">NS</col>
375 </row>
376 <row>
377 <col id="0">5</col>
378 <col id="1" translatable="yes">CNAME</col>
379 </row>
380 <row>
381 <col id="0">6</col>
382 <col id="1" translatable="yes">SOA</col>
383 </row>
384 <row>
385 <col id="0">12</col>
386 <col id="1" translatable="yes">PTR</col>
387 </row>
388 <row>
389 <col id="0">15</col>
390 <col id="1" translatable="yes">MX</col>
391 </row>
392 <row>
393 <col id="0">16</col>
394 <col id="1" translatable="yes">TXT</col>
395 </row>
396 <row>
397 <col id="0">28</col>
398 <col id="1" translatable="yes">AAAA</col>
399 </row>
400 <row>
401 <col id="0">65536</col>
402 <col id="1" translatable="yes">PKEY</col>
403 </row>
404 <row>
405 <col id="0">65537</col>
406 <col id="1" translatable="yes">PSEU</col>
407 </row>
408 </data>
409 </object>
410</interface> 410</interface>
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
46enum 46enum
@@ -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));