00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to the 00008 ** terms described in the LICENSE file. 00009 */ 00010 /* 00011 ** This file was originally written by Steven J. Murdoch, and 00012 ** modified by Matt Edman. It is distributed under the following 00013 ** license: 00014 ** 00015 ** Copyright (C) 2007, Matt Edman 00016 ** Copyright (C) 2007, Steven J. Murdoch 00017 ** <http://www.cl.cam.ac.uk/users/sjm217/> 00018 ** 00019 ** This program is free software; you can redistribute it and/or 00020 ** modify it under the terms of the GNU General Public License 00021 ** as published by the Free Software Foundation; either version 2 00022 ** of the License, or (at your option) any later version. 00023 ** 00024 ** This program is distributed in the hope that it will be useful, 00025 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00026 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00027 ** GNU General Public License for more details. 00028 ** 00029 ** You should have received a copy of the GNU General Public License 00030 ** along with this program; if not, write to the Free Software 00031 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, 00032 ** Boston, MA 02110-1301, USA. 00033 */ 00034 00035 /* 00036 ** \file helperprocess.h 00037 ** \version $Id: helperprocess.h 2675 2008-06-06 23:28:53Z edmanm $ 00038 ** \brief Invokes a web browser process (originally by Steven. J. Murdoch) 00039 */ 00040 00041 #ifndef _HELPERPROCESS_H 00042 #define _HELPERPROCESS_H 00043 00044 #include <QProcess> 00045 00046 00047 class HelperProcess : public QProcess 00048 { 00049 Q_OBJECT 00050 00051 public: 00052 /** Default constructor */ 00053 HelperProcess(QObject *parent = 0); 00054 /** Start the specified application. */ 00055 void start(const QString &app, const QStringList &args); 00056 /** Returns true iff process is not running. */ 00057 bool isDone() const; 00058 00059 private slots: 00060 /** Invoked when underlying QProcess fails. */ 00061 void onError(QProcess::ProcessError error); 00062 00063 signals: 00064 /** Invoked when start() fails. */ 00065 void startFailed(const QString &errorMessage); 00066 }; 00067 00068 #endif 00069