diff --git a/mainwindow.cc b/mainwindow.cc index e83b7398..91271300 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -411,7 +411,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ): actTrackingClipboard = trayIconMenu.addAction( tr( "Tracking Clipboard" ) ); actTrackingClipboard->setCheckable(true); actTrackingClipboard->setChecked(cfg.preferences.trackClipboardChanges); - actTrackingClipboard->setVisible( cfg.preferences.enableScanPopup ); +// actTrackingClipboard->setVisible( cfg.preferences.enableScanPopup ); connect( actTrackingClipboard , SIGNAL( triggered(bool) ), this, SLOT( trackingClipboard(bool) ) ); trayIconMenu.addSeparator(); @@ -918,6 +918,16 @@ MainWindow::MainWindow( Config::Class & cfg_ ): } inspector = new ArticleInspector( this ); + + connect( QApplication::clipboard(), &QClipboard::changed, this, &MainWindow::clipboardChange ); +} + +void MainWindow::clipboardChange( QClipboard::Mode mode ) +{ + if( scanPopup && cfg.preferences.trackClipboardChanges ) + { + scanPopup->translateWordFromClipboard(); + } } void MainWindow::ctrlTabPressed() diff --git a/mainwindow.hh b/mainwindow.hh index 683d9710..969479cb 100644 --- a/mainwindow.hh +++ b/mainwindow.hh @@ -487,6 +487,8 @@ private slots: void showGDHelp(); void hideGDHelp(); + void clipboardChange( QClipboard::Mode mode ); + signals: /// Set optional parts expand mode for all tabs void setExpandOptionalParts( bool expand ); diff --git a/scanpopup.cc b/scanpopup.cc index 2daf58c4..3289b928 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -514,14 +514,6 @@ void ScanPopup::delayShow() void ScanPopup::clipboardChanged( QClipboard::Mode m ) { - if( cfg.preferences.trackClipboardChanges ) - { - QString subtype = "plain"; - - handleInputWord( QApplication::clipboard()->text( subtype, m ) ); - return; - } - if( !isScanningEnabled ) return;