2015-02-07 00:32:25 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* Copyright (C) 2008, 2010 by Volker Lanz <vl@fidra.de> *
|
|
|
|
* *
|
|
|
|
* This program 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. *
|
|
|
|
* *
|
|
|
|
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.*
|
|
|
|
*************************************************************************/
|
2008-09-24 20:32:01 +01:00
|
|
|
|
|
|
|
#if !defined(NEWDIALOG__H)
|
|
|
|
|
|
|
|
#define NEWDIALOG__H
|
|
|
|
|
|
|
|
#include "gui/sizedialogbase.h"
|
|
|
|
|
2015-06-04 01:51:56 +01:00
|
|
|
#include <kpmcore/core/partition.h>
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-06-04 01:51:56 +01:00
|
|
|
#include <kpmcore/fs/filesystem.h>
|
2010-03-11 23:33:41 +00:00
|
|
|
|
2008-09-24 20:32:01 +01:00
|
|
|
class Device;
|
|
|
|
|
2010-05-18 23:27:30 +01:00
|
|
|
/** Dialog to create new Partitions.
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
Dialog to create a new Partition in some unallocated space on a Device.
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
@author Volker Lanz <vl@fidra.de>
|
2008-09-24 20:32:01 +01:00
|
|
|
*/
|
|
|
|
class NewDialog : public SizeDialogBase
|
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
Q_OBJECT
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
public:
|
|
|
|
NewDialog(QWidget* parent, Device& device, Partition& unallocatedPartition, PartitionRole::Roles r);
|
|
|
|
~NewDialog();
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
protected Q_SLOTS:
|
|
|
|
void accept();
|
|
|
|
void onRoleChanged(bool);
|
|
|
|
void onFilesystemChanged(int);
|
|
|
|
void onLabelChanged(const QString& newLabel);
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
protected:
|
|
|
|
void setupConnections();
|
|
|
|
void setupDialog();
|
|
|
|
void updateHideAndShow();
|
|
|
|
void updateFileSystem(FileSystem::Type t);
|
|
|
|
PartitionRole::Roles partitionRoles() const {
|
|
|
|
return m_PartitionRoles;
|
|
|
|
}
|
|
|
|
virtual bool canGrow() const {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
virtual bool canShrink() const {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
virtual bool canMove() const {
|
|
|
|
return true;
|
|
|
|
}
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
private:
|
|
|
|
PartitionRole::Roles m_PartitionRoles;
|
2008-09-24 20:32:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|