mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +00:00
Focus word list in history review mode
This commit is contained in:
parent
13e3c630dc
commit
5ceab47fb3
|
@ -2645,12 +2645,19 @@ static bool needHideSearchPane;
|
||||||
ui.showHideHistory->setText( tr( "&Show" ) );
|
ui.showHideHistory->setText( tr( "&Show" ) );
|
||||||
showHistory = false;
|
showHistory = false;
|
||||||
|
|
||||||
|
disconnect( &focusTranslateLineAction, SIGNAL( triggered() ),
|
||||||
|
this, SLOT( focusWordList() ) );
|
||||||
|
|
||||||
|
connect( &focusTranslateLineAction, SIGNAL( triggered() ),
|
||||||
|
this, SLOT( focusTranslateLine() ) );
|
||||||
|
|
||||||
connect( ui.translateLine, SIGNAL( textChanged( QString const & ) ),
|
connect( ui.translateLine, SIGNAL( textChanged( QString const & ) ),
|
||||||
this, SLOT( translateInputChanged( QString const & ) ) );
|
this, SLOT( translateInputChanged( QString const & ) ) );
|
||||||
|
|
||||||
ui.translateLine->clear();
|
ui.translateLine->clear();
|
||||||
ui.translateLine->setEnabled( true );
|
ui.translateLine->setEnabled( true );
|
||||||
ui.translateLine->setProperty( "noResults", false );
|
ui.translateLine->setProperty( "noResults", false );
|
||||||
|
focusTranslateLine();
|
||||||
setStyleSheet( styleSheet() );
|
setStyleSheet( styleSheet() );
|
||||||
|
|
||||||
ui.wordList->clear();
|
ui.wordList->clear();
|
||||||
|
@ -2664,6 +2671,12 @@ static bool needHideSearchPane;
|
||||||
disconnect( ui.translateLine, SIGNAL( textChanged( QString const & ) ),
|
disconnect( ui.translateLine, SIGNAL( textChanged( QString const & ) ),
|
||||||
this, SLOT( translateInputChanged( QString const & ) ) );
|
this, SLOT( translateInputChanged( QString const & ) ) );
|
||||||
|
|
||||||
|
disconnect( &focusTranslateLineAction, SIGNAL( triggered() ),
|
||||||
|
this, SLOT( focusTranslateLine() ) );
|
||||||
|
|
||||||
|
connect( &focusTranslateLineAction, SIGNAL( triggered() ),
|
||||||
|
this, SLOT( focusWordList() ) );
|
||||||
|
|
||||||
if( !ui.searchPane->isVisible() )
|
if( !ui.searchPane->isVisible() )
|
||||||
{
|
{
|
||||||
ui.searchPane->show();
|
ui.searchPane->show();
|
||||||
|
@ -2681,6 +2694,8 @@ static bool needHideSearchPane;
|
||||||
setStyleSheet( styleSheet() );
|
setStyleSheet( styleSheet() );
|
||||||
|
|
||||||
fillWordListFromHistory();
|
fillWordListFromHistory();
|
||||||
|
focusWordList();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2842,3 +2857,9 @@ void MainWindow::fillWordListFromHistory()
|
||||||
|
|
||||||
ui.wordList->setUpdatesEnabled( true );
|
ui.wordList->setUpdatesEnabled( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::focusWordList()
|
||||||
|
{
|
||||||
|
if( ui.wordList->count() > 0 )
|
||||||
|
ui.wordList->setFocus();
|
||||||
|
}
|
||||||
|
|
|
@ -329,6 +329,7 @@ private slots:
|
||||||
void on_showHideHistory_activated();
|
void on_showHideHistory_activated();
|
||||||
void on_exportHistory_activated();
|
void on_exportHistory_activated();
|
||||||
void on_importHistory_activated();
|
void on_importHistory_activated();
|
||||||
|
void focusWordList();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue