Commit cb0ddc56 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile without texttospeach

parent acec3c63
Pipeline #141845 passed with stage
in 1 minute and 28 seconds
......@@ -12,7 +12,10 @@
#include "articleviewerwebenginepage.h"
#include "urlhandler/webengine/urlhandlerwebengine.h"
#include "webengine/urlhandlerwebenginemanager.h"
#include <kpimtextedit/kpimtextedit-texttospeech.h>
#ifdef KPIMTEXTEDIT_TEXT_TO_SPEECH
#include <KPIMTextEdit/TextToSpeech>
#endif
#include <WebEngineViewer/InterceptorManager>
#include <WebEngineViewer/WebEngineAccessKey>
#include <WebEngineViewer/WebEngineManageScript>
......@@ -305,10 +308,12 @@ void ArticleViewerWebEngine::slotWebHitFinished(const WebEngineViewer::WebHitTes
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("tab_unmute")));
popup.addSeparator();
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("find_in_messages")));
#ifdef KPIMTEXTEDIT_TEXT_TO_SPEECH
if (KPIMTextEdit::TextToSpeech::self()->isReady()) {
popup.addSeparator();
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("speak_text")));
}
#endif
popup.exec(mapToGlobal(result.pos()));
}
......
......@@ -12,9 +12,9 @@
#include <KLocalizedString>
#include <MessageViewer/ViewerPluginToolManager>
#include <QVBoxLayout>
#ifdef KPIMTEXTEDIT_TEXT_TO_SPEECH
#include <KPIMTextEdit/kpimtextedit/texttospeechwidget.h>
#endif
#include <KPIMTextEdit/SlideContainer>
#include <WebEngineViewer/FindBarWebEngineView>
......@@ -45,7 +45,9 @@ template<typename Arg, typename R, typename C> InvokeWrapper<Arg, R, C> invoke(R
ArticleViewerWebEngineWidgetNg::ArticleViewerWebEngineWidgetNg(ArticleViewerWebEngine *customViewer, KActionCollection *ac, QWidget *parent)
: QWidget(parent)
, mArticleViewerNg(customViewer)
#ifdef KPIMTEXTEDIT_TEXT_TO_SPEECH
, mTextToSpeechWidget(new KPIMTextEdit::TextToSpeechWidget(this))
#endif
, mSliderContainer(new KPIMTextEdit::SlideContainer(this))
, mTrackingWarningWidget(new WebEngineViewer::TrackingWarningWidget(this))
......@@ -62,10 +64,10 @@ void ArticleViewerWebEngineWidgetNg::initializeLayout(KActionCollection *ac)
{
auto layout = new QVBoxLayout(this);
layout->setContentsMargins({});
#ifdef KPIMTEXTEDIT_TEXT_TO_SPEECH
mTextToSpeechWidget->setObjectName(QStringLiteral("texttospeechwidget"));
layout->addWidget(mTextToSpeechWidget);
#endif
mTrackingWarningWidget->setObjectName(QStringLiteral("mTrackingWarningWidget"));
layout->addWidget(mTrackingWarningWidget);
......@@ -107,7 +109,9 @@ void ArticleViewerWebEngineWidgetNg::slotFind()
void ArticleViewerWebEngineWidgetNg::slotSpeakText()
{
const QString text = mArticleViewerNg->selectedText();
#ifdef KPIMTEXTEDIT_TEXT_TO_SPEECH
mTextToSpeechWidget->say(text);
#endif
}
void ArticleViewerWebEngineWidgetNg::saveCurrentPosition()
......
......@@ -8,6 +8,8 @@
#include "akregator_export.h"
#include "articleviewerwebengine.h"
#include <kpimtextedit/kpimtextedit-texttospeech.h>
#include <QWidget>
class QPrinter;
class KActionCollection;
......@@ -55,7 +57,9 @@ private:
void printRequested(QWebEnginePage *page);
WebEngineViewer::FindBarWebEngineView *mFindBarWebView = nullptr;
ArticleViewerWebEngine *mArticleViewerNg = nullptr;
#ifdef KPIMTEXTEDIT_TEXT_TO_SPEECH
KPIMTextEdit::TextToSpeechWidget *const mTextToSpeechWidget;
#endif
KPIMTextEdit::SlideContainer *const mSliderContainer;
WebEngineViewer::TrackingWarningWidget *const mTrackingWarningWidget;
QPrinter *mCurrentPrinter = nullptr;
......
......@@ -15,7 +15,10 @@
#include <KActionCollection>
#include <KActionMenu>
#include <KIO/KUriFilterSearchProviderActions>
#include <kpimtextedit/kpimtextedit-texttospeech.h>
#ifdef KPIMTEXTEDIT_TEXT_TO_SPEECH
#include <KPIMTextEdit/TextToSpeech>
#endif
#include <QContextMenuEvent>
#include <QMenu>
#include <QWebEngineHistory>
......@@ -138,11 +141,13 @@ void AkrWebEngineViewer::slotWebHitFinished(const WebEngineViewer::WebHitTestRes
popup.addActions(interceptorUrlActions);
}
popup.addSeparator();
#ifdef KPIMTEXTEDIT_TEXT_TO_SPEECH
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("find_in_messages")));
if (KPIMTextEdit::TextToSpeech::self()->isReady()) {
popup.addSeparator();
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("speak_text")));
}
#endif
popup.exec(mapToGlobal(result.pos()));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment