2014-06-30 18:08:13 +02:00
|
|
|
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
|
|
|
*
|
|
|
|
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QScopedPointer>
|
|
|
|
|
2014-07-01 17:33:53 +02:00
|
|
|
// CalaPM
|
|
|
|
#include <core/partitionrole.h>
|
|
|
|
|
2014-06-30 18:08:13 +02:00
|
|
|
class Device;
|
|
|
|
class Partition;
|
2014-07-15 17:37:04 +02:00
|
|
|
class PartitionNode;
|
2014-07-04 17:58:32 +02:00
|
|
|
class PartitionInfo;
|
2014-06-30 18:08:13 +02:00
|
|
|
class Ui_CreatePartitionDialog;
|
|
|
|
|
|
|
|
class CreatePartitionDialog : public QDialog
|
|
|
|
{
|
2014-07-04 18:32:35 +02:00
|
|
|
Q_OBJECT
|
2014-06-30 18:08:13 +02:00
|
|
|
public:
|
2014-07-15 17:37:04 +02:00
|
|
|
CreatePartitionDialog( Device* device, PartitionNode* parentPartition, QWidget* parentWidget = nullptr );
|
2014-06-30 18:08:13 +02:00
|
|
|
~CreatePartitionDialog();
|
|
|
|
|
2014-07-16 10:15:57 +02:00
|
|
|
void initFromFreeSpace( Partition* partition );
|
2014-07-16 10:02:41 +02:00
|
|
|
void initFromPartitionInfo( PartitionInfo* partitionInfo );
|
2014-07-04 17:58:32 +02:00
|
|
|
PartitionInfo* createPartitionInfo();
|
2014-06-30 18:08:13 +02:00
|
|
|
|
2014-07-04 18:32:35 +02:00
|
|
|
private Q_SLOTS:
|
|
|
|
void updateMountPointUi();
|
|
|
|
|
2014-06-30 18:08:13 +02:00
|
|
|
private:
|
|
|
|
QScopedPointer< Ui_CreatePartitionDialog > m_ui;
|
|
|
|
Device* m_device;
|
2014-07-15 17:37:04 +02:00
|
|
|
qint64 m_minSector = 0;
|
|
|
|
qint64 m_maxSector = 0;
|
|
|
|
PartitionNode* m_parent;
|
2014-07-01 17:33:53 +02:00
|
|
|
PartitionRole m_role = PartitionRole( PartitionRole::None );
|
2014-07-16 10:15:57 +02:00
|
|
|
|
|
|
|
void initSectorRange( Partition* );
|
2014-07-16 10:34:56 +02:00
|
|
|
|
|
|
|
qint64 mbSizeForSectorRange( qint64 first, qint64 last ) const;
|
2014-06-30 18:08:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* CREATEPARTITIONDIALOG_H */
|