Add word to history via context menu from ScapPopup window

This commit is contained in:
Abs62 2012-09-16 14:30:14 +04:00
parent 305c9ed1b8
commit 44247c04c9
4 changed files with 13 additions and 6 deletions

View file

@ -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() ),

View file

@ -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()

View file

@ -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();

View file

@ -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: