2017-12-20 14:39:09 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
2014-06-30 18:08:13 +02:00
|
|
|
*
|
|
|
|
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
2016-03-08 12:44:23 +01:00
|
|
|
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
|
2014-06-30 18:08:13 +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 CREATEPARTITIONDIALOG_H
|
|
|
|
#define CREATEPARTITIONDIALOG_H
|
|
|
|
|
2015-07-02 13:49:21 +02:00
|
|
|
// KPMcore
|
|
|
|
#include <kpmcore/core/partitionrole.h>
|
2016-03-08 12:44:01 +01:00
|
|
|
#include <kpmcore/core/partitiontable.h>
|
2015-07-02 13:49:21 +02:00
|
|
|
|
2014-06-30 18:08:13 +02:00
|
|
|
#include <QDialog>
|
|
|
|
#include <QScopedPointer>
|
|
|
|
|
2014-07-01 17:33:53 +02:00
|
|
|
|
2014-06-30 18:08:13 +02:00
|
|
|
class Device;
|
|
|
|
class Partition;
|
2014-07-15 17:37:04 +02:00
|
|
|
class PartitionNode;
|
2014-08-09 11:31:00 +02:00
|
|
|
class PartitionSizeController;
|
2014-06-30 18:08:13 +02:00
|
|
|
class Ui_CreatePartitionDialog;
|
|
|
|
|
2014-08-08 11:46:43 +02:00
|
|
|
/**
|
|
|
|
* The dialog which is shown to create a new partition or to edit a
|
|
|
|
* to-be-created partition.
|
|
|
|
*/
|
2014-06-30 18:08:13 +02:00
|
|
|
class CreatePartitionDialog : public QDialog
|
|
|
|
{
|
2014-07-04 18:32:35 +02:00
|
|
|
Q_OBJECT
|
2014-06-30 18:08:13 +02:00
|
|
|
public:
|
2016-11-20 23:05:55 +01:00
|
|
|
CreatePartitionDialog( Device* device, PartitionNode* parentPartition, const QStringList& usedMountPoints, QWidget* parentWidget = nullptr );
|
2014-06-30 18:08:13 +02:00
|
|
|
~CreatePartitionDialog();
|
|
|
|
|
2014-08-08 11:46:43 +02:00
|
|
|
/**
|
|
|
|
* Must be called when user wants to create a partition in
|
|
|
|
* freeSpacePartition.
|
|
|
|
*/
|
|
|
|
void initFromFreeSpace( Partition* freeSpacePartition );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Must be called when user wants to edit a to-be-created partition.
|
|
|
|
*/
|
2014-07-16 16:20:58 +02:00
|
|
|
void initFromPartitionToCreate( Partition* partition );
|
|
|
|
Partition* createPartition();
|
2014-06-30 18:08:13 +02:00
|
|
|
|
2016-03-08 12:44:01 +01:00
|
|
|
PartitionTable::Flags newFlags() const;
|
|
|
|
|
2014-07-04 18:32:35 +02:00
|
|
|
private Q_SLOTS:
|
|
|
|
void updateMountPointUi();
|
2016-11-21 00:05:44 +01:00
|
|
|
void checkMountPointSelection();
|
2014-07-04 18:32:35 +02:00
|
|
|
|
2014-06-30 18:08:13 +02:00
|
|
|
private:
|
|
|
|
QScopedPointer< Ui_CreatePartitionDialog > m_ui;
|
2014-08-09 11:31:00 +02:00
|
|
|
PartitionSizeController* m_partitionSizeController;
|
2014-06-30 18:08:13 +02:00
|
|
|
Device* m_device;
|
2014-07-15 17:37:04 +02:00
|
|
|
PartitionNode* m_parent;
|
2014-07-01 17:33:53 +02:00
|
|
|
PartitionRole m_role = PartitionRole( PartitionRole::None );
|
2016-11-20 23:05:55 +01:00
|
|
|
QStringList m_usedMountPoints;
|
2014-07-16 10:15:57 +02:00
|
|
|
|
2014-07-28 11:45:13 +02:00
|
|
|
void initGptPartitionTypeUi();
|
|
|
|
void initMbrPartitionTypeUi();
|
2014-08-07 13:04:02 +02:00
|
|
|
void initPartResizerWidget( Partition* );
|
2014-06-30 18:08:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* CREATEPARTITIONDIALOG_H */
|