Reverse line order in Log(View)
[nomnom.git] / src / ProcProgDiag.h
blob2d49b940a0c53b33c76fa137cb3de84129491c25
1 /*
2 * Copyright (C) 2010 Toni Gundogdu.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef nomnom_procprogdiag_h
19 #define nomnom_procprogdiag_h
21 #include <QProgressDialog>
22 #include <QProcess>
23 #include <QHash>
24 #include <QRegExp>
26 class ProcessProgressDialog : public QProgressDialog
28 Q_OBJECT
29 public:
30 ProcessProgressDialog (QWidget *parent);
31 public:
32 void start (QStringList&);
33 void setLabelRegExp (const QHash<QString,QRegExp>&);
34 void setErrorRegExp (const QRegExp&);
35 private slots:
36 void onProcStarted ();
37 void onProcError (QProcess::ProcessError);
38 void onProcReadyRead ();
39 void onProcFinished (int, QProcess::ExitStatus);
40 void onCanceled ();
41 signals:
42 void finished (QString);
43 void error ();
44 private:
45 QHash<QString,QRegExp> _rx_label;
46 QRegExp _rx_error;
47 QString _buffer;
48 QProcess _proc;
49 QString _error;
50 bool _canceled;
53 #endif
55 // vim: set ts=2 sw=2 tw=72 expandtab: