[welcomeq] Port to newer QmlViewStep
This commit is contained in:
parent
adb312bdd2
commit
7bf0fded1b
@ -37,7 +37,7 @@
|
|||||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeQmlViewStepFactory, registerPlugin< WelcomeQmlViewStep >(); )
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeQmlViewStepFactory, registerPlugin< WelcomeQmlViewStep >(); )
|
||||||
|
|
||||||
WelcomeQmlViewStep::WelcomeQmlViewStep( QObject* parent )
|
WelcomeQmlViewStep::WelcomeQmlViewStep( QObject* parent )
|
||||||
: Calamares::ViewStep( parent )
|
: Calamares::QmlViewStep( QStringLiteral( "welcomeq" ), parent )
|
||||||
, m_requirementsChecker( new GeneralRequirements( this ) )
|
, m_requirementsChecker( new GeneralRequirements( this ) )
|
||||||
{
|
{
|
||||||
connect( Calamares::ModuleManager::instance(),
|
connect( Calamares::ModuleManager::instance(),
|
||||||
@ -51,60 +51,12 @@ WelcomeQmlViewStep::~WelcomeQmlViewStep()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString
|
QString
|
||||||
WelcomeQmlViewStep::prettyName() const
|
WelcomeQmlViewStep::prettyName() const
|
||||||
{
|
{
|
||||||
return tr( "Welcome" );
|
return tr( "Welcome" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWidget*
|
|
||||||
WelcomeQmlViewStep::widget()
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
WelcomeQmlViewStep::isNextEnabled() const
|
|
||||||
{
|
|
||||||
// TODO: should return true
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
WelcomeQmlViewStep::isBackEnabled() const
|
|
||||||
{
|
|
||||||
// TODO: should return true (it's weird that you are not allowed to have welcome *after* anything
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
WelcomeQmlViewStep::isAtBeginning() const
|
|
||||||
{
|
|
||||||
// TODO: adjust to "pages" in the QML
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
WelcomeQmlViewStep::isAtEnd() const
|
|
||||||
{
|
|
||||||
// TODO: adjust to "pages" in the QML
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Calamares::JobList
|
|
||||||
WelcomeQmlViewStep::jobs() const
|
|
||||||
{
|
|
||||||
return Calamares::JobList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/** @brief Look up a URL for a button
|
/** @brief Look up a URL for a button
|
||||||
*
|
*
|
||||||
* Looks up @p key in @p map; if it is a *boolean* value, then
|
* Looks up @p key in @p map; if it is a *boolean* value, then
|
||||||
@ -140,6 +92,7 @@ jobOrBrandingSetting( Calamares::Branding::StringEntry e, const QVariantMap& map
|
|||||||
void
|
void
|
||||||
WelcomeQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
WelcomeQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
{
|
{
|
||||||
|
QmlViewStep::setConfigurationMap( configurationMap );
|
||||||
using Calamares::Branding;
|
using Calamares::Branding;
|
||||||
|
|
||||||
m_config.setHelpUrl( jobOrBrandingSetting( Branding::SupportUrl, configurationMap, "showSupportUrl" ) );
|
m_config.setHelpUrl( jobOrBrandingSetting( Branding::SupportUrl, configurationMap, "showSupportUrl" ) );
|
||||||
|
@ -21,11 +21,10 @@
|
|||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
|
#include "PluginDllMacro.h"
|
||||||
#include "modulesystem/Requirement.h"
|
#include "modulesystem/Requirement.h"
|
||||||
#include "utils/PluginFactory.h"
|
#include "utils/PluginFactory.h"
|
||||||
#include "viewpages/ViewStep.h"
|
#include "viewpages/QmlViewStep.h"
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
@ -40,13 +39,7 @@ class Handler;
|
|||||||
|
|
||||||
class GeneralRequirements;
|
class GeneralRequirements;
|
||||||
|
|
||||||
class QQmlComponent;
|
class PLUGINDLLEXPORT WelcomeQmlViewStep : public Calamares::QmlViewStep
|
||||||
class QQuickItem;
|
|
||||||
class QQuickWidget;
|
|
||||||
|
|
||||||
// TODO: Needs a generic Calamares::QmlViewStep as base class
|
|
||||||
// TODO: refactor and move what makes sense to base class
|
|
||||||
class PLUGINDLLEXPORT WelcomeQmlViewStep : public Calamares::ViewStep
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -56,16 +49,6 @@ public:
|
|||||||
|
|
||||||
QString prettyName() const override;
|
QString prettyName() const override;
|
||||||
|
|
||||||
QWidget* widget() override;
|
|
||||||
|
|
||||||
bool isNextEnabled() const override;
|
|
||||||
bool isBackEnabled() const override;
|
|
||||||
|
|
||||||
bool isAtBeginning() const override;
|
|
||||||
bool isAtEnd() const override;
|
|
||||||
|
|
||||||
Calamares::JobList jobs() const override;
|
|
||||||
|
|
||||||
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
||||||
|
|
||||||
/** @brief Sets the country that Calamares is running in.
|
/** @brief Sets the country that Calamares is running in.
|
||||||
@ -82,12 +65,6 @@ private:
|
|||||||
// TODO: a generic QML viewstep should return a config object from a method
|
// TODO: a generic QML viewstep should return a config object from a method
|
||||||
Config m_config;
|
Config m_config;
|
||||||
GeneralRequirements* m_requirementsChecker;
|
GeneralRequirements* m_requirementsChecker;
|
||||||
|
|
||||||
// TODO: these need to be in the base class (also a base class of ExecutionViewStep)
|
|
||||||
QQuickWidget* m_qmlWidget;
|
|
||||||
QQmlComponent* m_qmlComponent;
|
|
||||||
QQuickItem* m_qmlItem;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( WelcomeQmlViewStepFactory )
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( WelcomeQmlViewStepFactory )
|
||||||
|
Loading…
Reference in New Issue
Block a user