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: Chris@62: public: Chris@62: HgRunner(QWidget * parent = 0); Chris@62: ~HgRunner(); jtkorhonen@0: Chris@62: void startHgCommand(QString workingDir, QStringList params); Chris@62: void startCommand(QString command, QString workingDir, QStringList params); jtkorhonen@0: Chris@62: bool isCommandRunning(); Chris@62: void killCurrentCommand(); jtkorhonen@0: Chris@62: int getExitCode(); Chris@62: QProcess::ExitStatus getExitStatus(); jtkorhonen@0: Chris@62: void hideProgBar(); jtkorhonen@0: Chris@62: QString getStdOut(); Chris@62: Chris@62: signals: Chris@62: void commandCompleted(); Chris@62: void commandFailed(); Chris@62: Chris@62: private: Chris@62: void saveOutput(); Chris@62: void setProcExitInfo(int procExitCode, QProcess::ExitStatus procExitStatus); Chris@62: QString getLastCommandLine(); Chris@62: void presentErrorToUser(); Chris@62: QString getHgBinaryName(); Chris@62: Chris@62: bool reportErrors; Chris@62: bool isRunning; Chris@62: QProcess *proc; Chris@62: QString stdOut; Chris@62: QString stdErr; Chris@62: int exitCode; Chris@62: QProcess::ExitStatus exitStatus; Chris@62: QString lastHgCommand; Chris@62: QString lastParams; Chris@62: Chris@62: private slots: Chris@62: void started(); Chris@62: void finished(int procExitCode, QProcess::ExitStatus procExitStatus); jtkorhonen@0: }; jtkorhonen@0: jtkorhonen@0: #endif // HGRUNNER_H