opt: don't focus on the main window if word comes from headword dialog

This commit is contained in:
shenleban tongying 2024-11-10 23:38:32 -05:00
parent d4db51f278
commit acbfef0870
2 changed files with 7 additions and 9 deletions

View file

@ -3730,13 +3730,6 @@ void MainWindow::wordReceived( const QString & word )
respondToTranslationRequest( word, false );
}
void MainWindow::headwordReceived( const QString & word, const QString & ID )
{
toggleMainWindow( true );
setInputLineText( word, WildcardPolicy::EscapeWildcards, NoPopupChange );
respondToTranslationRequest( word, false, ArticleView::scrollToFromDictionaryId( ID ), false );
}
void MainWindow::updateFavoritesMenu()
{
if ( ui.favoritesPane->isVisible() ) {
@ -4141,7 +4134,13 @@ void MainWindow::showDictionaryHeadwords( Dictionary::Class * dict )
headwordsDlg = new DictHeadwords( this, cfg, dict );
addGlobalActionsToDialog( headwordsDlg );
addGroupComboBoxActionsToDialog( headwordsDlg, groupList );
connect( headwordsDlg, &DictHeadwords::headwordSelected, this, &MainWindow::headwordReceived );
connect( headwordsDlg,
&DictHeadwords::headwordSelected,
this,
[ this ]( QString const & headword, QString const & dictID ) {
setInputLineText( headword, WildcardPolicy::EscapeWildcards, NoPopupChange );
respondToTranslationRequest( headword, false, ArticleView::scrollToFromDictionaryId( dictID ), false );
} );
connect( headwordsDlg,
&DictHeadwords::closeDialog,
this,

View file

@ -67,7 +67,6 @@ public slots:
void messageFromAnotherInstanceReceived( QString const & );
void showStatusBarMessage( QString const &, int, QPixmap const & );
void wordReceived( QString const & );
void headwordReceived( QString const &, QString const & );
void headwordFromFavorites( QString const &, QString const & );
void quitApp();