2017-12-20 14:39:09 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
2014-07-02 17:59:24 +02:00
|
|
|
*
|
2016-08-18 15:38:41 +02:00
|
|
|
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
|
2018-06-15 11:59:11 +02:00
|
|
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
2014-07-02 17:59:24 +02:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LOCALEVIEWSTEP_H
|
|
|
|
#define LOCALEVIEWSTEP_H
|
|
|
|
|
2019-05-02 19:48:19 +02:00
|
|
|
#include "geoip/Interface.h"
|
|
|
|
#include "utils/PluginFactory.h"
|
|
|
|
#include "viewpages/ViewStep.h"
|
2015-09-09 18:52:47 +02:00
|
|
|
|
2019-05-02 19:48:19 +02:00
|
|
|
#include "PluginDllMacro.h"
|
2014-07-02 17:59:24 +02:00
|
|
|
|
2014-07-03 13:13:38 +02:00
|
|
|
#include <QFutureWatcher>
|
2019-05-02 19:48:19 +02:00
|
|
|
#include <QObject>
|
2014-07-03 13:13:38 +02:00
|
|
|
|
2014-07-02 17:59:24 +02:00
|
|
|
class LocalePage;
|
2016-08-18 15:38:41 +02:00
|
|
|
class WaitingWidget;
|
2014-07-02 17:59:24 +02:00
|
|
|
|
|
|
|
class PLUGINDLLEXPORT LocaleViewStep : public Calamares::ViewStep
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit LocaleViewStep( QObject* parent = nullptr );
|
2017-09-20 14:24:28 +02:00
|
|
|
virtual ~LocaleViewStep() override;
|
2014-07-02 17:59:24 +02:00
|
|
|
|
|
|
|
QString prettyName() const override;
|
2014-07-08 18:25:54 +02:00
|
|
|
QString prettyStatus() const override;
|
2014-07-02 17:59:24 +02:00
|
|
|
|
|
|
|
QWidget* widget() override;
|
|
|
|
|
|
|
|
bool isNextEnabled() const override;
|
2015-01-29 20:24:09 +01:00
|
|
|
bool isBackEnabled() const override;
|
2014-07-02 17:59:24 +02:00
|
|
|
|
|
|
|
bool isAtBeginning() const override;
|
|
|
|
bool isAtEnd() const override;
|
|
|
|
|
2014-07-08 14:02:21 +02:00
|
|
|
QList< Calamares::job_ptr > jobs() const override;
|
|
|
|
|
2014-11-26 18:52:44 +01:00
|
|
|
void onActivate() override;
|
2014-07-08 18:25:54 +02:00
|
|
|
void onLeave() override;
|
|
|
|
|
2014-07-15 11:35:05 +02:00
|
|
|
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
|
|
|
|
2016-08-18 15:38:41 +02:00
|
|
|
private slots:
|
|
|
|
void setUpPage();
|
|
|
|
|
2014-07-02 17:59:24 +02:00
|
|
|
private:
|
2016-08-18 15:38:41 +02:00
|
|
|
void fetchGeoIpTimezone();
|
2014-07-03 13:13:38 +02:00
|
|
|
QWidget* m_widget;
|
|
|
|
QFutureWatcher< void > m_initWatcher;
|
2016-08-18 15:38:41 +02:00
|
|
|
WaitingWidget* m_waitingWidget;
|
2014-07-03 13:13:38 +02:00
|
|
|
|
|
|
|
LocalePage* m_actualWidget;
|
2014-07-03 13:19:32 +02:00
|
|
|
bool m_nextEnabled;
|
2014-07-08 18:25:54 +02:00
|
|
|
QString m_prettyStatus;
|
2014-07-15 11:35:05 +02:00
|
|
|
|
2019-05-02 19:48:19 +02:00
|
|
|
CalamaresUtils::GeoIP::RegionZonePair m_startingTimezone;
|
2014-11-25 17:43:12 +01:00
|
|
|
QString m_localeGenPath;
|
2018-04-16 11:16:23 +02:00
|
|
|
|
|
|
|
QString m_geoipUrl; // The URL, depening on style might be modified on lookup
|
|
|
|
QString m_geoipStyle; // String selecting which kind of geoip data to expect
|
|
|
|
QString m_geoipSelector; // String selecting data from the geoip lookup
|
2014-08-01 16:29:19 +02:00
|
|
|
|
|
|
|
QList< Calamares::job_ptr > m_jobs;
|
2014-07-02 17:59:24 +02:00
|
|
|
};
|
|
|
|
|
2015-09-09 18:52:47 +02:00
|
|
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( LocaleViewStepFactory )
|
|
|
|
|
2014-07-02 17:59:24 +02:00
|
|
|
#endif // LOCALEVIEWSTEP_H
|