diff --git a/src/ui/articleview.cc b/src/ui/articleview.cc index f6c18d15..2172444f 100644 --- a/src/ui/articleview.cc +++ b/src/ui/articleview.cc @@ -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(); } diff --git a/src/ui/scanpopup.cc b/src/ui/scanpopup.cc index db595e5e..11e9d789 100644 --- a/src/ui/scanpopup.cc +++ b/src/ui/scanpopup.cc @@ -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();