2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2019-08-02 10:57:12 +02:00
|
|
|
*
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2019-08-02 10:57:12 +02:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2019-08-02 10:57:12 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PACKAGECHOOSERPAGE_H
|
|
|
|
#define PACKAGECHOOSERPAGE_H
|
|
|
|
|
2021-04-16 14:53:13 +02:00
|
|
|
#include "Config.h"
|
2019-08-02 16:07:47 +02:00
|
|
|
#include "PackageModel.h"
|
|
|
|
|
2019-08-02 13:05:46 +02:00
|
|
|
#include <QAbstractItemModel>
|
2019-08-02 10:57:12 +02:00
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class PackageChooserPage;
|
|
|
|
}
|
|
|
|
|
|
|
|
class PackageChooserPage : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2019-08-02 16:25:26 +02:00
|
|
|
explicit PackageChooserPage( PackageChooserMode mode, QWidget* parent = nullptr );
|
2019-08-02 10:57:12 +02:00
|
|
|
|
2019-11-11 07:47:10 +01:00
|
|
|
/// @brief Sets the data model for the listview
|
2019-08-02 13:05:46 +02:00
|
|
|
void setModel( QAbstractItemModel* model );
|
|
|
|
|
2019-09-04 19:33:24 +02:00
|
|
|
/// @brief Sets the introductory (no-package-selected) texts
|
2019-09-04 19:40:35 +02:00
|
|
|
void setIntroduction( const PackageItem& item );
|
2019-11-11 07:47:10 +01:00
|
|
|
/// @brief Selects a listview item
|
|
|
|
void setSelection( const QModelIndex& index );
|
2019-08-03 23:51:00 +02:00
|
|
|
/// @brief Is anything selected?
|
2019-08-02 17:06:03 +02:00
|
|
|
bool hasSelection() const;
|
2019-08-03 23:51:00 +02:00
|
|
|
/** @brief Get the list of selected ids
|
|
|
|
*
|
|
|
|
* This list may be empty (if none is selected).
|
|
|
|
*/
|
|
|
|
QStringList selectedPackageIds() const;
|
2019-08-02 17:06:03 +02:00
|
|
|
|
2019-08-02 11:09:12 +02:00
|
|
|
public slots:
|
2019-08-02 16:07:47 +02:00
|
|
|
void currentChanged( const QModelIndex& index );
|
2019-08-02 11:09:12 +02:00
|
|
|
void updateLabels();
|
|
|
|
|
2019-08-02 17:06:03 +02:00
|
|
|
signals:
|
|
|
|
void selectionChanged();
|
|
|
|
|
2019-08-02 10:57:12 +02:00
|
|
|
private:
|
|
|
|
Ui::PackageChooserPage* ui;
|
2019-08-02 16:07:47 +02:00
|
|
|
PackageItem m_introduction;
|
2019-08-02 10:57:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PACKAGECHOOSERPAGE_H
|