diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-06-07 13:46:32 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-06-07 13:46:32 +0000 |
commit | 192d4ac8ae133acb2a3cea835f736a9a13caceb1 (patch) | |
tree | 2aff1ab7660ce4d9ad34f57458afaa2779f06ebf /src | |
parent | ee92b9da0b1f840d7d682af4e574d8a019fba5a4 (diff) | |
download | gnunet-gtk-192d4ac8ae133acb2a3cea835f736a9a13caceb1.tar.gz gnunet-gtk-192d4ac8ae133acb2a3cea835f736a9a13caceb1.zip |
use changed signal instead of edited to immediately popup dialog upon record type selection
Diffstat (limited to 'src')
-rw-r--r-- | src/namestore/gnunet-namestore-gtk.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c index 08ebc2e9..a837d19b 100644 --- a/src/namestore/gnunet-namestore-gtk.c +++ b/src/namestore/gnunet-namestore-gtk.c | |||
@@ -1746,33 +1746,27 @@ gnunet_namestore_gtk_popup_edit_button_activate_cb (GtkWidget *widget, | |||
1746 | * | 1746 | * |
1747 | * @param text renderer updated renderer | 1747 | * @param text renderer updated renderer |
1748 | * @param path_string the path identifying the edited cell | 1748 | * @param path_string the path identifying the edited cell |
1749 | * @param new_text updated text | 1749 | * @param iter selected position |
1750 | * @param user_data unused | 1750 | * @param user_data unused |
1751 | */ | 1751 | */ |
1752 | void | 1752 | void |
1753 | gnunet_namestore_gtk_type_cellrenderercombo_edited_cb (GtkCellRendererText *text, | 1753 | gnunet_namestore_gtk_type_cellrenderercombo_changed_cb (GtkCellRendererText *text, |
1754 | gchar *path_string, | 1754 | gchar *path_string, |
1755 | gchar *new_text, | 1755 | GtkTreeIter *iter, |
1756 | gpointer user_data) | 1756 | gpointer user_data) |
1757 | { | 1757 | { |
1758 | GtkTreeIter it; | 1758 | GtkTreeIter it; |
1759 | guint type; | 1759 | guint type; |
1760 | char *name_str; | 1760 | char *name_str; |
1761 | struct GNUNET_HashCode name_hash; | 1761 | struct GNUNET_HashCode name_hash; |
1762 | struct RecordInfo *ri; | 1762 | struct RecordInfo *ri; |
1763 | GtkTreeModel *types; | ||
1763 | 1764 | ||
1764 | if (0 == strcmp (new_text, _(NEW_RECORD_STR))) | 1765 | types = GTK_TREE_MODEL (get_object ("gnunet_namestore_gtk_type_liststore")); |
1765 | return; /* no record type was selected */ | 1766 | gtk_tree_model_get (types, |
1766 | type = GNUNET_GNSRECORD_typename_to_number (new_text); | 1767 | iter, |
1767 | if (UINT32_MAX == type) | 1768 | GNS_TYPE_TO_NAME_LISTSTORE_COLUMN_TYPE, &type, |
1768 | { | 1769 | -1); |
1769 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1770 | "Invalid or unsupported record type `%s'\n", | ||
1771 | new_text); | ||
1772 | show_error_message (_("Unsupported record type"), | ||
1773 | new_text); | ||
1774 | return; | ||
1775 | } | ||
1776 | /* check if this is a new record */ | 1770 | /* check if this is a new record */ |
1777 | gtk_tree_model_get_iter_from_string (tm, &it, path_string); | 1771 | gtk_tree_model_get_iter_from_string (tm, &it, path_string); |
1778 | gtk_tree_model_get (tm, &it, | 1772 | gtk_tree_model_get (tm, &it, |