mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Add word to history via context menu from ScapPopup window
This commit is contained in:
parent
305c9ed1b8
commit
44247c04c9
|
@ -1012,12 +1012,12 @@ void ArticleView::contextMenuRequested( QPoint const & pos )
|
|||
arg( ui.definition->selectedText() ),
|
||||
&menu );
|
||||
menu.addAction( lookupSelectionNewTab );
|
||||
}
|
||||
|
||||
addWordToHistoryAction = new QAction( tr( "&Add \"%1\" to history" ).
|
||||
arg( ui.definition->selectedText() ),
|
||||
&menu );
|
||||
menu.addAction( addWordToHistoryAction );
|
||||
}
|
||||
|
||||
Instances::Group const * altGroup =
|
||||
( groupComboBox && groupComboBox->getCurrentGroup() != getGroup( ui.definition->url() ) ) ?
|
||||
|
@ -1047,7 +1047,7 @@ void ArticleView::contextMenuRequested( QPoint const & pos )
|
|||
if ( selectedText.size() )
|
||||
menu.addAction( ui.definition->pageAction( QWebPage::Copy ) );
|
||||
|
||||
if( !popupView && menu.isEmpty() )
|
||||
if( menu.isEmpty() )
|
||||
{
|
||||
addHeaderToHistoryAction = new QAction( tr( "&Add \"%1\" to history" ).
|
||||
arg( ui.definition->title() ),
|
||||
|
|
|
@ -852,6 +852,9 @@ void MainWindow::makeScanPopup()
|
|||
|
||||
connect( scanPopup.get(), SIGNAL( setExpandMode( bool ) ),
|
||||
this, SLOT( setExpandMode( bool ) ) );
|
||||
|
||||
connect( scanPopup.get(), SIGNAL( forceAddWordToHistory( const QString & ) ),
|
||||
this, SLOT( forceAddWordToHistory( const QString & ) ) );
|
||||
}
|
||||
|
||||
vector< sptr< Dictionary::Class > > const & MainWindow::getActiveDicts()
|
||||
|
|
|
@ -64,6 +64,8 @@ ScanPopup::ScanPopup( QWidget * parent,
|
|||
definition, SLOT( receiveExpandOptionalParts( bool ) ) );
|
||||
connect( definition, SIGNAL( setExpandMode( bool ) ),
|
||||
this, SIGNAL( setExpandMode( bool ) ) );
|
||||
connect( definition, SIGNAL( forceAddWordToHistory( QString ) ),
|
||||
this, SIGNAL( forceAddWordToHistory( QString ) ) );
|
||||
|
||||
applyZoomFactor();
|
||||
|
||||
|
|
|
@ -58,6 +58,8 @@ signals:
|
|||
void setViewExpandMode( bool expand );
|
||||
/// Signal to switch expand optional parts mode
|
||||
void switchExpandMode();
|
||||
/// Signal to add word to history even if history is disabled
|
||||
void forceAddWordToHistory( const QString & word);
|
||||
|
||||
public slots:
|
||||
|
||||
|
|
Loading…
Reference in a new issue