This commit is contained in:
Kellermorph
2026-04-16 12:47:02 +02:00
parent c4e05f817c
commit ee65142b65
13 changed files with 413 additions and 158 deletions

View File

@@ -177,6 +177,15 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
ui->m_custom_tbt_path_cb->blockSignals(false);
}
path = settings.value("elements-collections/macros-path", "default").toString();
if (path != "default")
{
ui->m_user_macros_path_cb->blockSignals(true);
ui->m_user_macros_path_cb->setCurrentIndex(1);
ui->m_user_macros_path_cb->setItemData(1, path, Qt::DisplayRole);
ui->m_user_macros_path_cb->blockSignals(false);
}
fillLang();
}
@@ -321,6 +330,21 @@ void GeneralConfigurationPage::applyConf()
if (path != settings.value("elements-collections/custom-tbt-path").toString()) {
QETApp::resetCollectionsPath();
}
path = settings.value("elements-collections/macros-path").toString();
if (ui->m_user_macros_path_cb->currentIndex() == 1)
{
QString path = ui->m_user_macros_path_cb->currentText();
QDir dir(path);
settings.setValue("elements-collections/macros-path",
dir.exists() ? path : "default");
}
else {
settings.setValue("elements-collections/macros-path", "default");
}
if (path != settings.value("elements-collections/macros-path").toString()) {
QETApp::resetCollectionsPath();
}
}
/**
@@ -512,6 +536,19 @@ void GeneralConfigurationPage::on_m_custom_tbt_path_cb_currentIndexChanged(int i
}
}
void GeneralConfigurationPage::on_m_user_macros_path_cb_currentIndexChanged(int index)
{
if (index == 1)
{
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin des macros utilisateur (DEV)"), QETApp::documentDir());
if (!path.isEmpty()) {
ui->m_user_macros_path_cb->setItemData(1, path, Qt::DisplayRole);
}
else {
ui->m_user_macros_path_cb->setCurrentIndex(0);
}
}
}
void GeneralConfigurationPage::on_m_indi_text_font_pb_clicked()
{