rename enableScanPopupAction to enableScanningAction which now governs both popup and sendToMainWindow kinds of scanning

This commit is contained in:
shenleban tongying 2022-11-19 10:40:57 -05:00
parent b3b740854a
commit 9d9ad3ecc9
2 changed files with 12 additions and 12 deletions

View file

@ -230,17 +230,17 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
// scan popup // scan popup
navToolbar->addSeparator(); navToolbar->addSeparator();
enableScanPopupAction = navToolbar->addAction( QIcon( ":/icons/wizard.svg" ), tr( "Scan Popup" ) ); enableScanningAction = navToolbar->addAction( QIcon( ":/icons/wizard.svg" ), tr( "Enable Scanning" ) );
enableScanPopupAction->setCheckable( true ); enableScanningAction->setCheckable( true );
navToolbar->widgetForAction( enableScanPopupAction )->setObjectName( "scanPopupButton" ); navToolbar->widgetForAction( enableScanningAction )->setObjectName( "scanPopupButton" );
if( cfg.preferences.startWithScanPopupOn ) if( cfg.preferences.startWithScanPopupOn )
{ {
enableScanPopupAction->setIcon( QIcon( ":/icons/wizard-selected.svg" ) ); enableScanningAction->setIcon( QIcon( ":/icons/wizard-selected.svg" ) );
enableScanPopupAction->setChecked( true ); enableScanningAction->setChecked( true );
} }
connect( enableScanPopupAction, SIGNAL( toggled( bool ) ), connect( enableScanningAction, SIGNAL( toggled( bool ) ),
this, SLOT( scanEnableToggled( bool ) ) ); this, SLOT( scanEnableToggled( bool ) ) );
navToolbar->addSeparator(); navToolbar->addSeparator();
@ -405,7 +405,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
// tray icon // tray icon
connect( trayIconMenu.addAction( tr( "Show &Main Window" ) ), SIGNAL( triggered() ), connect( trayIconMenu.addAction( tr( "Show &Main Window" ) ), SIGNAL( triggered() ),
this, SLOT( showMainWindow() ) ); this, SLOT( showMainWindow() ) );
trayIconMenu.addAction( enableScanPopupAction ); trayIconMenu.addAction( enableScanningAction );
trayIconMenu.addSeparator(); trayIconMenu.addSeparator();
connect( trayIconMenu.addAction( tr( "&Quit" ) ), SIGNAL( triggered() ), connect( trayIconMenu.addAction( tr( "&Quit" ) ), SIGNAL( triggered() ),
@ -1188,7 +1188,7 @@ void MainWindow::updateTrayIcon()
if ( trayIcon ) if ( trayIcon )
{ {
// Update the icon to reflect the scanning mode // Update the icon to reflect the scanning mode
trayIcon->setIcon( enableScanPopupAction->isChecked() ? trayIcon->setIcon( enableScanningAction->isChecked() ?
QIcon::fromTheme("goldendict-scan-tray", QIcon( ":/icons/programicon_scan.png" )) : QIcon::fromTheme("goldendict-scan-tray", QIcon( ":/icons/programicon_scan.png" )) :
QIcon::fromTheme("goldendict-tray", QIcon( ":/icons/programicon_old.png" )) ); QIcon::fromTheme("goldendict-tray", QIcon( ":/icons/programicon_old.png" )) );
@ -1488,7 +1488,7 @@ void MainWindow::makeScanPopup()
scanPopup->setStyleSheet( styleSheet() ); scanPopup->setStyleSheet( styleSheet() );
if ( enableScanPopupAction->isChecked() ) if ( enableScanningAction->isChecked() )
scanPopup->enableScanning(); scanPopup->enableScanning();
connect( scanPopup.get(), SIGNAL(editGroupRequested( unsigned ) ), connect( scanPopup.get(), SIGNAL(editGroupRequested( unsigned ) ),
@ -3165,12 +3165,12 @@ void MainWindow::scanEnableToggled( bool on )
mainStatusBar->showMessage( tr( "Accessibility API is not enabled" ), 10000, mainStatusBar->showMessage( tr( "Accessibility API is not enabled" ), 10000,
QPixmap( ":/icons/error.svg" ) ); QPixmap( ":/icons/error.svg" ) );
#endif #endif
enableScanPopupAction->setIcon(QIcon(":/icons/wizard-selected.svg")); enableScanningAction->setIcon(QIcon(":/icons/wizard-selected.svg"));
} }
else else
{ {
scanPopup->disableScanning(); scanPopup->disableScanning();
enableScanPopupAction->setIcon(QIcon(":/icons/wizard.svg")); enableScanningAction->setIcon(QIcon(":/icons/wizard.svg"));
} }
} }

View file

@ -116,7 +116,7 @@ private:
addAllTabToFavoritesAction; addAllTabToFavoritesAction;
QToolBar * navToolbar; QToolBar * navToolbar;
MainStatusBar * mainStatusBar; MainStatusBar * mainStatusBar;
QAction * navBack, * navForward, * navPronounce, * enableScanPopupAction; QAction * navBack, * navForward, * navPronounce, * enableScanningAction;
QAction * beforeOptionsSeparator; QAction * beforeOptionsSeparator;
QAction * zoomIn, * zoomOut, * zoomBase; QAction * zoomIn, * zoomOut, * zoomBase;
QAction * wordsZoomIn, * wordsZoomOut, * wordsZoomBase; QAction * wordsZoomIn, * wordsZoomOut, * wordsZoomBase;