Fix #695, close Translation Assistant when there are no more lines to translate.

Originally committed to SVN as r2199.
This commit is contained in:
Niels Martin Hansen 2008-06-15 12:20:51 +00:00
parent 6f23c635be
commit 1c60d35d16

View file

@ -335,7 +335,13 @@ void DialogTranslation::OnTransBoxKey(wxKeyEvent &event) {
// Next // Next
if (Hotkeys.IsPressed(_T("Translation Assistant Accept"))) { if (Hotkeys.IsPressed(_T("Translation Assistant Accept"))) {
JumpToLine(curline,curblock+1); // JumpToLine() returns false if the requested line doesn't exist.
// Assume that means we were on the last line.
if (!JumpToLine(curline,curblock+1)) {
wxMessageBox(_("No more lines to translate."));
EndModal(1);
return;
}
TransText->ClearAll(); TransText->ClearAll();
TransText->SetFocus(); TransText->SetFocus();
} }