mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
fix:add log to clipboard datachange signal
fix:add log to clipboard datachange signal
This commit is contained in:
parent
370eb1357f
commit
6a7e54c165
|
@ -919,11 +919,12 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
|
||||
inspector.reset( new ArticleInspector( this ));
|
||||
|
||||
connect( QApplication::clipboard(), &QClipboard::changed, this, &MainWindow::clipboardChange );
|
||||
connect( QApplication::clipboard(), &QClipboard::dataChanged, this, &MainWindow::clipboardChange );
|
||||
}
|
||||
|
||||
void MainWindow::clipboardChange( QClipboard::Mode mode )
|
||||
void MainWindow::clipboardChange( )
|
||||
{
|
||||
qDebug() << "clipboard change ," << cfg.preferences.trackClipboardChanges << scanPopup.get();
|
||||
if( scanPopup && cfg.preferences.trackClipboardChanges )
|
||||
{
|
||||
scanPopup->translateWordFromClipboard();
|
||||
|
@ -3234,6 +3235,7 @@ void MainWindow::showMainWindow()
|
|||
void MainWindow::trackingClipboard( bool on )
|
||||
{
|
||||
cfg.preferences.trackClipboardChanges = on;
|
||||
makeScanPopup();
|
||||
}
|
||||
|
||||
void MainWindow::visitHomepage()
|
||||
|
|
|
@ -487,7 +487,7 @@ private slots:
|
|||
void showGDHelp();
|
||||
void hideGDHelp();
|
||||
|
||||
void clipboardChange( QClipboard::Mode mode );
|
||||
void clipboardChange( );
|
||||
|
||||
signals:
|
||||
/// Set optional parts expand mode for all tabs
|
||||
|
|
|
@ -469,12 +469,12 @@ void ScanPopup::editGroupRequested()
|
|||
|
||||
void ScanPopup::translateWordFromClipboard(QClipboard::Mode m)
|
||||
{
|
||||
GD_DPRINTF( "translating from clipboard or selection\n" );
|
||||
qDebug()<< "translating from clipboard or selection" ;
|
||||
|
||||
QString subtype = "plain";
|
||||
|
||||
QString str = QApplication::clipboard()->text( subtype, m);
|
||||
|
||||
qDebug() << "clipboard data:" << str;
|
||||
translateWord( str );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue