fix: navigate through epwing dictionary restricted to certain dictionary

This commit is contained in:
YiFang Xiao 2023-08-30 23:10:19 +08:00
parent bb29fd5c94
commit 791da91645
2 changed files with 5 additions and 3 deletions

View file

@ -387,9 +387,10 @@ sptr< Dictionary::DataRequest > ArticleMaker::makeDefinitionFor( QString const &
unmutedDicts.reserve( activeDicts.size() );
for ( unsigned x = 0; x < activeDicts.size(); ++x )
for ( unsigned x = 0; x < activeDicts.size(); ++x ) {
if ( !mutedDicts.contains( QString::fromStdString( activeDicts[ x ]->getId() ) ) )
unmutedDicts.push_back( activeDicts[ x ] );
}
return std::make_shared< ArticleRequest >(
word,

View file

@ -312,7 +312,8 @@ string Epwing::EpwingDictionary::epwing_previous_button( const int & articlePage
{
QString previousButton = QString( "p%1At%2" ).arg( articlePage ).arg( articleOffset );
string previousLink = R"(<p><a class="epwing_previous_page" href="gdlookup://localhost/)"
+ previousButton.toStdString() + "\">" + tr( "Previous Page" ).toStdString() + "</a></p>";
+ previousButton.toStdString() + "?dictionaries=" + getId() + "\">" + tr( "Previous Page" ).toStdString()
+ "</a></p>";
return previousLink;
}
@ -348,7 +349,7 @@ void EpwingDictionary::loadArticleNextPage( string & articleHeadword,
string Epwing::EpwingDictionary::epwing_next_button( const int & articlePage, const int & articleOffset )
{
QString refLink = QString( "r%1At%2" ).arg( articlePage ).arg( articleOffset );
string nextLink = R"(<p><a class="epwing_next_page" href="gdlookup://localhost/)" + refLink.toStdString() + "\">"
string nextLink = R"(<p><a class="epwing_next_page" href="gdlookup://localhost/)" + refLink.toStdString() + "?dictionaries="+getId()+"\">"
+ tr( "Next Page" ).toStdString() + "</a></p>";
return nextLink;