void Emulation::receiveData(const char* text, int length) { emit stateSet(NOTIFYACTIVITY); bufferedUpdate(); //QString unicodeText = _decoder->toUnicode(text,length); QString unicodeText = text; //send characters to terminal emulator for (int i=0;i<unicodeText.length();i++) { receiveChar(unicodeText[i].unicode()); } //look for z-modem indicator //-- someone who understands more about z-modems that I do may be able to move //this check into the above for loop? for (int i=0;i<length;i++) { if (text[i] == '\030') { if ((length-i-1 > 3) && (strncmp(text+i+1, "B00", 3) == 0)) emit zmodemDetected(); } } }
TESession::TESession(TEWidget* _te, const TQString &_term, ulong _winId, const TQString &_sessionId, const TQString &_initial_cwd) : DCOPObject( _sessionId.latin1() ) , sh(0) , connected(true) , monitorActivity(false) , monitorSilence(false) , notifiedActivity(false) , masterMode(false) , autoClose(true) , wantedClose(false) , schema_no(0) , font_no(3) , silence_seconds(10) , add_to_utmp(true) , xon_xoff(false) , pgm(TQString()) , args(TQStrList()) , sessionId(_sessionId) , cwd("") , initial_cwd(_initial_cwd) , zmodemBusy(false) , zmodemProc(0) , zmodemProgress(0) , encoding_no(0) { //kdDebug(1211)<<"TESession ctor() new TEPty"<<endl; te = _te; //kdDebug(1211)<<"TESession ctor() new TEmuVt102"<<endl; em = new TEmuVt102(te); font_h = te-> fontHeight(); font_w = te-> fontWidth(); TQObject::connect(te,TQT_SIGNAL(changedContentSizeSignal(int,int)), this,TQT_SLOT(onContentSizeChange(int,int))); TQObject::connect(te,TQT_SIGNAL(changedFontMetricSignal(int,int)), this,TQT_SLOT(onFontMetricChange(int,int))); term = _term; winId = _winId; iconName = "konsole"; setPty( new TEPty() ); connect( em, TQT_SIGNAL( changeTitle( int, const TQString & ) ), this, TQT_SLOT( setUserTitle( int, const TQString & ) ) ); connect( em, TQT_SIGNAL( notifySessionState(int) ), this, TQT_SLOT( notifySessionState(int) ) ); monitorTimer = new TQTimer(this); connect(monitorTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(monitorTimerDone())); connect( em, TQT_SIGNAL( zmodemDetected() ), this, TQT_SLOT(slotZModemDetected())); connect( em, TQT_SIGNAL( changeTabTextColor( int ) ), this, TQT_SLOT( changeTabTextColor( int ) ) ); //kdDebug(1211)<<"TESession ctor() done"<<endl; }
void TESession::emitZModemDetected() { emit zmodemDetected(this); }