Give the user a possibility to set the maximum number of parts during import on an dxf file. Because sometimes the dxf file can contain more than 200 elements and the user is deleting some elements afterwards

This commit is contained in:
Martin Marmsoler
2023-10-12 20:46:09 +02:00
parent 0cfde21758
commit e51ddbaa42
4 changed files with 85 additions and 10 deletions

View File

@@ -122,6 +122,12 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
ui->m_highlight_integrated_elements->setChecked(settings.value("diagrameditor/highlight-integrated-elements", true).toBool());
ui->m_default_elements_info->setPlainText(settings.value("elementeditor/default-informations", "").toString());
/*
Nombre maximum de primitives affichees par la "liste des parties"
Au-dela, un petit message est affiche, indiquant que ce nombre a ete depasse
et que la liste ne sera donc pas mise a jour.
*/
ui->MaxPartsElementEditorList_sb->setValue(settings.value("elementeditor/max-parts-element-editor-list", 200).toInt());
QString path = settings.value("elements-collections/common-collection-path", "default").toString();
if (path != "default")
@@ -185,6 +191,7 @@ void GeneralConfigurationPage::applyConf()
//ELEMENT EDITOR
settings.setValue("elementeditor/default-informations", ui->m_default_elements_info->toPlainText());
settings.setValue("elementeditor/max-parts-element-editor-list", ui->MaxPartsElementEditorList_sb->value());
//DIAGRAM VIEW
settings.setValue("diagramview/gestures", ui->m_use_gesture_trackpad->isChecked());
@@ -434,3 +441,14 @@ void GeneralConfigurationPage::on_m_indi_text_font_pb_clicked()
ui->m_indi_text_font_pb->setText(fontInfos);
}
}
void GeneralConfigurationPage::on_MaxPartsElementEditorList_sb_valueChanged(int value)
{
if (value > 500) {
ui->MaxPartsElementEditorList_sb->setToolTip(tr("To high values might lead to crashes of the application."));
ui->MaxPartsElementEditorList_sb->setStyleSheet("background-color: orange");
} else {
ui->MaxPartsElementEditorList_sb->setToolTip("");
ui->MaxPartsElementEditorList_sb->setStyleSheet("");
}
}