Check first selection of mountpoint too.

When opening the dialog.
This commit is contained in:
shainer 2016-11-20 23:05:44 +00:00
parent f51b05e8aa
commit 8c1199df2d
2 changed files with 7 additions and 3 deletions

View File

@ -110,6 +110,8 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, PartitionNode* par
updateMountPointUi();
setupFlagsList();
// Checks the initial selection.
checkMountPointSelection();
}
CreatePartitionDialog::~CreatePartitionDialog()
@ -257,10 +259,12 @@ CreatePartitionDialog::updateMountPointUi()
}
void
CreatePartitionDialog::checkMountPointSelection(const QString& selection)
CreatePartitionDialog::checkMountPointSelection()
{
const QString& selection = m_ui->mountPointComboBox->currentText();
if (m_usedMountPoints.contains(selection)) {
m_ui->labelMountPoint->setText("Mountpoint already used. Please select another one.");
m_ui->labelMountPoint->setText("Mountpoint already in use. Please select another one.");
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
} else {
m_ui->labelMountPoint->setText( QString() );

View File

@ -61,7 +61,7 @@ public:
private Q_SLOTS:
void updateMountPointUi();
void checkMountPointSelection(const QString &);
void checkMountPointSelection();
private:
void setupFlagsList();