Commit Graph

157 Commits

Author SHA1 Message Date
Juergen Spitzmueller
9966b4be4a Adapt inset info to new version check 2022-12-19 17:42:49 +01:00
Jean-Marc Lasgouttes
337cc97174 Use auto const & when possible to avoid copies
In several range-based for loops, implicit copies are made. Remove
that when possible, and try to shut converity up otherwise.

Fixes issues found by coverity.
2022-08-30 17:31:37 +02:00
Jean-Marc Lasgouttes
dc502c8279 Fixup 12dfdbf0: intercept validate(), not latex()
The fake contents of the inset should be created before validate(), so
that the correct packages are loaded.
2022-03-10 17:10:17 +01:00
Jean-Marc Lasgouttes
a6db1383f5 Get rid of spelling and language marks in info inset
These are just annoying. Note that the language mark cannot currently
be specified in a layout file, but it is not clear that there is a
need for that. Therefore I used the simple and hackish way.
2022-03-10 13:35:45 +01:00
Jean-Marc Lasgouttes
12dfdbf0a3 Fix crash in InsetInfo when bindings change
This is actually a generic InsetInfo issue:

1/ the contents of the inset is computed in updateBuffer, so that it
   is available for drawing but also for latex output (think batch
   export). When it is called, it deletes the existing inner paragraph
   and replaces it by a new one

2/ metrics build a new Row object that represents to paragraph

3/ draw() relies on this information

Now, imagine that updateBuffer() is called after metrics(). This can
happen for many reasons, and does happen here (display a shortcut info
and change the shortcut file from cua to emacs).

This problem has been here forever, but is only visible now that the
(experimental) bookmark display code needs to read the underlying
paragraph id.

The solution is to compute the inset contents at metrics time. This
is done by moving the relevant code to a new standalone build() method
that is called in metrics() but also in latex().
2022-03-10 12:45:07 +01:00
Juergen Spitzmueller
10f4f2113a Fix deprecation warning (from|toTime_t) 2021-03-12 10:32:03 +01:00
Juergen Spitzmueller
148748b0c2 Make InsetInfo math/IPA icons visible in dark mode
This does not show the real colors, but the icons are at least readable.
2020-12-13 09:51:32 +01:00
Yuriy Skalko
ecf62a8f21 Refactor OutputParams
Now all Inset hierarchy uses OutputParams.h included in Inset.h.
Forward declare some enums to reduce header dependencies.
2020-11-30 13:05:03 +02:00
Yuriy Skalko
7ca2f2b58d Use range-based loops 2020-11-21 20:32:16 +02:00
Yuriy Skalko
d38eddb397 Match header/source function argument naming 2020-11-01 22:23:44 +02:00
Yuriy Skalko
fbefdb10a5 Move Cursor.h from Clipboard.h 2020-10-16 08:02:51 +03:00
Yuriy Skalko
7d38a4d126 Loop refactoring 2020-10-09 09:04:20 +03:00
Stephan Witt
0fa4b7e736 #9376 prepare use of Length in lyxrc - move the class Length to support 2020-08-07 09:24:31 +02:00
Juergen Spitzmueller
065c09537b Amend 261625f412 2020-07-29 12:23:10 +02:00
Juergen Spitzmueller
f6d9e4170d InsetInfo: Pass back inset-modify that do not target this inset
Fixes #9214.
2020-07-13 16:15:42 +02:00
Juergen Spitzmueller
261625f412 Force local switch for info insets that change language
Fixes compilation of current English UG
2020-06-27 09:40:12 +02:00
Jean-Marc Lasgouttes
2d48072e66 Get rid of Qt resources
It turns out that the resources were mostly not used anyway. Removing
them shrinks LyX binary by ~6MB.

Only autotools have been adapted. cmake will require the same
simplification.
2020-06-07 01:15:28 +02:00
Juergen Spitzmueller
d94b708a0f Tell updateBuffer whether an inset is deleted.
Fixes #11747
2020-03-06 13:23:01 +01:00
Jean-Marc Lasgouttes
3aba81cf6a Many small code cleanups suggested by cppcheck 2019-09-16 00:45:20 +02:00
Juergen Spitzmueller
231b36d950 Fix text direction of references with XeTeX/bidi
Fixes: #11626
2019-08-05 16:30:01 +02:00
Pavel Sanda
a6634f5bb3 git VCS: add support for short hashes in inset info ("Abbreviated revision").
Fixes bug #11620.

Patch from Joel Kulesza.
2019-07-28 22:01:17 +02:00
Juergen Spitzmueller
55c9bc218a Do not use GUI language for shortcut info inset if no translation is available
Fixes: #11508

Now there is the opposite case which needs to be addressed:
If no translation is available for a shortcut in a non-latin-scripted
document, we need to switch the language to English.
2019-03-09 12:00:40 +01:00
Juergen Spitzmueller
523d284729 missed this. 2018-11-09 11:47:51 +01:00
Juergen Spitzmueller
a5004a394a Fix thinko
Actually use the replaced path string :-/
2018-11-09 11:28:38 +01:00
Juergen Spitzmueller
5e26a3a633 Implement layout format in insetinfo
The docs refer to the outdated layout formats. The inset prevents this.
2018-09-20 11:33:03 +02:00
Juergen Spitzmueller
bc644d131c Fix potential null pointer detected by Coverity 2018-09-01 10:45:03 +02:00
Juergen Spitzmueller
b0f579655c InsetInfo: Move validateArgument() to params
and use it for LFUN_INFO_INSERT validation
2018-08-18 14:29:15 +02:00
Juergen Spitzmueller
e9b187af08 New info-inset type l7n
This returns a localized version of a string (in the GUI language)
if available, removing trailing colons and accelerator marks.

