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_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
//

View File

@ -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 ;
}

View File

@ -1729,7 +1729,7 @@ void RsTurtleStringSearchRequestItem::performLocalSearch(std::list<TurtleFileInf
std::cerr << "Performing rsFiles->search()" << 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::list<TurtleFileInf
return ;
// 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() ;

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>737</width>
<width>1156</width>
<height>402</height>
</rect>
</property>
@ -86,7 +86,7 @@
<item>
<widget class="QPushButton" name="addShares_PB">
<property name="text">
<string>Add Share</string>
<string>Configure shared directories</string>
</property>
<property name="icon">
<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;
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: