2020-09-16 00:35:12 +01:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2008-2012 Volker Lanz <vl@fidra.de>
|
2020-10-24 22:15:02 +01:00
|
|
|
SPDX-FileCopyrightText: 2013-2020 Andrius Štikonas <andrius@stikonas.eu>
|
2020-09-16 00:35:12 +01:00
|
|
|
SPDX-FileCopyrightText: 2015 Teo Mrnjavac <teo@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2016 Chantara Tith <tith.chantara@gmail.com>
|
|
|
|
SPDX-FileCopyrightText: 2018 Caio Jordão Carvalho <caiojcarvalho@gmail.com>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
2008-09-24 20:32:01 +01:00
|
|
|
|
|
|
|
#include "gui/newdialog.h"
|
|
|
|
#include "gui/sizedialogwidget.h"
|
2010-04-15 11:46:36 +01:00
|
|
|
#include "gui/sizedetailswidget.h"
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2016-01-12 00:12:49 +00:00
|
|
|
#include <core/partition.h>
|
|
|
|
#include <core/device.h>
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2016-01-12 00:12:49 +00:00
|
|
|
#include <fs/filesystemfactory.h>
|
2016-04-15 14:38:11 +01:00
|
|
|
#include <fs/luks.h>
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2016-01-12 00:12:49 +00:00
|
|
|
#include <util/capacity.h>
|
|
|
|
#include <util/helpers.h>
|
2015-06-12 13:11:29 +01:00
|
|
|
#include "util/guihelpers.h"
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2020-10-24 22:15:02 +01:00
|
|
|
#include <utility>
|
|
|
|
|
2017-10-09 13:54:31 +01:00
|
|
|
#include <QtGlobal>
|
2014-05-18 21:41:48 +01:00
|
|
|
#include <QFontDatabase>
|
2020-11-14 01:30:13 +00:00
|
|
|
#include <QPalette>
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2016-05-17 01:06:45 +01:00
|
|
|
#include <KColorScheme>
|
2014-05-17 03:06:58 +01:00
|
|
|
#include <KConfigGroup>
|
2014-05-13 23:53:37 +01:00
|
|
|
#include <KLocalizedString>
|
2014-05-17 03:06:58 +01:00
|
|
|
#include <KSharedConfig>
|
2014-05-13 23:53:37 +01:00
|
|
|
|
2008-09-24 20:32:01 +01:00
|
|
|
/** Creates a NewDialog
|
2015-07-13 15:17:41 +01:00
|
|
|
@param parent the parent widget
|
|
|
|
@param device the Device on which a new Partition is to be created
|
|
|
|
@param unallocatedPartition the unallocated space on the Device to create a Partition in
|
|
|
|
@param r the permitted Roles for the new Partition
|
2008-09-24 20:32:01 +01:00
|
|
|
*/
|
|
|
|
NewDialog::NewDialog(QWidget* parent, Device& device, Partition& unallocatedPartition, PartitionRole::Roles r) :
|
2015-07-13 15:17:41 +01:00
|
|
|
SizeDialogBase(parent, device, unallocatedPartition, unallocatedPartition.firstSector(), unallocatedPartition.lastSector()),
|
2016-07-17 08:25:56 +01:00
|
|
|
m_PartitionRoles(r),
|
2017-10-28 18:35:53 +01:00
|
|
|
m_IsValidPassword(true)
|
2008-09-24 20:32:01 +01:00
|
|
|
{
|
2016-07-18 02:21:14 +01:00
|
|
|
setWindowTitle(xi18nc("@title:window", "Create a new partition"));
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
setupDialog();
|
|
|
|
setupConstraints();
|
|
|
|
setupConnections();
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2016-07-17 08:25:56 +01:00
|
|
|
updateOkButtonStatus();
|
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
KConfigGroup kcg(KSharedConfig::openConfig(), "newDialog");
|
|
|
|
restoreGeometry(kcg.readEntry<QByteArray>("Geometry", QByteArray()));
|
2008-09-24 20:32:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
NewDialog::~NewDialog()
|
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
KConfigGroup kcg(KSharedConfig::openConfig(), "newDialog");
|
|
|
|
kcg.writeEntry("Geometry", saveGeometry());
|
2008-09-24 20:32:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void NewDialog::setupDialog()
|
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
QStringList fsNames;
|
2016-08-09 14:57:33 +01:00
|
|
|
for (const auto &fs : FileSystemFactory::map()) {
|
2016-04-15 14:38:11 +01:00
|
|
|
if (fs->supportCreate() != FileSystem::cmdSupportNone &&
|
2018-04-07 19:54:55 +01:00
|
|
|
fs->type() != FileSystem::Type::Extended &&
|
|
|
|
fs->type() != FileSystem::Type::Luks &&
|
|
|
|
fs->type() != FileSystem::Type::Luks2)
|
2016-04-15 14:38:11 +01:00
|
|
|
fsNames.append(fs->name());
|
2016-08-08 19:39:20 +01:00
|
|
|
}
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2017-05-03 19:24:41 +01:00
|
|
|
std::sort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan);
|
2010-02-17 19:39:24 +00:00
|
|
|
|
2020-10-24 22:15:02 +01:00
|
|
|
for (const auto &fsName : std::as_const(fsNames))
|
2016-04-15 14:38:11 +01:00
|
|
|
dialogWidget().comboFileSystem().addItem(createFileSystemColor(FileSystem::typeForName(fsName), 8), fsName);
|
2010-02-17 19:39:24 +00:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
QString selected = FileSystem::nameForType(GuiHelpers::defaultFileSystem());
|
|
|
|
const int idx = dialogWidget().comboFileSystem().findText(selected);
|
|
|
|
dialogWidget().comboFileSystem().setCurrentIndex(idx != -1 ? idx : 0);
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
dialogWidget().radioPrimary().setVisible(partitionRoles() & PartitionRole::Primary);
|
|
|
|
dialogWidget().radioExtended().setVisible(partitionRoles() & PartitionRole::Extended);
|
|
|
|
dialogWidget().radioLogical().setVisible(partitionRoles() & PartitionRole::Logical);
|
2008-12-27 13:37:44 +00:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
if (partitionRoles() & PartitionRole::Primary)
|
|
|
|
dialogWidget().radioPrimary().setChecked(true);
|
|
|
|
else
|
|
|
|
dialogWidget().radioLogical().setChecked(true);
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
SizeDialogBase::setupDialog();
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2016-04-21 17:43:44 +01:00
|
|
|
dialogWidget().checkBoxEncrypt().hide();
|
|
|
|
dialogWidget().editPassphrase().hide();
|
|
|
|
|
2018-04-09 02:58:03 +01:00
|
|
|
if (device().type() == Device::Type::LVM_Device) {
|
2018-01-06 21:24:16 +00:00
|
|
|
dialogWidget().comboFileSystem().removeItem(dialogWidget().comboFileSystem().findText(QStringLiteral("lvm2 pv")));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-05-17 01:06:45 +01:00
|
|
|
dialogWidget().editPassphrase().setMinimumPasswordLength(1);
|
|
|
|
dialogWidget().editPassphrase().setMaximumPasswordLength(512); // cryptsetup does not support longer passwords
|
|
|
|
|
|
|
|
// set a background warning color (taken from the current color scheme)
|
|
|
|
KColorScheme colorScheme(QPalette::Active, KColorScheme::View);
|
|
|
|
dialogWidget().editPassphrase().setBackgroundWarningColor(colorScheme.background(KColorScheme::NegativeBackground).color());
|
|
|
|
|
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
// don't move these above the call to parent's setupDialog, because only after that has
|
|
|
|
// run there is a valid partition set in the part resizer widget and they will need that.
|
|
|
|
onRoleChanged(false);
|
|
|
|
onFilesystemChanged(dialogWidget().comboFileSystem().currentIndex());
|
2021-12-12 20:13:52 +00:00
|
|
|
|
2021-12-28 16:27:20 +00:00
|
|
|
auto showPermissionsGroup = [this] {
|
2021-12-12 20:13:52 +00:00
|
|
|
const QString currText = dialogWidget().comboFileSystem().currentText();
|
|
|
|
const bool enablePosixPermission = QList<QString>({
|
2021-12-28 15:50:30 +00:00
|
|
|
QStringLiteral("btrfs"),
|
2021-12-12 20:13:52 +00:00
|
|
|
QStringLiteral("ext2"),
|
|
|
|
QStringLiteral("ext3"),
|
2021-12-28 15:50:30 +00:00
|
|
|
QStringLiteral("ext4"),
|
|
|
|
QStringLiteral("f2fs"),
|
|
|
|
QStringLiteral("hfsplus"),
|
|
|
|
QStringLiteral("jfs"),
|
|
|
|
QStringLiteral("minix"),
|
|
|
|
QStringLiteral("ocfs2"),
|
|
|
|
QStringLiteral("reiserfs"),
|
|
|
|
QStringLiteral("reiser4"),
|
|
|
|
QStringLiteral("udf"),
|
|
|
|
QStringLiteral("xfs"),
|
|
|
|
QStringLiteral("zfs"),}
|
2021-12-12 20:13:52 +00:00
|
|
|
).contains(currText);
|
|
|
|
if (enablePosixPermission) {
|
|
|
|
dialogWidget().showPosixPermissions();
|
|
|
|
} else {
|
|
|
|
dialogWidget().hidePosixPermissions();
|
|
|
|
}
|
2021-12-28 16:27:20 +00:00
|
|
|
};
|
|
|
|
connect(&dialogWidget().comboFileSystem(), QOverload<int>::of(&QComboBox::currentIndexChanged), this, showPermissionsGroup);
|
|
|
|
showPermissionsGroup();
|
2021-12-28 16:36:45 +00:00
|
|
|
dialogWidget().radioRootPermissions().setChecked(true);
|
2008-09-24 20:32:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void NewDialog::setupConnections()
|
|
|
|
{
|
2016-05-22 20:03:49 +01:00
|
|
|
connect(&dialogWidget().radioPrimary(), &QRadioButton::toggled, this, &NewDialog::onRoleChanged);
|
|
|
|
connect(&dialogWidget().radioExtended(), &QRadioButton::toggled, this, &NewDialog::onRoleChanged);
|
|
|
|
connect(&dialogWidget().radioLogical(), &QRadioButton::toggled, this, &NewDialog::onRoleChanged);
|
|
|
|
connect(&dialogWidget().checkBoxEncrypt(), &QCheckBox::toggled, this, &NewDialog::onRoleChanged);
|
2017-10-09 13:54:31 +01:00
|
|
|
connect(&dialogWidget().comboFileSystem(), qOverload<int>(&QComboBox::currentIndexChanged), this, &NewDialog::onFilesystemChanged);
|
2016-05-22 20:03:49 +01:00
|
|
|
connect(&dialogWidget().label(), &QLineEdit::textChanged, this, &NewDialog::onLabelChanged);
|
2016-06-25 12:00:16 +01:00
|
|
|
// listen to password status updates
|
|
|
|
connect(&dialogWidget().editPassphrase(), &KNewPasswordWidget::passwordStatusChanged, this, &NewDialog::slotPasswordStatusChanged);
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
SizeDialogBase::setupConnections();
|
2008-09-24 20:32:01 +01:00
|
|
|
}
|
|
|
|
|
2016-06-25 17:59:26 +01:00
|
|
|
bool NewDialog::canMove() const
|
|
|
|
{
|
2018-04-09 02:58:03 +01:00
|
|
|
return (device().type() == Device::Type::LVM_Device) ? false : true;
|
2016-06-25 17:59:26 +01:00
|
|
|
}
|
|
|
|
|
2008-09-24 20:32:01 +01:00
|
|
|
void NewDialog::accept()
|
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
if (partition().roles().has(PartitionRole::Extended)) {
|
|
|
|
partition().deleteFileSystem();
|
2018-04-07 19:54:55 +01:00
|
|
|
partition().setFileSystem(FileSystemFactory::create(FileSystem::Type::Extended,
|
2016-04-15 14:38:11 +01:00
|
|
|
partition().firstSector(),
|
2017-09-03 16:01:48 +01:00
|
|
|
partition().lastSector(),
|
|
|
|
partition().sectorSize()));
|
2016-04-15 14:38:11 +01:00
|
|
|
}
|
2016-04-19 15:53:56 +01:00
|
|
|
else if (partition().roles().has(PartitionRole::Luks)) {
|
2016-04-15 14:38:11 +01:00
|
|
|
FileSystem::Type innerFsType = partition().fileSystem().type();
|
|
|
|
partition().deleteFileSystem();
|
|
|
|
FS::luks* luksFs = dynamic_cast< FS::luks* >(
|
2018-04-07 19:54:55 +01:00
|
|
|
FileSystemFactory::create(FileSystem::Type::Luks,
|
2016-04-15 14:38:11 +01:00
|
|
|
partition().firstSector(),
|
2017-09-03 16:01:48 +01:00
|
|
|
partition().lastSector(),
|
|
|
|
partition().sectorSize()));
|
2016-04-15 14:38:11 +01:00
|
|
|
luksFs->createInnerFileSystem(innerFsType);
|
2016-04-29 21:27:43 +01:00
|
|
|
luksFs->setPassphrase(dialogWidget().editPassphrase().password());
|
2016-04-15 14:38:11 +01:00
|
|
|
partition().setFileSystem(luksFs);
|
2016-04-24 17:48:24 +01:00
|
|
|
partition().fileSystem().setLabel(dialogWidget().label().text());
|
2015-07-13 15:17:41 +01:00
|
|
|
}
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
QDialog::accept();
|
2008-09-24 20:32:01 +01:00
|
|
|
}
|
|
|
|
|
2008-12-27 13:37:44 +00:00
|
|
|
void NewDialog::onRoleChanged(bool)
|
2008-09-24 20:32:01 +01:00
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
PartitionRole::Roles r = PartitionRole::None;
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
if (dialogWidget().radioPrimary().isChecked())
|
|
|
|
r = PartitionRole::Primary;
|
|
|
|
else if (dialogWidget().radioExtended().isChecked())
|
|
|
|
r = PartitionRole::Extended;
|
|
|
|
else if (dialogWidget().radioLogical().isChecked())
|
|
|
|
r = PartitionRole::Logical;
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2016-04-21 16:57:25 +01:00
|
|
|
bool doEncrypt = dialogWidget().checkBoxEncrypt().isVisible() &&
|
|
|
|
dialogWidget().checkBoxEncrypt().isChecked();
|
|
|
|
if (doEncrypt)
|
2016-04-19 15:53:56 +01:00
|
|
|
r |= PartitionRole::Luks;
|
2016-04-15 14:38:11 +01:00
|
|
|
|
2016-04-21 16:57:25 +01:00
|
|
|
dialogWidget().editPassphrase().setVisible(doEncrypt);
|
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
// Make sure an extended partition gets correctly displayed: Set its file system to extended.
|
|
|
|
// Also make sure to set a primary's or logical's file system once the user goes back from
|
|
|
|
// extended to any of those.
|
|
|
|
if (r == PartitionRole::Extended)
|
2018-04-07 19:54:55 +01:00
|
|
|
updateFileSystem(FileSystem::Type::Extended);
|
2015-07-13 15:17:41 +01:00
|
|
|
else
|
|
|
|
updateFileSystem(FileSystem::typeForName(dialogWidget().comboFileSystem().currentText()));
|
2010-03-11 23:33:41 +00:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
dialogWidget().comboFileSystem().setEnabled(r != PartitionRole::Extended);
|
|
|
|
partition().setRoles(PartitionRole(r));
|
2010-03-16 11:40:54 +00:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
setupConstraints();
|
2010-03-16 11:40:54 +00:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
dialogWidget().partResizerWidget().resizeLogicals(0, 0, true);
|
|
|
|
dialogWidget().partResizerWidget().update();
|
2010-04-15 17:59:56 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
updateHideAndShow();
|
2008-09-24 20:32:01 +01:00
|
|
|
}
|
|
|
|
|
2010-03-11 23:33:41 +00:00
|
|
|
void NewDialog::updateFileSystem(FileSystem::Type t)
|
2008-09-24 20:32:01 +01:00
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
partition().deleteFileSystem();
|
2017-09-03 16:01:48 +01:00
|
|
|
partition().setFileSystem(FileSystemFactory::create(t, partition().firstSector(), partition().lastSector(), partition().sectorSize()));
|
2010-03-11 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void NewDialog::onFilesystemChanged(int idx)
|
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
updateFileSystem(FileSystem::typeForName(dialogWidget().comboFileSystem().itemText(idx)));
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
setupConstraints();
|
2016-08-27 00:16:32 +01:00
|
|
|
updateOkButtonStatus();
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2017-09-03 16:01:48 +01:00
|
|
|
const FileSystem* fs = FileSystemFactory::create(FileSystem::typeForName(dialogWidget().comboFileSystem().currentText()), -1, -1, -1, -1, QString());
|
2017-09-05 12:52:47 +01:00
|
|
|
dialogWidget().m_EditLabel->setMaxLength(fs->maxLabelLength());
|
|
|
|
dialogWidget().m_EditLabel->setValidator(fs->labelValidator(dialogWidget().m_EditLabel));
|
2013-01-03 12:43:03 +00:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
updateSpinCapacity(partition().length());
|
|
|
|
dialogWidget().partResizerWidget().update();
|
2009-03-25 12:58:32 +00:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
updateHideAndShow();
|
2009-03-25 12:58:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void NewDialog::onLabelChanged(const QString& newLabel)
|
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
partition().fileSystem().setLabel(newLabel);
|
2009-03-25 12:58:32 +00:00
|
|
|
}
|
|
|
|
|
2016-05-17 01:06:45 +01:00
|
|
|
void NewDialog::slotPasswordStatusChanged()
|
|
|
|
{
|
|
|
|
// You may want to extend this switch with more cases,
|
|
|
|
// in order to warn the user about all the possible password issues.
|
|
|
|
switch (dialogWidget().editPassphrase().passwordStatus()) {
|
|
|
|
case KNewPasswordWidget::WeakPassword:
|
|
|
|
case KNewPasswordWidget::StrongPassword:
|
2016-07-17 08:25:56 +01:00
|
|
|
m_IsValidPassword = true;
|
2016-05-17 01:06:45 +01:00
|
|
|
break;
|
|
|
|
default:
|
2016-07-17 08:25:56 +01:00
|
|
|
m_IsValidPassword = false;
|
2016-05-17 01:06:45 +01:00
|
|
|
break;
|
|
|
|
}
|
2016-07-17 08:25:56 +01:00
|
|
|
updateOkButtonStatus();
|
2016-05-17 01:06:45 +01:00
|
|
|
}
|
|
|
|
|
2009-03-25 12:58:32 +00:00
|
|
|
void NewDialog::updateHideAndShow()
|
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
// this is mostly copy'n'pasted from PartPropsDialog::updateHideAndShow()
|
2017-08-18 12:50:41 +01:00
|
|
|
if (partition().roles().has(PartitionRole::Extended) ||
|
|
|
|
(partition().fileSystem().supportSetLabel() == FileSystem::cmdSupportNone &&
|
|
|
|
partition().fileSystem().supportCreateWithLabel() == FileSystem::cmdSupportNone) )
|
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
dialogWidget().label().setReadOnly(true);
|
|
|
|
dialogWidget().noSetLabel().setVisible(true);
|
|
|
|
dialogWidget().noSetLabel().setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
|
|
|
|
|
|
|
|
QPalette palette = dialogWidget().noSetLabel().palette();
|
2020-11-14 01:30:13 +00:00
|
|
|
QColor f = palette.color(QPalette::WindowText);
|
2015-07-13 15:17:41 +01:00
|
|
|
f.setAlpha(128);
|
2020-11-14 01:30:13 +00:00
|
|
|
palette.setColor(QPalette::WindowText, f);
|
2015-07-13 15:17:41 +01:00
|
|
|
dialogWidget().noSetLabel().setPalette(palette);
|
2016-04-15 14:38:11 +01:00
|
|
|
dialogWidget().checkBoxEncrypt().hide();
|
2016-04-21 16:57:25 +01:00
|
|
|
dialogWidget().editPassphrase().hide();
|
2015-07-13 15:17:41 +01:00
|
|
|
} else {
|
|
|
|
dialogWidget().label().setReadOnly(false);
|
|
|
|
dialogWidget().noSetLabel().setVisible(false);
|
|
|
|
}
|
2018-05-07 23:22:20 +01:00
|
|
|
if (FileSystemFactory::map()[FileSystem::Type::Luks]->supportCreate() && FS::luks::canEncryptType(FileSystem::typeForName(dialogWidget().comboFileSystem().currentText())) && !partition().roles().has(PartitionRole::Extended))
|
2016-04-21 18:30:18 +01:00
|
|
|
{
|
2016-04-16 00:28:14 +01:00
|
|
|
dialogWidget().checkBoxEncrypt().show();
|
2016-04-21 18:25:53 +01:00
|
|
|
if (dialogWidget().checkBoxEncrypt().isChecked())
|
|
|
|
{
|
|
|
|
dialogWidget().editPassphrase().show();
|
2016-05-17 01:06:45 +01:00
|
|
|
slotPasswordStatusChanged();
|
2016-04-21 18:25:53 +01:00
|
|
|
}
|
2016-04-21 18:30:18 +01:00
|
|
|
}
|
2016-04-16 00:28:14 +01:00
|
|
|
else
|
2016-04-21 18:21:34 +01:00
|
|
|
{
|
2016-04-16 00:28:14 +01:00
|
|
|
dialogWidget().checkBoxEncrypt().hide();
|
2016-04-21 18:21:34 +01:00
|
|
|
dialogWidget().editPassphrase().hide();
|
|
|
|
}
|
2016-04-16 00:28:14 +01:00
|
|
|
|
2008-09-24 20:32:01 +01:00
|
|
|
}
|
2016-07-17 08:25:56 +01:00
|
|
|
|
|
|
|
void NewDialog::updateOkButtonStatus()
|
|
|
|
{
|
|
|
|
okButton->setEnabled(isValidPassword() && isValidLVName());
|
|
|
|
}
|
2021-12-09 13:10:21 +00:00
|
|
|
|
|
|
|
bool NewDialog::useUnsecuredPartition() const
|
|
|
|
{
|
2021-12-12 20:13:52 +00:00
|
|
|
return !dialogWidget().isPermissionOnlyRoot();
|
2021-12-09 13:10:21 +00:00
|
|
|
}
|