[LyX/master] Typo in a comment
commit bee08b19ee2bdd8089cbd45ab2035bde7c9c6903 Author: Scott Kostyshak Date: Thu Jan 5 23:33:16 2023 -0500 Typo in a comment --- src/support/os.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/support/os.h b/src/support/os.h index a96791d..7e6bdbd 100644 --- a/src/support/os.h +++ b/src/support/os.h @@ -62,7 +62,7 @@ int timeout_ms(); /// @param reset True if the python path should be recomputed std::string const python(bool reset = false); -/// Check for availbility of the python interpreter +/// Check for availability of the python interpreter bool hasPython(); /// -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/2.3.x] Avoid static members zoom_min_ and zoom_max_
commit 638e8e4c6c200c9d0d49ad9f0771dc6a6119f01c Author: Stephan Witt Date: Wed Feb 9 10:59:18 2022 +0100 Avoid static members zoom_min_ and zoom_max_ Some compilers cannot use static class members by reference. std::min() and std::max() are passing parameters by const reference. --- src/frontends/qt4/GuiView.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 0b2b1f3..910df34 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -477,9 +477,9 @@ private: /// from the default zoom pref double zoom_ratio_ = 1.0; /// Minimum zoom percentage - static int const zoom_min_ = 10; + int const zoom_min_ = 10; /// Maximum zoom percentage - static int const zoom_max_ = 1000; + int const zoom_max_ = 1000; // movability flag of all toolbars bool toolbarsMovable_; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] #12523 check for existence of usable Python interpreter
commit bbc2270972cfbb1aa11836498c8a6c73be91f18d Author: Stephan Witt Date: Fri Jan 6 00:32:09 2023 +0100 #12523 check for existence of usable Python interpreter - present appropriate alert message in case of missing Python - add the option to quit LyX immediately - recheck for Python interpreter on reconfigure if it was missing --- src/LyX.cpp | 26 +++--- src/support/Package.cpp |4 ++-- src/support/os.cpp |6 ++ src/support/os.h|3 +++ 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/LyX.cpp b/src/LyX.cpp index fc2f871..2a7cba3 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -581,10 +581,11 @@ void LyX::execCommands() { // The advantage of doing this here is that the event loop // is already started. So any need for interaction will be - // aknowledged. + // acknowledged. // if reconfiguration is needed. - if (LayoutFileList::get().empty()) { + const bool noLayouts = LayoutFileList::get().empty(); + if (noLayouts && os::hasPython()) { switch (Alert::prompt( _("No textclass is found"), _("LyX will only have minimal functionality because no textclasses " @@ -593,7 +594,8 @@ void LyX::execCommands() 0, 2, _(""), _(" LaTeX"), - _(""))) + _(""), + _(" LyX"))) { case 0: // regular reconfigure @@ -604,6 +606,24 @@ void LyX::execCommands() lyx::dispatch(FuncRequest(LFUN_RECONFIGURE, " --without-latex-config")); break; + case 3: + lyx::dispatch(FuncRequest(LFUN_LYX_QUIT, "")); + return; + default: + break; + } + } else if (noLayouts) { + switch (Alert::prompt( + _("No python is found"), + _("LyX will only have minimal functionality because no python interpreter " + "has been found. Consider download and install of an python interpreter."), + 0, 1, + _(""), + _(" LyX"))) + { + case 1: + lyx::dispatch(FuncRequest(LFUN_LYX_QUIT, "")); + return; default: break; } diff --git a/src/support/Package.cpp b/src/support/Package.cpp index 400bf15..ffc1395 100644 --- a/src/support/Package.cpp +++ b/src/support/Package.cpp @@ -159,9 +159,9 @@ Package::Package(string const & command_line_arg0, int Package::reconfigureUserLyXDir(string const & option) const { - if (configure_command_.empty()) { + if (configure_command_.empty() || !os::hasPython()) { FileName const configure_script(addName(system_support().absFileName(), "configure.py")); - configure_command_ = os::python() + ' ' + + configure_command_ = os::python(true) + ' ' + quoteName(configure_script.toFilesystemEncoding()) + with_version_suffix() + " --binary-dir=" + quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding()); diff --git a/src/support/os.cpp b/src/support/os.cpp index cafe4b1..abb9ec6 100644 --- a/src/support/os.cpp +++ b/src/support/os.cpp @@ -191,6 +191,12 @@ string const python(bool reset) return command; } + +bool hasPython() +{ + return !(python23_call(python()).empty()); +} + } // namespace os } // namespace support } // namespace lyx diff --git a/src/support/os.h b/src/support/os.h index d89af7d..a96791d 100644 --- a/src/support/os.h +++ b/src/support/os.h @@ -62,6 +62,9 @@ int timeout_ms(); /// @param reset True if the python path should be recomputed std::string const python(bool reset = false); +/// Check for availbility of the python interpreter +bool hasPython(); + /// bool isFilesystemCaseSensitive(); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] ctests: invert a bug from old routine
commit 83c72a3eceb1ce98242a848579952b7526739d15 Author: Scott Kostyshak Date: Thu Jan 5 12:55:32 2023 -0500 ctests: invert a bug from old routine A test from a recent file, KOMA-Script_Book.lyx, uncovered this issue. It is an old routine so not critical to fix. The following is the diff that prevents convergence: \begin_inset Newpage cleardoublepage \end_inset \end_layout \begin_layout Standard If convert_bibtex_clearpage(document) in lyx_2_0.py is commented out, then the test passes. --- development/autotests/invertedTests | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/development/autotests/invertedTests b/development/autotests/invertedTests index 1fa9941..0fc1eeb 100644 --- a/development/autotests/invertedTests +++ b/development/autotests/invertedTests @@ -148,6 +148,22 @@ export/examples/ko/Welcome_lyx2[23] # https://www.mail-archive.com/search?l=mid=20200915233446.atwbyulny5gsbtyi%40tallinn export/examples/ru/Presentations/Beamer_lyx(16|20) +# The following is the diff that prevents convergence: +# +# \begin_inset Newpage cleardoublepage +# \end_inset +# +# +# \end_layout +# +# \begin_layout Standard +# +# If convert_bibtex_clearpage(document) in lyx_2_0.py is commented out, then +# the test passes. +# Since this is an old export (and additionally the issue is an old export routine) +# it is not critical. +export/examples/Books/KOMA-Script_Book_lyx16 + # == Sublabel: ert -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Fix "origin" in KOMA-Script_Book.lyx
commit 0f7f61b29ecde672fe0f9957791a7ab1ea17ba6e Author: Kornel Benko Date: Thu Jan 5 16:24:00 2023 +0100 Fix "origin" in KOMA-Script_Book.lyx --- lib/examples/Books/KOMA-Script_Book.lyx |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/examples/Books/KOMA-Script_Book.lyx b/lib/examples/Books/KOMA-Script_Book.lyx index d98a13a..36281be 100644 --- a/lib/examples/Books/KOMA-Script_Book.lyx +++ b/lib/examples/Books/KOMA-Script_Book.lyx @@ -3,7 +3,7 @@ \begin_document \begin_header \save_transient_properties true -\origin unavailable +\origin /systemlyxdir/examples/Books/ \textclass scrbook \begin_preamble -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Add information to Row::operator<
commit 7c5bad56c4cd4e927d449963cb9114d4fddf1fcd Author: Jean-Marc Lasgouttes Date: Thu Jan 5 11:55:32 2023 +0100 Add information to Row::operator<< --- src/Row.cpp |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Row.cpp b/src/Row.cpp index 6edde19..fea9a38 100644 --- a/src/Row.cpp +++ b/src/Row.cpp @@ -328,7 +328,7 @@ ostream & operator<<(ostream & os, Row::Elements const & elts) ostream & operator<<(ostream & os, Row const & row) { - os << " pos: " << row.pos_ << " end: " << row.end_ + os << " pit: " << row.pit_ << " pos: " << row.pos_ << " end: " << row.end_ << " left_margin: " << row.left_margin << " width: " << row.dim_.wid << " right_margin: " << row.right_margin @@ -337,7 +337,8 @@ ostream & operator<<(ostream & os, Row const & row) << " separator: " << row.separator << " label_hfill: " << row.label_hfill << " end_boundary: " << row.end_boundary() - << " flushed: " << row.flushed() << "\n"; + << " flushed: " << row.flushed_ + << " rtl=" << row.rtl_ << "\n"; // We cannot use the operator above, unfortunately double x = row.left_margin; for (Row::Element const & e : row.elements_) { -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs