aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-namestore-gtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/gnunet-namestore-gtk.c')
-rw-r--r--src/namestore/gnunet-namestore-gtk.c210
1 files changed, 107 insertions, 103 deletions
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c
index eeac58ee..52066e73 100644
--- a/src/namestore/gnunet-namestore-gtk.c
+++ b/src/namestore/gnunet-namestore-gtk.c
@@ -629,6 +629,7 @@ setup_qrcode ()
629 g_object_unref (pb); 629 g_object_unref (pb);
630} 630}
631 631
632
632#endif 633#endif
633 634
634 635
@@ -1304,7 +1305,8 @@ edit_dialog_setup_common_elements (
1304 if (GNUNET_YES != edc->old_record_in_namestore) 1305 if (GNUNET_YES != edc->old_record_in_namestore)
1305 { 1306 {
1306 gtk_widget_hide (GTK_WIDGET ( 1307 gtk_widget_hide (GTK_WIDGET (
1307 gtk_builder_get_object (edc->builder, "edit_dialog_delete_button"))); 1308 gtk_builder_get_object (edc->builder,
1309 "edit_dialog_delete_button")));
1308 edit_dialog_disable_save (edc); 1310 edit_dialog_disable_save (edc);
1309 } 1311 }
1310 gtk_entry_set_text (GTK_ENTRY ( 1312 gtk_entry_set_text (GTK_ENTRY (
@@ -1312,12 +1314,12 @@ edit_dialog_setup_common_elements (
1312 "edit_dialog_name_entry")), 1314 "edit_dialog_name_entry")),
1313 edc->name); 1315 edc->name);
1314 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object ( 1316 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (
1315 edc->builder, 1317 edc->builder,
1316 "edit_dialog_options_public_checkbutton")), 1318 "edit_dialog_options_public_checkbutton")),
1317 edc->n_public); 1319 edc->n_public);
1318 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object ( 1320 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (
1319 edc->builder, 1321 edc->builder,
1320 "edit_dialog_options_shadow_checkbutton")), 1322 "edit_dialog_options_shadow_checkbutton")),
1321 edc->n_is_shadow); 1323 edc->n_is_shadow);
1322 1324
1323 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == edc->n_exp_time) 1325 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == edc->n_exp_time)
@@ -1328,14 +1330,14 @@ edit_dialog_setup_common_elements (
1328 "edit_dialog_expiration_never_radiobutton")), 1330 "edit_dialog_expiration_never_radiobutton")),
1329 TRUE); 1331 TRUE);
1330 gtk_widget_hide (GTK_WIDGET ( 1332 gtk_widget_hide (GTK_WIDGET (
1331 gtk_builder_get_object (edc->builder, 1333 gtk_builder_get_object (edc->builder,
1332 "edit_dialog_expiration_absolute_calendar"))); 1334 "edit_dialog_expiration_absolute_calendar")));
1333 gtk_widget_hide (GTK_WIDGET ( 1335 gtk_widget_hide (GTK_WIDGET (
1334 gtk_builder_get_object (edc->builder, 1336 gtk_builder_get_object (edc->builder,
1335 "edit_dialog_expiration_absolute_hbox"))); 1337 "edit_dialog_expiration_absolute_hbox")));
1336 gtk_widget_hide (GTK_WIDGET ( 1338 gtk_widget_hide (GTK_WIDGET (
1337 gtk_builder_get_object (edc->builder, 1339 gtk_builder_get_object (edc->builder,
1338 "edit_dialog_expiration_relative_combobox"))); 1340 "edit_dialog_expiration_relative_combobox")));
1339 } 1341 }
1340 if ((edc->n_is_relative) && 1342 if ((edc->n_is_relative) &&
1341 (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != edc->n_exp_time)) 1343 (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != edc->n_exp_time))
@@ -1346,11 +1348,11 @@ edit_dialog_setup_common_elements (
1346 "edit_dialog_expiration_relative_radiobutton")), 1348 "edit_dialog_expiration_relative_radiobutton")),
1347 TRUE); 1349 TRUE);
1348 gtk_widget_hide (GTK_WIDGET ( 1350 gtk_widget_hide (GTK_WIDGET (
1349 gtk_builder_get_object (edc->builder, 1351 gtk_builder_get_object (edc->builder,
1350 "edit_dialog_expiration_absolute_calendar"))); 1352 "edit_dialog_expiration_absolute_calendar")));
1351 gtk_widget_hide (GTK_WIDGET ( 1353 gtk_widget_hide (GTK_WIDGET (
1352 gtk_builder_get_object (edc->builder, 1354 gtk_builder_get_object (edc->builder,
1353 "edit_dialog_expiration_absolute_hbox"))); 1355 "edit_dialog_expiration_absolute_hbox")));
1354 rt.rel_value_us = edc->n_exp_time; 1356 rt.rel_value_us = edc->n_exp_time;
1355 } 1357 }
1356 else 1358 else
@@ -1380,8 +1382,8 @@ edit_dialog_setup_common_elements (
1380 TRUE); 1382 TRUE);
1381 1383
1382 gtk_widget_hide (GTK_WIDGET ( 1384 gtk_widget_hide (GTK_WIDGET (
1383 gtk_builder_get_object (edc->builder, 1385 gtk_builder_get_object (edc->builder,
1384 "edit_dialog_expiration_relative_combobox"))); 1386 "edit_dialog_expiration_relative_combobox")));
1385 at.abs_value_us = edc->n_exp_time; 1387 at.abs_value_us = edc->n_exp_time;
1386 } 1388 }
1387 else 1389 else
@@ -1403,13 +1405,13 @@ edit_dialog_setup_common_elements (
1403 (double) ymd->tm_hour); 1405 (double) ymd->tm_hour);
1404 gtk_spin_button_set_value ( 1406 gtk_spin_button_set_value (
1405 GTK_SPIN_BUTTON (gtk_builder_get_object ( 1407 GTK_SPIN_BUTTON (gtk_builder_get_object (
1406 edc->builder, 1408 edc->builder,
1407 "edit_dialog_expiration_absolute_minutes_spinbutton")), 1409 "edit_dialog_expiration_absolute_minutes_spinbutton")),
1408 (double) ymd->tm_min); 1410 (double) ymd->tm_min);
1409 gtk_spin_button_set_value ( 1411 gtk_spin_button_set_value (
1410 GTK_SPIN_BUTTON (gtk_builder_get_object ( 1412 GTK_SPIN_BUTTON (gtk_builder_get_object (
1411 edc->builder, 1413 edc->builder,
1412 "edit_dialog_expiration_absolute_seconds_spinbutton")), 1414 "edit_dialog_expiration_absolute_seconds_spinbutton")),
1413 (double) ymd->tm_sec); 1415 (double) ymd->tm_sec);
1414} 1416}
1415 1417
@@ -1435,17 +1437,19 @@ edit_dialog_putes_common_elements (
1435 1437
1436 /* is public flag */ 1438 /* is public flag */
1437 edc->n_public = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ( 1439 edc->n_public = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (
1438 gtk_builder_get_object (edc->builder, 1440 gtk_builder_get_object (
1439 "edit_dialog_options_public_checkbutton"))); 1441 edc->builder,
1442 "edit_dialog_options_public_checkbutton")));
1440 /* is shadow flag */ 1443 /* is shadow flag */
1441 edc->n_is_shadow = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ( 1444 edc->n_is_shadow = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (
1442 gtk_builder_get_object (edc->builder, 1445 gtk_builder_get_object (
1443 "edit_dialog_options_shadow_checkbutton"))); 1446 edc->builder,
1447 "edit_dialog_options_shadow_checkbutton")));
1444 1448
1445 /* 'forever' expiration time */ 1449 /* 'forever' expiration time */
1446 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ( 1450 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (
1447 gtk_builder_get_object (edc->builder, 1451 gtk_builder_get_object (edc->builder,
1448 "edit_dialog_expiration_never_radiobutton")))) 1452 "edit_dialog_expiration_never_radiobutton"))))
1449 { 1453 {
1450 edc->n_exp_time = GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us; 1454 edc->n_exp_time = GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us;
1451 edc->n_is_relative = 1455 edc->n_is_relative =
@@ -1455,8 +1459,8 @@ edit_dialog_putes_common_elements (
1455 /* 'relative' expiration time */ 1459 /* 'relative' expiration time */
1456 if ( 1460 if (
1457 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ( 1461 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (
1458 gtk_builder_get_object (edc->builder, 1462 gtk_builder_get_object (edc->builder,
1459 "edit_dialog_expiration_relative_radiobutton")))) 1463 "edit_dialog_expiration_relative_radiobutton"))))
1460 { 1464 {
1461 cb = GTK_COMBO_BOX ( 1465 cb = GTK_COMBO_BOX (
1462 gtk_builder_get_object (edc->builder, 1466 gtk_builder_get_object (edc->builder,
@@ -1477,8 +1481,8 @@ edit_dialog_putes_common_elements (
1477 /* 'absolute' expiration time */ 1481 /* 'absolute' expiration time */
1478 if ( 1482 if (
1479 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ( 1483 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (
1480 gtk_builder_get_object (edc->builder, 1484 gtk_builder_get_object (edc->builder,
1481 "edit_dialog_expiration_absolute_radiobutton")))) 1485 "edit_dialog_expiration_absolute_radiobutton"))))
1482 { 1486 {
1483 guint year; 1487 guint year;
1484 guint month; 1488 guint month;
@@ -1490,22 +1494,22 @@ edit_dialog_putes_common_elements (
1490 struct GNUNET_TIME_Absolute atime; 1494 struct GNUNET_TIME_Absolute atime;
1491 1495
1492 gtk_calendar_get_date (GTK_CALENDAR (gtk_builder_get_object ( 1496 gtk_calendar_get_date (GTK_CALENDAR (gtk_builder_get_object (
1493 edc->builder, 1497 edc->builder,
1494 "edit_dialog_expiration_absolute_calendar")), 1498 "edit_dialog_expiration_absolute_calendar")),
1495 &year, 1499 &year,
1496 &month, 1500 &month,
1497 &day); 1501 &day);
1498 hour = gtk_spin_button_get_value (GTK_SPIN_BUTTON ( 1502 hour = gtk_spin_button_get_value (GTK_SPIN_BUTTON (
1499 gtk_builder_get_object (edc->builder, 1503 gtk_builder_get_object (edc->builder,
1500 "edit_dialog_expiration_absolute_hours_spinbutton"))); 1504 "edit_dialog_expiration_absolute_hours_spinbutton")));
1501 minute = 1505 minute =
1502 gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object ( 1506 gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
1503 edc->builder, 1507 edc->builder,
1504 "edit_dialog_expiration_absolute_minutes_spinbutton"))); 1508 "edit_dialog_expiration_absolute_minutes_spinbutton")));
1505 second = 1509 second =
1506 gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object ( 1510 gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (
1507 edc->builder, 1511 edc->builder,
1508 "edit_dialog_expiration_absolute_seconds_spinbutton"))); 1512 "edit_dialog_expiration_absolute_seconds_spinbutton")));
1509 GNUNET_snprintf (fancydate, 1513 GNUNET_snprintf (fancydate,
1510 sizeof (fancydate), 1514 sizeof (fancydate),
1511 "%u-%u-%u %u:%u:%u", 1515 "%u-%u-%u %u:%u:%u",
@@ -1661,8 +1665,8 @@ launch_edit_dialog (gint n_type,
1661 if (NULL == typename) 1665 if (NULL == typename)
1662 { 1666 {
1663 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1667 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1664 "Record type `%u' not supported by this installation\n", 1668 "Record type `%u' not supported by this installation\n",
1665 (unsigned int) n_type); 1669 (unsigned int) n_type);
1666 return; 1670 return;
1667 } 1671 }
1668 if (NULL == current_pseudonym) 1672 if (NULL == current_pseudonym)
@@ -1701,9 +1705,7 @@ launch_edit_dialog (gint n_type,
1701 edc->new_zone_option = g_strdup (current_pseudonym); 1705 edc->new_zone_option = g_strdup (current_pseudonym);
1702 edc->zone_liststore = zone_liststore; 1706 edc->zone_liststore = zone_liststore;
1703 edc->check_validity = &check_validity; 1707 edc->check_validity = &check_validity;
1704 GNUNET_asprintf (&edc->liblow, 1708 GNUNET_asprintf (&edc->liblow, "libgnunet_plugin_gtk_namestore_%s", typename);
1705 "libgnunet_plugin_gtk_namestore_%s",
1706 typename);
1707 GNUNET_STRINGS_utf8_tolower (edc->liblow, edc->liblow); 1709 GNUNET_STRINGS_utf8_tolower (edc->liblow, edc->liblow);
1708 edc->plugin = GNUNET_PLUGIN_load (edc->liblow, edc); 1710 edc->plugin = GNUNET_PLUGIN_load (edc->liblow, edc);
1709 if (NULL == edc->plugin) 1711 if (NULL == edc->plugin)
@@ -1817,10 +1819,10 @@ gnunet_namestore_gtk_popup_edit_button_activate_cb (GtkWidget *widget,
1817 return; 1819 return;
1818 } 1820 }
1819 GNUNET_CRYPTO_hash (n_name, 1821 GNUNET_CRYPTO_hash (n_name,
1820 strlen (n_name), 1822 strlen (n_name),
1821 &name_hash); 1823 &name_hash);
1822 ri = GNUNET_CONTAINER_multihashmap_get (n2r, 1824 ri = GNUNET_CONTAINER_multihashmap_get (n2r,
1823 &name_hash); 1825 &name_hash);
1824 if ( (NULL == ri) || 1826 if ( (NULL == ri) ||
1825 (off >= ri->rd_count) ) 1827 (off >= ri->rd_count) )
1826 { 1828 {
@@ -1829,7 +1831,7 @@ gnunet_namestore_gtk_popup_edit_button_activate_cb (GtkWidget *widget,
1829 return; 1831 return;
1830 } 1832 }
1831 launch_edit_dialog (n_type, n_name, 1833 launch_edit_dialog (n_type, n_name,
1832 ri, off); 1834 ri, off);
1833 g_free (n_name); 1835 g_free (n_name);
1834} 1836}
1835 1837
@@ -1844,10 +1846,11 @@ gnunet_namestore_gtk_popup_edit_button_activate_cb (GtkWidget *widget,
1844 * @param user_data unused 1846 * @param user_data unused
1845 */ 1847 */
1846void 1848void
1847gnunet_namestore_gtk_type_cellrenderercombo_changed_cb (GtkCellRendererText *text, 1849gnunet_namestore_gtk_type_cellrenderercombo_changed_cb (
1848 gchar *path_string, 1850 GtkCellRendererText *text,
1849 GtkTreeIter *iter, 1851 gchar *path_string,
1850 gpointer user_data) 1852 GtkTreeIter *iter,
1853 gpointer user_data)
1851{ 1854{
1852 GtkTreeIter it; 1855 GtkTreeIter it;
1853 guint type; 1856 guint type;
@@ -1870,8 +1873,8 @@ gnunet_namestore_gtk_type_cellrenderercombo_changed_cb (GtkCellRendererText *tex
1870 return; 1873 return;
1871 } 1874 }
1872 gtk_tree_model_get (tm, &it, 1875 gtk_tree_model_get (tm, &it,
1873 GNS_TREESTORE_COL_NAME, &name_str, 1876 GNS_TREESTORE_COL_NAME, &name_str,
1874 -1); 1877 -1);
1875 if (NULL == name_str) 1878 if (NULL == name_str)
1876 { 1879 {
1877 GNUNET_break (0); 1880 GNUNET_break (0);
@@ -1903,10 +1906,11 @@ gnunet_namestore_gtk_type_cellrenderercombo_changed_cb (GtkCellRendererText *tex
1903 * @param user_data unused 1906 * @param user_data unused
1904 */ 1907 */
1905void 1908void
1906gnunet_namestore_gtk_name_cellrenderertext_edited_cb (GtkCellRendererText *renderer, 1909gnunet_namestore_gtk_name_cellrenderertext_edited_cb (
1907 gchar *path, 1910 GtkCellRendererText *renderer,
1908 gchar *new_text, 1911 gchar *path,
1909 gpointer user_data) 1912 gchar *new_text,
1913 gpointer user_data)
1910{ 1914{
1911 GtkTreeIter it; 1915 GtkTreeIter it;
1912 gboolean not_dummy; 1916 gboolean not_dummy;
@@ -1916,8 +1920,8 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (GtkCellRendererText *rende
1916 GtkTreePath *tpath; 1920 GtkTreePath *tpath;
1917 1921
1918 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1922 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1919 "New text for `%s' is `%s'\n", 1923 "New text for `%s' is `%s'\n",
1920 path, 1924 path,
1921 new_text); 1925 new_text);
1922 if ((0 == strcmp (new_text, 1926 if ((0 == strcmp (new_text,
1923 NEW_NAME_STR)) || 1927 NEW_NAME_STR)) ||
@@ -1928,8 +1932,9 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (GtkCellRendererText *rende
1928 GNUNET_DNSPARSER_check_label (new_text)) 1932 GNUNET_DNSPARSER_check_label (new_text))
1929 { 1933 {
1930 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1934 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1931 _("Name `%s' invalid for GNS/DNS (too long for a DNS label?)\n"), 1935 _ (
1932 new_text); 1936 "Name `%s' invalid for GNS/DNS (too long for a DNS label?)\n"),
1937 new_text);
1933 gtk_widget_error_bell (GTK_WIDGET (main_window)); 1938 gtk_widget_error_bell (GTK_WIDGET (main_window));
1934 return; 1939 return;
1935 } 1940 }
@@ -1941,25 +1946,25 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (GtkCellRendererText *rende
1941 return; 1946 return;
1942 } 1947 }
1943 gtk_tree_model_get (tm, &it, 1948 gtk_tree_model_get (tm, &it,
1944 GNS_TREESTORE_COL_NOT_DUMMY_ROW, &not_dummy, 1949 GNS_TREESTORE_COL_NOT_DUMMY_ROW, &not_dummy,
1945 GNS_TREESTORE_COL_NAME, &name, 1950 GNS_TREESTORE_COL_NAME, &name,
1946 -1); 1951 -1);
1947 GNUNET_break (! not_dummy); 1952 GNUNET_break (! not_dummy);
1948 GNUNET_break (0 == strcmp (name, _(NEW_NAME_STR))); 1953 GNUNET_break (0 == strcmp (name, _ (NEW_NAME_STR)));
1949 g_free (name); 1954 g_free (name);
1950 1955
1951 GNUNET_CRYPTO_hash (new_text, 1956 GNUNET_CRYPTO_hash (new_text,
1952 strlen (new_text), 1957 strlen (new_text),
1953 &name_hash); 1958 &name_hash);
1954 ri = GNUNET_CONTAINER_multihashmap_get (n2r, 1959 ri = GNUNET_CONTAINER_multihashmap_get (n2r,
1955 &name_hash); 1960 &name_hash);
1956 if (NULL != ri) 1961 if (NULL != ri)
1957 { 1962 {
1958 GtkTreeSelection *sel; 1963 GtkTreeSelection *sel;
1959 GtkTreePath *sel_path; 1964 GtkTreePath *sel_path;
1960 1965
1961 sel_path = gtk_tree_row_reference_get_path (ri->rr); 1966 sel_path = gtk_tree_row_reference_get_path (ri->rr);
1962 sel = gtk_tree_view_get_selection(tv); 1967 sel = gtk_tree_view_get_selection (tv);
1963 gtk_tree_selection_select_path (sel, sel_path); 1968 gtk_tree_selection_select_path (sel, sel_path);
1964 gtk_tree_path_free (sel_path); 1969 gtk_tree_path_free (sel_path);
1965 return; 1970 return;
@@ -1969,17 +1974,17 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (GtkCellRendererText *rende
1969 ri = GNUNET_new (struct RecordInfo); 1974 ri = GNUNET_new (struct RecordInfo);
1970 gtk_tree_store_set (ts, 1975 gtk_tree_store_set (ts,
1971 &it, 1976 &it,
1972 GNS_TREESTORE_COL_NAME, new_text, 1977 GNS_TREESTORE_COL_NAME, new_text,
1973 GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE, 1978 GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE,
1974 GNS_TREESTORE_COL_RECORD_TYPE, 0, 1979 GNS_TREESTORE_COL_RECORD_TYPE, 0,
1975 GNS_TREESTORE_COL_RECORD_TYPE_AS_STR, _(NEW_RECORD_STR), 1980 GNS_TREESTORE_COL_RECORD_TYPE_AS_STR, _ (NEW_RECORD_STR),
1976 GNS_TREESTORE_COL_NOT_DUMMY_ROW, FALSE, 1981 GNS_TREESTORE_COL_NOT_DUMMY_ROW, FALSE,
1977 GNS_TREESTORE_COL_IS_RECORD_ROW, TRUE, 1982 GNS_TREESTORE_COL_IS_RECORD_ROW, TRUE,
1978 GNS_TREESTORE_COL_TYPE_IS_EDITABLE, TRUE, 1983 GNS_TREESTORE_COL_TYPE_IS_EDITABLE, TRUE,
1979 GNS_TREESTORE_COL_NAME_IS_EDITABLE, FALSE, 1984 GNS_TREESTORE_COL_NAME_IS_EDITABLE, FALSE,
1980 -1); 1985 -1);
1981 tpath = gtk_tree_model_get_path (tm, 1986 tpath = gtk_tree_model_get_path (tm,
1982 &it); 1987 &it);
1983 ri->rr = gtk_tree_row_reference_new (tm, 1988 ri->rr = gtk_tree_row_reference_new (tm,
1984 tpath); 1989 tpath);
1985 ri->name = GNUNET_strdup (name); 1990 ri->name = GNUNET_strdup (name);
@@ -1995,15 +2000,16 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (GtkCellRendererText *rende
1995 &it, 2000 &it,
1996 NULL, 2001 NULL,
1997 0, 2002 0,
1998 GNS_TREESTORE_COL_NAME, _(NEW_NAME_STR), 2003 GNS_TREESTORE_COL_NAME, _ (NEW_NAME_STR),
1999 GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE, 2004 GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE,
2000 GNS_TREESTORE_COL_RECORD_TYPE, GNUNET_DNSPARSER_TYPE_A, 2005 GNS_TREESTORE_COL_RECORD_TYPE,
2001 GNS_TREESTORE_COL_NOT_DUMMY_ROW, FALSE, 2006 GNUNET_DNSPARSER_TYPE_A,
2002 GNS_TREESTORE_COL_IS_RECORD_ROW, FALSE, 2007 GNS_TREESTORE_COL_NOT_DUMMY_ROW, FALSE,
2003 GNS_TREESTORE_COL_TYPE_IS_EDITABLE, FALSE, 2008 GNS_TREESTORE_COL_IS_RECORD_ROW, FALSE,
2004 GNS_TREESTORE_COL_NAME_IS_EDITABLE, TRUE, 2009 GNS_TREESTORE_COL_TYPE_IS_EDITABLE, FALSE,
2005 GNS_TREESTORE_COL_RECORD_OFFSET, UINT_MAX, 2010 GNS_TREESTORE_COL_NAME_IS_EDITABLE, TRUE,
2006 -1); 2011 GNS_TREESTORE_COL_RECORD_OFFSET, UINT_MAX,
2012 -1);
2007} 2013}
2008 2014
2009 2015
@@ -2022,23 +2028,23 @@ create_popup_menu ()
2022 gboolean name_vis; 2028 gboolean name_vis;
2023 2029
2024 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2030 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2025 "Considering creating popup menu...\n"); 2031 "Considering creating popup menu...\n");
2026 sel = gtk_tree_view_get_selection (tv); 2032 sel = gtk_tree_view_get_selection (tv);
2027 if (! gtk_tree_selection_get_selected (sel, 2033 if (! gtk_tree_selection_get_selected (sel,
2028 NULL, 2034 NULL,
2029 &it)) 2035 &it))
2030 { 2036 {
2031 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2037 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2032 "No row selected\n"); 2038 "No row selected\n");
2033 return NULL; 2039 return NULL;
2034 } 2040 }
2035 gtk_tree_model_get (tm, &it, 2041 gtk_tree_model_get (tm, &it,
2036 GNS_TREESTORE_COL_NAME_IS_VISIBLE, &name_vis, 2042 GNS_TREESTORE_COL_NAME_IS_VISIBLE, &name_vis,
2037 -1); 2043 -1);
2038 if (name_vis) 2044 if (name_vis)
2039 { 2045 {
2040 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2046 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2041 "Selected row is not a record row\n"); 2047 "Selected row is not a record row\n");
2042 return NULL; 2048 return NULL;
2043 } 2049 }
2044 popup = GTK_MENU (get_object ("gnunet_namestore_gtk_edit_popup_menu")); 2050 popup = GTK_MENU (get_object ("gnunet_namestore_gtk_edit_popup_menu"));
@@ -2118,8 +2124,8 @@ gnunet_namestore_gtk_treeview_button_press_event_cb (GtkWidget *widget,
2118 */ 2124 */
2119gboolean 2125gboolean
2120gnunet_namestore_gtk_treeview_key_press_event_cb (GtkWidget *widget, 2126gnunet_namestore_gtk_treeview_key_press_event_cb (GtkWidget *widget,
2121 GdkEvent *event, 2127 GdkEvent *event,
2122 gpointer user_data) 2128 gpointer user_data)
2123{ 2129{
2124 GdkEventKey *event_key = (GdkEventKey *) event; 2130 GdkEventKey *event_key = (GdkEventKey *) event;
2125 GtkTreeIter iter; 2131 GtkTreeIter iter;
@@ -2987,7 +2993,7 @@ gnunet_namestore_gtk_zone_combobox_changed_cb (GtkComboBox *widget,
2987 -1); 2993 -1);
2988 /* clang-format on */ 2994 /* clang-format on */
2989 gtk_widget_set_sensitive (GTK_WIDGET (get_object ( 2995 gtk_widget_set_sensitive (GTK_WIDGET (get_object (
2990 "gnunet_namestore_gtk_zone_del_button")), 2996 "gnunet_namestore_gtk_zone_del_button")),
2991 TRUE); 2997 TRUE);
2992 load_zone (name, ego); 2998 load_zone (name, ego);
2993} 2999}
@@ -3088,7 +3094,7 @@ identity_cb (void *cls,
3088 /* make combo box insensitive if nothing can be selected */ 3094 /* make combo box insensitive if nothing can be selected */
3089 gtk_widget_set_sensitive (GTK_WIDGET (zone_combo_box), FALSE); 3095 gtk_widget_set_sensitive (GTK_WIDGET (zone_combo_box), FALSE);
3090 gtk_widget_set_sensitive (GTK_WIDGET (get_object ( 3096 gtk_widget_set_sensitive (GTK_WIDGET (get_object (
3091 "gnunet_namestore_gtk_zone_entry")), 3097 "gnunet_namestore_gtk_zone_entry")),
3092 FALSE); 3098 FALSE);
3093 clear_zone_view (); 3099 clear_zone_view ();
3094 } 3100 }
@@ -3175,7 +3181,7 @@ gnunet_namestore_gtk_zone_del_button_clicked_cb (GtkButton *button,
3175 GNUNET_CONTAINER_multihashmap_iterate (n2r, &delete_records, NULL); 3181 GNUNET_CONTAINER_multihashmap_iterate (n2r, &delete_records, NULL);
3176 gtk_tree_store_clear (ts); 3182 gtk_tree_store_clear (ts);
3177 gtk_widget_set_sensitive (GTK_WIDGET (get_object ( 3183 gtk_widget_set_sensitive (GTK_WIDGET (get_object (
3178 "gnunet_namestore_gtk_zone_del_button")), 3184 "gnunet_namestore_gtk_zone_del_button")),
3179 FALSE); 3185 FALSE);
3180 gtk_widget_set_sensitive (main_window, FALSE); 3186 gtk_widget_set_sensitive (main_window, FALSE);
3181 iop = GNUNET_IDENTITY_delete (identity, pseu, &iop_cont, NULL); 3187 iop = GNUNET_IDENTITY_delete (identity, pseu, &iop_cont, NULL);
@@ -3200,7 +3206,7 @@ gnunet_namestore_gtk_zone_add_entry_changed_cb (GtkEditable *editable,
3200 (void) user_data; 3206 (void) user_data;
3201 label = gtk_entry_get_text (GTK_ENTRY (editable)); 3207 label = gtk_entry_get_text (GTK_ENTRY (editable));
3202 gtk_widget_set_sensitive (GTK_WIDGET (get_object ( 3208 gtk_widget_set_sensitive (GTK_WIDGET (get_object (
3203 "gnunet_namestore_gtk_zone_add_button")), 3209 "gnunet_namestore_gtk_zone_add_button")),
3204 NULL == fresh_label (label)); 3210 NULL == fresh_label (label));
3205} 3211}
3206 3212
@@ -3265,12 +3271,12 @@ run (void *cls)
3265 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, 3271 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
3266 "gnunet-namestore-gtk", 3272 "gnunet-namestore-gtk",
3267 "NICK_EXPIRATION"); 3273 "NICK_EXPIRATION");
3268 GNUNET_SCHEDULER_shutdown (); 3274 GNUNET_GTK_main_loop_quit (ml);
3269 return; 3275 return;
3270 } 3276 }
3271 if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL)) 3277 if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL))
3272 { 3278 {
3273 GNUNET_SCHEDULER_shutdown (); 3279 GNUNET_GTK_main_loop_quit (ml);
3274 return; 3280 return;
3275 } 3281 }
3276 GNUNET_GTK_set_icon_search_path (); 3282 GNUNET_GTK_set_icon_search_path ();
@@ -3313,9 +3319,7 @@ run (void *cls)
3313int 3319int
3314main (int argc, char *const *argv) 3320main (int argc, char *const *argv)
3315{ 3321{
3316 struct GNUNET_GETOPT_CommandLineOption options[] = { 3322 struct GNUNET_GETOPT_CommandLineOption options[] = {GNUNET_GETOPT_OPTION_END};
3317 GNUNET_GETOPT_OPTION_END
3318 };
3319 int ret; 3323 int ret;
3320 3324
3321 if (GNUNET_OK == 3325 if (GNUNET_OK ==