12 #include "blockingkprocess.h" 14 #include <tqapplication.h> 17 BlockingTDEProcess::BlockingTDEProcess(TQObject *parent,
const char *name)
18 : TDEProcess(parent, name)
25 connect(
this, TQT_SIGNAL(receivedStdout(TDEProcess *,
char *,
int)),
26 this, TQT_SLOT(slotReceivedStdOut(TDEProcess *,
char *,
int)));
27 connect(
this, TQT_SIGNAL(receivedStderr(TDEProcess *,
char *,
int)),
28 this, TQT_SLOT(slotReceivedStdErr(TDEProcess *,
char *,
int)));
29 connect(
this, TQT_SIGNAL(processExited(TDEProcess *)),
30 this, TQT_SLOT(slotProcessExited(TDEProcess *)));
33 BlockingTDEProcess::BlockingTDEProcess()
40 connect(
this, TQT_SIGNAL(receivedStdout(TDEProcess *,
char *,
int)),
41 this, TQT_SLOT(slotReceivedStdOut(TDEProcess *,
char *,
int)));
42 connect(
this, TQT_SIGNAL(receivedStderr(TDEProcess *,
char *,
int)),
43 this, TQT_SLOT(slotReceivedStdErr(TDEProcess *,
char *,
int)));
44 connect(
this, TQT_SIGNAL(processExited(TDEProcess *)),
45 this, TQT_SLOT(slotProcessExited(TDEProcess *)));
49 BlockingTDEProcess::~BlockingTDEProcess()
52 bool BlockingTDEProcess::start(RunMode runmode, Communication comm)
54 if (TDEProcess::start(runmode, comm))
57 m_timer =
new TQTimer();
58 connect(m_timer, TQT_SIGNAL(timeout()),
this, TQT_SLOT(slotTimeOut()));
59 m_timer->start(m_timeoutValue*1000,
true);
69 void BlockingTDEProcess::slotReceivedStdOut(TDEProcess *,
char *buffer,
int buflen)
71 m_stdOut += TQString::fromLatin1(buffer, buflen);
74 void BlockingTDEProcess::slotReceivedStdErr(TDEProcess *,
char *buffer,
int buflen)
76 m_stdErr += TQString::fromLatin1(buffer, buflen);
79 void BlockingTDEProcess::slotProcessExited(TDEProcess *)
84 void BlockingTDEProcess::slotTimeOut()
92 void tqt_enter_modal( TQWidget *widget );
93 void tqt_leave_modal( TQWidget *widget );
95 void BlockingTDEProcess::enter_loop()
97 TQWidget dummy(0,0,WType_Dialog | WShowModal);
98 dummy.setFocusPolicy( TQ_NoFocus );
99 tqt_enter_modal(&dummy);
101 tqt_leave_modal(&dummy);
105 #include "blockingkprocess.moc"