aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-05 18:59:26 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-05 18:59:26 +0000
commita60d897b4ae3727ecd9a1a4bcb4d2e66b92a2660 (patch)
tree2f93b4dd14829ce200358b59b82610a8b9f17754
parent5b67e280801b703ccd9e7eb4412e562876568a97 (diff)
downloadgnunet-gtk-a60d897b4ae3727ecd9a1a4bcb4d2e66b92a2660.tar.gz
gnunet-gtk-a60d897b4ae3727ecd9a1a4bcb4d2e66b92a2660.zip
-towards fixing 2132
-rw-r--r--src/fs/gnunet-fs-gtk_event-handler.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/src/fs/gnunet-fs-gtk_event-handler.c b/src/fs/gnunet-fs-gtk_event-handler.c
index 14d68675..dc313cd0 100644
--- a/src/fs/gnunet-fs-gtk_event-handler.c
+++ b/src/fs/gnunet-fs-gtk_event-handler.c
@@ -299,11 +299,6 @@ start_download (GtkTreeView *tree_view,
299 int anonymity; 299 int anonymity;
300 int filename_is_absolute; 300 int filename_is_absolute;
301 301
302 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
303 "Starting a %sdownload\n",
304 is_recursive ? "recursive " : "");
305
306 GNUNET_assert (tab != NULL);
307 tm = gtk_tree_view_get_model (tree_view); 302 tm = gtk_tree_view_get_model (tree_view);
308 if (TRUE != gtk_tree_model_get_iter (tm, &iter, path)) 303 if (TRUE != gtk_tree_model_get_iter (tm, &iter, path))
309 { 304 {
@@ -325,6 +320,8 @@ start_download (GtkTreeView *tree_view,
325 if (!(GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri))) 320 if (!(GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri)))
326 { 321 {
327 /* can only download chk/loc URIs, ignore */ 322 /* can only download chk/loc URIs, ignore */
323 /* break because in this case, we should not have even gotten here */
324 GNUNET_break (0);
328 return; 325 return;
329 } 326 }
330 327
@@ -456,7 +453,34 @@ GNUNET_FS_GTK_search_treeview_row_activated (GtkTreeView * tree_view,
456 gpointer user_data) 453 gpointer user_data)
457{ 454{
458 struct SearchTab *tab = user_data; 455 struct SearchTab *tab = user_data;
456 struct GNUNET_FS_Uri *uri;
457 GtkTreeModel *tm;
458 GtkTreeIter iter;
459 459
460 tm = gtk_tree_view_get_model (tree_view);
461 if (TRUE != gtk_tree_model_get_iter (tm, &iter, path))
462 {
463 GNUNET_break (0);
464 return;
465 }
466 gtk_tree_model_get (tm, &iter, 1, &uri, -1);
467 if (NULL == uri)
468 {
469 /* user clicked on directory that was opened (not downloaded!), so we
470 have no URI and downloading makes no sense. Ignore! */
471 return;
472 }
473 if (GNUNET_FS_uri_test_ksk (uri))
474 {
475 /* FIXME-FEATURE: copy keywords to search bar (and select 'no' namespace) */
476 return;
477 }
478 if (GNUNET_FS_uri_test_sks (uri))
479 {
480 /* FIXME-FEATURE: select namespace and copy root to search bar */
481 return;
482 }
483 /* must be chk/loc URI, start download */
460 start_download (tree_view, path, tab, GNUNET_NO, GNUNET_NO); 484 start_download (tree_view, path, tab, GNUNET_NO, GNUNET_NO);
461} 485}
462 486
@@ -627,7 +651,8 @@ search_list_popup (GtkTreeModel *tm,
627 spc->sr = sr; 651 spc->sr = sr;
628 menu = GTK_MENU (gtk_menu_new ()); 652 menu = GTK_MENU (gtk_menu_new ());
629 if ( (NULL == sr->download) && 653 if ( (NULL == sr->download) &&
630 (NULL != uri) ) 654 (NULL != uri) &&
655 ( (GNUNET_FS_uri_test_chk (uri) || GNUNET_FS_uri_test_loc (uri))) )
631 { 656 {
632 /* only display download menus if there is a URI */ 657 /* only display download menus if there is a URI */
633 child = gtk_menu_item_new_with_label (_("_Download")); 658 child = gtk_menu_item_new_with_label (_("_Download"));