source: calamares/trunk/fuentes/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp @ 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#include "InteractiveTerminalViewStep.h"
20
21#include "InteractiveTerminalPage.h"
22
23#include <QVariant>
24
25CALAMARES_PLUGIN_FACTORY_DEFINITION( InteractiveTerminalViewStepFactory, registerPlugin<InteractiveTerminalViewStep>(); )
26
27InteractiveTerminalViewStep::InteractiveTerminalViewStep( QObject* parent )
28    : Calamares::ViewStep( parent )
29    , m_widget( new InteractiveTerminalPage() )
30{
31    emit nextStatusChanged( true );
32}
33
34
35InteractiveTerminalViewStep::~InteractiveTerminalViewStep()
36{
37    if ( m_widget && m_widget->parent() == nullptr )
38        m_widget->deleteLater();
39}
40
41
42QString
43InteractiveTerminalViewStep::prettyName() const
44{
45    return tr( "Script" );
46}
47
48
49QWidget*
50InteractiveTerminalViewStep::widget()
51{
52    return m_widget;
53}
54
55
56void
57InteractiveTerminalViewStep::next()
58{
59    emit done();
60}
61
62
63void
64InteractiveTerminalViewStep::back()
65{}
66
67
68bool
69InteractiveTerminalViewStep::isNextEnabled() const
70{
71    return true;
72}
73
74
75bool
76InteractiveTerminalViewStep::isBackEnabled() const
77{
78    return true;
79}
80
81
82bool
83InteractiveTerminalViewStep::isAtBeginning() const
84{
85    return true;
86}
87
88
89bool
90InteractiveTerminalViewStep::isAtEnd() const
91{
92    return true;
93}
94
95
96QList< Calamares::job_ptr >
97InteractiveTerminalViewStep::jobs() const
98{
99    return QList< Calamares::job_ptr >();
100}
101
102
103void
104InteractiveTerminalViewStep::onActivate()
105{
106    m_widget->onActivate();
107}
108
109
110void
111InteractiveTerminalViewStep::setConfigurationMap( const QVariantMap& configurationMap )
112{
113    if ( configurationMap.contains( "command" ) &&
114         configurationMap.value( "command").type() == QVariant::String )
115        m_widget->setCommand( configurationMap.value( "command" ).toString() );
116}
117
Note: See TracBrowser for help on using the repository browser.