20 #include "shellscript.h"
22 #include <tdeapplication.h>
23 #include <dcopclient.h>
25 #include <kgenericfactory.h>
26 #include <scriptclientinterface.h>
31 ShellScript::ShellScript(
KScriptClientInterface *parent, const
char *, const TQStringList & ) : ScriptClientInterface(parent)
35 connect ( m_script, TQ_SIGNAL(receivedStdout(
TDEProcess *,
char *,
int)), TQ_SLOT(stdOut(
TDEProcess *,
char *,
int )));
36 connect ( m_script, TQ_SIGNAL(receivedStderr(
TDEProcess *,
char *,
int)), TQ_SLOT(stdErr(
TDEProcess *,
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())
73 ScriptClientInterface->done((KScriptClientInterface::Result)proc->
exitStatus(),
"");
76 void ShellScript::stdErr(
TDEProcess *,
char *buffer,
int)
78 ScriptClientInterface->error(buffer);
80 void ShellScript::stdOut(
TDEProcess *,
char *buffer,
int)
82 ScriptClientInterface->output(buffer);
85 #include "shellscript.moc"
This class is used for allowing feedback to the main system.