comparison hgrunner.h @ 0:a9098eba2ee5

Initial commit.
author Jari Korhonen <jtkorhonen@gmail.com>
date Thu, 22 Apr 2010 03:15:35 +0300
parents
children 45bfb8dc1faf
comparison
equal deleted inserted replaced
-1:000000000000 0:a9098eba2ee5
1 #ifndef HGRUNNER_H
2 #define HGRUNNER_H
3
4 //** Copyright (C) Jari Korhonen, 2010 (under lgpl)
5
6 #include <QProgressBar>
7 #include <QProcess>
8 #include <QByteArray>
9 #include <QRect>
10
11 class HgRunner : public QProgressBar
12 {
13 Q_OBJECT
14
15 public:
16 HgRunner(QWidget * parent = 0);
17 ~HgRunner();
18
19 void startProc(QString hgExePathAndName, QString workingDir, QStringList params, bool reportErrors = true);
20 bool isProcRunning();
21 void killProc();
22 int getExitCode();
23 void hideProgBar();
24 QString getStdOut();
25
26 private:
27 void setProcExitInfo(int procExitCode, QProcess::ExitStatus procExitStatus);
28 QString getLastCommandLine();
29 void presentErrorToUser();
30
31 bool reportErrors;
32 bool isRunning;
33 QProcess *proc;
34 QString stdOut;
35 QString stdErr;
36 int exitCode;
37 QProcess::ExitStatus exitStatus;
38 QString lastHgCommand;
39 QString lastParams;
40
41
42 private slots:
43 void started();
44 void error(QProcess::ProcessError error);
45 void finished(int procExitCode, QProcess::ExitStatus procExitStatus);
46 };
47
48 #endif // HGRUNNER_H