File indexing completed on 2024-04-14 15:48:52

0001 /***************************************************************************
0002  *   Copyright (C) 2008 by Daniel Nicoletti                                *
0003  *   dantti12@gmail.com                                                    *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; see the file COPYING. If not, write to       *
0017  *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
0018  *   Boston, MA 02110-1301, USA.                                           *
0019  ***************************************************************************/
0020 
0021 #ifndef APPLICATION_LAUNCHER_H
0022 #define APPLICATION_LAUNCHER_H
0023 
0024 #include <QDialog>
0025 #include <QModelIndex>
0026 
0027 #include <Transaction>
0028 
0029 namespace Ui {
0030     class ApplicationLauncher;
0031 }
0032 
0033 class Q_DECL_EXPORT ApplicationLauncher : public QDialog
0034 {
0035     Q_OBJECT
0036     Q_PROPERTY(bool embedded READ embedded WRITE setEmbedded USER true)
0037 public:
0038     explicit ApplicationLauncher(QWidget *parent = nullptr);
0039     ~ApplicationLauncher() override;
0040 
0041     bool embedded() const;
0042     void setEmbedded(bool embedded);
0043 
0044     QStringList packages() const;
0045     bool hasApplications();
0046 
0047 public Q_SLOTS:
0048     void addPackage(PackageKit::Transaction::Info info, const QString &packageID, const QString &summary);
0049     void files(const QString &packageID, const QStringList &files);
0050 
0051 private Q_SLOTS:
0052     void itemClicked(const QModelIndex &index);
0053     void on_showCB_toggled(bool checked);
0054 
0055 private:
0056     bool m_embed;
0057     QStringList m_files;
0058     QStringList m_packages;
0059     Ui::ApplicationLauncher *ui;
0060 };
0061 
0062 #endif