aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/fs/fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fs/fs.c')
-rw-r--r--src/plugins/fs/fs.c52
1 files changed, 15 insertions, 37 deletions
diff --git a/src/plugins/fs/fs.c b/src/plugins/fs/fs.c
index ccc2e2a1..9219bf8e 100644
--- a/src/plugins/fs/fs.c
+++ b/src/plugins/fs/fs.c
@@ -358,10 +358,12 @@ on_search_summary_selection_changed (gpointer signal, gpointer cls)
358 > 0); 358 > 0);
359} 359}
360 360
361static int 361int
362on_upload_copy_uri_activate (void *cls, GtkWidget * searchEntry) 362on_upload_copy_uri_activate_fs (void *dummy1, GtkWidget *dummy2)
363{ 363{
364 GtkTreeView *uploadList = cls; 364 GtkWidget *uploadsList =
365 glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (),
366 "activeUploadsList");
365 GtkTreePath *path; 367 GtkTreePath *path;
366 GtkTreeIter iter; 368 GtkTreeIter iter;
367 struct GNUNET_ECRS_URI *uri; 369 struct GNUNET_ECRS_URI *uri;
@@ -369,7 +371,7 @@ on_upload_copy_uri_activate (void *cls, GtkWidget * searchEntry)
369 GtkClipboard *clip; 371 GtkClipboard *clip;
370 372
371 path = NULL; 373 path = NULL;
372 if (FALSE == gtk_tree_view_get_path_at_pos (uploadList, 374 if (FALSE == gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW(uploadsList),
373 last_x, 375 last_x,
374 last_y, 376 last_y,
375 &path, NULL, NULL, NULL)) 377 &path, NULL, NULL, NULL))
@@ -394,37 +396,6 @@ on_upload_copy_uri_activate (void *cls, GtkWidget * searchEntry)
394 return FALSE; 396 return FALSE;
395} 397}
396 398
397static gint
398upload_click_handler (void *cls, GdkEvent * event)
399{
400 GtkTreeView *uploadList = cls;
401 GtkMenu *menu;
402 GtkWidget *entry;
403 GdkEventButton *event_button;
404
405 if ((event == NULL) || (event->type != GDK_BUTTON_PRESS))
406 return FALSE;
407 event_button = (GdkEventButton *) event;
408 if (event_button->button != 3)
409 return FALSE;
410 last_x = event_button->x;
411 last_y = event_button->y;
412 entry = gtk_menu_item_new_with_label (_("_Copy URI to Clipboard"));
413 g_signal_connect_swapped (entry,
414 "activate",
415 G_CALLBACK (on_upload_copy_uri_activate),
416 uploadList);
417 gtk_label_set_use_underline (GTK_LABEL
418 (gtk_bin_get_child (GTK_BIN (entry))), TRUE);
419 gtk_widget_show (entry);
420 menu = GTK_MENU (gtk_menu_new ());
421 gtk_menu_shell_append (GTK_MENU_SHELL (menu), entry);
422 gtk_menu_popup (menu,
423 NULL,
424 NULL, NULL, NULL, event_button->button, event_button->time);
425 return TRUE;
426}
427
428/** 399/**
429 * Setup the summary views (in particular the models 400 * Setup the summary views (in particular the models
430 * and the renderers). 401 * and the renderers).
@@ -441,6 +412,7 @@ fs_summary_start ()
441 GtkCellRenderer *renderer; 412 GtkCellRenderer *renderer;
442 GtkTreeViewColumn *column; 413 GtkTreeViewColumn *column;
443 int col; 414 int col;
415 GladeXML *contextMenuXML;
444 416
445 /* keyword list setup */ 417 /* keyword list setup */
446 searchCB 418 searchCB
@@ -530,6 +502,10 @@ fs_summary_start ()
530 "changed", 502 "changed",
531 G_CALLBACK (&on_download_summary_selection_changed), 503 G_CALLBACK (&on_download_summary_selection_changed),
532 NULL, NULL, 0); 504 NULL, NULL, 0);
505 contextMenuXML =
506 glade_xml_new (GNUNET_GTK_get_glade_filename (),
507 "downloadsContextMenu", PACKAGE_NAME);
508 GNUNET_GTK_connect_glade_with_plugins (contextMenuXML);
533 509
534 renderer = gtk_cell_renderer_text_new (); 510 renderer = gtk_cell_renderer_text_new ();
535 col = gtk_tree_view_insert_column_with_attributes (downloadList, 511 col = gtk_tree_view_insert_column_with_attributes (downloadList,
@@ -597,8 +573,6 @@ fs_summary_start ()
597 uploadList = 573 uploadList =
598 GTK_TREE_VIEW (glade_xml_get_widget 574 GTK_TREE_VIEW (glade_xml_get_widget
599 (GNUNET_GTK_get_main_glade_XML (), "activeUploadsList")); 575 (GNUNET_GTK_get_main_glade_XML (), "activeUploadsList"));
600 g_signal_connect_swapped (uploadList, "button-press-event",
601 G_CALLBACK (upload_click_handler), uploadList);
602 upload_summary = gtk_tree_store_new (UPLOAD_NUM, G_TYPE_STRING, /* filename */ 576 upload_summary = gtk_tree_store_new (UPLOAD_NUM, G_TYPE_STRING, /* filename */
603 G_TYPE_INT, /* progress */ 577 G_TYPE_INT, /* progress */
604 G_TYPE_STRING, /* URI as string */ 578 G_TYPE_STRING, /* URI as string */
@@ -610,6 +584,10 @@ fs_summary_start ()
610 "changed", 584 "changed",
611 G_CALLBACK (&on_upload_summary_selection_changed), 585 G_CALLBACK (&on_upload_summary_selection_changed),
612 NULL, NULL, 0); 586 NULL, NULL, 0);
587 contextMenuXML =
588 glade_xml_new (GNUNET_GTK_get_glade_filename (),
589 "uploadsContextMenu", PACKAGE_NAME);
590 GNUNET_GTK_connect_glade_with_plugins (contextMenuXML);
613 591
614 renderer = gtk_cell_renderer_progress_new (); 592 renderer = gtk_cell_renderer_progress_new ();
615 col = gtk_tree_view_insert_column_with_attributes (uploadList, 593 col = gtk_tree_view_insert_column_with_attributes (uploadList,