Close the output window by clicking "Enter"
[qgit4/redivivus.git] / src / myprocess.h
blob6e472f82dcb2ff26e595a8f02b636c4720f9c0da
1 /*
2 Author: Marco Costalba (C) 2005-2007
4 Copyright: See COPYING file that comes with this distribution
6 */
7 #ifndef MYPROCESS_H
8 #define MYPROCESS_H
10 #include <QProcess>
11 #include "git.h"
13 class Git;
15 //custom process used to run shell commands in parallel
17 class MyProcess : public QProcess {
18 Q_OBJECT
19 public:
20 MyProcess(QObject *go, Git* g, const QString& wd, bool reportErrors);
21 bool runSync(SCRef runCmd, QByteArray* runOutput, QObject* rcv, SCRef buf);
22 bool runAsync(SCRef rc, QObject* rcv, SCRef buf);
23 static const QStringList splitArgList(SCRef cmd);
25 signals:
26 void procDataReady(const QByteArray&);
27 void eof();
29 public slots:
30 void on_cancel();
32 private slots:
33 void on_readyReadStandardOutput();
34 void on_readyReadStandardError();
35 void on_finished(int, QProcess::ExitStatus);
37 private:
38 void setupSignals();
39 bool launchMe(SCRef runCmd, SCRef buf);
40 void sendErrorMsg(bool notStarted = false, SCRef errDesc = "");
41 static void restoreSpaces(QString& newCmd, const QChar& sepChar);
43 QObject* guiObject;
44 Git* git;
45 QString runCmd;
46 QByteArray* runOutput;
47 QString workDir;
48 QObject* receiver;
49 QStringList arguments;
50 bool errorReportingEnabled;
51 bool canceling;
52 bool busy;
53 bool async;
54 bool isWinShell;
55 bool isErrorExit;
58 #endif