2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2014-07-10 19:55:16 +02:00
|
|
|
*
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-FileCopyrightText: 2014 Aurélien Gâteau <agateau@kde.org>
|
|
|
|
* SPDX-FileCopyrightText: 2015 Teo Mrnjavac <teo@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2014-07-10 19:55:16 +02:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2014-07-10 19:55:16 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CREATEPARTITIONTABLEJOB_H
|
|
|
|
#define CREATEPARTITIONTABLEJOB_H
|
|
|
|
|
2019-06-14 23:14:11 +02:00
|
|
|
#include "Job.h"
|
2019-06-14 23:39:44 +02:00
|
|
|
#include "partition/KPMManager.h"
|
2014-07-10 19:55:16 +02:00
|
|
|
|
2015-07-02 13:49:21 +02:00
|
|
|
// KPMcore
|
|
|
|
#include <kpmcore/core/partitiontable.h>
|
2014-07-15 14:40:08 +02:00
|
|
|
|
2014-07-10 19:55:16 +02:00
|
|
|
class Device;
|
|
|
|
|
2014-08-08 11:46:43 +02:00
|
|
|
/**
|
|
|
|
* Creates a partition table on a device. It supports MBR and GPT partition
|
|
|
|
* tables.
|
|
|
|
*
|
|
|
|
* This wipes all the data from the device.
|
|
|
|
*/
|
2014-07-10 19:55:16 +02:00
|
|
|
class CreatePartitionTableJob : public Calamares::Job
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-07-15 14:40:08 +02:00
|
|
|
CreatePartitionTableJob( Device* device, PartitionTable::TableType type );
|
2014-07-10 19:55:16 +02:00
|
|
|
QString prettyName() const override;
|
2015-04-09 15:16:09 +02:00
|
|
|
QString prettyDescription() const override;
|
2015-06-13 02:26:38 +02:00
|
|
|
QString prettyStatusMessage() const override;
|
2014-07-10 19:55:16 +02:00
|
|
|
Calamares::JobResult exec() override;
|
|
|
|
|
|
|
|
void updatePreview();
|
2020-04-07 11:36:40 +02:00
|
|
|
Device* device() const { return m_device; }
|
2014-07-10 19:55:16 +02:00
|
|
|
|
|
|
|
private:
|
2019-06-14 23:39:44 +02:00
|
|
|
CalamaresUtils::Partition::KPMManager m_kpmcore;
|
2014-07-10 19:55:16 +02:00
|
|
|
Device* m_device;
|
2014-07-15 14:40:08 +02:00
|
|
|
PartitionTable::TableType m_type;
|
2014-07-10 19:55:16 +02:00
|
|
|
PartitionTable* createTable();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* CREATEPARTITIONTABLEJOB_H */
|