aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2008-06-26 00:20:55 +0000
committerChristian Grothoff <christian@grothoff.org>2008-06-26 00:20:55 +0000
commit30fd9ccc87d4621a3622b329b3074bab9ed6cedf (patch)
tree270ebc956e21dd42b23953f60ccb8f6d4663374a
parent4437af95142446480d8ca1d95b88785ccda91894 (diff)
downloadgnunet-gtk-30fd9ccc87d4621a3622b329b3074bab9ed6cedf.tar.gz
gnunet-gtk-30fd9ccc87d4621a3622b329b3074bab9ed6cedf.zip
fixing 1376
-rw-r--r--src/plugins/fs/fs.c49
-rw-r--r--src/plugins/fs/upload.c30
2 files changed, 30 insertions, 49 deletions
diff --git a/src/plugins/fs/fs.c b/src/plugins/fs/fs.c
index 9614aded..6c5efb3e 100644
--- a/src/plugins/fs/fs.c
+++ b/src/plugins/fs/fs.c
@@ -53,17 +53,6 @@ GtkTreeStore *download_summary;
53 53
54GtkTreeStore *upload_summary; 54GtkTreeStore *upload_summary;
55 55
56/**
57 * Last right-click event coordinates in summary.
58 */
59static unsigned int last_x;
60
61/**
62 * Last right-click event coordinates in summary.
63 */
64static unsigned int last_y;
65
66
67void 56void
68on_updateIntervalComboEntry_changed_fs (GtkWidget * button, 57on_updateIntervalComboEntry_changed_fs (GtkWidget * button,
69 GtkWidget * entryBox) 58 GtkWidget * entryBox)
@@ -329,44 +318,6 @@ on_download_summary_selection_changed (gpointer signal, gpointer cls)
329 > 0); 318 > 0);
330} 319}
331 320
332int
333on_upload_copy_uri_activate_fs (void *dummy1, GtkWidget * dummy2)
334{
335 GtkWidget *uploadsList =
336 glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (),
337 "activeUploadsList");
338 GtkTreePath *path;
339 GtkTreeIter iter;
340 struct GNUNET_ECRS_URI *uri;
341 char *str;
342 GtkClipboard *clip;
343
344 path = NULL;
345 if (FALSE == gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (uploadsList),
346 last_x,
347 last_y,
348 &path, NULL, NULL, NULL))
349 {
350 GNUNET_GE_BREAK (NULL, 0);
351 return FALSE;
352 }
353 if (FALSE == gtk_tree_model_get_iter (GTK_TREE_MODEL (upload_summary),
354 &iter, path))
355 {
356 GNUNET_GE_BREAK (NULL, 0);
357 gtk_tree_path_free (path);
358 return FALSE;
359 }
360 gtk_tree_path_free (path);
361 uri = NULL;
362 gtk_tree_model_get (GTK_TREE_MODEL (upload_summary),
363 &iter, UPLOAD_URISTRING, &str, -1);
364 clip = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
365 gtk_clipboard_set_text (clip, str, strlen (str));
366 GNUNET_free (str);
367 return FALSE;
368}
369
370/** 321/**
371 * Setup the summary views (in particular the models 322 * Setup the summary views (in particular the models
372 * and the renderers). 323 * and the renderers).
diff --git a/src/plugins/fs/upload.c b/src/plugins/fs/upload.c
index a9103db9..4b17e2c6 100644
--- a/src/plugins/fs/upload.c
+++ b/src/plugins/fs/upload.c
@@ -666,6 +666,36 @@ on_clearCompletedUploads_clicked_fs (void *unused, GtkWidget * clearButton)
666} 666}
667 667
668static void 668static void
669do_copy_uri (GtkTreeModel * model,
670 GtkTreePath * path,
671 GtkTreeIter * iter, gpointer unused)
672{
673 char *str;
674 GtkClipboard *clip;
675
676 gtk_tree_model_get (model,
677 iter, UPLOAD_URISTRING, &str, -1);
678 clip = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
679 gtk_clipboard_set_text (clip, str, strlen (str));
680 GNUNET_free (str);
681}
682
683int
684on_upload_copy_uri_activate_fs (void *dummy1, GtkWidget * dummy2)
685{
686 GtkTreeSelection *selection;
687 GtkWidget *uploadList;
688
689 uploadList =
690 glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (),
691 "activeUploadsList");
692 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (uploadList));
693 GNUNET_GTK_tree_selection_selected_foreach
694 (selection, &do_copy_uri, NULL);
695 return FALSE;
696}
697
698static void
669fsuiCallUploadCallback (GtkTreeModel * model, 699fsuiCallUploadCallback (GtkTreeModel * model,
670 GtkTreePath * path, 700 GtkTreePath * path,
671 GtkTreeIter * iter, gpointer fsui_call) 701 GtkTreeIter * iter, gpointer fsui_call)