Show new translation after group changing

This commit is contained in:
Abs62 2012-09-03 16:42:43 +04:00
parent e4adc5f168
commit 52fbeac618
2 changed files with 6 additions and 3 deletions

View file

@ -1359,7 +1359,10 @@ void MainWindow::currentGroupChanged( QString const & )
// Update word search results // Update word search results
if( !showHistory ) if( !showHistory )
{
translateInputChanged( ui.translateLine->text() ); translateInputChanged( ui.translateLine->text() );
translateInputFinished( false );
}
updateCurrentGroupProperty(); updateCurrentGroupProperty();
} }
@ -1423,14 +1426,14 @@ void MainWindow::translateInputChanged( QString const & newValue )
wordFinder.prefixMatch( req, getActiveDicts() ); wordFinder.prefixMatch( req, getActiveDicts() );
} }
void MainWindow::translateInputFinished() void MainWindow::translateInputFinished( bool checkModifiers )
{ {
QString word = ui.translateLine->text(); QString word = ui.translateLine->text();
if ( word.size() ) if ( word.size() )
{ {
Qt::KeyboardModifiers mods = QApplication::keyboardModifiers(); Qt::KeyboardModifiers mods = QApplication::keyboardModifiers();
if ( mods & (Qt::ControlModifier | Qt::ShiftModifier) ) if ( checkModifiers && ( mods & (Qt::ControlModifier | Qt::ShiftModifier) ) )
addNewTab(); addNewTab();
showTranslationFor( word ); showTranslationFor( word );

View file

@ -248,7 +248,7 @@ private slots:
void currentGroupChanged( QString const & ); void currentGroupChanged( QString const & );
void translateInputChanged( QString const & ); void translateInputChanged( QString const & );
void translateInputFinished(); void translateInputFinished( bool checkModifiers = true );
/// Closes any opened search in the article view, and focuses the translateLine/close main window to tray. /// Closes any opened search in the article view, and focuses the translateLine/close main window to tray.
void handleEsc(); void handleEsc();