[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r33515 - in gnunet-gtk: contrib src/conversation
From: |
gnunet |
Subject: |
[GNUnet-SVN] r33515 - in gnunet-gtk: contrib src/conversation |
Date: |
Wed, 4 Jun 2014 15:25:38 +0200 |
Author: grothoff
Date: 2014-06-04 15:25:38 +0200 (Wed, 04 Jun 2014)
New Revision: 33515
Modified:
gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade
gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
gnunet-gtk/src/conversation/gnunet-conversation-gtk_get_label.c
gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.c
Log:
implementing Paste button (fixes #3420)
Modified: gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade
2014-06-04 13:11:36 UTC (rev 33514)
+++ gnunet-gtk/contrib/gnunet_conversation_gtk_main_window.glade
2014-06-04 13:25:38 UTC (rev 33515)
@@ -716,6 +716,7 @@
<property
name="label">gtk-paste</property>
<property
name="use_action_appearance">False</property>
<property
name="visible">True</property>
+ <property
name="sensitive">False</property>
<property
name="can_focus">True</property>
<property
name="receives_default">True</property>
<property name="tooltip_text"
translatable="yes">Add phone address from clipboard to address book.</property>
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
2014-06-04 13:11:36 UTC (rev 33514)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
2014-06-04 13:25:38 UTC (rev 33515)
@@ -70,7 +70,12 @@
*/
static GtkWidget *contacts_treeview;
+/**
+ * The "paste" button.
+ */
+static GtkWidget *b_paste;
+
/**
* A row was activated in the contacts list. Initiate call.
*
@@ -263,9 +268,11 @@
if (NULL == ego)
{
/* ego deselected (likely shutdown) */
+ gtk_widget_set_sensitive (b_paste, FALSE);
return;
}
gtk_widget_hide (contacts_treeview);
+ gtk_widget_set_sensitive (b_paste, TRUE);
temp_zone_pkey = GNUNET_IDENTITY_ego_get_private_key (ego);
zone_mon = GNUNET_NAMESTORE_zone_monitor_start (GCG_get_configuration (),
temp_zone_pkey,
@@ -375,6 +382,9 @@
("gnunet_conversation_gtk_contacts_liststore"));
contacts_treemodel
= GTK_TREE_MODEL (contacts_liststore);
+ b_paste = GTK_WIDGET (GCG_get_main_window_object
+ ("gnunet_conversation_gtk_contacts_paste_button"));
+
}
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_get_label.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_get_label.c
2014-06-04 13:11:36 UTC (rev 33514)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_get_label.c
2014-06-04 13:25:38 UTC (rev 33515)
@@ -117,6 +117,8 @@
return;
}
ego = GCG_ZONES_get_selected_zone ();
+ if (NULL == ego)
+ return;
pkey = GNUNET_IDENTITY_ego_get_private_key (ego);
qe = GNUNET_NAMESTORE_records_lookup (GCG_IMPORT_get_namestore (),
pkey,
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.c
2014-06-04 13:11:36 UTC (rev 33514)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_import.c
2014-06-04 13:25:38 UTC (rev 33515)
@@ -133,7 +133,15 @@
size_t value_size;
const struct GNUNET_CRYPTO_EcdsaPrivateKey *zkey;
uint32_t type;
+ char cname[256];
+ if (GNUNET_OK !=
+ GNUNET_DNSPARSER_check_name (address))
+ {
+ GCG_log (_("Domain name `%s' invalid\n"),
+ address);
+ return;
+ }
if (NULL != add_contact_qe)
{
GCG_log (_("Adding contact failed: %s\n"),
@@ -153,9 +161,20 @@
}
else
{
+ value_size = 0;
+ if (GNUNET_OK !=
+ GNUNET_DNSPARSER_builder_add_name (cname,
+ sizeof (cname),
+ &value_size,
+ address))
+ {
+ GNUNET_break (0);
+ GCG_log (_("Failed to create CNAME record for domain name `%s'\n"),
+ address);
+ return;
+ }
type = GNUNET_DNSPARSER_TYPE_CNAME;
- value = address;
- value_size = strlen (address) + 1;
+ value = cname;
}
rd.data = value;
rd.data_size = value_size;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r33515 - in gnunet-gtk: contrib src/conversation,
gnunet <=