/guitone-1.0rc5/src/monotone/MonotoneProcess.h
C Header | 63 lines | 33 code | 13 blank | 17 comment | 0 complexity | c56932cd5f3fd79c7d700f6db455758e MD5 | raw file
Possible License(s): GPL-3.0
1/***************************************************************************
2 * Copyright (C) 2010 by Thomas Keller *
3 * me@thomaskeller.biz *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
18
19#ifndef MONOTONE_PROCESS_H
20#define MONOTONE_PROCESS_H
21
22#include "vocab.h"
23#include "MonotoneResourceFile.h"
24
25#include <QProcess>
26#include <QStringList>
27
28class MonotoneProcess : public QProcess
29{
30 Q_OBJECT
31public:
32 MonotoneProcess();
33 virtual ~MonotoneProcess();
34
35 void start(const QStringList &);
36 QString getBufferedOutput() const;
37
38 void setMonotoneBinaryPath(const QString &);
39 void setMonotoneHandle(const MonotoneHandlePtr &);
40
41 bool successful();
42
43 static bool singleRun(const QStringList &,
44 const MonotoneHandlePtr & handle,
45 QString & output);
46
47signals:
48 void output(const QString &);
49 void error(const QString &);
50
51private slots:
52 void readOutput();
53 void processError(QProcess::ProcessError);
54
55private:
56 MonotoneHandlePtr monotoneHandle;
57 QString monotoneBinaryPath;
58
59 QString bufferedOutput;
60 MonotoneResourceFile rcFile;
61};
62
63#endif