Commit Graph

250 Commits

Author SHA1 Message Date
Richard Kimberly Heck
01dc665a25 Make continuous spellcheck the default.
Convert old preferences to preserve previous setting, as well.
2021-02-15 11:03:43 -05:00
Richard Kimberly Heck
93e7ab1f3e Do not write \default_view_format if it is empty. 2021-02-15 10:55:37 -05:00
Scott Kostyshak
eaebe404ae Fix a comparison of arrays to compare *contents*
The previous code was mistakenly comparing addresses of the arrays.
This issue was caught by a warning when compiling with Clang in
C++20 mode, since comparing array addresses in this way is
deprecated.

This commit should prevent some unnecessary dispatches of
LFUN_SCREEN_FONT_UPDATE.
2020-12-31 14:02:40 -05:00
Juergen Spitzmueller
704331fdcd Add dark theme colors to semantic colors (#8325) 2020-12-12 10:56:05 +01:00
Yuriy Skalko
196d9caeb0 Clean includes using the output of iwyu tool 2020-10-20 11:38:55 +03:00
Yuriy Skalko
cd933534bd Increment preferences format to 34: rename Cyrillic *.kmap files 2020-09-17 15:05:31 +02:00
Stephan Witt
45e8ea4acc #11756 Respect system preferences for tabbing on Mac 2020-09-04 23:28:27 +02:00
Juergen Spitzmueller
8365eabd6f Make paper search function accessible and customizable 2020-08-27 08:48:55 +02:00
Pavel Sanda
894ad70eba Enable Open Citation menu item iff citation contain locator information or external search script is available.
Per Juergen's request.
2020-08-23 22:19:34 +02:00
Juergen Spitzmueller
8415041b1f Use hexnames only for x11 colors
This prevents wrong color allocation with ambiguous names.

Fixes #11828

Patch by D. Ramöller with extensions by me.
2020-08-03 14:10:46 +02:00
Richard Kimberly Heck
e1615f4107 Const-ness, and a missing Class declaration. I do not understand
why this ever worked.
2020-05-17 20:52:58 -04:00
Kornel Benko
478a303f4a Use c++11 to remove last char from a string
Thanks Scott.
2020-04-19 08:59:54 +02:00
Kornel Benko
333e023e82 Amend(4) 689f26d2: Add default path to server pipe (cmake build)
Rename the placeholde $$User to $$UserDir

Make it more readable. Suggestion from Stephan Witt.
2020-04-18 22:26:56 +02:00
Kornel Benko
237378477f Amend(3) 689f26d2: Add default path to server pipe (cmake build)
Omit duplicated separators if replacing string '$$User' with actual userdir
2020-04-18 16:32:24 +02:00
Kornel Benko
689f26d247 Add default path to server pipe (cmake build + unix)
Actually the change is affecting only builds if
1.) Using cmake build
2.) on unix

To use it on
  cygwin: one has to patch development/cygwin/lyxrc.dist.in
  MacOSX:     -//-         development/MacOSX/lyxrc.dist.in

We need also a Windows-version

Also the compilation with automake lacks the handling of development/unix/lyxrc.dist.in
2020-04-17 18:38:51 +02:00
Juergen Spitzmueller
5fc2662b13 Add pref to keep ct markup on copy/paste
Fixes #10278, #10128
2020-01-13 15:20:48 +01:00
Juergen Spitzmueller
39bff52797 Increase lyxrc format 2019-12-27 11:06:11 +01:00
Juergen Spitzmueller
8e62dcc20f Add pref option to disable underlining of added text (in workarea)
Addresses #10102
2019-12-27 10:35:52 +01:00
Juergen Spitzmueller
a08cbf41cf Provide way to add (optional) user initials
This makes it easier to hook the changes package into LyX's ct markup.
2019-12-24 14:31:08 +01:00
Juergen Spitzmueller
d76cef70a0 Allow to hide formats from menus
Fixes: #11657
2019-09-11 10:29:50 +02:00
Juergen Spitzmueller
b852df91bc Localize the default decimal separator
Do not blindly use (English) "." as default, but the locale default of
the current context language.

Fixes: #7204
2019-07-22 08:05:28 +02:00
Jean-Marc Lasgouttes
c476c3766c Add a pref to disable OS keyboard language support
By default, the behavior is the same as before, except that the
language of new document is not unconditionally en_US anymore.

The new checkbox "Respect OS keyboard language" (off by default)
governs this behavior.

