From 38cf63d9755b5b59b3044aa1976f8902ab06b3a1 Mon Sep 17 00:00:00 2001 From: xiaoyifang <105986+xiaoyifang@users.noreply.github.com> Date: Thu, 3 Feb 2022 18:09:06 +0800 Subject: [PATCH 1/2] Update How to use ocr together with GoldenDict.md --- howto/How to use ocr together with GoldenDict.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/howto/How to use ocr together with GoldenDict.md b/howto/How to use ocr together with GoldenDict.md index 17ec24ce..59ec4e8c 100644 --- a/howto/How to use ocr together with GoldenDict.md +++ b/howto/How to use ocr together with GoldenDict.md @@ -5,7 +5,9 @@ the technique used there is old and can not work crossplatform . with the help of another great tool [Capture2Text](https://sourceforge.net/projects/capture2text/) ,GoldenDict can work with ocr seamlessly. # Note -Capture2Text has offered Windows precompiled executable files.I think it would be easier and possible to make it work on Linux as some afforts have tried. +Capture2Text has offered Windows precompiled executable files.I have ported it to Linux https://github.com/xiaoyifang/Capture2Text + +Thanks to: - [Capture2Text Linux Port](https://github.com/GSam/Capture2Text ) - [another on nixos](https://github.com/sikmir/nur-packages/blob/7c876e3fb20160781207a8f652fb052647e6da0d/pkgs/misc/capture2text/default.nix) from [sikmir](https://github.com/goldendict/goldendict/issues/1445#issuecomment-1022972220) From 35f844a9a836d7c8bf4d9f53cdc0383b58283553 Mon Sep 17 00:00:00 2001 From: yifang Date: Fri, 4 Feb 2022 21:19:32 +0800 Subject: [PATCH 2/2] fix:when auto pronounce enabled. the sentence audio can not be played. --- articleview.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/articleview.cc b/articleview.cc index aa6383e8..38101edf 100644 --- a/articleview.cc +++ b/articleview.cc @@ -515,7 +515,7 @@ void ArticleView::showAnticipation() ui.definition->setCursor( Qt::WaitCursor ); } -void ArticleView::loadFinished( bool ) +void ArticleView::loadFinished( bool result ) { setZoomFactor(cfg.preferences.zoomFactor); QUrl url = ui.definition->url(); @@ -601,8 +601,11 @@ void ArticleView::loadFinished( bool ) } } - emit pageLoaded( this ); - + //the click audio url such as gdau://xxxx ,webview also emit a pageLoaded signal but with the result is false.need future investigation. + //the audio link click ,no need to emit pageLoaded signal + if(result){ + emit pageLoaded( this ); + } if( Utils::Url::hasQueryItem( ui.definition->url(), "regexp" ) ) highlightFTSResults(); } @@ -1116,6 +1119,7 @@ void ArticleView::openLink( QUrl const & url, QUrl const & ref, QString const & scrollTo, Contexts const & contexts_ ) { + audioPlayer->stop(); qDebug() << "open link url:" << url; Contexts contexts( contexts_ );