This can be used to refer to dialog items in the docs in a portable way.
2018-08-13 17:18:44 +02:00
Juergen Spitzmueller
d6a93143ec InsetInfo: enable inset dissolve 2018-08-11 17:43:25 +02:00
Juergen Spitzmueller
806f742263 Amend 5f45b3ed9c 2018-08-09 17:23:05 +02:00
Juergen Spitzmueller
5f45b3ed9c Fix shortcuts info output on the Mac
QKeySequence returns special characters for keys on the mac rather than
textual key names (as on other OSes).

Since these symbols are not included in many fonts, we re-translate them
to textual names

Fixes: #10641
2018-08-09 16:59:06 +02:00
Juergen Spitzmueller
b8ed202658 Consider default output format 2018-08-08 15:50:04 +02:00
Juergen Spitzmueller
91a5263d68 Extend list of accessible menu info
When searching for and item in the menu, also try to consider those that
require a BufferView (such as View/Update formats).

Also, be explicit for the default format in order to find it.

Fixes: #9851
2018-08-08 15:05:58 +02:00
Juergen Spitzmueller
dd3ae00f74 Disambiguate time (period) from time (of day). 2018-08-07 15:24:40 +02:00
Juergen Spitzmueller
c6d8efba6c Add user name and email to Insert > Fields
This is a low hanging fruit, since it's already available (although
quite hidden)

Generally, output "not set" i a pref is not set rather than an empty
string.
2018-08-07 14:57:44 +02:00
Juergen Spitzmueller
2cd7aab7cf Validate (fix) date vs. time specifier 2018-08-07 12:56:43 +02:00
Juergen Spitzmueller
7efdf98fc8 Further extend Info insets:
* Add time type (time, modtime, fixtime)
* Add "name-noext" buffer type (file name w/o extension)
2018-08-07 12:14:45 +02:00
Juergen Spitzmueller
307319e95e Introduce InsetInfoParams
This allows to open the dialog without having an inset already.
2018-08-06 20:07:15 +02:00
Juergen Spitzmueller
e730234e57 Add date-related info insets
With this commit, info insets leave the dark backstage room of an opaque
and quite hidden dev-only feature and come frontstage.

In the UI, they present themselves as "Fields" since this is what people
know from word processors. Other user-related fields that could be
implemented next: time, user name (I plan to do that for 2.4).

Since this supersedes date-insert, I removed Insert > Date from
the menu and propose to ditch date-insert and the corresponding rc.

The lyx2lyx reversion routine has lots of room for improvement and
attractive tasks for pythons (file timestamp, switch of localization).
Please feel invited!

This is a file format change.
2018-08-05 10:01:36 +02:00
Juergen Spitzmueller
abaccece15 InsetInfo: use localized shortcuts 2018-08-01 15:17:46 +02:00
Juergen Spitzmueller
8d45179403 More GuiInfo usability work 2018-08-01 09:28:03 +02:00
Juergen Spitzmueller
a76c69dea8 Typo.
Thanks, Kornel.
2018-07-30 17:02:28 +02:00
Juergen Spitzmueller
358436ea1e Split vcs Info inset from buffer Info inset
This should go separately in the GUI, and thus in the inset.
2018-07-29 19:41:34 +02:00
Juergen Spitzmueller
5075ce0297 InsetInfo: add useful shortcuts. 2018-07-29 18:28:18 +02:00
Juergen Spitzmueller
803a88f243 Sort out problems with InsetInfo language settings
* use the context language of the info inset (rather than the buffer
language), and translate strings accordingly

* for menu and shortcuts, use the Gui language instead

* actually care that all translatable strings end in po
(this wasn't the case).

Fixes: #5348, rest of #10463
2018-07-27 12:14:37 +02:00
Juergen Spitzmueller
d1ec35a0dc Amend 79cf3f5ec1
Some InfoInsets have to be LTR always.
2018-07-25 11:38:56 +02:00
Juergen Spitzmueller
79cf3f5ec1 Fix text direction issue for InsetInfo in RTL context
Fixes: #10463
2018-07-25 11:00:00 +02:00
Richard Heck
d188a36fc2 Fix bug #10835.
VCS InsetInfos were broken by the switch at 2e934fc5f8 to using
updateBuffer to handle them. But we do not really want to go through
that routine in a clone, not for those insets, whose contents we
want to be the same as in the original Buffer.

Also fixes some issues noted in discussion of this bug: Failure to
update after context menu switch; failure to re-calculate shortcuts,
which can change.
2017-12-29 16:09:15 -05:00
Jean-Marc Lasgouttes
6936c1b4fa Fix MSVC warning
Take this occasion to simplify the code.

Fixes bug #10402.
2017-12-14 13:39:37 +01:00
Juergen Spitzmueller
c466baaa5b Collapsable -> Collapsible (part 2)
The current spelling is not strictly wrong, but flagged as unusual or
historical by some authorities. It is also found fault with many
spell checkers. Thus we decided to move to the more standard "-ible"
form once and for all.

See #10678 for discussion

This part covers the most tricky part: the internal naming.
Translations and layouts will follow.

This will all also all be backported to 2.3.x, for the sake of backwards
compatibility (cherry-picking).
2017-10-16 10:12:21 +02:00