diff options
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_egos.c | 28 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation-gtk_phone.c | 5 |
2 files changed, 31 insertions, 2 deletions
diff --git a/src/conversation/gnunet-conversation-gtk_egos.c b/src/conversation/gnunet-conversation-gtk_egos.c index 4c4d4a2f..4646f6e4 100644 --- a/src/conversation/gnunet-conversation-gtk_egos.c +++ b/src/conversation/gnunet-conversation-gtk_egos.c | |||
@@ -175,7 +175,33 @@ void | |||
175 | gnunet_conversation_gtk_ego_copy_button_clicked_cb (GtkButton *button, | 175 | gnunet_conversation_gtk_ego_copy_button_clicked_cb (GtkButton *button, |
176 | gpointer user_data) | 176 | gpointer user_data) |
177 | { | 177 | { |
178 | GNUNET_break (0); // FIXME: not implemented | 178 | struct GNUNET_IDENTITY_Ego *ego; |
179 | const gchar *label; | ||
180 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv; | ||
181 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | ||
182 | const char *zkey; | ||
183 | char *uri; | ||
184 | GtkClipboard *cb; | ||
185 | |||
186 | label = gtk_entry_get_text (GTK_ENTRY | ||
187 | (GCG_get_main_window_object | ||
188 | ("gnunet_conversation_gtk_ego_label_entry"))); | ||
189 | GNUNET_break ( (NULL != label) && | ||
190 | (0 != strlen (label)) ); | ||
191 | ego = GCG_EGOS_get_selected_ego (); | ||
192 | GNUNET_break (NULL != ego); | ||
193 | priv = GNUNET_IDENTITY_ego_get_private_key (ego); | ||
194 | GNUNET_CRYPTO_ecdsa_key_get_public (priv, | ||
195 | &pub); | ||
196 | zkey = GNUNET_GNSRECORD_pkey_to_zkey (&pub); | ||
197 | GNUNET_asprintf (&uri, | ||
198 | "gnunet://gns/%s.%s/", | ||
199 | label, | ||
200 | zkey); | ||
201 | cb = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); | ||
202 | gtk_clipboard_set_text (cb, uri, -1); | ||
203 | gtk_clipboard_store (cb); | ||
204 | GNUNET_free (uri); | ||
179 | } | 205 | } |
180 | 206 | ||
181 | 207 | ||
diff --git a/src/conversation/gnunet-conversation-gtk_phone.c b/src/conversation/gnunet-conversation-gtk_phone.c index 45cbfffa..e3444421 100644 --- a/src/conversation/gnunet-conversation-gtk_phone.c +++ b/src/conversation/gnunet-conversation-gtk_phone.c | |||
@@ -1595,11 +1595,14 @@ static void | |||
1595 | update_copy_sensitivity () | 1595 | update_copy_sensitivity () |
1596 | { | 1596 | { |
1597 | const gchar *label; | 1597 | const gchar *label; |
1598 | struct GNUNET_IDENTITY_Ego *ego; | ||
1598 | 1599 | ||
1600 | ego = GCG_EGOS_get_selected_ego (); | ||
1599 | label = gtk_entry_get_text (GTK_ENTRY | 1601 | label = gtk_entry_get_text (GTK_ENTRY |
1600 | (GCG_get_main_window_object | 1602 | (GCG_get_main_window_object |
1601 | ("gnunet_conversation_gtk_ego_label_entry"))); | 1603 | ("gnunet_conversation_gtk_ego_label_entry"))); |
1602 | if ( (NULL == label) || | 1604 | if ( (NULL == ego) || |
1605 | (NULL == label) || | ||
1603 | (0 == strlen (label)) ) | 1606 | (0 == strlen (label)) ) |
1604 | gtk_widget_set_sensitive (b_copy, FALSE); | 1607 | gtk_widget_set_sensitive (b_copy, FALSE); |
1605 | else | 1608 | else |