diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-09-20 17:08:04 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-09-20 17:08:04 -0500 |
commit | 71d09ecaccd22e13ca2ac2faac9e2080364d1513 (patch) | |
tree | 3c28e0bb8d50117dde6b9de6636a3395d14b9491 /ui/qt5/mountdialog.cc | |
parent | b0b956ee5375c21ebd0461c6bfc5053e76ace478 (diff) | |
download | horizon-71d09ecaccd22e13ca2ac2faac9e2080364d1513.tar.gz horizon-71d09ecaccd22e13ca2ac2faac9e2080364d1513.tar.bz2 horizon-71d09ecaccd22e13ca2ac2faac9e2080364d1513.tar.xz horizon-71d09ecaccd22e13ca2ac2faac9e2080364d1513.zip |
Qt UI: Add ability to format from partition page
Diffstat (limited to 'ui/qt5/mountdialog.cc')
-rw-r--r-- | ui/qt5/mountdialog.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ui/qt5/mountdialog.cc b/ui/qt5/mountdialog.cc index 111bce6..618fdf7 100644 --- a/ui/qt5/mountdialog.cc +++ b/ui/qt5/mountdialog.cc @@ -77,6 +77,20 @@ MountDialog::MountDialog(QStringList skipParts, QStringList skipMounts, pathInput->setWhatsThis(tr("Select where the partition will be mounted.")); pathInput->addItems(pathCandidates); + QStringList fsCandidates = {"ext4", "xfs", "jfs", "hfs+", "vfat", "ext3"}; + formatChoice = new QCheckBox(tr("Format")); + formatChoice->setWhatsThis(tr("Erase and format this device with a new file system.")); + + formatInput = new QComboBox; + formatInput->setEditable(false); + formatInput->setWhatsThis(tr("Select the file system this partition will be formatted.")); + formatInput->addItems(fsCandidates); + + QHBoxLayout *formatLayout = new QHBoxLayout; + formatLayout->addWidget(formatChoice); + formatLayout->addStretch(); + formatLayout->addWidget(formatInput); + QVBoxLayout *controlLayout = new QVBoxLayout; controlLayout->addWidget(new QLabel(tr("Partition"))); #ifdef HAS_INSTALL_ENV @@ -86,6 +100,7 @@ MountDialog::MountDialog(QStringList skipParts, QStringList skipMounts, #endif /* HAS_INSTALL_ENV */ controlLayout->addWidget(new QLabel(tr("will be mounted on"))); controlLayout->addWidget(pathInput); + controlLayout->addLayout(formatLayout); QHBoxLayout *mainBox = new QHBoxLayout; mainBox->addLayout(controlLayout); @@ -120,3 +135,19 @@ QString MountDialog::mountPoint() const { void MountDialog::setMountPoint(const QString &path) { pathInput->setCurrentText(path); } + +bool MountDialog::isFormatting() const { + return formatChoice->isChecked(); +} + +void MountDialog::setFormatting(bool format) { + formatChoice->setChecked(format); +} + +QString MountDialog::formatType() const { + return formatInput->currentText(); +} + +void MountDialog::setFormatType(const QString &formatType) { + formatInput->setCurrentText(formatType); +} |