added folder "company-titleblocks" \(incl. language-files\)

This commit is contained in:
plc-user
2023-12-16 09:32:44 +01:00
parent a4495d50d1
commit f12b11bee3
65 changed files with 39625 additions and 27212 deletions

View File

@@ -147,6 +147,15 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
ui->m_company_elmt_path_cb->blockSignals(false);
}
path = settings.value("elements-collections/company-tbt-path", "default").toString();
if (path != "default")
{
ui->m_company_tbt_path_cb->blockSignals(true);
ui->m_company_tbt_path_cb->setCurrentIndex(1);
ui->m_company_tbt_path_cb->setItemData(1, path, Qt::DisplayRole);
ui->m_company_tbt_path_cb->blockSignals(false);
}
path = settings.value("elements-collections/custom-collection-path", "default").toString();
if (path != "default")
{
@@ -280,6 +289,21 @@ void GeneralConfigurationPage::applyConf()
QETApp::resetCollectionsPath();
}
path = settings.value("elements-collections/company-tbt-path").toString();
if (ui->m_company_tbt_path_cb->currentIndex() == 1)
{
QString path = ui->m_company_tbt_path_cb->currentText();
QDir dir(path);
settings.setValue("elements-collections/company-tbt-path",
dir.exists() ? path : "default");
}
else {
settings.setValue("elements-collections/company-tbt-path", "default");
}
if (path != settings.value("elements-collections/company-tbt-path").toString()) {
QETApp::resetCollectionsPath();
}
path = settings.value("elements-collections/custom-tbt-path").toString();
if (ui->m_custom_tbt_path_cb->currentIndex() == 1)
{
@@ -450,6 +474,20 @@ void GeneralConfigurationPage::on_m_custom_elmt_path_cb_currentIndexChanged(int
}
}
void GeneralConfigurationPage::on_m_company_tbt_path_cb_currentIndexChanged(int index)
{
if (index == 1)
{
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin des cartouches company"), QDir::homePath());
if (!path.isEmpty()) {
ui->m_company_tbt_path_cb->setItemData(1, path, Qt::DisplayRole);
}
else {
ui->m_company_tbt_path_cb->setCurrentIndex(0);
}
}
}
void GeneralConfigurationPage::on_m_custom_tbt_path_cb_currentIndexChanged(int index)
{
if (index == 1)