source: calamares/trunk/fuentes/src/libcalamaresui/viewpages/BlankViewStep.cpp @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 17 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 2018, Adriaan de Groot <groot@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#include "BlankViewStep.h"
19
20#include "utils/CalamaresUtilsGui.h"
21
22#include <QLabel>
23#include <QVBoxLayout>
24#include <QWidget>
25
26namespace Calamares
27{
28
29BlankViewStep::BlankViewStep( const QString& title, const QString& description, const QString& details, QObject* parent)
30    : Calamares::ViewStep( parent )
31    , m_widget( new QWidget() )
32{
33    QBoxLayout* layout = new QVBoxLayout();
34
35    constexpr int const marginWidth = 10;
36    constexpr int const spacingHeight = 10;
37
38    auto* label = new QLabel( title );
39    label->setAlignment( Qt::AlignHCenter );
40    label->setFont( CalamaresUtils::largeFont() );
41    layout->addWidget( label );
42
43    label = new QLabel( description );
44    label->setWordWrap( true );
45    label->setMargin( marginWidth );
46    layout->addSpacing( spacingHeight );
47    layout->addWidget( label );
48
49    if ( !details.isEmpty() )
50    {
51        label = new QLabel( details );
52        label->setMargin( marginWidth );
53        layout->addSpacing( spacingHeight );
54        layout->addWidget( label );
55    }
56
57    layout->addStretch( 1 );   // Push the rest to the top
58
59    m_widget->setLayout( layout );
60}
61
62BlankViewStep::~BlankViewStep()
63{
64}
65
66QString
67BlankViewStep::prettyName() const
68{
69    return tr( "Blank Page" );
70}
71
72void
73BlankViewStep::back()
74{
75}
76
77void
78BlankViewStep::next()
79{
80}
81
82bool
83BlankViewStep::isBackEnabled() const
84{
85    return false;
86}
87
88bool
89BlankViewStep::isNextEnabled() const
90{
91    return false;
92}
93
94bool
95BlankViewStep::isAtBeginning() const
96{
97    return true;
98}
99
100bool
101BlankViewStep::isAtEnd() const
102{
103    return false;
104}
105
106QWidget*
107BlankViewStep::widget()
108{
109    return m_widget;
110}
111
112Calamares::JobList
113BlankViewStep::jobs() const
114{
115    return JobList();
116}
117
118}  // namespace
Note: See TracBrowser for help on using the repository browser.