diff --git a/src/modules/plasmalnf/CMakeLists.txt b/src/modules/plasmalnf/CMakeLists.txt index b78aac6b8..e3dee1c61 100644 --- a/src/modules/plasmalnf/CMakeLists.txt +++ b/src/modules/plasmalnf/CMakeLists.txt @@ -3,13 +3,14 @@ find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE) find_package( KF5 5.29 REQUIRED CoreAddons Plasma Service ) calamares_add_plugin( plasmalnf - TYPE job + TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO SOURCES - PlasmaLnfJob.cpp + PlasmaLnfViewStep.cpp + PlasmaLnfPage.cpp + UI + page_plasmalnf.ui LINK_PRIVATE_LIBRARIES - calamares - KF5::Plasma - KF5::Service + calamaresui SHARED_LIB ) diff --git a/src/modules/plasmalnf/PlasmaLnfPage.cpp b/src/modules/plasmalnf/PlasmaLnfPage.cpp new file mode 100644 index 000000000..d83a845bc --- /dev/null +++ b/src/modules/plasmalnf/PlasmaLnfPage.cpp @@ -0,0 +1,47 @@ +/* === This file is part of Calamares - === + * + * Copyright 2017, Adriaan de Groot + * + * 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 . + */ + +#include "PlasmaLnfPage.h" + +#include "ui_page_plasmalnf.h" + +#include "Branding.h" +#include "JobQueue.h" +#include "GlobalStorage.h" +#include "utils/Logger.h" +#include "utils/CalamaresUtilsGui.h" +#include "utils/Retranslator.h" +#include "ViewManager.h" + +#include +#include +#include + +PlasmaLnfPage::PlasmaLnfPage(QWidget *parent) + : QWidget( parent ) + , ui( new Ui::PlasmaLnfPage ) +{ + using StringEntry = Calamares::Branding::StringEntry; + + ui->setupUi( this ); + CALAMARES_RETRANSLATE( + ui->retranslateUi( this ); + ui->generalExplanation->setText( tr( "Please choose a look-and-feel for the KDE Plasma Desktop, below." ) ); + ) +} + diff --git a/src/modules/plasmalnf/PlasmaLnfPage.h b/src/modules/plasmalnf/PlasmaLnfPage.h new file mode 100644 index 000000000..f7a17720a --- /dev/null +++ b/src/modules/plasmalnf/PlasmaLnfPage.h @@ -0,0 +1,40 @@ +/* === This file is part of Calamares - === + * + * Copyright 2017, Adriaan de Groot + * + * 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 . + */ + +#ifndef PLASMALNFPAGE_H +#define PLASMALNFPAGE_H + +#include +#include + +namespace Ui +{ +class PlasmaLnfPage; +} + +class PlasmaLnfPage : public QWidget +{ + Q_OBJECT +public: + explicit PlasmaLnfPage( QWidget* parent = nullptr ); + +private: + Ui::PlasmaLnfPage* ui; +}; + +#endif //PLASMALNFPAGE_H diff --git a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp new file mode 100644 index 000000000..eac93a6e1 --- /dev/null +++ b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp @@ -0,0 +1,121 @@ +/* === This file is part of Calamares - === + * + * Copyright 2017, Adriaan de Groot + * + * 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 . + */ + +#include "JobQueue.h" +#include "GlobalStorage.h" +#include "utils/Logger.h" +#include "utils/CalamaresUtils.h" +#include "utils/CalamaresUtilsSystem.h" + +#include "PlasmaLnfJob.h" +#include "PlasmaLnfPage.h" +#include "PlasmaLnfViewStep.h" + +#include +#include + +CALAMARES_PLUGIN_FACTORY_DEFINITION( PlasmaLnfViewStepFactory, registerPlugin(); ) + +PlasmaLnfViewStep::PlasmaLnfViewStep( QObject* parent ) + : Calamares::ViewStep( parent ) + , m_widget( new PlasmaLnfPage ) +{ + emit nextStatusChanged( false ); +} + + +PlasmaLnfViewStep::~PlasmaLnfViewStep() +{ + if ( m_widget && m_widget->parent() == nullptr ) + m_widget->deleteLater(); +} + + +QString +PlasmaLnfViewStep::prettyName() const +{ + return tr( "Look-and-Feel" ); +} + + +QWidget* +PlasmaLnfViewStep::widget() +{ + return m_widget; +} + + +void +PlasmaLnfViewStep::next() +{ + emit done(); +} + + +void +PlasmaLnfViewStep::back() +{} + + +bool +PlasmaLnfViewStep::isNextEnabled() const +{ + return true; +} + + +bool +PlasmaLnfViewStep::isBackEnabled() const +{ + return true; +} + + +bool +PlasmaLnfViewStep::isAtBeginning() const +{ + return true; +} + + +bool +PlasmaLnfViewStep::isAtEnd() const +{ + return true; +} + + +void PlasmaLnfViewStep::onLeave() +{ +} + + +Calamares::JobList +PlasmaLnfViewStep::jobs() const +{ + Calamares::JobList l; + + cDebug() << "Creating Plasma LNF jobs .."; + return l; +} + + +void +PlasmaLnfViewStep::setConfigurationMap( const QVariantMap& configurationMap ) +{ +} diff --git a/src/modules/plasmalnf/PlasmaLnfViewStep.h b/src/modules/plasmalnf/PlasmaLnfViewStep.h new file mode 100644 index 000000000..99a48b79c --- /dev/null +++ b/src/modules/plasmalnf/PlasmaLnfViewStep.h @@ -0,0 +1,65 @@ +/* === This file is part of Calamares - === + * + * Copyright 2017, Adriaan de Groot + * + * 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 . + */ + +#ifndef PLASMALNFVIEWSTEP_H +#define PLASMALNFVIEWSTEP_H + +#include +#include +#include + +#include +#include +#include + +class PlasmaLnfPage; + +class PLUGINDLLEXPORT PlasmaLnfViewStep : public Calamares::ViewStep +{ + Q_OBJECT + +public: + explicit PlasmaLnfViewStep( QObject* parent = nullptr ); + virtual ~PlasmaLnfViewStep() override; + + QString prettyName() const override; + + QWidget* widget() override; + + void next() override; + void back() override; + + bool isNextEnabled() const override; + bool isBackEnabled() const override; + + bool isAtBeginning() const override; + bool isAtEnd() const override; + + void onLeave() override; + + Calamares::JobList jobs() const override; + + void setConfigurationMap( const QVariantMap& configurationMap ) override; + +private: + PlasmaLnfPage* m_widget; +}; + +CALAMARES_PLUGIN_FACTORY_DECLARATION( PlasmaLnfViewStepFactory ) + +#endif // PLASMALNFVIEWSTEP_H diff --git a/src/modules/plasmalnf/page_plasmalnf.qrc b/src/modules/plasmalnf/page_plasmalnf.qrc new file mode 100644 index 000000000..7646d2b36 --- /dev/null +++ b/src/modules/plasmalnf/page_plasmalnf.qrc @@ -0,0 +1 @@ + diff --git a/src/modules/plasmalnf/page_plasmalnf.ui b/src/modules/plasmalnf/page_plasmalnf.ui new file mode 100644 index 000000000..dfb906c22 --- /dev/null +++ b/src/modules/plasmalnf/page_plasmalnf.ui @@ -0,0 +1,50 @@ + + + PlasmaLnfPage + + + + 0 + 0 + 799 + 400 + + + + Form + + + + + + margin-bottom: 1ex; +margin-left: 2em; + + + Placeholder + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + diff --git a/src/modules/plasmalnf/plasmalnf.conf b/src/modules/plasmalnf/plasmalnf.conf new file mode 100644 index 000000000..54fff14c1 --- /dev/null +++ b/src/modules/plasmalnf/plasmalnf.conf @@ -0,0 +1,2 @@ +-- +# PlasmaLnf module has no configuration