Chris@57: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@57: Chris@57: /* Chris@57: EasyMercurial Chris@57: Chris@57: Based on HgExplorer by Jari Korhonen Chris@57: Copyright (c) 2010 Jari Korhonen Chris@57: Copyright (c) 2010 Chris Cannam Chris@57: Copyright (c) 2010 Queen Mary, University of London Chris@57: Chris@57: This program is free software; you can redistribute it and/or Chris@57: modify it under the terms of the GNU General Public License as Chris@57: published by the Free Software Foundation; either version 2 of the Chris@57: License, or (at your option) any later version. See the file Chris@57: COPYING included with this distribution for more information. Chris@57: */ Chris@57: jtkorhonen@0: #ifndef HGRUNNER_H jtkorhonen@0: #define HGRUNNER_H jtkorhonen@0: jtkorhonen@0: #include jtkorhonen@0: #include jtkorhonen@0: #include jtkorhonen@0: #include jtkorhonen@0: jtkorhonen@0: class HgRunner : public QProgressBar jtkorhonen@0: { jtkorhonen@0: Q_OBJECT jtkorhonen@0: jtkorhonen@0: public: jtkorhonen@0: HgRunner(QWidget * parent = 0); jtkorhonen@0: ~HgRunner(); jtkorhonen@0: jtkorhonen@0: void startProc(QString hgExePathAndName, QString workingDir, QStringList params, bool reportErrors = true); jtkorhonen@0: bool isProcRunning(); jtkorhonen@0: void killProc(); jtkorhonen@0: int getExitCode(); jtkorhonen@0: void hideProgBar(); jtkorhonen@0: QString getStdOut(); jtkorhonen@0: jtkorhonen@0: private: jtkorhonen@0: void setProcExitInfo(int procExitCode, QProcess::ExitStatus procExitStatus); jtkorhonen@0: QString getLastCommandLine(); jtkorhonen@0: void presentErrorToUser(); jtkorhonen@0: jtkorhonen@0: bool reportErrors; jtkorhonen@0: bool isRunning; jtkorhonen@0: QProcess *proc; jtkorhonen@0: QString stdOut; jtkorhonen@0: QString stdErr; jtkorhonen@0: int exitCode; jtkorhonen@0: QProcess::ExitStatus exitStatus; jtkorhonen@0: QString lastHgCommand; jtkorhonen@0: QString lastParams; jtkorhonen@0: jtkorhonen@0: jtkorhonen@0: private slots: jtkorhonen@0: void started(); jtkorhonen@0: void error(QProcess::ProcessError error); jtkorhonen@0: void finished(int procExitCode, QProcess::ExitStatus procExitStatus); jtkorhonen@0: }; jtkorhonen@0: jtkorhonen@0: #endif // HGRUNNER_H