mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
Show new translation after group changing
This commit is contained in:
parent
e4adc5f168
commit
52fbeac618
|
@ -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 );
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue