2008-09-24 20:32:01 +01:00
|
|
|
/***************************************************************************
|
2010-03-16 11:40:54 +00:00
|
|
|
* Copyright (C) 2008,2010 by Volker Lanz <vl@fidra.de> *
|
2008-09-24 20:32:01 +01:00
|
|
|
* *
|
|
|
|
* 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 2 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, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#if !defined(NEWDIALOG__H)
|
|
|
|
|
|
|
|
#define NEWDIALOG__H
|
|
|
|
|
|
|
|
#include "gui/sizedialogbase.h"
|
|
|
|
|
|
|
|
#include "core/partition.h"
|
|
|
|
|
2010-03-11 23:33:41 +00:00
|
|
|
#include "fs/filesystem.h"
|
|
|
|
|
2008-09-24 20:32:01 +01:00
|
|
|
class Device;
|
|
|
|
|
|
|
|
/** @brief Dialog to create new Partitions.
|
|
|
|
|
|
|
|
Dialog to create a new Partition in some unallocated space on a Device.
|
|
|
|
|
|
|
|
@author vl@fidra.de
|
|
|
|
*/
|
|
|
|
class NewDialog : public SizeDialogBase
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
NewDialog(QWidget* parent, Device& device, Partition& unallocatedPartition, PartitionRole::Roles r);
|
|
|
|
~NewDialog();
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void accept();
|
2008-12-27 13:37:44 +00:00
|
|
|
void onRoleChanged(bool);
|
2008-09-24 20:32:01 +01:00
|
|
|
void onFilesystemChanged(int);
|
2009-03-25 12:58:32 +00:00
|
|
|
void onLabelChanged(const QString& newLabel);
|
2008-09-24 20:32:01 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void setupConnections();
|
|
|
|
void setupDialog();
|
2009-03-25 12:58:32 +00:00
|
|
|
void updateHideAndShow();
|
2010-03-11 23:33:41 +00:00
|
|
|
void updateFileSystem(FileSystem::Type t);
|
2008-09-24 20:32:01 +01:00
|
|
|
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; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
PartitionRole::Roles m_PartitionRoles;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|