summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/session.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/session.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/session.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/apps/embeddedkonsole/session.cpp b/core/apps/embeddedkonsole/session.cpp
index 043b8db..a94712a 100644
--- a/core/apps/embeddedkonsole/session.cpp
+++ b/core/apps/embeddedkonsole/session.cpp
@@ -6,119 +6,119 @@
6 /* */ 6 /* */
7/* -------------------------------------------------------------------------- */ 7/* -------------------------------------------------------------------------- */
8#include "session.h" 8#include "session.h"
9// #include <kdebug.h> 9// #include <kdebug.h>
10 10
11#include <stdlib.h> 11#include <stdlib.h>
12 12
13#define HERE fprintf(stderr,"%s(%d): here\n",__FILE__,__LINE__) 13#define HERE fprintf(stderr,"%s(%d): here\n",__FILE__,__LINE__)
14 14
15/*! \class TESession 15/*! \class TESession
16 16
17 Sessions are combinations of TEPTy and Emulations. 17 Sessions are combinations of TEPTy and Emulations.
18 18
19 The stuff in here does not belong to the terminal emulation framework, 19 The stuff in here does not belong to the terminal emulation framework,
20 but to main.C. It serves it's duty by providing a single reference 20 but to main.C. It serves it's duty by providing a single reference
21 to TEPTy/Emulation pairs. In fact, it is only there to demonstrate one 21 to TEPTy/Emulation pairs. In fact, it is only there to demonstrate one
22 of the abilities of the framework - multible sessions. 22 of the abilities of the framework - multible sessions.
23*/ 23*/
24 24
25TESession::TESession(QMainWindow* main, TEWidget* _te, const char* _pgm, QStrList & _args, const char *_term) : schema_no(0), font_no(3), pgm(_pgm), args(_args) 25TESession::TESession(QMainWindow* main, TEWidget* _te, const char* _pgm, QStrList & _args, const char *_term) : schema_no(0), font_no(3), pgm(_pgm), args(_args)
26{ 26{
27 te = _te; 27 te = _te;
28 term = _term; 28 term = _term;
29 29
30 // sh = new TEPty(); 30 // sh = new TEPty();
31 sh = new MyPty(); 31 sh = new MyPty();
32 em = new TEmuVt102(te); 32 em = new TEmuVt102(te);
33 33
34 sh->setSize(te->Lines(),te->Columns()); // not absolutely nessesary 34 sh->setSize(te->Lines(),te->Columns()); // not absolutely nessesary
35 QObject::connect( sh,SIGNAL(block_in(const char*,int)), 35 QObject::connect( sh,SIGNAL(block_in(const char*,int)),
36 em,SLOT(onRcvBlock(const char*,int)) ); 36 em,SLOT(onRcvBlock(const char*,int)) );
37 QObject::connect( em,SIGNAL(ImageSizeChanged(int,int)), 37 QObject::connect( em,SIGNAL(ImageSizeChanged(int,int)),
38 sh,SLOT(setSize(int,int))); 38 sh,SLOT(setSize(int,int)));
39 39
40 // 'main' should do those connects itself, somehow. 40 // 'main' should do those connects itself, somehow.
41 // These aren't KTMW's slots, but konsole's.(David) 41 // These aren't KTMW's slots, but konsole's.(David)
42 42
43/* 43/*
44 QObject::connect( em,SIGNAL(ImageSizeChanged(int,int)), 44 QObject::connect( em,SIGNAL(ImageSizeChanged(int,int)),
45 main,SLOT(notifySize(int,int))); 45 main,SLOT(notifySize(int,int)));
46*/ 46*/
47 QObject::connect( em,SIGNAL(sndBlock(const char*,int)), 47 QObject::connect( em,SIGNAL(sndBlock(const char*,int)),
48 sh,SLOT(send_bytes(const char*,int)) ); 48 sh,SLOT(send_bytes(const char*,int)) );
49 QObject::connect( em,SIGNAL(changeColumns(int)), 49 QObject::connect( em,SIGNAL(changeColumns(int)),
50 main,SLOT(changeColumns(int)) ); 50 main,SLOT(changeColumns(int)) );
51 51
52 52
53 53
54 QObject::connect( em,SIGNAL(changeTitle(int, const QString&)), 54 QObject::connect( em,SIGNAL(changeTitle(int,const QString&)),
55 this,SLOT(changeTitle(int, const QString&)) ); 55 this,SLOT(changeTitle(int,const QString&)) );
56 56
57 QObject::connect( sh,SIGNAL(done(int)), this,SLOT(done(int)) ); 57 QObject::connect( sh,SIGNAL(done(int)), this,SLOT(done(int)) );
58} 58}
59 59
60 60
61 61
62void TESession::run() 62void TESession::run()
63{ 63{
64 //kdDebug() << "Running the session!" << pgm << "\n"; 64 //kdDebug() << "Running the session!" << pgm << "\n";
65 sh->run(pgm,args,term.data(),FALSE); 65 sh->run(pgm,args,term.data(),FALSE);
66} 66}
67 67
68void TESession::kill(int ) // signal) 68void TESession::kill(int ) // signal)
69{ 69{
70// sh->kill(signal); 70// sh->kill(signal);
71} 71}
72 72
73TESession::~TESession() 73TESession::~TESession()
74{ 74{
75 QObject::disconnect( sh, SIGNAL( done( int ) ), 75 QObject::disconnect( sh, SIGNAL( done(int) ),
76 this, SLOT( done( int ) ) ); 76 this, SLOT( done(int) ) );
77 delete em; 77 delete em;
78 delete sh; 78 delete sh;
79} 79}
80 80
81void TESession::setConnect(bool c) 81void TESession::setConnect(bool c)
82{ 82{
83 em->setConnect(c); 83 em->setConnect(c);
84} 84}
85 85
86void TESession::done(int status) 86void TESession::done(int status)
87{ 87{
88 emit done(te,status); 88 emit done(te,status);
89} 89}
90 90
91void TESession::terminate() 91void TESession::terminate()
92{ 92{
93 delete this; 93 delete this;
94} 94}
95 95
96TEmulation* TESession::getEmulation() 96TEmulation* TESession::getEmulation()
97{ 97{
98 return em; 98 return em;
99} 99}
100 100
101// following interfaces might be misplaced /// 101// following interfaces might be misplaced ///
102 102
103int TESession::schemaNo() 103int TESession::schemaNo()
104{ 104{
105 return schema_no; 105 return schema_no;
106} 106}
107 107
108int TESession::keymap() 108int TESession::keymap()
109{ 109{
110 return keymap_no; 110 return keymap_no;
111} 111}
112 112
113int TESession::fontNo() 113int TESession::fontNo()
114{ 114{
115 return font_no; 115 return font_no;
116} 116}
117 117
118const char* TESession::emuName() 118const char* TESession::emuName()
119{ 119{
120 return term.data(); 120 return term.data();
121} 121}
122 122
123void TESession::setSchemaNo(int sn) 123void TESession::setSchemaNo(int sn)
124{ 124{