Diffstat (limited to 'noncore/apps/opie-console/emulation_handler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index 8846959..df8e573 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp @@ -8,3 +8,3 @@ #include "emulation_handler.h" - +#include "script.h" @@ -15,2 +15,3 @@ EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const c m_teWid->setMinimumSize(150, 70 ); + m_script = 0; parent->resize( m_teWid->calcSize(80, 24 ) ); @@ -30,2 +31,4 @@ EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const c EmulationHandler::~EmulationHandler() { + if (isRecording()) + clearScript(); delete m_teEmu; @@ -33,2 +36,3 @@ EmulationHandler::~EmulationHandler() { } + void EmulationHandler::load( const Profile& prof) { @@ -47,2 +51,4 @@ void EmulationHandler::recvEmulation(const char* src, int len ) { + if (isRecording()) + m_script->append(ar); emit send(ar); @@ -147 +153,27 @@ QPushButton* EmulationHandler::cornerButton() { } + + +Script *EmulationHandler::script() { + return m_script; +} + +bool EmulationHandler::isRecording() { + return (m_script != 0); +} + +void EmulationHandler::startRecording() { + if (!isRecording()) + m_script = new Script(); +} + +void EmulationHandler::clearScript() { + if (isRecording()) { + delete m_script; + m_script = 0; + } +} + +void EmulationHandler::runScript(const Script *script) { + emit send(script->script()); +} + |