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