mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
[locale] Hand the Config object also to the page
This commit is contained in:
parent
b6b5c44996
commit
338635146f
3 changed files with 10 additions and 4 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "LocalePage.h"
|
||||
|
||||
#include "Config.h"
|
||||
#include "SetTimezoneJob.h"
|
||||
#include "timezonewidget/timezonewidget.h"
|
||||
|
||||
|
@ -26,7 +27,6 @@
|
|||
#include "JobQueue.h"
|
||||
#include "LCLocaleDialog.h"
|
||||
#include "Settings.h"
|
||||
|
||||
#include "locale/Label.h"
|
||||
#include "locale/TimeZone.h"
|
||||
#include "utils/CalamaresUtilsGui.h"
|
||||
|
@ -40,8 +40,9 @@
|
|||
#include <QProcess>
|
||||
#include <QPushButton>
|
||||
|
||||
LocalePage::LocalePage( QWidget* parent )
|
||||
LocalePage::LocalePage( Config* config, QWidget* parent )
|
||||
: QWidget( parent )
|
||||
, m_config( config )
|
||||
, m_regionList( CalamaresUtils::Locale::TZRegion::fromZoneTab() )
|
||||
, m_regionModel( std::make_unique< CalamaresUtils::Locale::CStringListModel >( m_regionList ) )
|
||||
, m_blockTzWidgetSet( false )
|
||||
|
|
|
@ -32,13 +32,15 @@
|
|||
class QComboBox;
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
|
||||
class Config;
|
||||
class TimeZoneWidget;
|
||||
|
||||
class LocalePage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LocalePage( QWidget* parent = nullptr );
|
||||
explicit LocalePage( class Config* config, QWidget* parent = nullptr );
|
||||
virtual ~LocalePage();
|
||||
|
||||
void init( const QString& initialRegion, const QString& initialZone, const QString& localeGenPath );
|
||||
|
@ -54,6 +56,9 @@ public:
|
|||
private:
|
||||
LocaleConfiguration guessLocaleConfiguration() const;
|
||||
|
||||
/// @brief Non-owning pointer to the ViewStep's config
|
||||
Config* m_config;
|
||||
|
||||
// For the given locale config, return two strings describing
|
||||
// the settings for language and numbers.
|
||||
std::pair< QString, QString > prettyLocaleStatus( const LocaleConfiguration& ) const;
|
||||
|
|
|
@ -68,7 +68,7 @@ LocaleViewStep::setUpPage()
|
|||
{
|
||||
if ( !m_actualWidget )
|
||||
{
|
||||
m_actualWidget = new LocalePage();
|
||||
m_actualWidget = new LocalePage( m_config.get() );
|
||||
}
|
||||
m_actualWidget->init( m_startingTimezone.first, m_startingTimezone.second, m_localeGenPath );
|
||||
m_widget->layout()->addWidget( m_actualWidget );
|
||||
|
|
Loading…
Add table
Reference in a new issue