From 5aef67d33287411125485812bff7ffa6aed45ea4 Mon Sep 17 00:00:00 2001 From: mr-alice Date: Wed, 2 Nov 2016 21:31:14 +0100 Subject: [PATCH] fixed tooltips in ShareManager, and fixed anonymous search mechanism --- libretroshare/src/retroshare/rsfiles.h | 3 ++- libretroshare/src/rsserver/p3peers.cc | 4 +++- libretroshare/src/turtle/p3turtle.cc | 4 ++-- retroshare-gui/src/gui/SharedFilesDialog.ui | 4 ++-- .../src/gui/common/GroupFlagsWidget.cpp | 16 ++++++++++------ 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/libretroshare/src/retroshare/rsfiles.h b/libretroshare/src/retroshare/rsfiles.h index c40ce9d54..b45aedcc7 100644 --- a/libretroshare/src/retroshare/rsfiles.h +++ b/libretroshare/src/retroshare/rsfiles.h @@ -76,7 +76,8 @@ const FileSearchFlags RS_FILE_HINTS_SPEC_ONLY ( 0x01000000 ); const FileSearchFlags RS_FILE_HINTS_NETWORK_WIDE ( 0x00000080 );// anonymously shared over network const FileSearchFlags RS_FILE_HINTS_BROWSABLE ( 0x00000100 );// browsable by friends -const FileSearchFlags RS_FILE_HINTS_PERMISSION_MASK ( 0x00000180 );// OR of the last two flags. Used to filter out. +const FileSearchFlags RS_FILE_HINTS_SEARCHABLE ( 0x00000200 );// browsable by friends +const FileSearchFlags RS_FILE_HINTS_PERMISSION_MASK ( 0x00000380 );// OR of the last tree flags. Used to filter out. // Flags used when requesting a transfer // diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index aea128867..d4b5fe332 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -1379,12 +1379,14 @@ FileSearchFlags p3Peers::computePeerPermissionFlags(const RsPeerId& peer_ssl_id, } bool network_wide = (share_flags & DIR_FLAGS_ANONYMOUS_DOWNLOAD) ;//|| ( (share_flags & DIR_FLAGS_NETWORK_WIDE_GROUPS) && found) ; - bool browsable = (share_flags & DIR_FLAGS_BROWSABLE) && found ; + bool browsable = (share_flags & DIR_FLAGS_BROWSABLE) && found ; + bool searchable = (share_flags & DIR_FLAGS_ANONYMOUS_SEARCH) ; FileSearchFlags final_flags ; if(network_wide) final_flags |= RS_FILE_HINTS_NETWORK_WIDE ; if(browsable ) final_flags |= RS_FILE_HINTS_BROWSABLE ; + if(searchable ) final_flags |= RS_FILE_HINTS_SEARCHABLE ; return final_flags ; } diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 8208c08b8..bb4684f01 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1729,7 +1729,7 @@ void RsTurtleStringSearchRequestItem::performLocalSearch(std::listsearch()" << std::endl ; #endif // now, search! - rsFiles->SearchKeywords(words, initialResults,RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_NETWORK_WIDE,PeerId()); + rsFiles->SearchKeywords(words, initialResults,RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_SEARCHABLE,PeerId()); #ifdef P3TURTLE_DEBUG std::cerr << initialResults.size() << " matches found." << std::endl ; @@ -1767,7 +1767,7 @@ void RsTurtleRegExpSearchRequestItem::performLocalSearch(std::listSearchBoolExp(exp,initialResults,RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_NETWORK_WIDE,PeerId()); + rsFiles->SearchBoolExp(exp,initialResults,RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_SEARCHABLE,PeerId()); result.clear() ; diff --git a/retroshare-gui/src/gui/SharedFilesDialog.ui b/retroshare-gui/src/gui/SharedFilesDialog.ui index 25f9337fa..f408098c5 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.ui +++ b/retroshare-gui/src/gui/SharedFilesDialog.ui @@ -6,7 +6,7 @@ 0 0 - 737 + 1156 402 @@ -86,7 +86,7 @@ - Add Share + Configure shared directories diff --git a/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp b/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp index ad11c7c40..9a24c1300 100644 --- a/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp @@ -96,16 +96,20 @@ void GroupFlagsWidget::update_button_state(bool b,int button_id) { QString tip_on, tip_off; switch (button_id) { - case 2: - tip_on = tr("Directory is visible to some friends (see list at right)"); - tip_off = tr("Directory is NOT visible to any friend"); + case INDEX_BROWSABLE: + tip_on = tr("Directory content is visible to friend nodes (see list at right)"); + tip_off = tr("Directory content is NOT visible to friend nodes"); break; - case 0: + case INDEX_ANON_SEARCH: tip_on = tr("Directory can be searched anonymously"); tip_off = tr("Directory cannot be searched anonymously"); break; - case 1: - tip_on = tr("Files can be downloaded anonymously"); + case INDEX_ANON_DL: + if(_buttons[INDEX_ANON_SEARCH]->isChecked()) + tip_on = tr("Files can be accessed using anonymous tunnels"); + else + tip_on = tr("Files can be accessed using anonymous & end-to-end encrypted tunnels"); + tip_off = tr("Files cannot be downloaded anonymously"); break; default: