Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

ScriptRunner Class Reference

#include <ScriptRunner.h>

List of all members.

Public Member Functions

bool processError ()
bool processRunning ()
 ScriptRunner (QWidget *parent, QString scriptName, QString mainWorkDir)
 ~ScriptRunner ()

Private Slots

void okButtonPressed ()
void processExited ()
void readFromStderr ()
void readFromStdout ()
void stopButtonPressed ()

Private Member Functions

ScriptRunner operator= (const ScriptRunner &)
void runScript (QString scriptName, QStringList scriptParameters)
void runScript (QString scriptName)
void runScript (const char *scriptName)
 ScriptRunner (const ScriptRunner &)
bool stopScript ()

Private Attributes

QPushButton * okButton
bool procErr
QProcess * process
QTextEdit * scriptMessages
QString workingDirectory


Detailed Description

Runs scripts in the /scripts directory. Can pass parameters to them but script is assumed to be self contained. Use the program 'expect' within the script if interaction is required with an external program.

Definition at line 41 of file ScriptRunner.h.


Constructor & Destructor Documentation

ScriptRunner::ScriptRunner QWidget *  parent,
QString  scriptName,
QString  mainWorkDir
 

Constructor.

Definition at line 36 of file ScriptRunner.cpp.

References okButton, okButtonPressed(), process, processExited(), readFromStderr(), readFromStdout(), runScript(), scriptMessages, stopButtonPressed(), and workingDirectory.

ScriptRunner::~ScriptRunner  ) 
 

Destructor.

Definition at line 78 of file ScriptRunner.cpp.

References process.

ScriptRunner::ScriptRunner const ScriptRunner  )  [private]
 

Declare copy constructor private so it cannot be used inadvertently.


Member Function Documentation

void ScriptRunner::okButtonPressed  )  [private, slot]
 

Slot for when ok button is pressed.

Definition at line 108 of file ScriptRunner.cpp.

Referenced by ScriptRunner().

ScriptRunner ScriptRunner::operator= const ScriptRunner  )  [private]
 

Declare assignment private so it cannot be used inadvertently.

bool ScriptRunner::processError  ) 
 

Returns true if there has been an error running the script.

Definition at line 92 of file ScriptRunner.cpp.

References procErr.

void ScriptRunner::processExited  )  [private, slot]
 

Slot called when process exits.

Definition at line 114 of file ScriptRunner.cpp.

References okButton, and scriptMessages.

Referenced by ScriptRunner().

bool ScriptRunner::processRunning  ) 
 

Returns true if process is running.

Definition at line 98 of file ScriptRunner.cpp.

References process.

void ScriptRunner::readFromStderr  )  [private, slot]
 

Prints out error from process.

Definition at line 124 of file ScriptRunner.cpp.

References process, and scriptMessages.

Referenced by ScriptRunner().

void ScriptRunner::readFromStdout  )  [private, slot]
 

Slot called when there is something to read from standard out.

Definition at line 134 of file ScriptRunner.cpp.

References process, and scriptMessages.

Referenced by ScriptRunner().

void ScriptRunner::runScript QString  scriptName,
QStringList  scriptParameters
[private]
 

Runs a script with a given set of parameters.

Definition at line 195 of file ScriptRunner.cpp.

References okButton, procErr, process, scriptMessages, and workingDirectory.

void ScriptRunner::runScript QString  scriptName  )  [private]
 

Runs the named script.

Definition at line 163 of file ScriptRunner.cpp.

References okButton, procErr, process, scriptMessages, and workingDirectory.

void ScriptRunner::runScript const char *  scriptName  )  [private]
 

Overloaded run script method.

Definition at line 157 of file ScriptRunner.cpp.

Referenced by ScriptRunner().

void ScriptRunner::stopButtonPressed  )  [private, slot]
 

Slot for when stop button is pressed.

Definition at line 146 of file ScriptRunner.cpp.

References okButton, and stopScript().

Referenced by ScriptRunner().

bool ScriptRunner::stopScript  )  [private]
 

Politely ask process to quit and kill it if it does not respond.

Definition at line 228 of file ScriptRunner.cpp.

References process.

Referenced by stopButtonPressed().


Member Data Documentation

QPushButton* ScriptRunner::okButton [private]
 

Hides the dialog. This is disabled whilst the script is running.

Definition at line 75 of file ScriptRunner.h.

Referenced by processExited(), runScript(), ScriptRunner(), and stopButtonPressed().

bool ScriptRunner::procErr [private]
 

Flag to record errors executing the script.

Definition at line 66 of file ScriptRunner.h.

Referenced by processError(), and runScript().

QProcess* ScriptRunner::process [private]
 

The process that executes the script.

Definition at line 69 of file ScriptRunner.h.

Referenced by processRunning(), readFromStderr(), readFromStdout(), runScript(), ScriptRunner(), stopScript(), and ~ScriptRunner().

QTextEdit* ScriptRunner::scriptMessages [private]
 

QTextEdit to display the output from the script.

Definition at line 72 of file ScriptRunner.h.

Referenced by processExited(), readFromStderr(), readFromStdout(), runScript(), and ScriptRunner().

QString ScriptRunner::workingDirectory [private]
 

The main directory of the application. This should contain containing the scripts in a scripts subdirectory.

Definition at line 63 of file ScriptRunner.h.

Referenced by runScript(), and ScriptRunner().


The documentation for this class was generated from the following files:
Generated on Mon Sep 3 22:29:05 2007 for SpikeStream Application by  doxygen 1.4.4