[LyX/master] Inform user if panel or tab has invalid content (#10827)
commit d888d0d130edc7b72d4afea01a93ede2ea0ce648 Author: Juergen Spitzmueller Date: Thu Dec 22 15:01:58 2022 +0100 Inform user if panel or tab has invalid content (#10827) This adds a warning icon to either the tab header or the panel stack entry item if a widget on the panel/stack has invalid content. Particularly helpful to get aware of such content on other tabs/panes than the one currently selected. --- src/frontends/qt/ButtonController.cpp | 63 + src/frontends/qt/ButtonController.h |8 +++- src/frontends/qt/GuiDocument.cpp | 82 +--- src/frontends/qt/GuiExternal.cpp | 14 ++ src/frontends/qt/GuiGraphics.cpp | 21 +++- src/frontends/qt/GuiInclude.cpp |4 +- src/frontends/qt/PanelStack.cpp | 16 ++ src/frontends/qt/PanelStack.h |2 + src/frontends/qt/Validator.cpp|6 ++- src/frontends/qt/Validator.h |3 +- 10 files changed, 163 insertions(+), 56 deletions(-) diff --git a/src/frontends/qt/ButtonController.cpp b/src/frontends/qt/ButtonController.cpp index 47d9c7e..a2c7359 100644 --- a/src/frontends/qt/ButtonController.cpp +++ b/src/frontends/qt/ButtonController.cpp @@ -11,6 +11,8 @@ #include #include "ButtonController.h" +#include "GuiApplication.h" +#include "PanelStack.h" #include "qt_helpers.h" @@ -21,6 +23,7 @@ #include #include #include +#include #include @@ -36,18 +39,25 @@ namespace frontend { class CheckedLineEdit { public: - CheckedLineEdit(QLineEdit * input, QWidget * label = nullptr); + CheckedLineEdit(QLineEdit * input, QWidget * label = nullptr, + int tabindex = -1, QString const panel = QString()); + /// check the widget and do visual marking bool check() const; + /// reset all visual markings for tabs or panel sections + void setSectionsValid() const; private: // non-owned QLineEdit * input_; - QWidget * label_; + QWidget * target_; + int tab_index_; + QString panel_name_; }; -CheckedLineEdit::CheckedLineEdit(QLineEdit * input, QWidget * label) - : input_(input), label_(label) +CheckedLineEdit::CheckedLineEdit(QLineEdit * input, QWidget * label, +int tabindex, QString const panel) + : input_(input), target_(label), tab_index_(tabindex), panel_name_(panel) {} @@ -55,8 +65,8 @@ bool CheckedLineEdit::check() const { if (!input_->isEnabled()) { // we do not check diabled widgets - if (label_) - setValid(label_, true); + if (target_) + setValid(target_, true); return true; } @@ -70,13 +80,37 @@ bool CheckedLineEdit::check() const // Visual feedback. setValid(input_, valid); - if (label_) - setValid(label_, valid); + if (target_) { + if (!valid && !panel_name_.isEmpty() && qobject_cast(target_) != nullptr) { + qobject_cast(target_)->markPanelValid(panel_name_, false); + // this is a panel, so stop here. + return valid; + } + setValid(target_, valid); + if (!valid && tab_index_ >= 0 && qobject_cast(target_) != nullptr) { + QIcon warn(getPixmap("images/", "emblem-shellescape", "svgz,png")); + QTabBar * tb = qobject_cast(target_)->tabBar(); + tb->setTabIcon(tab_index_, warn); + tb->setTabToolTip(tab_index_, qt_("This tab contains invalid input. Please fix!")); + } + } return valid; } +void CheckedLineEdit::setSectionsValid() const +{ + if (target_ && tab_index_ >= 0 && qobject_cast(target_) != nullptr) { + QTabBar * tb = qobject_cast(target_)->tabBar(); + tb->setTabIcon(tab_index_, QIcon()); + tb->setTabToolTip(tab_index_, QString()); + } + else if (!panel_name_.isEmpty() && qobject_cast(target_) != nullptr) + qobject_cast(target_)->markPanelValid(panel_name_, true); +} + + / // // ButtonController::Private @@ -94,6 +128,9 @@ public: bool checkWidgets() const { bool valid = true; + for (const CheckedLineEdit & w : checked_widgets_) { + w.setSectionsValid(); + } for (const CheckedLineEdit & w : checked_widgets_) valid &= w.check(); return valid; @@ -240,9 +277,15 @@ void ButtonController::refresh() const } -void ButtonController::addCheckedLineEdit(QLineEdit * input, QWidget * label) +void ButtonController::addCheckedLineEdit(QLineEdit * i
[LyX/master] de.po
commit 870462583e26b3cf61e34e3a47e31dc24144a0b1 Author: Juergen Spitzmueller Date: Thu Dec 22 15:57:27 2022 +0100 de.po po/de.gmo | Bin 634460 -> 634778 bytes po/de.po | 650 +++-- 2 files changed, 334 insertions(+), 316 deletions(-) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Update fr.po
commit f15dad1a4a1911e87a8dfa12bf6b906a2638735f Author: jpc Date: Thu Dec 22 16:07:52 2022 +0100 Update fr.po po/fr.gmo | Bin 637552 -> 637831 bytes po/fr.po | 648 +++-- 2 files changed, 332 insertions(+), 316 deletions(-) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Update sk.po
commit d3d007143cb69dce62182299cb44044f3bd6919a Author: Kornel Benko Date: Thu Dec 22 20:25:05 2022 +0100 Update sk.po --- po/sk.po | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/po/sk.po b/po/sk.po index fcbc129..68d64a1 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: LyX-2.4\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2022-12-18 17:36+0100\n" -"PO-Revision-Date: 2022-12-18 16:43+\n" +"POT-Creation-Date: 2022-12-22 15:25+0100\n" +"PO-Revision-Date: 2022-12-22 14:32+\n" "Last-Translator: Kornel Benko \n" "Language-Team: Slovak \n" "Language: sk\n" @@ -31026,6 +31026,10 @@ msgstr "Dings 3" msgid "Dings 4" msgstr "Dings 4" +#: src/frontends/qt/ButtonController.cpp:94 +msgid "This tab contains invalid input. Please fix!" +msgstr "Táto karta obsahuje neplatný vstup. Opravte to prosím!" + #: src/frontends/qt/ButtonController.cpp:222 #: src/frontends/qt/GuiApplication.cpp:1950 src/frontends/qt/GuiCompare.cpp:193 #: src/frontends/qt/GuiSymbols.cpp:346 @@ -35338,6 +35342,10 @@ msgstr "Nijaká akcia nebola definovaná!" msgid "Search" msgstr "Hľadať" +#: src/frontends/qt/PanelStack.cpp:160 +msgid "This section contains invalid input. Please fix!" +msgstr "Táto sekcia obsahuje neplatný vstup. Opravte to prosím!" + #: src/frontends/qt/Toolbars.cpp:246 #, c-format msgid "Export %1$s" -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Add entries for Hazard and Precautionary Statements, Risk and Safety Statements and Linguistics to Chapter 4 Modules of Additional.lyx
commit 5732b0482a8735d9afddef4cd6bd651ef7011d6c Author: John R Hudson Date: Thu Dec 22 13:37:27 2022 + Add entries for Hazard and Precautionary Statements, Risk and Safety Statements and Linguistics to Chapter 4 Modules of Additional.lyx --- lib/doc/Additional.lyx | 132 1 files changed, 132 insertions(+), 0 deletions(-) diff --git a/lib/doc/Additional.lyx b/lib/doc/Additional.lyx index 437cfe2..465ccd7 100644 --- a/lib/doc/Additional.lyx +++ b/lib/doc/Additional.lyx @@ -13120,6 +13120,138 @@ Modules \end_layout \begin_layout Section + +\change_inserted 564990737 1671716212 + +\lang american +Academic Field Specifics +\end_layout + +\begin_layout Subsection + +\change_inserted 564990737 1671716212 + +\lang american +Chemistry: Hazard and Precautionary Statements +\end_layout + +\begin_layout Standard + +\change_inserted 564990737 1671716212 + +\lang american +This module provides two insets to typeset numbers and phrases of chemical + hazard and precautionary statements. + For a description see +\family sans +\lang british +File\SpecialChar menuseparator +Open Example\SpecialChar menuseparator +Modules\SpecialChar menuseparator +Hazard and Precautionary Statements +\family default + and +\family sans +Help\SpecialChar menuseparator +Specific Manuals\SpecialChar menuseparator +Hazard and Precautionary Statements +\family default +\lang american +. +\end_layout + +\begin_layout Subsection + +\change_inserted 564990737 1671716212 + +\series bold +\lang american +Chemistry: Risk and Safety Statements +\end_layout + +\begin_layout Standard + +\change_inserted 564990737 1671716212 + +\lang american +This module provides two insets, +\family sans +R-S number +\family default + and +\family sans +R-S phrase +\family default +, accessible via the menu +\family sans +\bar under +I +\bar default +nsert\SpecialChar menuseparator +Custom +\begin_inset space ~ +\end_inset + +Insets +\family default + and an environment to typeset numbers and phrases of chemical risk and + safety statements. +\end_layout + +\begin_layout Subsection + +\change_inserted 564990737 1671716212 + +\lang american +Linguistics +\end_layout + +\begin_layout Standard + +\change_inserted 564990737 1671716212 + +\lang american +This module uses the +\family sans +covington.sty +\family default + package to add environments useful for linguistics (numbered examples, + glosses, semantic markup, tableau floats). + You can obtain information about this module in +\family sans +\bar under +H +\bar default +elp\SpecialChar menuseparator +S +\bar under +p +\bar default +ecific +\begin_inset space ~ +\end_inset + +Manuals\SpecialChar menuseparator + +\bar under +L +\bar default +inguistics +\family default + and +\family sans +\lang british +File\SpecialChar menuseparator +Open Example\SpecialChar menuseparator + +\lang american +Modules\SpecialChar menuseparator +Linguistics +\family default +. +\end_layout + +\begin_layout Section Multiple Text Columns \end_layout -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Mark "edit externally" button of preamble and local layout
commit 7015d7db07080da2048dd3e66a4019c8b2c83865 Author: Juergen Spitzmueller Date: Fri Dec 23 08:19:26 2022 +0100 Mark "edit externally" button of preamble and local layout while external editing is underway --- src/frontends/qt/GuiDocument.cpp |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp index 22e2069..33f79a7 100644 --- a/src/frontends/qt/GuiDocument.cpp +++ b/src/frontends/qt/GuiDocument.cpp @@ -576,7 +576,7 @@ void PreambleModule::editExternal() { preambleTE->document()->setPlainText(toqstr(s)); tempfile_.reset(); editPB->setText(qt_("&Edit Externally")); - editPB->setStyleSheet(""); + editPB->setIcon(QIcon()); changed(); return; } @@ -593,8 +593,8 @@ void PreambleModule::editExternal() { preambleTE->setReadOnly(true); theFormats().edit(*current_id_, tempfilename, format); editPB->setText(qt_("&End Edit")); - editPB->setStyleSheet( - colorButtonStyleSheet(QColor(255, 0, 0))); + QIcon warn(getPixmap("images/", "emblem-shellescape", "svgz,png")); + editPB->setIcon(warn); changed(); } @@ -755,6 +755,7 @@ void LocalLayout::editExternal() { locallayoutTE->document()->setPlainText(toqstr(s)); tempfile_.reset(); editPB->setText(qt_("&Edit Externally")); + editPB->setIcon(QIcon()); changed(); return; } @@ -771,6 +772,8 @@ void LocalLayout::editExternal() { locallayoutTE->setReadOnly(true); theFormats().edit(*current_id_, tempfilename, format); editPB->setText(qt_("&End Edit")); + QIcon warn(getPixmap("images/", "emblem-shellescape", "svgz,png")); + editPB->setIcon(warn); validatePB->setEnabled(false); hideConvert(); changed(); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs