File indexing completed on 2024-05-05 10:08:13

0001 /*******************************************************************************
0002  * Copyright (C) 2008-2013 Konstantinos Smanis <konstantinos.smanis@gmail.com> *
0003  *                                                                             *
0004  * This program is free software: you can redistribute it and/or modify it     *
0005  * under the terms of the GNU General Public License as published by the Free  *
0006  * Software Foundation, either version 3 of the License, or (at your option)   *
0007  * any later version.                                                          *
0008  *                                                                             *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT *
0010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
0011  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
0012  * more details.                                                               *
0013  *                                                                             *
0014  * You should have received a copy of the GNU General Public License along     *
0015  * with this program. If not, see <http://www.gnu.org/licenses/>.              *
0016  *******************************************************************************/
0017 
0018 //Krazy
0019 //krazy:excludeall=cpp
0020 
0021 #ifndef REMOVEDLG_H
0022 #define REMOVEDLG_H
0023 
0024 //Qt
0025 #include <QDialog>
0026 class QProgressDialog;
0027 
0028 //Project
0029 #include <config.h>
0030 class Entry;
0031 #if HAVE_QAPT
0032 #include "qaptBackend.h"
0033 #elif HAVE_QPACKAGEKIT
0034 #include "qPkBackend.h"
0035 #endif
0036 
0037 //Ui
0038 namespace Ui
0039 {
0040     class RemoveDialog;
0041 }
0042 
0043 class RemoveDialog : public QDialog
0044 {
0045     Q_OBJECT
0046 public:
0047     explicit RemoveDialog(const QList<Entry> &entries, QWidget *parent = nullptr);
0048     virtual ~RemoveDialog();
0049 private Q_SLOTS:
0050     void slotAccepted();
0051     void slotItemChanged();
0052     void slotProgress(const QString &status, int percentage);
0053     void slotFinished(bool success);
0054 private:
0055     void detectCurrentKernelImage();
0056 
0057 #if HAVE_QAPT
0058     QAptBackend *m_backend;
0059 #elif HAVE_QPACKAGEKIT
0060     QPkBackend *m_backend;
0061 #endif
0062     QString m_currentKernelImage;
0063     QProgressDialog *m_progressDlg;
0064     Ui::RemoveDialog *ui;
0065     QPushButton *m_okButton;
0066 };
0067 
0068 #endif