summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/emulation_handler.cpp
Unidiff
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.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index 956ac76..e045aef 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -4,2 +4,3 @@
4#include "script.h" 4#include "script.h"
5#include "logger.h"
5 6
@@ -7,2 +8,6 @@
7#include <opie2/odebug.h> 8#include <opie2/odebug.h>
9
10#include <qfile.h>
11#include <qtextstream.h>
12
8using namespace Opie::Core; 13using namespace Opie::Core;
@@ -18,2 +23,3 @@ EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const c
18 m_script = 0; 23 m_script = 0;
24 m_log = 0;
19 parent->resize( m_teWid->calcSize(80, 24 ) ); 25 parent->resize( m_teWid->calcSize(80, 24 ) );
@@ -40,2 +46,3 @@ EmulationHandler::~EmulationHandler() {
40 delete m_teWid; 46 delete m_teWid;
47 delete m_log;
41} 48}
@@ -70,3 +77,7 @@ void EmulationHandler::recv( const QByteArray& ar) {
70 m_teEmu->onRcvBlock(ar.data(), ar.count() ); 77 m_teEmu->onRcvBlock(ar.data(), ar.count() );
78 if ( isLogging() ) {
79 m_log->append( ar );
80 }
71} 81}
82
72void EmulationHandler::recvEmulation(const char* src, int len ) { 83void EmulationHandler::recvEmulation(const char* src, int len ) {
@@ -79,2 +90,4 @@ void EmulationHandler::recvEmulation(const char* src, int len ) {
79} 90}
91
92
80QWidget* EmulationHandler::widget() { 93QWidget* EmulationHandler::widget() {
@@ -186,2 +199,6 @@ bool EmulationHandler::isRecording() {
186 199
200bool EmulationHandler::isLogging() {
201 return (m_log != 0);
202}
203
187void EmulationHandler::startRecording() { 204void EmulationHandler::startRecording() {
@@ -191,2 +208,12 @@ void EmulationHandler::startRecording() {
191 208
209void EmulationHandler::startLogging(const QString fileName) {
210 m_logFileName = fileName;
211 if (!isLogging())
212 m_log = new Logger(m_logFileName);
213}
214
215QString EmulationHandler::logFileName() {
216 return m_logFileName;
217}
218
192void EmulationHandler::clearScript() { 219void EmulationHandler::clearScript() {
@@ -198,2 +225,9 @@ void EmulationHandler::clearScript() {
198 225
226void EmulationHandler::clearLog() {
227 if (isLogging()) {
228 delete m_log;
229 m_log = 0;
230 }
231}
232
199void EmulationHandler::runScript(const Script *script) { 233void EmulationHandler::runScript(const Script *script) {