clean: convert navPronounce connect to new syntax

This commit is contained in:
shenleban tongying 2023-04-29 04:04:56 -04:00 committed by xiaoyifang
parent cfe1a1c8c0
commit 6498bd4f17
2 changed files with 6 additions and 17 deletions

View file

@ -233,8 +233,9 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
navPronounce->setEnabled( false );
navToolbar->widgetForAction( navPronounce )->setObjectName( "soundButton" );
connect( navPronounce, SIGNAL( triggered() ),
this, SLOT( pronounce() ) );
connect( navPronounce, &QAction::triggered, [ this ]() {
getCurrentArticleView()->playSound();
} );
// zooming
// named separator (to be able to hide it via CSS)
@ -1910,8 +1911,9 @@ void MainWindow::pageLoaded( ArticleView * view )
updatePronounceAvailability();
if ( cfg.preferences.pronounceOnLoadMain )
pronounce( view );
if ( cfg.preferences.pronounceOnLoadMain && view != nullptr ) {
view->playSound();
}
//updateFoundInDictsList();
}
@ -1970,14 +1972,6 @@ void MainWindow::dictionaryBarToggled( bool )
applyMutedDictionariesState(); // Visibility change affects searches and results
}
void MainWindow::pronounce( ArticleView * view )
{
if ( view )
view->playSound();
else
getCurrentArticleView()->playSound();
}
void MainWindow::showDictsPane( )
{
if( !ui.dictsPane->isVisible() )

View file

@ -329,11 +329,6 @@ private slots:
void dictionaryBarToggled( bool checked );
/// Pronounces the currently displayed word by playing its first audio
/// reference, if it has any.
/// If view is 0, the operation is done for the currently open tab.
void pronounce( ArticleView * view = 0 );
void zoomin();
void zoomout();
void unzoom();