Create jobs in locale viewmodule.
This commit is contained in:
parent
34c5ac3182
commit
271b0945c9
@ -8,6 +8,7 @@ calamares_add_plugin( locale
|
||||
LocaleViewStep.cpp
|
||||
LocalePage.cpp
|
||||
QtWaitingSpinner.cpp
|
||||
SetTimezoneJob.cpp
|
||||
timezonewidget/timezonewidget.cpp
|
||||
timezonewidget/localeglobal.cpp
|
||||
UI
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "LocalePage.h"
|
||||
|
||||
#include "timezonewidget/timezonewidget.h"
|
||||
#include "SetTimezoneJob.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QComboBox>
|
||||
@ -179,3 +180,15 @@ LocalePage::prettyStatus() const
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
QList< Calamares::job_ptr >
|
||||
LocalePage::createJobs()
|
||||
{
|
||||
QList< Calamares::job_ptr > list;
|
||||
LocaleGlobal::Location location = m_tzWidget->getCurrentLocation();
|
||||
|
||||
Calamares::Job* j = new SetTimezoneJob( location.region, location.zone );
|
||||
list.append( Calamares::job_ptr( j ) );
|
||||
|
||||
return list;
|
||||
}
|
||||
|
@ -19,6 +19,8 @@
|
||||
#ifndef LOCALEPAGE_H
|
||||
#define LOCALEPAGE_H
|
||||
|
||||
#include "Typedefs.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QComboBox;
|
||||
@ -34,6 +36,8 @@ public:
|
||||
|
||||
QString prettyStatus() const;
|
||||
|
||||
QList< Calamares::job_ptr > createJobs();
|
||||
|
||||
private:
|
||||
TimeZoneWidget* m_tzWidget;
|
||||
QComboBox* m_regionCombo;
|
||||
|
@ -154,13 +154,16 @@ LocaleViewStep::isAtEnd() const
|
||||
QList< Calamares::job_ptr >
|
||||
LocaleViewStep::jobs() const
|
||||
{
|
||||
return QList< Calamares::job_ptr >();
|
||||
return m_jobs;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LocaleViewStep::onLeave()
|
||||
{
|
||||
m_jobs.clear();
|
||||
m_jobs.append( m_actualWidget->createJobs() );
|
||||
|
||||
m_prettyStatus = m_actualWidget->prettyStatus();
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,8 @@ private:
|
||||
QString m_prettyStatus;
|
||||
|
||||
QPair< QString, QString > m_startingTimezone;
|
||||
|
||||
QList< Calamares::job_ptr > m_jobs;
|
||||
};
|
||||
|
||||
#endif // LOCALEVIEWSTEP_H
|
||||
|
Loading…
Reference in New Issue
Block a user