fix: [regression]scanpopup right context menu lost dictionary list (#989)

* fix: [regression]scanpopup right context menu lost dictionary list

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
xiaoyifang 2023-07-20 22:49:37 +08:00 committed by GitHub
parent 8471029770
commit df4bc68248
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -252,14 +252,11 @@ ArticleView::ArticleView( QWidget * parent,
// Variable name for store current selection range
rangeVarName = QString( "sr_%1" ).arg( QString::number( (quint64)this, 16 ) );
if ( const bool fromMainWindow = parent && parent->objectName() == "MainWindow" ) {
connect( GlobalBroadcaster::instance(),
&GlobalBroadcaster::dictionaryChanges,
this,
&ArticleView::setActiveDictIds );
connect( GlobalBroadcaster::instance(), &GlobalBroadcaster::dictionaryClear, this, &ArticleView::dictionaryClear );
}
connect( GlobalBroadcaster::instance(), &GlobalBroadcaster::dictionaryChanges, this, &ArticleView::setActiveDictIds );
connect( GlobalBroadcaster::instance(), &GlobalBroadcaster::dictionaryClear, this, &ArticleView::dictionaryClear );
channel = new QWebChannel( webview->page() );
agent = new ArticleViewAgent( this );
@ -1862,6 +1859,8 @@ void ArticleView::pasteTriggered()
unsigned ArticleView::getCurrentGroup()
{
if ( !groupComboBox )
return currentGroupId;
return groupComboBox->getCurrentGroup();
}

View file

@ -132,6 +132,7 @@ ScanPopup::ScanPopup( QWidget * parent,
ui.groupList->fill( groups );
ui.groupList->setCurrentGroup( cfg.lastPopupGroupId );
definition->setCurrentGroupId( ui.groupList->getCurrentGroup() );
dictionaryBar.setFloatable( false );
Instances::Group const * igrp = groups.findGroup( cfg.lastPopupGroupId );
@ -598,6 +599,8 @@ void ScanPopup::currentGroupChanged( int )
updateDictionaryBar();
definition->setCurrentGroupId( cfg.lastPopupGroupId );
if ( isVisible() ) {
updateSuggestionList();
translateInputFinished();