1 | /******************************************************************* |
2 | * debugpackageinstaller.h |
3 | * Copyright 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com> |
4 | * |
5 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License as |
7 | * published by the Free Software Foundation; either version 2 of |
8 | * the License, or (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 DEBUGPACKAGEINSTALLER__H |
20 | #define DEBUGPACKAGEINSTALLER__H |
21 | |
22 | #include <QtCore/QObject> |
23 | #include <QtCore/QProcess> |
24 | |
25 | class KProcess; |
26 | class KProgressDialog; |
27 | |
28 | class DebugPackageInstaller: public QObject |
29 | { |
30 | Q_OBJECT |
31 | |
32 | enum Results { ResultInstalled = 0, ResultError = 1, |
33 | ResultSymbolsNotFound = 2, ResultCanceled = 3 }; |
34 | |
35 | public: |
36 | explicit DebugPackageInstaller(QObject *parent = 0); |
37 | bool canInstallDebugPackages() const; |
38 | void setMissingLibraries(const QStringList &); |
39 | void installDebugPackages(); |
40 | |
41 | private Q_SLOTS: |
42 | void processFinished(int, QProcess::ExitStatus); |
43 | void progressDialogCanceled(); |
44 | |
45 | Q_SIGNALS: |
46 | void packagesInstalled(); |
47 | void error(const QString &); |
48 | void canceled(); |
49 | |
50 | private: |
51 | KProcess * m_installerProcess; |
52 | KProgressDialog * m_progressDialog; |
53 | QString m_executablePath; |
54 | QStringList m_missingLibraries; |
55 | }; |
56 | |
57 | #endif |
58 | |