source: calamares/trunk/fuentes/src/modules/partition/gui/CreatePartitionDialog.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 2.6 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014, Aurélien Gâteau <agateau@kde.org>
4 *   Copyright 2016, Teo Mrnjavac <teo@kde.org>
5 *
6 *   Calamares is free software: you can redistribute it and/or modify
7 *   it under the terms of the GNU General Public License as published by
8 *   the Free Software Foundation, either version 3 of the License, or
9 *   (at your option) any later version.
10 *
11 *   Calamares is distributed in the hope that it will be useful,
12 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 *   GNU General Public License for more details.
15 *
16 *   You should have received a copy of the GNU General Public License
17 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef CREATEPARTITIONDIALOG_H
21#define CREATEPARTITIONDIALOG_H
22
23// KPMcore
24#include <kpmcore/core/partitionrole.h>
25#include <kpmcore/core/partitiontable.h>
26
27#include <QDialog>
28#include <QScopedPointer>
29
30
31class Device;
32class Partition;
33class PartitionNode;
34class PartitionSizeController;
35class Ui_CreatePartitionDialog;
36
37/**
38 * The dialog which is shown to create a new partition or to edit a
39 * to-be-created partition.
40 */
41class CreatePartitionDialog : public QDialog
42{
43    Q_OBJECT
44public:
45    /**
46     * @brief Dialog for editing a new partition.
47     *
48     * For the (unlikely) case that a newly created partition is being re-edited,
49     * pass a pointer to that @p partition, otherwise pass nullptr.
50     */
51    CreatePartitionDialog( Device* device, PartitionNode* parentPartition, Partition* partition, const QStringList& usedMountPoints, QWidget* parentWidget = nullptr );
52    ~CreatePartitionDialog();
53
54    /**
55     * Must be called when user wants to create a partition in
56     * freeSpacePartition.
57     */
58    void initFromFreeSpace( Partition* freeSpacePartition );
59
60    /**
61     * Must be called when user wants to edit a to-be-created partition.
62     */
63    void initFromPartitionToCreate( Partition* partition );
64    Partition* createPartition();
65
66    PartitionTable::Flags newFlags() const;
67
68private Q_SLOTS:
69    void updateMountPointUi();
70    void checkMountPointSelection();
71
72private:
73    QScopedPointer< Ui_CreatePartitionDialog > m_ui;
74    PartitionSizeController* m_partitionSizeController;
75    Device* m_device;
76    PartitionNode* m_parent;
77    PartitionRole m_role = PartitionRole( PartitionRole::None );
78    QStringList m_usedMountPoints;
79
80    void initGptPartitionTypeUi();
81    void initMbrPartitionTypeUi();
82    void initPartResizerWidget( Partition* );
83};
84
85#endif /* CREATEPARTITIONDIALOG_H */
Note: See TracBrowser for help on using the repository browser.