aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-06-04 13:25:38 +0000
committerChristian Grothoff <christian@grothoff.org>2014-06-04 13:25:38 +0000
commitdc530a3e229702cb1ee314a2774c924744b452fe (patch)
treebc3e8e474f2ad64693ba3840f1f4df8cb3d5b700 /src
parentf8be71835e1ec81d34df48997876e175eb35ef58 (diff)
downloadgnunet-gtk-dc530a3e229702cb1ee314a2774c924744b452fe.tar.gz
gnunet-gtk-dc530a3e229702cb1ee314a2774c924744b452fe.zip
implementing Paste button (fixes #3420)
Diffstat (limited to 'src')
-rw-r--r--src/conversation/gnunet-conversation-gtk_contacts.c10
-rw-r--r--src/conversation/gnunet-conversation-gtk_get_label.c2
-rw-r--r--src/conversation/gnunet-conversation-gtk_import.c23
3 files changed, 33 insertions, 2 deletions
diff --git a/src/conversation/gnunet-conversation-gtk_contacts.c b/src/conversation/gnunet-conversation-gtk_contacts.c
index 78fb96e3..e66b4da1 100644
--- a/src/conversation/gnunet-conversation-gtk_contacts.c
+++ b/src/conversation/gnunet-conversation-gtk_contacts.c
@@ -70,6 +70,11 @@ static struct GNUNET_NAMESTORE_ZoneMonitor *zone_mon;
70 */ 70 */
71static GtkWidget *contacts_treeview; 71static GtkWidget *contacts_treeview;
72 72
73/**
74 * The "paste" button.
75 */
76static GtkWidget *b_paste;
77
73 78
74/** 79/**
75 * A row was activated in the contacts list. Initiate call. 80 * A row was activated in the contacts list. Initiate call.
@@ -263,9 +268,11 @@ gnunet_conversation_gtk_contacts_zone_combobox_changed_cb (GtkComboBox *widget,
263 if (NULL == ego) 268 if (NULL == ego)
264 { 269 {
265 /* ego deselected (likely shutdown) */ 270 /* ego deselected (likely shutdown) */
271 gtk_widget_set_sensitive (b_paste, FALSE);
266 return; 272 return;
267 } 273 }
268 gtk_widget_hide (contacts_treeview); 274 gtk_widget_hide (contacts_treeview);
275 gtk_widget_set_sensitive (b_paste, TRUE);
269 temp_zone_pkey = GNUNET_IDENTITY_ego_get_private_key (ego); 276 temp_zone_pkey = GNUNET_IDENTITY_ego_get_private_key (ego);
270 zone_mon = GNUNET_NAMESTORE_zone_monitor_start (GCG_get_configuration (), 277 zone_mon = GNUNET_NAMESTORE_zone_monitor_start (GCG_get_configuration (),
271 temp_zone_pkey, 278 temp_zone_pkey,
@@ -375,6 +382,9 @@ GCG_CONTACTS_init ()
375 ("gnunet_conversation_gtk_contacts_liststore")); 382 ("gnunet_conversation_gtk_contacts_liststore"));
376 contacts_treemodel 383 contacts_treemodel
377 = GTK_TREE_MODEL (contacts_liststore); 384 = GTK_TREE_MODEL (contacts_liststore);
385 b_paste = GTK_WIDGET (GCG_get_main_window_object
386 ("gnunet_conversation_gtk_contacts_paste_button"));
387
378} 388}
379 389
380 390
diff --git a/src/conversation/gnunet-conversation-gtk_get_label.c b/src/conversation/gnunet-conversation-gtk_get_label.c
index ea99fc1f..cfc41cab 100644
--- a/src/conversation/gnunet-conversation-gtk_get_label.c
+++ b/src/conversation/gnunet-conversation-gtk_get_label.c
@@ -117,6 +117,8 @@ gnunet_conversation_gtk_enter_label_entry_changed_cb (GtkEditable *editable,
117 return; 117 return;
118 } 118 }
119 ego = GCG_ZONES_get_selected_zone (); 119 ego = GCG_ZONES_get_selected_zone ();
120 if (NULL == ego)
121 return;
120 pkey = GNUNET_IDENTITY_ego_get_private_key (ego); 122 pkey = GNUNET_IDENTITY_ego_get_private_key (ego);
121 qe = GNUNET_NAMESTORE_records_lookup (GCG_IMPORT_get_namestore (), 123 qe = GNUNET_NAMESTORE_records_lookup (GCG_IMPORT_get_namestore (),
122 pkey, 124 pkey,
diff --git a/src/conversation/gnunet-conversation-gtk_import.c b/src/conversation/gnunet-conversation-gtk_import.c
index 1b24f1f6..71cb86c6 100644
--- a/src/conversation/gnunet-conversation-gtk_import.c
+++ b/src/conversation/gnunet-conversation-gtk_import.c
@@ -133,7 +133,15 @@ GSC_add_contact (const gchar *name,
133 size_t value_size; 133 size_t value_size;
134 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zkey; 134 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zkey;
135 uint32_t type; 135 uint32_t type;
136 char cname[256];
136 137
138 if (GNUNET_OK !=
139 GNUNET_DNSPARSER_check_name (address))
140 {
141 GCG_log (_("Domain name `%s' invalid\n"),
142 address);
143 return;
144 }
137 if (NULL != add_contact_qe) 145 if (NULL != add_contact_qe)
138 { 146 {
139 GCG_log (_("Adding contact failed: %s\n"), 147 GCG_log (_("Adding contact failed: %s\n"),
@@ -153,9 +161,20 @@ GSC_add_contact (const gchar *name,
153 } 161 }
154 else 162 else
155 { 163 {
164 value_size = 0;
165 if (GNUNET_OK !=
166 GNUNET_DNSPARSER_builder_add_name (cname,
167 sizeof (cname),
168 &value_size,
169 address))
170 {
171 GNUNET_break (0);
172 GCG_log (_("Failed to create CNAME record for domain name `%s'\n"),
173 address);
174 return;
175 }
156 type = GNUNET_DNSPARSER_TYPE_CNAME; 176 type = GNUNET_DNSPARSER_TYPE_CNAME;
157 value = address; 177 value = cname;
158 value_size = strlen (address) + 1;
159 } 178 }
160 rd.data = value; 179 rd.data = value;
161 rd.data_size = value_size; 180 rd.data_size = value_size;