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)

View File

@@ -44,6 +44,7 @@ class GeneralConfigurationPage : public ConfigPage
void on_m_common_elmt_path_cb_currentIndexChanged(int index);
void on_m_company_elmt_path_cb_currentIndexChanged(int index);
void on_m_custom_elmt_path_cb_currentIndexChanged(int index);
void on_m_company_tbt_path_cb_currentIndexChanged(int index);
void on_m_custom_tbt_path_cb_currentIndexChanged(int index);
void on_m_indi_text_font_pb_clicked();
void on_MaxPartsElementEditorList_sb_valueChanged(int value);

View File

@@ -264,14 +264,14 @@
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_8">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Répertoire de la collection utilisateur</string>
<string>Répertoire des cartouches company</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="m_custom_elmt_path_cb">
<widget class="QComboBox" name="m_company_tbt_path_cb">
<item>
<property name="text">
<string>Par defaut</string>
@@ -285,13 +285,34 @@
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Répertoire de la collection utilisateur</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="m_custom_elmt_path_cb">
<item>
<property name="text">
<string>Par defaut</string>
</property>
</item>
<item>
<property name="text">
<string>Parcourir...</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Répertoire des cartouches utilisateur</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QComboBox" name="m_custom_tbt_path_cb">
<item>
<property name="text">
@@ -305,7 +326,7 @@
</item>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>(Recharger les collections d'éléments pour appliquer les changements)</string>