source: calamares/trunk/fuentes/src/modules/summary/SummaryPage.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 2.4 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
4 *
5 *   Calamares is free software: you can redistribute it and/or modify
6 *   it under the terms of the GNU General Public License as published by
7 *   the Free Software Foundation, either version 3 of the License, or
8 *   (at your option) any later version.
9 *
10 *   Calamares 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 Calamares. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef SUMMARYPAGE_H
20#define SUMMARYPAGE_H
21
22#include "Typedefs.h"
23
24#include <QWidget>
25
26class QLabel;
27class QScrollArea;
28class QVBoxLayout;
29class SummaryViewStep;
30
31/** @brief Provide a summary view with to-be-done action descriptions.
32*
33* Those steps that occur since the previous execution step (e.g. that
34* are queued for execution now; in the normal case where there is
35* only one execution step, this means everything that the installer
36* is going to do) are added to the summary view. Each view step
37* can provide one of the following things to display in the summary
38* view:
39*
40* - A string from ViewStep::prettyStatus(), which is formatted
41*   and added as a QLabel to the view. Return an empty string
42*   from prettyStatus() to avoid this.
43* - A QWidget from ViewStep::createSummaryWidget(). This is for
44*   complicated displays not suitable for simple text representation.
45*   Return a nullptr to avoid this.
46*
47* If neither a (non-empty) string nor a widget is returned, the
48* step is not named in the summary.
49*/
50class SummaryPage : public QWidget
51{
52    Q_OBJECT
53public:
54    explicit SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent = nullptr );
55
56    void onActivate();
57    void createContentWidget();
58
59private:
60    Calamares::ViewStepList stepsForSummary( const Calamares::ViewStepList& allSteps ) const;
61
62    const SummaryViewStep* m_thisViewStep;
63
64    QVBoxLayout* m_layout = nullptr;
65    QWidget* m_contentWidget = nullptr;
66
67    QLabel* createTitleLabel( const QString& text ) const;
68    QLabel* createBodyLabel( const QString& text ) const;
69
70    QScrollArea* m_scrollArea;
71};
72
73#endif // SUMMARYPAGE_H
Note: See TracBrowser for help on using the repository browser.