Add error message for empty source language
This commit is contained in:
parent
79b3092411
commit
56e502c3c9
@ -706,6 +706,14 @@ in %1</source>
|
||||
<translation>Ошибка инициализации OCR: %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Recognizer</name>
|
||||
<message>
|
||||
<location filename="../../src/ocr/recognizer.cpp" line="36"/>
|
||||
<source>No source language set. Check settings</source>
|
||||
<translation>Не задан исходный язык. Проверьте настройки</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ResultEditor</name>
|
||||
<message>
|
||||
|
@ -32,6 +32,12 @@ void Recognizer::recognize(const TaskPtr &task)
|
||||
SOFT_ASSERT(task, return );
|
||||
SOFT_ASSERT(task->isValid(), return );
|
||||
|
||||
if (task->sourceLanguage.isEmpty()) {
|
||||
task->error = tr("No source language set. Check settings");
|
||||
manager_.recognized(task);
|
||||
return;
|
||||
}
|
||||
|
||||
queue_.push_back(task);
|
||||
if (queue_.size() == 1)
|
||||
processQueue();
|
||||
|
Loading…
Reference in New Issue
Block a user