Update prefs format to 30.
2019-07-20 12:57:16 +02:00
Jean-Marc Lasgouttes
2b1515a936 Rename LM_ST_* to *_STYLE and FONT_SIZE_* to *_SIZE
This makes code more uniform. This is typically something that is done
at end of cycle to limit backport issues later.
2019-06-14 17:05:49 +02:00
Jean-Marc Lasgouttes
7bb08f10b1 Move initial values of LyXRC members to the header
We use a C++11 construct that puts initial values of members along
with their definition. It is a good construct and now the out of line
constructor and the setDefaults() method can go.

This removes the need to define a dummy constructor in tex2lyx and
client.

The only needed change to the rest of code is a change of signature
for the user_(name|email) to return std::string. They are now called
explicitely from the constructor. We now have to include userinfo.h in
LyXRC.h, but this should not be too expensive.
2019-04-19 14:46:12 +02:00
Juergen Spitzmueller
2078a02ce9 Silence compiler warning 2019-03-08 16:48:49 +01:00
Jean-Marc Lasgouttes
954531f247 Update screen as needed when preferences are changed
This commit removes the adhoc code in GuiPrefs and moves it to LyXRC,
so that it triggers in every preference change.

The code has also been updated to trigger on more variables, e.g.
font_*_foundry.

Note that the actual function that are called have not been changed
(addPreviews and LFUN_SCREEN_FONT_UPDATE), although there are doubts
that they behave as needed (see FIXMEs).

Fixes bug #11498.
2019-02-26 16:53:14 +01:00
Enrico Forestieri
472bdf5910 Replace environment variables in PATH prefix
The PATH prefix modified through the GUI was set without
replacing embedded environment variables. This might have
caused problems on Windows with external python installations.
2019-01-11 18:15:40 +01:00
Jean-Marc Lasgouttes
9fe101e890 Remove support for pixmap cache
This code has issues and there is no evidence that it improves performance.

Remove LyXRC variable \use_pixmap_cache and update rc format to 29.

Now the global pixmap cache is only used by GuiCompleter. Therefore
there is no need to reset it when fonts change.
2018-10-07 14:56:55 +02:00
Juergen Spitzmueller
ed61ce74b7 So long, date-insert!
This function is superseded by info-insert date, which is much mightier
and more flexible.
2018-08-20 09:25:22 +02:00
Juergen Spitzmueller
8d45179403 More GuiInfo usability work 2018-08-01 09:28:03 +02:00
Juergen Spitzmueller
389352b3fb Add optional flavor flag to needaux
Also, use latex flavor if no flag is given rather than default output
format

Fixes: #9127
2018-04-25 13:51:40 +02:00
Richard Kimberly Heck
ae45a5de59 Add slightly improved error message.
(cherry picked from commit 4f0504d778)
2018-04-23 20:36:56 -04:00
Juergen Spitzmueller
26ea1e1496 Align fontenc with document fonts
Following a request by Günter, we consider the document fonts (only rm
for now) when selecting an appropriate font encoding.

See #9741

The new default font encoding setting "auto" does

* consider the font encoding needed by the language(s), which can now
  have fallback alternatives
* Consider which font encoding is provided by the document font

Thus, cm now will result in OT1 fontenc, if the language can deal with
that.

The font_enc pref is ditched: it is no longer needed.

The automatism is still very basic and is subject to extension.

File format and prefs format change.
2018-04-22 19:06:46 +02:00
Jean-Marc Lasgouttes
ae473b012a Fix default spellchecker when only Enchant is available
This has been annoying me for ages.
2018-03-19 14:07:03 +01:00
Jean-Marc Lasgouttes
af795b80d8 Make it possible to select (not)native file dialogs at run time
Add a new LyXRC variable use_native_filedialog (true by default) that
allows to select the kind of FileDialog we want at runtime.
2018-03-19 11:17:33 +01:00
Richard Heck
ab6b4679e6 Fix bug #10918. 2018-02-24 01:06:36 -05:00
Juergen Spitzmueller
f2b6ff0870 Swap prefs format 24 and 25, since the former will not be backported. 2017-11-02 16:40:05 +01:00
Juergen Spitzmueller
891a7ef79f Collapsable -> Collapsible (part 5)
Preferences update and prefs2prefs routine.

This was forgotten in the process.
2017-11-02 16:26:45 +01:00
Juergen Spitzmueller
2aaf185e7c Add default output format for pLaTeX
Fixes: #10747
2017-09-09 08:56:04 +02:00
Jean-Marc Lasgouttes
3d590d3bd7 Merge remote-tracking branch 'features/properpaint'
Now painting the workarea is done at paint events as should be.
Explicit painting after updating metrics has been replaced by a much
lighter procedure (updatePosCache) to update the insets positions cache.

Expected benefits:
- better performance
- proper use of subpixel aliasing

