20 #include "shellscript.h"
22 #include <kapplication.h>
23 #include <dcopclient.h>
25 #include <kgenericfactory.h>
26 #include <scriptclientinterface.h>
31 ShellScript::ShellScript(
KScriptClientInterface *parent, const
char *, const TQStringList & ) : ScriptClientInterface(parent)
34 connect ( m_script, TQT_SIGNAL(processExited(
KProcess *)), TQT_SLOT(Exit(
KProcess *)));
35 connect ( m_script, TQT_SIGNAL(receivedStdout(
KProcess *,
char *,
int)), TQT_SLOT(stdOut(
KProcess *,
char *,
int )));
36 connect ( m_script, TQT_SIGNAL(receivedStderr(
KProcess *,
char *,
int)), TQT_SLOT(stdErr(
KProcess *,
char *,
int )));
41 ShellScript::~ShellScript()
45 TQString ShellScript::script()
const
50 void ShellScript::setScript(
const TQString &scriptFile )
52 m_scriptName = scriptFile;
53 *m_script <<
"sh" << m_scriptName << kapp->dcopClient()->appId();
56 void ShellScript::setScript(
const TQString &,
const TQString & )
61 void ShellScript::run(TQObject *,
const TQVariant &)
65 void ShellScript::kill()
67 if (!m_script->kill())
71 void ShellScript::Exit(
KProcess *proc)
73 ScriptClientInterface->done((KScriptClientInterface::Result)proc->
exitStatus(),
"");
76 void ShellScript::stdErr(
KProcess *,
char *buffer,
int)
78 ScriptClientInterface->error(buffer);
80 void ShellScript::stdOut(
KProcess *,
char *buffer,
int)
82 ScriptClientInterface->output(buffer);
85 #include "shellscript.moc"