diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 00bb99ac80741fc50ef8a289719373032f2391eb (patch) | |
tree | 3a5a9bf72f942784b38bf77dd66c534662fab5f2 /ksayit/KTTSD_Lib/kttsdlibsetupimpl.cpp | |
download | tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.tar.gz tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.zip |
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
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" |