annotate hgrunner.h @ 30:45bfb8dc1faf

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