mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
fix: double click to translation should stop audio first.
there are cases when the audio is too long (in wiki). when double click occured .the audio is still playing.
This commit is contained in:
parent
59ea20f4c1
commit
d607079ffb
|
@ -2250,7 +2250,7 @@ void ArticleView::onJsActiveArticleChanged(QString const & id)
|
|||
void ArticleView::doubleClicked( QPoint pos )
|
||||
{
|
||||
// We might want to initiate translation of the selected word
|
||||
|
||||
audioPlayer->stop();
|
||||
if ( cfg.preferences.doubleClickTranslates )
|
||||
{
|
||||
QString selectedText = ui.definition->selectedText();
|
||||
|
|
|
@ -2696,14 +2696,18 @@ void MainWindow::dictsListItemActivated( QListWidgetItem * item )
|
|||
void MainWindow::dictsListSelectionChanged()
|
||||
{
|
||||
QList< QListWidgetItem * > selected = ui.dictsList->selectedItems();
|
||||
if ( selected.size() )
|
||||
if( selected.size() )
|
||||
{
|
||||
ArticleView * view = getCurrentArticleView();
|
||||
if(view){
|
||||
QString dictId = ui.dictsList->selectedItems().at(0)->data(Qt::UserRole).toString();
|
||||
view->setActiveArticleId(dictId);
|
||||
}
|
||||
// jumpToDictionary( selected.front() );
|
||||
ArticleView * view = getCurrentArticleView();
|
||||
if( view )
|
||||
{
|
||||
QString dictId = ui.dictsList->selectedItems().at( 0 )->data( Qt::UserRole ).toString();
|
||||
view->setActiveArticleId( dictId );
|
||||
}
|
||||
// selection change ,no need to jump to article ,if jump to article ,the position in webview would be changed
|
||||
// when click the dictionary in the html.
|
||||
|
||||
// jumpToDictionary( selected.front() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue