diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 4d935b242..90857636f 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -186,11 +186,13 @@ OkularTTS* PageViewPrivate::tts() { if ( !m_tts ) { - m_tts = new OkularTTS( messageWindow, q ); + m_tts = new OkularTTS( q ); if ( aSpeakStop ) { QObject::connect( m_tts, SIGNAL( hasSpeechs( bool ) ), aSpeakStop, SLOT( setEnabled( bool ) ) ); + QObject::connect( m_tts, SIGNAL( errorMessage( const QString & ) ), + q, SLOT( errorMessage( const QString & ) ) ); } } diff --git a/ui/tts.cpp b/ui/tts.cpp index 239e81cc6..d02d77e2e 100644 --- a/ui/tts.cpp +++ b/ui/tts.cpp @@ -15,7 +15,6 @@ #include #include -#include "pageviewutils.h" #include "kspeechinterface.h" /* Private storage. */ @@ -31,7 +30,6 @@ public: void teardownIface(); OkularTTS *q; - PageViewMessage *messageWindow; org::kde::KSpeech* kspeech; QSet< int > jobs; }; @@ -51,7 +49,7 @@ void OkularTTS::Private::setupIface() QString error; if ( KToolInvocation::startServiceByDesktopName( "kttsd", QStringList(), &error ) ) { - messageWindow->display( i18n( "Starting KTTSD Failed: %1", error ) ); + emit q->errorMessage( i18n( "Starting KTTSD Failed: %1", error ) ); } else { @@ -82,10 +80,9 @@ void OkularTTS::Private::teardownIface() } -OkularTTS::OkularTTS( PageViewMessage *messageWindow, QObject *parent ) +OkularTTS::OkularTTS( QObject *parent ) : QObject( parent ), d( new Private( this ) ) { - d->messageWindow = messageWindow; } OkularTTS::~OkularTTS() diff --git a/ui/tts.h b/ui/tts.h index a335a0d2b..d9eb59324 100644 --- a/ui/tts.h +++ b/ui/tts.h @@ -12,13 +12,11 @@ #include -class PageViewMessage; - class OkularTTS : public QObject { Q_OBJECT public: - OkularTTS( PageViewMessage *messageWindow, QObject *parent = 0 ); + OkularTTS( QObject *parent = 0 ); ~OkularTTS(); void say( const QString &text ); @@ -26,6 +24,7 @@ class OkularTTS : public QObject signals: void hasSpeechs( bool has ); + void errorMessage( const QString &message ); private slots: void slotServiceUnregistered( const QString& );