diff options
Diffstat (limited to 'ksayit/KTTSD_Lib/kttsdlibsetupimpl.cpp')
-rw-r--r-- | ksayit/KTTSD_Lib/kttsdlibsetupimpl.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/ksayit/KTTSD_Lib/kttsdlibsetupimpl.cpp b/ksayit/KTTSD_Lib/kttsdlibsetupimpl.cpp new file mode 100644 index 0000000..0c7bc8f --- /dev/null +++ b/ksayit/KTTSD_Lib/kttsdlibsetupimpl.cpp @@ -0,0 +1,76 @@ +// +// C++ Implementation: kttsdlibsetupimpl +// +// Description: +// +// +// Author: Robert Vogl <voglrobe@lapislazuli>, (C) 2004 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include <stdio.h> + +// Qt includes +#include <qpushbutton.h> + +// KDE includes +#include <kdebug.h> +#include <klocale.h> +#include <kmessagebox.h> + +// App specific includes +#include "kttsdlibsetupimpl.h" + +KTTSDlibSetupImpl::KTTSDlibSetupImpl(QWidget *parent, const char *name) + : KTTSDlibSetup(parent, name) +{ +} + + +KTTSDlibSetupImpl::~KTTSDlibSetupImpl() +{ +} + + +void KTTSDlibSetupImpl::slotLaunchControlcenter() +{ + kdDebug(100200) << "KTTSDlibSetupImpl::slotLaunchControlCenter()" << endl; + + // check if controllcenter module for KTTSD exists + FILE *fp; + char cmdresult[20]; + + // if ( (fp = popen("kcmshell --list | grep kcmkttsmgr", "r")) != NULL){ + if ( (fp = popen("kcmshell --list | grep kcmkttsd", "r")) != NULL){ + fgets(cmdresult, 18, fp); + pclose(fp); + } + if ( !QCString(cmdresult).contains("kcmkttsd") ){ + QString error = i18n("Control Center Module for KTTSD not found."); + KMessageBox::sorry(this, error, i18n("Problem")); + return; + } + + // invoke the Control Center Module + KProcess *kcmproc = new KProcess(); + connect(kcmproc, SIGNAL(processExited(KProcess*)), + this, SLOT(slotKCMProcessExited(KProcess*)) ); + (*kcmproc) << "kcmshell"; + (*kcmproc) << "kcmkttsd"; + kcmproc->start(KProcess::NotifyOnExit); + + kcm_Button->setEnabled(false); +} + + +void KTTSDlibSetupImpl::slotKCMProcessExited(KProcess *p) +{ + kdDebug(100200) << "slotKCMProcessExited()" << endl; + kcm_Button->setEnabled(true); +} + + + +#include "kttsdlibsetupimpl.moc" |