Hide custom_language_package if custom is not selected

Otherwise people might read it as if babel was automatically selected
This commit is contained in:
Juergen Spitzmueller 2019-07-21 16:27:12 +02:00
parent 6e7ef06dbc
commit 6fd2f7769f
2 changed files with 18 additions and 3 deletions

View File

@ -2463,7 +2463,13 @@ void PrefLanguage::on_uiLanguageCO_currentIndexChanged(int)
void PrefLanguage::on_languagePackageCO_currentIndexChanged(int i) void PrefLanguage::on_languagePackageCO_currentIndexChanged(int i)
{ {
languagePackageED->setEnabled(i == 2); if (i == 2)
languagePackageED->setText(save_langpack_);
else if (!languagePackageED->text().isEmpty()) {
save_langpack_ = languagePackageED->text();
languagePackageED->clear();
}
languagePackageED->setEnabled(i == 2);
} }
@ -2505,8 +2511,14 @@ void PrefLanguage::updateRC(LyXRC const & rc)
explicitDocLangBeginCB->setChecked(!rc.language_auto_begin); explicitDocLangBeginCB->setChecked(!rc.language_auto_begin);
explicitDocLangEndCB->setChecked(!rc.language_auto_end); explicitDocLangEndCB->setChecked(!rc.language_auto_end);
languagePackageCO->setCurrentIndex(rc.language_package_selection); languagePackageCO->setCurrentIndex(rc.language_package_selection);
languagePackageED->setText(toqstr(rc.language_custom_package)); if (languagePackageCO->currentIndex() == 2) {
languagePackageED->setEnabled(languagePackageCO->currentIndex() == 2); languagePackageED->setText(toqstr(rc.language_custom_package));
languagePackageED->setEnabled(true);
} else {
languagePackageED->clear();
save_langpack_ = toqstr(rc.language_custom_package);
languagePackageED->setEnabled(false);
}
globalCB->setChecked(rc.language_global_options); globalCB->setChecked(rc.language_global_options);
startCommandED->setText(toqstr(rc.language_command_begin)); startCommandED->setText(toqstr(rc.language_command_begin));
endCommandED->setText(toqstr(rc.language_command_end)); endCommandED->setText(toqstr(rc.language_command_end));

View File

@ -408,6 +408,9 @@ public:
private Q_SLOTS: private Q_SLOTS:
void on_uiLanguageCO_currentIndexChanged(int); void on_uiLanguageCO_currentIndexChanged(int);
void on_languagePackageCO_currentIndexChanged(int); void on_languagePackageCO_currentIndexChanged(int);
private:
///
QString save_langpack_;
}; };