fixed tooltips in ShareManager, and fixed anonymous search mechanism

This commit is contained in:
mr-alice 2016-11-02 21:31:14 +01:00
parent d2118c5329
commit 5aef67d332
5 changed files with 19 additions and 12 deletions

View File

@ -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_NETWORK_WIDE ( 0x00000080 );// anonymously shared over network
const FileSearchFlags RS_FILE_HINTS_BROWSABLE ( 0x00000100 );// browsable by friends 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 // Flags used when requesting a transfer
// //

View File

@ -1380,11 +1380,13 @@ 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 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 ; FileSearchFlags final_flags ;
if(network_wide) final_flags |= RS_FILE_HINTS_NETWORK_WIDE ; if(network_wide) final_flags |= RS_FILE_HINTS_NETWORK_WIDE ;
if(browsable ) final_flags |= RS_FILE_HINTS_BROWSABLE ; if(browsable ) final_flags |= RS_FILE_HINTS_BROWSABLE ;
if(searchable ) final_flags |= RS_FILE_HINTS_SEARCHABLE ;
return final_flags ; return final_flags ;
} }

View File

@ -1729,7 +1729,7 @@ void RsTurtleStringSearchRequestItem::performLocalSearch(std::list<TurtleFileInf
std::cerr << "Performing rsFiles->search()" << std::endl ; std::cerr << "Performing rsFiles->search()" << std::endl ;
#endif #endif
// now, search! // 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 #ifdef P3TURTLE_DEBUG
std::cerr << initialResults.size() << " matches found." << std::endl ; std::cerr << initialResults.size() << " matches found." << std::endl ;
@ -1767,7 +1767,7 @@ void RsTurtleRegExpSearchRequestItem::performLocalSearch(std::list<TurtleFileInf
return ; return ;
// now, search! // now, search!
rsFiles->SearchBoolExp(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() ; result.clear() ;

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>737</width> <width>1156</width>
<height>402</height> <height>402</height>
</rect> </rect>
</property> </property>
@ -86,7 +86,7 @@
<item> <item>
<widget class="QPushButton" name="addShares_PB"> <widget class="QPushButton" name="addShares_PB">
<property name="text"> <property name="text">
<string>Add Share</string> <string>Configure shared directories</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">

View File

@ -96,16 +96,20 @@ void GroupFlagsWidget::update_button_state(bool b,int button_id)
{ {
QString tip_on, tip_off; QString tip_on, tip_off;
switch (button_id) { switch (button_id) {
case 2: case INDEX_BROWSABLE:
tip_on = tr("Directory is visible to some friends (see list at right)"); tip_on = tr("Directory content is visible to friend nodes (see list at right)");
tip_off = tr("Directory is NOT visible to any friend"); tip_off = tr("Directory content is NOT visible to friend nodes");
break; break;
case 0: case INDEX_ANON_SEARCH:
tip_on = tr("Directory can be searched anonymously"); tip_on = tr("Directory can be searched anonymously");
tip_off = tr("Directory cannot be searched anonymously"); tip_off = tr("Directory cannot be searched anonymously");
break; break;
case 1: case INDEX_ANON_DL:
tip_on = tr("Files can be downloaded anonymously"); 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"); tip_off = tr("Files cannot be downloaded anonymously");
break; break;
default: default: