Port to validateLabel function.
This commit is contained in:
parent
ff45763427
commit
0f64ac2dc3
|
@ -228,7 +228,9 @@ void NewDialog::onFilesystemChanged(int idx)
|
||||||
updateOkButtonStatus();
|
updateOkButtonStatus();
|
||||||
|
|
||||||
const FileSystem* fs = FileSystemFactory::create(FileSystem::typeForName(dialogWidget().comboFileSystem().currentText()), -1, -1, -1, -1, QString());
|
const FileSystem* fs = FileSystemFactory::create(FileSystem::typeForName(dialogWidget().comboFileSystem().currentText()), -1, -1, -1, -1, QString());
|
||||||
dialogWidget().m_EditLabel->setMaxLength(fs->maxLabelLength());
|
connect(dialogWidget().m_EditLabel, &QLineEdit::textChanged, [=] (const QString& text) {
|
||||||
|
dialogWidget().m_EditLabel->setText(fs->validateLabel(text));
|
||||||
|
});
|
||||||
|
|
||||||
updateSpinCapacity(partition().length());
|
updateSpinCapacity(partition().length());
|
||||||
dialogWidget().partResizerWidget().update();
|
dialogWidget().partResizerWidget().update();
|
||||||
|
|
|
@ -318,7 +318,9 @@ void PartPropsDialog::setupFileSystemComboBox()
|
||||||
dialogWidget().fileSystem().setCurrentIndex(dialogWidget().fileSystem().findText(selected));
|
dialogWidget().fileSystem().setCurrentIndex(dialogWidget().fileSystem().findText(selected));
|
||||||
|
|
||||||
const FileSystem* fs = FileSystemFactory::create(FileSystem::typeForName(dialogWidget().fileSystem().currentText()), -1, -1, -1, -1, QString());
|
const FileSystem* fs = FileSystemFactory::create(FileSystem::typeForName(dialogWidget().fileSystem().currentText()), -1, -1, -1, -1, QString());
|
||||||
dialogWidget().m_EditLabel->setMaxLength(fs->maxLabelLength());
|
m_EditLabelConnection = connect(dialogWidget().m_EditLabel, &QLineEdit::textChanged, [=] (const QString& text) {
|
||||||
|
dialogWidget().m_EditLabel->setText(fs->validateLabel(text));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void PartPropsDialog::updatePartitionFileSystem()
|
void PartPropsDialog::updatePartitionFileSystem()
|
||||||
|
@ -343,7 +345,10 @@ void PartPropsDialog::onFilesystemChanged(int)
|
||||||
updatePartitionFileSystem();
|
updatePartitionFileSystem();
|
||||||
|
|
||||||
const FileSystem* fs = FileSystemFactory::create(FileSystem::typeForName(dialogWidget().fileSystem().currentText()), -1, -1, -1, -1, QString());
|
const FileSystem* fs = FileSystemFactory::create(FileSystem::typeForName(dialogWidget().fileSystem().currentText()), -1, -1, -1, -1, QString());
|
||||||
dialogWidget().m_EditLabel->setMaxLength(fs->maxLabelLength());
|
disconnect( m_EditLabelConnection );
|
||||||
|
m_EditLabelConnection = connect(dialogWidget().m_EditLabel, &QLineEdit::textChanged, [=] (const QString& text) {
|
||||||
|
dialogWidget().m_EditLabel->setText(fs->validateLabel(text));
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
dialogWidget().fileSystem().disconnect(this);
|
dialogWidget().fileSystem().disconnect(this);
|
||||||
setupFileSystemComboBox();
|
setupFileSystemComboBox();
|
||||||
|
|
|
@ -129,6 +129,7 @@ private:
|
||||||
QPushButton* cancelButton;
|
QPushButton* cancelButton;
|
||||||
QVBoxLayout *mainLayout;
|
QVBoxLayout *mainLayout;
|
||||||
|
|
||||||
|
QMetaObject::Connection m_EditLabelConnection;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue