comparison hgrunner.h @ 75:295e3ee4a257

* Allocate a pty for the subprocess, and ask the user for password. Very rudimentary and non-portable.
author Chris Cannam
date Fri, 19 Nov 2010 18:39:40 +0000
parents 68aebc316898
children 8a4e26dc3182
comparison
equal deleted inserted replaced
74:10eb97683aa9 75:295e3ee4a257
20 20
21 #include <QProgressBar> 21 #include <QProgressBar>
22 #include <QProcess> 22 #include <QProcess>
23 #include <QByteArray> 23 #include <QByteArray>
24 #include <QRect> 24 #include <QRect>
25 #include <QFile>
25 26
26 class HgRunner : public QProgressBar 27 class HgRunner : public QProgressBar
27 { 28 {
28 Q_OBJECT 29 Q_OBJECT
29 30
52 void saveOutput(); 53 void saveOutput();
53 void setProcExitInfo(int procExitCode, QProcess::ExitStatus procExitStatus); 54 void setProcExitInfo(int procExitCode, QProcess::ExitStatus procExitStatus);
54 QString getLastCommandLine(); 55 QString getLastCommandLine();
55 void presentErrorToUser(); 56 void presentErrorToUser();
56 QString getHgBinaryName(); 57 QString getHgBinaryName();
58
59 int ptyMasterFd;
60 int ptySlaveFd;
61 QString ptySlaveFilename;
62 QFile *procInput;
57 63
58 bool reportErrors; 64 bool reportErrors;
59 bool isRunning; 65 bool isRunning;
60 QProcess *proc; 66 QProcess *proc;
61 QString stdOut; 67 QString stdOut;
66 QString lastParams; 72 QString lastParams;
67 73
68 private slots: 74 private slots:
69 void started(); 75 void started();
70 void finished(int procExitCode, QProcess::ExitStatus procExitStatus); 76 void finished(int procExitCode, QProcess::ExitStatus procExitStatus);
77 void stdOutReady();
78 void stdErrReady();
71 }; 79 };
72 80
73 #endif // HGRUNNER_H 81 #endif // HGRUNNER_H