diff options
Diffstat (limited to 'src/namestore/gnunet-namestore-gtk.c')
-rw-r--r-- | src/namestore/gnunet-namestore-gtk.c | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c index 337cc043..08ebc2e9 100644 --- a/src/namestore/gnunet-namestore-gtk.c +++ b/src/namestore/gnunet-namestore-gtk.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2012, 2013 Christian Grothoff (and other contributing authors) | 3 | (C) 2012, 2013, 2014 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -1812,6 +1812,7 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (GtkCellRendererText *rende | |||
1812 | char *name; | 1812 | char *name; |
1813 | struct RecordInfo *ri; | 1813 | struct RecordInfo *ri; |
1814 | struct GNUNET_HashCode name_hash; | 1814 | struct GNUNET_HashCode name_hash; |
1815 | GtkTreePath *tpath; | ||
1815 | 1816 | ||
1816 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1817 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1817 | "New text for `%s' is `%s'\n", | 1818 | "New text for `%s' is `%s'\n", |
@@ -1853,6 +1854,7 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (GtkCellRendererText *rende | |||
1853 | } | 1854 | } |
1854 | 1855 | ||
1855 | /* change dummy line to new name, then add new dummy */ | 1856 | /* change dummy line to new name, then add new dummy */ |
1857 | ri = GNUNET_new (struct RecordInfo); | ||
1856 | gtk_tree_store_set (ts, &it, | 1858 | gtk_tree_store_set (ts, &it, |
1857 | GNS_TREESTORE_COL_NAME, new_text, | 1859 | GNS_TREESTORE_COL_NAME, new_text, |
1858 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE, | 1860 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE, |
@@ -1863,6 +1865,18 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (GtkCellRendererText *rende | |||
1863 | GNS_TREESTORE_COL_TYPE_IS_EDITABLE, TRUE, | 1865 | GNS_TREESTORE_COL_TYPE_IS_EDITABLE, TRUE, |
1864 | GNS_TREESTORE_COL_NAME_IS_EDITABLE, FALSE, | 1866 | GNS_TREESTORE_COL_NAME_IS_EDITABLE, FALSE, |
1865 | -1); | 1867 | -1); |
1868 | tpath = gtk_tree_model_get_path (tm, | ||
1869 | &it); | ||
1870 | ri->rr = gtk_tree_row_reference_new (tm, | ||
1871 | tpath); | ||
1872 | ri->name = GNUNET_strdup (name); | ||
1873 | gtk_tree_path_free (tpath); | ||
1874 | GNUNET_assert (GNUNET_OK == | ||
1875 | GNUNET_CONTAINER_multihashmap_put (n2r, | ||
1876 | &name_hash, | ||
1877 | ri, | ||
1878 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | ||
1879 | |||
1866 | /* add a new dummy line */ | 1880 | /* add a new dummy line */ |
1867 | gtk_tree_store_insert_with_values (ts, &it,NULL, 0, | 1881 | gtk_tree_store_insert_with_values (ts, &it,NULL, 0, |
1868 | GNS_TREESTORE_COL_NAME, _(NEW_NAME_STR), | 1882 | GNS_TREESTORE_COL_NAME, _(NEW_NAME_STR), |
@@ -2318,17 +2332,19 @@ zone_iteration_proc (void *cls, | |||
2318 | else | 2332 | else |
2319 | { | 2333 | { |
2320 | ri = GNUNET_new (struct RecordInfo); | 2334 | ri = GNUNET_new (struct RecordInfo); |
2321 | gtk_tree_store_append (ts, &iter_name, NULL); | 2335 | gtk_tree_store_insert_with_values (ts, |
2322 | gtk_tree_store_set (ts, &iter_name, | 2336 | &iter_name, |
2323 | GNS_TREESTORE_COL_NAME, name, | 2337 | NULL, |
2324 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE, | 2338 | -1, |
2325 | GNS_TREESTORE_COL_RECORD_TYPE, GNUNET_GNSRECORD_TYPE_ANY, | 2339 | GNS_TREESTORE_COL_NAME, name, |
2326 | GNS_TREESTORE_COL_RECORD_TYPE_AS_STR, _(NEW_RECORD_STR), | 2340 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE, |
2327 | GNS_TREESTORE_COL_IS_RECORD_ROW, TRUE, | 2341 | GNS_TREESTORE_COL_RECORD_TYPE, GNUNET_GNSRECORD_TYPE_ANY, |
2328 | GNS_TREESTORE_COL_NOT_DUMMY_ROW, FALSE, | 2342 | GNS_TREESTORE_COL_RECORD_TYPE_AS_STR, _(NEW_RECORD_STR), |
2329 | GNS_TREESTORE_COL_TYPE_IS_EDITABLE, TRUE, | 2343 | GNS_TREESTORE_COL_IS_RECORD_ROW, TRUE, |
2330 | GNS_TREESTORE_COL_RECORD_OFFSET, UINT_MAX, | 2344 | GNS_TREESTORE_COL_NOT_DUMMY_ROW, FALSE, |
2331 | -1); | 2345 | GNS_TREESTORE_COL_TYPE_IS_EDITABLE, TRUE, |
2346 | GNS_TREESTORE_COL_RECORD_OFFSET, UINT_MAX, | ||
2347 | -1); | ||
2332 | 2348 | ||
2333 | path = gtk_tree_model_get_path (tm, | 2349 | path = gtk_tree_model_get_path (tm, |
2334 | &iter_name); | 2350 | &iter_name); |
@@ -2423,7 +2439,10 @@ zone_iteration_proc (void *cls, | |||
2423 | setup_qrcode (); | 2439 | setup_qrcode (); |
2424 | #endif | 2440 | #endif |
2425 | } | 2441 | } |
2426 | gtk_tree_store_insert_with_values (ts, &iter_record , &iter_name, 0, | 2442 | gtk_tree_store_insert_with_values (ts, |
2443 | &iter_record , | ||
2444 | &iter_name, | ||
2445 | -1, | ||
2427 | GNS_TREESTORE_COL_NAME, name, | 2446 | GNS_TREESTORE_COL_NAME, name, |
2428 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, FALSE, | 2447 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, FALSE, |
2429 | GNS_TREESTORE_COL_RECORD_TYPE, rd[c].record_type, | 2448 | GNS_TREESTORE_COL_RECORD_TYPE, rd[c].record_type, |
@@ -2534,7 +2553,10 @@ load_zone (const char *name, | |||
2534 | label); | 2553 | label); |
2535 | g_free (label); | 2554 | g_free (label); |
2536 | /* Append a top level row and leave it empty */ | 2555 | /* Append a top level row and leave it empty */ |
2537 | gtk_tree_store_insert_with_values (ts, &toplevel, NULL, 0, | 2556 | gtk_tree_store_insert_with_values (ts, |
2557 | &toplevel, | ||
2558 | NULL, | ||
2559 | -1, | ||
2538 | GNS_TREESTORE_COL_NAME, _(NEW_NAME_STR), | 2560 | GNS_TREESTORE_COL_NAME, _(NEW_NAME_STR), |
2539 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE, | 2561 | GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE, |
2540 | GNS_TREESTORE_COL_RECORD_TYPE, GNUNET_DNSPARSER_TYPE_A, | 2562 | GNS_TREESTORE_COL_RECORD_TYPE, GNUNET_DNSPARSER_TYPE_A, |