author | wazlaf <wazlaf> | 2002-10-20 14:53:08 (UTC) |
---|---|---|
committer | wazlaf <wazlaf> | 2002-10-20 14:53:08 (UTC) |
commit | 18ba3be9ca69c42476e310649e3068d2d5f8a03b (patch) (side-by-side diff) | |
tree | d6a68e8f1a319ef8320d714356beebcf440a630f /noncore/apps/opie-console/emulation_handler.cpp | |
parent | 9f442f5af601d1e15bb4d0509ed012e61609260d (diff) | |
download | opie-18ba3be9ca69c42476e310649e3068d2d5f8a03b.zip opie-18ba3be9ca69c42476e310649e3068d2d5f8a03b.tar.gz opie-18ba3be9ca69c42476e310649e3068d2d5f8a03b.tar.bz2 |
scripting fixed (moved from emulation_layer to emulation_handler). Scripts now use QByteArray instead of QString
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()); +} + |