2017-12-20 14:39:09 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
2014-06-27 17:25:39 +02:00
|
|
|
*
|
|
|
|
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
2018-06-15 11:59:11 +02:00
|
|
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
2019-01-10 16:28:05 +01:00
|
|
|
* Copyright 2019, Collabora Ltd
|
2014-06-27 17:25:39 +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 PARTITIONPAGE_H
|
|
|
|
#define PARTITIONPAGE_H
|
|
|
|
|
2014-07-03 18:00:40 +02:00
|
|
|
#include <QWidget>
|
2014-06-27 17:25:39 +02:00
|
|
|
#include <QScopedPointer>
|
2015-12-30 16:37:57 +01:00
|
|
|
#include <QMutex>
|
2014-06-27 17:25:39 +02:00
|
|
|
|
2014-06-30 13:37:46 +02:00
|
|
|
class PartitionCoreModule;
|
2014-06-27 17:25:39 +02:00
|
|
|
class Ui_PartitionPage;
|
|
|
|
|
2014-07-15 17:37:04 +02:00
|
|
|
class Device;
|
2014-06-27 17:25:39 +02:00
|
|
|
class DeviceModel;
|
2014-07-15 17:37:04 +02:00
|
|
|
class Partition;
|
2014-06-27 17:25:39 +02:00
|
|
|
|
2014-08-08 11:46:43 +02:00
|
|
|
/**
|
|
|
|
* The user interface for the module.
|
|
|
|
*
|
|
|
|
* Shows the information exposed by PartitionCoreModule and asks it to schedule
|
|
|
|
* jobs according to user actions.
|
|
|
|
*/
|
2014-07-03 18:00:40 +02:00
|
|
|
class PartitionPage : public QWidget
|
2014-06-27 17:25:39 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-09-03 18:07:35 +02:00
|
|
|
explicit PartitionPage( PartitionCoreModule* core, QWidget* parent = nullptr );
|
2014-06-27 17:25:39 +02:00
|
|
|
~PartitionPage();
|
|
|
|
|
2015-12-29 12:33:24 +01:00
|
|
|
void onRevertClicked();
|
|
|
|
|
2019-01-10 16:28:05 +01:00
|
|
|
int selectedDeviceIndex();
|
|
|
|
void selectDeviceByIndex( int index );
|
|
|
|
|
2014-06-27 17:25:39 +02:00
|
|
|
private:
|
|
|
|
QScopedPointer< Ui_PartitionPage > m_ui;
|
2014-06-30 13:37:46 +02:00
|
|
|
PartitionCoreModule* m_core;
|
2014-06-30 15:04:10 +02:00
|
|
|
void updateButtons();
|
2014-07-10 19:55:16 +02:00
|
|
|
void onNewPartitionTableClicked();
|
2018-06-04 21:31:58 +02:00
|
|
|
void onNewVolumeGroupClicked();
|
2018-06-26 05:38:52 +02:00
|
|
|
void onResizeVolumeGroupClicked();
|
|
|
|
void onDeactivateVolumeGroupClicked();
|
|
|
|
void onRemoveVolumeGroupClicked();
|
2014-06-30 16:17:28 +02:00
|
|
|
void onCreateClicked();
|
2014-07-15 17:37:04 +02:00
|
|
|
void onEditClicked();
|
2014-07-02 15:49:35 +02:00
|
|
|
void onDeleteClicked();
|
2014-07-25 13:07:22 +02:00
|
|
|
void onPartitionViewActivated();
|
2014-07-29 10:57:10 +02:00
|
|
|
void onPartitionModelReset();
|
2014-07-15 17:37:04 +02:00
|
|
|
|
2014-07-16 16:20:58 +02:00
|
|
|
void updatePartitionToCreate( Device*, Partition* );
|
2014-07-17 09:49:15 +02:00
|
|
|
void editExistingPartition( Device*, Partition* );
|
2014-07-23 18:15:46 +02:00
|
|
|
void updateBootLoaderInstallPath();
|
2014-07-24 19:26:19 +02:00
|
|
|
void updateFromCurrentDevice();
|
2016-05-05 15:28:35 +02:00
|
|
|
void updateBootLoaderIndex();
|
2015-12-30 16:37:57 +01:00
|
|
|
|
2018-05-16 16:56:06 +02:00
|
|
|
/**
|
|
|
|
* @brief Check if a new partition can be created (as primary) on the device.
|
|
|
|
*
|
|
|
|
* Returns true if a new partition can be created on the device. Provides
|
|
|
|
* a warning popup and returns false if it cannot.
|
|
|
|
*/
|
|
|
|
bool checkCanCreate( Device* );
|
|
|
|
|
2016-11-20 23:05:55 +01:00
|
|
|
QStringList getCurrentUsedMountpoints();
|
|
|
|
|
2015-12-30 16:37:57 +01:00
|
|
|
QMutex m_revertMutex;
|
2016-05-05 15:28:35 +02:00
|
|
|
int m_lastSelectedBootLoaderIndex;
|
2017-01-18 12:10:50 +01:00
|
|
|
bool m_isEfi;
|
2014-06-27 17:25:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PARTITIONPAGE_H
|