diff --git a/Pdf4QtViewer/pdfsidebarwidget.cpp b/Pdf4QtViewer/pdfsidebarwidget.cpp index aea1f30..c23617c 100644 --- a/Pdf4QtViewer/pdfsidebarwidget.cpp +++ b/Pdf4QtViewer/pdfsidebarwidget.cpp @@ -36,6 +36,7 @@ #include #include #include +#include namespace pdfviewer { @@ -275,6 +276,20 @@ void PDFSidebarWidget::selectPage(Page page) ui->stackedWidget->setCurrentWidget(pageInfo.second.page); } } + + if (page == Speech && ui->speechVoiceComboBox->count() == 0) + { + // Check, if speech engine is properly set + QStringList speechEngines = QTextToSpeech::availableEngines(); + if (speechEngines.isEmpty()) + { + QMessageBox::critical(this, tr("Error"), tr("Speech feature is unavailable. No speech engines detected. If you're using Linux, please install speech libraries like 'flite' or 'speechd'.")); + } + else + { + QMessageBox::critical(this, tr("Error"), tr("The speech feature is available, but its options are not properly set. Please check the speech settings in the options dialog.")); + } + } } std::vector PDFSidebarWidget::getValidPages() const