Enqueue all partition jobs when leaving the PartitionViewStep
This commit is contained in:
parent
4916d0cb88
commit
a318ec49fc
@ -21,7 +21,6 @@
|
||||
#include <CreatePartitionJob.h>
|
||||
#include <DeletePartitionJob.h>
|
||||
#include <DeviceModel.h>
|
||||
#include <JobQueue.h>
|
||||
#include <PartitionModel.h>
|
||||
#include <Typedefs.h>
|
||||
#include <utils/Logger.h>
|
||||
|
@ -52,6 +52,11 @@ public:
|
||||
|
||||
void deletePartition( Device* device, Partition* partition );
|
||||
|
||||
QList< Calamares::job_ptr > jobs() const
|
||||
{
|
||||
return m_jobs;
|
||||
}
|
||||
|
||||
private:
|
||||
struct DeviceInfo
|
||||
{
|
||||
|
@ -31,10 +31,10 @@
|
||||
#include <QItemSelectionModel>
|
||||
#include <QPointer>
|
||||
|
||||
PartitionPage::PartitionPage( QWidget* parent )
|
||||
PartitionPage::PartitionPage( PartitionCoreModule* core, QWidget* parent )
|
||||
: Calamares::AbstractPage( parent )
|
||||
, m_ui( new Ui_PartitionPage )
|
||||
, m_core( new PartitionCoreModule( this ) )
|
||||
, m_core( core )
|
||||
{
|
||||
m_ui->setupUi( this );
|
||||
m_ui->deviceListView->setModel( m_core->deviceModel() );
|
||||
|
@ -32,7 +32,7 @@ class PartitionPage : public Calamares::AbstractPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PartitionPage( QWidget* parent = 0 );
|
||||
explicit PartitionPage( PartitionCoreModule* core, QWidget* parent = 0 );
|
||||
~PartitionPage();
|
||||
|
||||
Q_SIGNALS:
|
||||
|
@ -16,14 +16,16 @@
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "PartitionViewStep.h"
|
||||
|
||||
#include "PartitionPage.h"
|
||||
#include <PartitionViewStep.h>
|
||||
|
||||
#include <PartitionPage.h>
|
||||
#include <PartitionCoreModule.h>
|
||||
#include <JobQueue.h>
|
||||
|
||||
PartitionViewStep::PartitionViewStep( QObject* parent )
|
||||
: Calamares::ViewStep( parent )
|
||||
, m_widget( new PartitionPage() )
|
||||
, m_core( new PartitionCoreModule( this ) )
|
||||
, m_widget( new PartitionPage( m_core ) )
|
||||
{
|
||||
}
|
||||
|
||||
@ -45,6 +47,7 @@ PartitionViewStep::widget()
|
||||
void
|
||||
PartitionViewStep::next()
|
||||
{
|
||||
Calamares::JobQueue::instance()->enqueue( m_core->jobs() );
|
||||
emit done();
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "PluginDllMacro.h"
|
||||
|
||||
class PartitionPage;
|
||||
class PartitionCoreModule;
|
||||
|
||||
class PLUGINDLLEXPORT PartitionViewStep : public Calamares::ViewStep
|
||||
{
|
||||
@ -48,6 +49,7 @@ public:
|
||||
bool isAtEnd() const override;
|
||||
|
||||
private:
|
||||
PartitionCoreModule* m_core;
|
||||
PartitionPage* m_widget;
|
||||
};
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <PartitionCoreModule.h>
|
||||
#include <PartitionPage.h>
|
||||
|
||||
#include <QApplication>
|
||||
@ -6,7 +7,8 @@ int
|
||||
main( int argc, char* argv[] )
|
||||
{
|
||||
QApplication app( argc, argv );
|
||||
PartitionPage page;
|
||||
PartitionCoreModule core;
|
||||
PartitionPage page( &core );
|
||||
page.show();
|
||||
return app.exec();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user