From 00bb99ac80741fc50ef8a289719373032f2391eb Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksayit/KTTSD_Lib/kttsdlibsetupimpl.cpp | 76 ++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 ksayit/KTTSD_Lib/kttsdlibsetupimpl.cpp (limited to 'ksayit/KTTSD_Lib/kttsdlibsetupimpl.cpp') 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 , (C) 2004 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include + +// Qt includes +#include + +// KDE includes +#include +#include +#include + +// 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" -- cgit v1.2.1