2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2014-07-08 17:28:35 +02:00
|
|
|
*
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac <teo@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2014-07-08 17:28:35 +02:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2014-07-08 17:28:35 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SUMMARYPAGE_H
|
|
|
|
#define SUMMARYPAGE_H
|
|
|
|
|
2019-05-07 15:51:23 +02:00
|
|
|
#include "viewpages/ViewStep.h"
|
2015-09-09 19:06:44 +02:00
|
|
|
|
2014-07-08 17:28:35 +02:00
|
|
|
#include <QWidget>
|
|
|
|
|
2014-07-08 18:24:39 +02:00
|
|
|
class QLabel;
|
2015-04-09 18:02:29 +02:00
|
|
|
class QScrollArea;
|
2014-07-30 14:15:29 +02:00
|
|
|
class QVBoxLayout;
|
2015-09-09 19:06:44 +02:00
|
|
|
class SummaryViewStep;
|
2014-07-08 18:24:39 +02:00
|
|
|
|
2017-08-08 13:54:38 +02:00
|
|
|
/** @brief Provide a summary view with to-be-done action descriptions.
|
|
|
|
*
|
|
|
|
* Those steps that occur since the previous execution step (e.g. that
|
|
|
|
* are queued for execution now; in the normal case where there is
|
|
|
|
* only one execution step, this means everything that the installer
|
|
|
|
* is going to do) are added to the summary view. Each view step
|
|
|
|
* can provide one of the following things to display in the summary
|
|
|
|
* view:
|
|
|
|
*
|
|
|
|
* - A string from ViewStep::prettyStatus(), which is formatted
|
|
|
|
* and added as a QLabel to the view. Return an empty string
|
|
|
|
* from prettyStatus() to avoid this.
|
|
|
|
* - A QWidget from ViewStep::createSummaryWidget(). This is for
|
|
|
|
* complicated displays not suitable for simple text representation.
|
|
|
|
* Return a nullptr to avoid this.
|
|
|
|
*
|
|
|
|
* If neither a (non-empty) string nor a widget is returned, the
|
|
|
|
* step is not named in the summary.
|
|
|
|
*/
|
2014-07-08 17:28:35 +02:00
|
|
|
class SummaryPage : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-09-09 19:06:44 +02:00
|
|
|
explicit SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent = nullptr );
|
2014-07-08 17:28:35 +02:00
|
|
|
|
2021-07-20 15:17:35 +02:00
|
|
|
/// @brief Create contents showing all of the summary
|
2014-07-08 18:24:39 +02:00
|
|
|
void onActivate();
|
2021-07-20 15:17:35 +02:00
|
|
|
/// @brief Clean up the widgets
|
|
|
|
void onLeave();
|
2014-07-08 18:24:39 +02:00
|
|
|
|
|
|
|
private:
|
2015-09-09 19:06:44 +02:00
|
|
|
Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const;
|
2021-07-20 15:17:35 +02:00
|
|
|
void createContentWidget();
|
2015-09-09 19:06:44 +02:00
|
|
|
|
|
|
|
const SummaryViewStep* m_thisViewStep;
|
|
|
|
|
2014-07-30 14:15:29 +02:00
|
|
|
QVBoxLayout* m_layout = nullptr;
|
|
|
|
QWidget* m_contentWidget = nullptr;
|
|
|
|
|
|
|
|
QLabel* createTitleLabel( const QString& text ) const;
|
|
|
|
QLabel* createBodyLabel( const QString& text ) const;
|
2015-04-09 18:02:29 +02:00
|
|
|
|
|
|
|
QScrollArea* m_scrollArea;
|
2014-07-08 17:28:35 +02:00
|
|
|
};
|
|
|
|
|
2020-08-22 01:19:58 +02:00
|
|
|
#endif // SUMMARYPAGE_H
|