From bbeee6bbef8c3b82507e052b5e72511693c2a682 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 21 Jul 2019 11:37:54 +0200 Subject: [PATCH] Improve prefs language UI --- src/frontends/qt/GuiPrefs.cpp | 12 +- src/frontends/qt/ui/PrefLanguageUi.ui | 442 ++++++++++++++------------ 2 files changed, 247 insertions(+), 207 deletions(-) diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp index 9af8ea4c55..728e8fe379 100644 --- a/src/frontends/qt/GuiPrefs.cpp +++ b/src/frontends/qt/GuiPrefs.cpp @@ -2396,9 +2396,9 @@ PrefLanguage::PrefLanguage(GuiPreferences * form) this, SIGNAL(changed())); connect(respectOSkbdCB, SIGNAL(clicked()), this, SIGNAL(changed())); - connect(autoBeginCB, SIGNAL(clicked()), + connect(explicitDocLangBeginCB, SIGNAL(clicked()), this, SIGNAL(changed())); - connect(autoEndCB, SIGNAL(clicked()), + connect(explicitDocLangEndCB, SIGNAL(clicked()), this, SIGNAL(changed())); connect(languagePackageCO, SIGNAL(activated(int)), this, SIGNAL(changed())); @@ -2472,8 +2472,8 @@ void PrefLanguage::applyRC(LyXRC & rc) const rc.visual_cursor = visualCursorRB->isChecked(); rc.mark_foreign_language = markForeignCB->isChecked(); rc.respect_os_kbd_language = respectOSkbdCB->isChecked(); - rc.language_auto_begin = autoBeginCB->isChecked(); - rc.language_auto_end = autoEndCB->isChecked(); + rc.language_auto_begin = !explicitDocLangBeginCB->isChecked(); + rc.language_auto_end = !explicitDocLangEndCB->isChecked(); int const p = languagePackageCO->currentIndex(); if (p == 0) rc.language_package_selection = LyXRC::LP_AUTO; @@ -2502,8 +2502,8 @@ void PrefLanguage::updateRC(LyXRC const & rc) logicalCursorRB->setChecked(true); markForeignCB->setChecked(rc.mark_foreign_language); respectOSkbdCB->setChecked(rc.respect_os_kbd_language); - autoBeginCB->setChecked(rc.language_auto_begin); - autoEndCB->setChecked(rc.language_auto_end); + explicitDocLangBeginCB->setChecked(!rc.language_auto_begin); + explicitDocLangEndCB->setChecked(!rc.language_auto_end); languagePackageCO->setCurrentIndex(rc.language_package_selection); languagePackageED->setText(toqstr(rc.language_custom_package)); languagePackageED->setEnabled(languagePackageCO->currentIndex() == 2); diff --git a/src/frontends/qt/ui/PrefLanguageUi.ui b/src/frontends/qt/ui/PrefLanguageUi.ui index 63616c8050..ed7d7fd845 100644 --- a/src/frontends/qt/ui/PrefLanguageUi.ui +++ b/src/frontends/qt/ui/PrefLanguageUi.ui @@ -6,225 +6,175 @@ 0 0 - 475 - 362 + 517 + 570 - + - - - User &interface language: - - - uiLanguageCO - - - - - - - Select the language of the user interface (menus, dialogs, etc.) - - - 20 - - - - - - - Language &package: - - - languagePackageCO - - - - - + - - - Select which language package LyX should use + + + User &interface language: + + + uiLanguageCO - - - Automatic - - - - - Always Babel - - - - - Custom - - - - - None[[language package]] - - - + - Enter the command to load the language package (default: \usepackage{babel}) + Select the language of the user interface (menus, dialogs, etc.) + + + 20 + + + + Qt::Horizontal + + + + 40 + 20 + + + + - - - - Command s&tart: - - - startCommandED - - - - - - - The LaTeX command that starts a switch to a foreign language - - - - - - - Qt::Horizontal - - - - 102 - 20 - - - - - - - - Command e&nd: - - - endCommandED - - - - - - - The LaTeX command that ends a switch to a foreign language - - - - - - - Default decimal &separator: - - - defaultDecimalPointLE - - - - - - - - 20 - 16777215 - - - - - - - Qt::AlignCenter - - - - - - - Default length &unit: - - - defaultLengthUnitCO - - - - - - - - - - Check to pass the language globally (to the document class), not locally (to the language package) - - - Set languages &globally - - - - - - - If checked, the document language is not explicitly set by a language switch command - - - Auto &begin - - - - - - - If checked, the document language is not explicitly closed by a language switch command - - - Auto &end - - - - - - - Check to highlight foreign languages visually in the work area - - - Mark &foreign languages - - - - - - - Select to use the current keyboard language, as set from the operating system, as default input language. - - - Respect &OS keyboard language + + + + LaTeX Language Support + + + + + Language &package: + + + languagePackageCO + + + + + + + Select which (LaTeX) language package documents should use by default + + + + Automatic + + + + + Always Babel + + + + + Custom + + + + + None[[language package]] + + + + + + + + Enter the command to load a custom language package (default: \usepackage{babel}) + + + + + + + Command s&tart: + + + startCommandED + + + + + + + The LaTeX command that starts a switch to a different language. The placeholder $$lang is replaced by the actual language name. + + + + + + + Command e&nd: + + + endCommandED + + + + + + + The LaTeX command that ends a switch to a different language. The placeholder $$lang is replaced by the actual language name. + + + + + + + Check to pass the language globally (to the document class), not locally (to the language package), so that other packages are also informed about the used languages. + + + Set languages &globally + + + + + + + If checked, the document language is explicitly set by a language switch command + + + Set document language e&xplicitly + + + + + + + If checked, the document language is explicitly closed by a language switch command + + + &Unset document language explicitly + + + + - + - Right-to-Left Language Support + Editor Settings true @@ -234,17 +184,46 @@ + + + Check to highlight additional languages (to the document language) visually in the work area + + + &Mark additional languages + + + + + + + Select to use the current keyboard language, as set from the operating system, as default input language. + + + Respect &OS keyboard language + + + + 6 - + + 0 + + + 0 + + + 0 + + 0 - Cursor movement: + Right-to-left cursor movement: false @@ -270,14 +249,75 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Local Preferences + + + + + + Default decimal &separator: + + + defaultDecimalPointLE + + + + + + + Default length &unit: + + + defaultLengthUnitCO + + + + + + + + 20 + 16777215 + + + + + + + Qt::AlignCenter + + + - + + + + Qt::Horizontal - 101 + 40 20 @@ -286,7 +326,7 @@ - + Qt::Vertical @@ -313,8 +353,7 @@ defaultDecimalPointLE defaultLengthUnitCO globalCB - autoBeginCB - autoEndCB + explicitDocLangBeginCB markForeignCB respectOSkbdCB logicalCursorRB @@ -324,4 +363,5 @@ qt_i18n.h + -- 2.39.2