1
/***************************************************************************
2
* Copyright (C) 2008 by Volker Lanz <vl@fidra.de> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18
***************************************************************************/
20
#if !defined(PARTPROPSDIALOG__H)
22
#define PARTPROPSDIALOG__H
24
#include "fs/filesystem.h"
26
#include "core/partitiontable.h"
32
class PartPropsWidget;
38
/** @brief Show Partition properties.
40
Dialog that shows a Partition's properties and allows the user to change (or recreate)
41
the Partition's FileSystem, its label and its flags.
45
class PartPropsDialog : public KDialog
50
PartPropsDialog(QWidget* parent, Device& d, Partition& p);
54
QString newLabel() const;
55
PartitionTable::Flags newFlags() const;
56
FileSystem::Type newFileSystemType() const;
57
bool forceRecreate() const { return m_ForceRecreate; } /**< @return true if user wants to recreate the FileSystem on the Partition */
61
void setupConnections();
62
void setupFileSystemComboBox();
63
void setupFlagsList();
64
void updateHideAndShow();
66
bool warnFileSystemChange() const { return m_WarnFileSystemChange; }
67
void setWarnFileSystemChange() { m_WarnFileSystemChange = true; }
69
Device& device() { return m_Device; }
70
const Device& device() const { return m_Device; }
72
Partition& partition() { return m_Partition; }
73
const Partition& partition() const { return m_Partition; }
75
PartPropsWidget& dialogWidget() { Q_ASSERT(m_DialogWidget); return *m_DialogWidget; }
76
const PartPropsWidget& dialogWidget() const { Q_ASSERT(m_DialogWidget); return *m_DialogWidget; }
78
bool isReadOnly() const { return m_ReadOnly; }
79
void setForceRecreate(bool b) { m_ForceRecreate = b; }
83
void onFilesystemChanged(int idx);
88
Partition& m_Partition;
89
bool m_WarnFileSystemChange;
90
PartPropsWidget* m_DialogWidget;