Mercurial > hg > easyhg
annotate hgrunner.h @ 60:73073f34a5ee
* win32 build fixes
author | Chris Cannam |
---|---|
date | Tue, 16 Nov 2010 19:53:14 +0000 |
parents | f583e44d9d31 |
children | 68aebc316898 |
rev | line source |
---|---|
Chris@57 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
Chris@57 | 2 |
Chris@57 | 3 /* |
Chris@57 | 4 EasyMercurial |
Chris@57 | 5 |
Chris@57 | 6 Based on HgExplorer by Jari Korhonen |
Chris@57 | 7 Copyright (c) 2010 Jari Korhonen |
Chris@57 | 8 Copyright (c) 2010 Chris Cannam |
Chris@57 | 9 Copyright (c) 2010 Queen Mary, University of London |
Chris@57 | 10 |
Chris@57 | 11 This program is free software; you can redistribute it and/or |
Chris@57 | 12 modify it under the terms of the GNU General Public License as |
Chris@57 | 13 published by the Free Software Foundation; either version 2 of the |
Chris@57 | 14 License, or (at your option) any later version. See the file |
Chris@57 | 15 COPYING included with this distribution for more information. |
Chris@57 | 16 */ |
Chris@57 | 17 |
jtkorhonen@0 | 18 #ifndef HGRUNNER_H |
jtkorhonen@0 | 19 #define HGRUNNER_H |
jtkorhonen@0 | 20 |
jtkorhonen@0 | 21 #include <QProgressBar> |
jtkorhonen@0 | 22 #include <QProcess> |
jtkorhonen@0 | 23 #include <QByteArray> |
jtkorhonen@0 | 24 #include <QRect> |
jtkorhonen@0 | 25 |
jtkorhonen@0 | 26 class HgRunner : public QProgressBar |
jtkorhonen@0 | 27 { |
jtkorhonen@0 | 28 Q_OBJECT |
jtkorhonen@0 | 29 |
jtkorhonen@0 | 30 public: |
jtkorhonen@0 | 31 HgRunner(QWidget * parent = 0); |
jtkorhonen@0 | 32 ~HgRunner(); |
jtkorhonen@0 | 33 |
jtkorhonen@0 | 34 void startProc(QString hgExePathAndName, QString workingDir, QStringList params, bool reportErrors = true); |
jtkorhonen@0 | 35 bool isProcRunning(); |
jtkorhonen@0 | 36 void killProc(); |
jtkorhonen@0 | 37 int getExitCode(); |
jtkorhonen@0 | 38 void hideProgBar(); |
jtkorhonen@0 | 39 QString getStdOut(); |
jtkorhonen@0 | 40 |
jtkorhonen@0 | 41 private: |
jtkorhonen@0 | 42 void setProcExitInfo(int procExitCode, QProcess::ExitStatus procExitStatus); |
jtkorhonen@0 | 43 QString getLastCommandLine(); |
jtkorhonen@0 | 44 void presentErrorToUser(); |
jtkorhonen@0 | 45 |
jtkorhonen@0 | 46 bool reportErrors; |
jtkorhonen@0 | 47 bool isRunning; |
jtkorhonen@0 | 48 QProcess *proc; |
jtkorhonen@0 | 49 QString stdOut; |
jtkorhonen@0 | 50 QString stdErr; |
jtkorhonen@0 | 51 int exitCode; |
jtkorhonen@0 | 52 QProcess::ExitStatus exitStatus; |
jtkorhonen@0 | 53 QString lastHgCommand; |
jtkorhonen@0 | 54 QString lastParams; |
jtkorhonen@0 | 55 |
jtkorhonen@0 | 56 |
jtkorhonen@0 | 57 private slots: |
jtkorhonen@0 | 58 void started(); |
jtkorhonen@0 | 59 void error(QProcess::ProcessError error); |
jtkorhonen@0 | 60 void finished(int procExitCode, QProcess::ExitStatus procExitStatus); |
jtkorhonen@0 | 61 }; |
jtkorhonen@0 | 62 |
jtkorhonen@0 | 63 #endif // HGRUNNER_H |