calamares/src/modules/greeting/GreetingViewStep.cpp
Teo Mrnjavac 20d5a37fef Major ViewStep additions and changes.
Renamed ViewPlugin to ViewStep.
Back/Next button status management.
Subpages are now under a ViewStep's jurisdiction, we only forward back/
next signals if a ViewStep says it's got more pages to show. ViewStep
exposes a QWidget* to ViewManager, this QWidget gets added to a stack.
If a ViewStep wishes to show more than one page, it must manage more
pages on its own inside its single QWidget*.
2014-06-27 18:04:53 +02:00

84 lines
1.5 KiB
C++

/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#include "GreetingViewStep.h"
#include "GreetingPage.h"
GreetingViewStep::GreetingViewStep( QObject* parent )
: Calamares::ViewStep( parent )
, m_widget( new GreetingPage() )
{
emit nextStatusChanged( true );
}
GreetingViewStep::~GreetingViewStep()
{
if ( m_widget && m_widget->parent() == nullptr )
m_widget->deleteLater();
}
QString
GreetingViewStep::prettyName()
{
return tr( "Welcome" );
}
QWidget*
GreetingViewStep::widget()
{
return m_widget;
}
void
GreetingViewStep::next()
{
emit done();
}
void
GreetingViewStep::back()
{}
bool
GreetingViewStep::isNextEnabled()
{
return true;
}
bool
GreetingViewStep::isAtBeginning()
{
return true;
}
bool
GreetingViewStep::isAtEnd()
{
return true;
}