From 52fbeac6182eeab912f21dcd559bcf52d31902c1 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Mon, 3 Sep 2012 16:42:43 +0400 Subject: [PATCH] Show new translation after group changing --- mainwindow.cc | 7 +++++-- mainwindow.hh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mainwindow.cc b/mainwindow.cc index 0855317a..e2ccce0f 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -1359,7 +1359,10 @@ void MainWindow::currentGroupChanged( QString const & ) // Update word search results if( !showHistory ) + { translateInputChanged( ui.translateLine->text() ); + translateInputFinished( false ); + } updateCurrentGroupProperty(); } @@ -1423,14 +1426,14 @@ void MainWindow::translateInputChanged( QString const & newValue ) wordFinder.prefixMatch( req, getActiveDicts() ); } -void MainWindow::translateInputFinished() +void MainWindow::translateInputFinished( bool checkModifiers ) { QString word = ui.translateLine->text(); if ( word.size() ) { Qt::KeyboardModifiers mods = QApplication::keyboardModifiers(); - if ( mods & (Qt::ControlModifier | Qt::ShiftModifier) ) + if ( checkModifiers && ( mods & (Qt::ControlModifier | Qt::ShiftModifier) ) ) addNewTab(); showTranslationFor( word ); diff --git a/mainwindow.hh b/mainwindow.hh index ee5d4bcb..7ac16064 100644 --- a/mainwindow.hh +++ b/mainwindow.hh @@ -248,7 +248,7 @@ private slots: void currentGroupChanged( 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. void handleEsc();