[partition] Mount points should start with a /
This commit is contained in:
parent
fbcd1ffbbe
commit
d8be9a9443
@ -325,11 +325,17 @@ CreatePartitionDialog::updateMountPointUi()
|
|||||||
void
|
void
|
||||||
CreatePartitionDialog::checkMountPointSelection()
|
CreatePartitionDialog::checkMountPointSelection()
|
||||||
{
|
{
|
||||||
if ( m_usedMountPoints.contains( selectedMountPoint( m_ui->mountPointComboBox ) ) )
|
const QString mountPoint = selectedMountPoint( m_ui->mountPointComboBox );
|
||||||
|
if ( m_usedMountPoints.contains( mountPoint ) )
|
||||||
{
|
{
|
||||||
m_ui->labelMountPoint->setText( tr( "Mountpoint already in use. Please select another one." ) );
|
m_ui->labelMountPoint->setText( tr( "Mountpoint already in use. Please select another one." ) );
|
||||||
m_ui->buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
m_ui->buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
||||||
}
|
}
|
||||||
|
else if ( !mountPoint.isEmpty() && !mountPoint.startsWith( '/' ) )
|
||||||
|
{
|
||||||
|
m_ui->labelMountPoint->setText( tr( "Mountpoint must start with a <pre>/</pre>." ) );
|
||||||
|
m_ui->buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ui->labelMountPoint->setText( QString() );
|
m_ui->labelMountPoint->setText( QString() );
|
||||||
|
@ -295,11 +295,17 @@ EditExistingPartitionDialog::updateMountPointPicker()
|
|||||||
void
|
void
|
||||||
EditExistingPartitionDialog::checkMountPointSelection()
|
EditExistingPartitionDialog::checkMountPointSelection()
|
||||||
{
|
{
|
||||||
if ( m_usedMountPoints.contains( selectedMountPoint( m_ui->mountPointComboBox ) ) )
|
const QString mountPoint = selectedMountPoint( m_ui->mountPointComboBox );
|
||||||
|
if ( m_usedMountPoints.contains( mountPoint ) )
|
||||||
{
|
{
|
||||||
m_ui->labelMountPoint->setText( tr( "Mountpoint already in use. Please select another one." ) );
|
m_ui->labelMountPoint->setText( tr( "Mountpoint already in use. Please select another one." ) );
|
||||||
m_ui->buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
m_ui->buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
||||||
}
|
}
|
||||||
|
else if ( !mountPoint.isEmpty() && !mountPoint.startsWith( '/' ) )
|
||||||
|
{
|
||||||
|
m_ui->labelMountPoint->setText( tr( "Mountpoint must start with a <pre>/</pre>." ) );
|
||||||
|
m_ui->buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ui->labelMountPoint->setText( QString() );
|
m_ui->labelMountPoint->setText( QString() );
|
||||||
|
Loading…
Reference in New Issue
Block a user