The LyXRC variable use_qimage is not needed anymore and is therefore removed.
2017-09-08 17:05:13 +02:00
Jean-Marc Lasgouttes
4f4383cac5 remove LyXRC::use_qimage
This is not needed anymore now that we do not need a backup pixmap.

Update LyXRC format to 23 and add conversion.
2017-09-08 16:58:21 +02:00
Juergen Spitzmueller
858a9a0465 Make the session zoom relative to the default zoom
Also rename lyxrc.zoom to lyxrc.defaultZoom

Fixes: #10455
2017-09-06 18:13:34 +02:00
Juergen Spitzmueller
1249e5e13e Mark some intentional fall-throughs (in a way understandable to gcc)
This silences -Wimplicit-fallthrough warnings with gcc7.

(Re-Apply without the unintended commits)
2017-08-12 09:06:29 +02:00
Juergen Spitzmueller
0120c3fc10 Revert "Mark some intentional fall-throughs (in a way understandable to gcc)"
This reverts commit 6dc1884d05.
2017-08-12 09:04:23 +02:00
Juergen Spitzmueller
6dc1884d05 Mark some intentional fall-throughs (in a way understandable to gcc)
This silences -Wimplicit-fallthrough warnings with gcc7.
2017-08-12 08:57:02 +02:00
Kornel Benko
b7082f2d29 Correctly interpret return value of LyXRC::read(FileName const & filename, bool check_format) 2017-08-01 13:08:07 +02:00
Christian Ridderström
e30f3d76d2 Bulk cleanup/fix incorrect annotation at the end of namespaces.
This commit does a bulk fix of incorrect annotations (comments) at the
end of namespaces.

The commit was generated by initially running clang-format, and then
from the diff of the result extracting the hunks corresponding to
fixes of namespace comments. The changes being applied and all the
results have been manually reviewed. The source code successfully
builds on macOS.

Further details on the steps below, in case they're of interest to
someone else in the future.

1. Checkout a fresh and up to date version of src/

    git pull && git checkout -- src && git status src

2. Ensure there's a suitable .clang-format in place, i.e. with options
   to fix the comment at the end of namespaces, including:

    FixNamespaceComments:                           true
    SpacesBeforeTrailingComments:                   1

and that clang-format is >= 5.0.0, by doing e.g.:

    clang-format -dump-config | grep Comments:
    clang-format --version

3. Apply clang-format to the source:

    clang-format -i $(find src -name "*.cpp" -or -name "*.h")

4. Create and filter out hunks related to fixing the namespace

    git diff -U0 src > tmp.patch
    grepdiff '^} // namespace' --output-matching=hunk tmp.patch  > fix_namespace.patch

5. Filter out hunks corresponding to simple fixes into to a separate patch:

    pcregrep -M -e '^diff[^\n]+\nindex[^\n]+\n--- [^\n]+\n\+\+\+ [^\n]+\n'  \
        -e '^@@ -[0-9]+ \+[0-9]+ @@[^\n]*\n-\}[^\n]*\n\+\}[^\n]*\n'         \
        fix_namespace.patch > fix_namespace_simple.patch

6. Manually review the simple patch and then apply it, after first
   restoring the source.

    git checkout -- src
    patch -p1 < fix_namespace_simple.path

7. Manually review the (simple) changes and then stage the changes

    git diff src
    git add src

8. Again apply clang-format and filter out hunks related to any
   remaining fixes to the namespace, this time filter with more
   context. There will be fewer hunks as all the simple cases have
   already been handled:

    clang-format -i $(find src -name "*.cpp" -or -name "*.h")
    git diff src > tmp.patch
    grepdiff '^} // namespace' --output-matching=hunk tmp.patch  > fix_namespace2.patch

9. Manually review/edit the resulting patch file to remove hunks for files
   which need to be dealt with manually, noting the file names and
   line numbers. Then restore files to as before applying clang-format
   and apply the patch:

    git checkout src
    patch -p1 < fix_namespace2.patch

10. Manually fix the files noted in the previous step. Stage files,
    review changes and commit.
2017-07-23 13:11:54 +02:00
Richard Heck
75bfed5507 Fix trailing whitespace in cpp files. 2017-07-03 13:53:14 -04:00
Enrico Forestieri
ae56167718 Use a combo box instead of a check box for selecting the listings package 2017-06-12 17:24:26 +02:00
Daniel Ramöller
4183a9f4dc Preferences shows current zoom instead of preference's default zoom (#10455)
- Adds a currentZoom variable which holds the current zoom level.

- The zoom stored in preferences is used as default zoom level (default binding:
  M+0).

- The currentZoom is saved and restored via QSettings.

- Adds LFUN buffer-zoom for (re)setting zoom.
2017-05-07 14:17:54 +02:00