aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-15 12:34:26 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-15 12:34:26 +0000
commitff583b70c86a8c5a8982a5c2af25d51208173454 (patch)
tree823e89020069b8d357d0acd879e320055aa6b58b
parenta841376422f9b5cca49bf551c01ffd62bb386033 (diff)
downloadgnunet-gtk-ff583b70c86a8c5a8982a5c2af25d51208173454.tar.gz
gnunet-gtk-ff583b70c86a8c5a8982a5c2af25d51208173454.zip
-fix funky PSEU editing issue
-rw-r--r--src/setup/gnunet-setup-gns.c48
1 files changed, 23 insertions, 25 deletions
diff --git a/src/setup/gnunet-setup-gns.c b/src/setup/gnunet-setup-gns.c
index 11820cf4..768054e1 100644
--- a/src/setup/gnunet-setup-gns.c
+++ b/src/setup/gnunet-setup-gns.c
@@ -836,7 +836,6 @@ decrypt_block_for_merge (void *cls,
836} 836}
837 837
838 838
839
840/** 839/**
841 * The edit dialog completed; update the namestore and the 840 * The edit dialog completed; update the namestore and the
842 * view based on the new values in 'edc'. 841 * view based on the new values in 'edc'.
@@ -1213,28 +1212,21 @@ GNUNET_setup_gns_popup_edit_button_activate_cb (GtkWidget *widget,
1213 * 1212 *
1214 * @param renderer updated renderer 1213 * @param renderer updated renderer
1215 * @param path the path identifying the edited cell 1214 * @param path the path identifying the edited cell
1216 * @param new_iter selected cell in the combo's model (with the record type) 1215 * @param new_text updated text
1217 * @param user_data unused 1216 * @param user_data unused
1218 */ 1217 */
1219void 1218void
1220GNUNET_setup_gns_type_cellrenderercombo_changed_cb (GtkCellRendererCombo *combo, 1219GNUNET_setup_gns_type_cellrenderercombo_edited_cb (GtkCellRendererText *text,
1221 gchar *path_string, 1220 gchar *path_string,
1222 GtkTreeIter *new_iter, 1221 gchar *new_text,
1223 gpointer user_data) 1222 gpointer user_data)
1224{ 1223{
1225 GtkListStore *ls;
1226 gchar *new_text;
1227 GtkTreeIter it; 1224 GtkTreeIter it;
1228 guint type; 1225 guint type;
1229 char *name_str; 1226 char *name_str;
1230 struct GNUNET_HashCode name_hash; 1227 struct GNUNET_HashCode name_hash;
1231 struct RecordInfo *ri; 1228 struct RecordInfo *ri;
1232 1229
1233 ls = GTK_LIST_STORE (GNUNET_SETUP_get_object ("GNUNET_setup_gns_type_liststore"));
1234 gtk_tree_model_get (GTK_TREE_MODEL (ls), new_iter,
1235 1, &new_text,
1236 -1);
1237
1238 if (0 == strcmp (new_text, _(NEW_RECORD_STR))) 1230 if (0 == strcmp (new_text, _(NEW_RECORD_STR)))
1239 { 1231 {
1240 GNUNET_break (0); 1232 GNUNET_break (0);
@@ -1585,17 +1577,31 @@ GNUNET_setup_gns_pseu_entry_changed_cb (GtkEditable *editable,
1585 struct OperationContext *oc; 1577 struct OperationContext *oc;
1586 1578
1587 pseu = gtk_entry_get_text (GTK_ENTRY (editable)); 1579 pseu = gtk_entry_get_text (GTK_ENTRY (editable));
1580 if ( (NULL != current_pseudonym) &&
1581 (0 == strcmp (pseu,
1582 current_pseudonym)) )
1583 return;
1588 if (GNUNET_OK != 1584 if (GNUNET_OK !=
1589 GNUNET_DNSPARSER_check_label (pseu)) 1585 GNUNET_DNSPARSER_check_label (pseu))
1590 { 1586 {
1591 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1587 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1592 _("Name `%s' invalid for GADS/DNS (too long for a DNS label?)\n"), 1588 _("Name `%s' invalid for GNS (too long for a DNS label?)\n"),
1593 pseu); 1589 pseu);
1594 gdk_beep (); 1590 gdk_beep ();
1595 gtk_entry_set_text (GTK_ENTRY (editable), 1591 gtk_entry_set_text (GTK_ENTRY (editable),
1596 pseu); 1592 current_pseudonym);
1597 return; 1593 return;
1598 } 1594 }
1595 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1596 "New Pseudonym is `%s' %u\n",
1597 pseu);
1598 GNUNET_free_non_null (current_pseudonym);
1599 if ( (NULL != pseu) &&
1600 (0 != strlen (pseu)) )
1601 current_pseudonym = GNUNET_strdup (pseu);
1602 else
1603 current_pseudonym = NULL;
1604
1599 GNUNET_CRYPTO_hash ("+", 1, &hc); 1605 GNUNET_CRYPTO_hash ("+", 1, &hc);
1600 ri = GNUNET_CONTAINER_multihashmap_get (n2r, &hc); 1606 ri = GNUNET_CONTAINER_multihashmap_get (n2r, &hc);
1601 if (NULL == ri) 1607 if (NULL == ri)
@@ -1642,15 +1648,6 @@ GNUNET_setup_gns_pseu_entry_changed_cb (GtkEditable *editable,
1642 total, 1648 total,
1643 rd_new, 1649 rd_new,
1644 &operation_done_cont, oc); 1650 &operation_done_cont, oc);
1645 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1646 "New Pseudonym is `%s' %u\n",
1647 (char *) pseu, rd_new[off].data_size);
1648 GNUNET_free_non_null (current_pseudonym);
1649 if ( (NULL != pseu) &&
1650 (0 != strlen (pseu)) )
1651 current_pseudonym = GNUNET_strdup (pseu);
1652 else
1653 current_pseudonym = NULL;
1654 } 1651 }
1655#if HAVE_QRENCODE_H 1652#if HAVE_QRENCODE_H
1656 setup_qrcode (); 1653 setup_qrcode ();
@@ -1874,7 +1871,8 @@ zone_iteration_proc (void *cls,
1874 GNUNET_asprintf (&type_str, "%s", EXPIRE_INVALID_STRING); 1871 GNUNET_asprintf (&type_str, "%s", EXPIRE_INVALID_STRING);
1875 1872
1876 if ( (0 == strcmp (name, GNUNET_GNS_MASTERZONE_STR)) && 1873 if ( (0 == strcmp (name, GNUNET_GNS_MASTERZONE_STR)) &&
1877 (GNUNET_NAMESTORE_TYPE_PSEU == rd[c].record_type) ) 1874 (GNUNET_NAMESTORE_TYPE_PSEU == rd[c].record_type) &&
1875 (NULL == current_pseudonym) )
1878 { 1876 {
1879 pseu_entry = GTK_ENTRY((GNUNET_SETUP_get_object ("GNUNET_setup_gns_pseu_entry"))); 1877 pseu_entry = GTK_ENTRY((GNUNET_SETUP_get_object ("GNUNET_setup_gns_pseu_entry")));
1880 gtk_entry_set_text (pseu_entry, val); 1878 gtk_entry_set_text (pseu_entry, val);