Commit Graph

25236 Commits

Author SHA1 Message Date
Juergen Spitzmueller
b124adbd38 Introduce listpreamble argument type
This uses the InsetArgument interface to provide access to a document
part hitherto inaccessible by LyX: the part between \begin and the first
\item in a list (where lengths and counters can be redefined, for
instance).

Fixes: #11098

File format change, layout format change
2018-08-17 10:22:32 +02:00
Juergen Spitzmueller
74657a14a7 Disambiguate dialog buttons
Fixes: #11242
2018-08-14 17:05:40 +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
b3c57aded7 tex2lyx/TODO: cleanup
Remove items that are done or not relevant to tex import.
2018-08-12 09:09:23 +02:00
Juergen Spitzmueller
c12fe77c94 Remove inclusion of obsolete header 2018-08-12 08:29:16 +02:00
Juergen Spitzmueller
d6a93143ec InsetInfo: enable inset dissolve 2018-08-11 17:43:25 +02:00
Juergen Spitzmueller
521d7c2e0b tex2lyx: fix option parsing of listings
the tricky thing was to decide whether [foo] is taken as option or as
verbatim content.

Candidate for stable.
2018-08-11 16:55:44 +02:00
Juergen Spitzmueller
07d760ef30 Rework BibTeX dialog
Fixes concerns reported in #11239
2018-08-11 12:17:42 +02:00
Kornel Benko
366e37c851 Added latex-DejaVu fonts to lyx-GUI.
Increment lyx-format to 561
2018-08-10 19:38:06 +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
fd7490762d Support key symbols via menukeys package 2018-08-09 15:05:19 +02:00
Juergen Spitzmueller
b8ed202658 Consider default output format 2018-08-08 15:50:04 +02:00
Juergen Spitzmueller
7c5d243e71 Revert that part
We don't want to lose the shortcuts.
2018-08-08 15:14:26 +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
d1fbbb78a8 Disable Immediate Apply if no inset is modified. 2018-08-08 10:34:57 +02:00
Juergen Spitzmueller
44718e0e8c GuiInfo: Show "Unknown" only if issued from an unknown info. 2018-08-08 09:52:03 +02:00
Richard Kimberly Heck
2896441dbb Update buffer after preferences change.
Fixes missing update after new InsetInfo stuff.
2018-08-07 23:38:55 -04:00
Enrico Forestieri
cf5f2661dc Fix LyX server on Windows
On some recent Windows versions, GetLastError() may also return
NO_ERROR instead of ERROR_IO_PENDING during an overlapped write
operation to a pipe. This was confusing the state machine in
Server.cpp so that replies to commands were scheduled but were
never actually output.
2018-08-07 17:56:07 +02:00
Juergen Spitzmueller
781b10306a update tex2lyx tests 2018-08-07 15:42:22 +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
2315bdad41 Fix small UI glitch 2018-08-07 14:48:51 +02:00
Juergen Spitzmueller
2cd7aab7cf Validate (fix) date vs. time specifier 2018-08-07 12:56:43 +02:00
Juergen Spitzmueller
37279f6681 Typos 2018-08-07 12:41:00 +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
b75f716b73 Capitalization fixes
Fixes: #11237
2018-08-05 10:11:38 +02:00
Kornel Benko
ed8dfa3fa0 Expand tilde meaning in front of a path name.
This allows to address data in the current lyx-system-directory.
The additional prefix is '~:s/'
The original prefix '~/' still addresses current users home directory.
2018-08-05 10:03:52 +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
Kornel Benko
5c303abf1c Amend f3b89e4: Use correct end-layout
Also correct indentation of innner values
2018-08-04 07:51:53 +02:00
Juergen Spitzmueller
b286c6d235 Change size policy of buffer combo in refs dialog
Fixes: #9316
2018-08-02 09:08:11 +02:00
Juergen Spitzmueller
87a7f728ca reorder entries 2018-08-01 16:51:38 +02:00
Juergen Spitzmueller
1cf1eaf1fe Pass languages also if babel is provided by class.
This is needed to load all used languages.
2018-08-01 15:46:00 +02:00
Juergen Spitzmueller
abaccece15 InsetInfo: use localized shortcuts 2018-08-01 15:17:46 +02:00
Kornel Benko
8233b3f593 Amend 7f3fd5a: Missed changes in version.h 2018-08-01 12:09:42 +02:00
Juergen Spitzmueller
8d45179403 More GuiInfo usability work 2018-08-01 09:28:03 +02:00
Juergen Spitzmueller
d70468a3b2 Update info-insert documentation 2018-07-30 17:18:38 +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
372712cfd9 Fix problem of unwanted spaces caused by macro definitions
Patch by Gilbert J. M. Forkel

Fixes: #11216
2018-07-29 15:17:48 +02:00
Juergen Spitzmueller
a8b0e64094 Try to please windows compiler 2018-07-28 10:26:52 +02:00
Scott Kostyshak
d12798759a Fix crash when selecting text with changes
When selecting text, in some cases a DocIterator could be forwarded
to a (non-existant) paragraph after the end. The critical part of
this fix is to break the loop at the correct place. The following
are additional improvements:

- increase readability by defining a bool named "in_last_par"
- use cur.selectionEnd().pit() instead of cur.selectionEnd().paragraph().id()
- use it.lastpos() instead of it.paragraph().size()

This commit fixes a regression introduced by 23de5e5e, and reported
at #11204.

Thanks to Jürgen and JMarc.
2018-07-27 15:39:39 -04: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
b6eacd8d4f Make the InsetInfo dialog a bit less esoteric. 2018-07-26 16:02:03 +02:00
Juergen Spitzmueller
f8e286b823 Use footnotehyper rather than footnote if hyperref is used
Fixes: #11212
2018-07-25 18:01:22 +02:00
Jean-Marc Lasgouttes
ab2b5e02f9 Revert "Make formal table lines exagerately thick to identify \cmidrule"
This not the correct solution. Let's see if we find a better one.

This reverts commit d900b1fcec.
2018-07-25 17:40:42 +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
Juergen Spitzmueller
99aefa5fd2 Implement tri-state in GuiSetBorder
A new UNDECIDED state is used if multiple cells with differing border
settings are selected.

This prevents additional borders to be set without being asked.

Fixes: #10010
2018-07-24 13:49:27 +02:00
Juergen Spitzmueller
1883c4346d Revert "Fix toggle-line for multi-cell selection"
This changes the behavior of the table border toolbar in a way I am not sure everybody appreciates.

This reverts commit 022228e56f.
2018-07-24 08:48:33 +02:00
Jean-Marc Lasgouttes
d900b1fcec Make formal table lines exagerately thick to identify \cmidrule
Width is now 3 for top/bottomrule, 2 for midrule and 1 for cmidrule.
These numbers are bogus of course, but the goal is to help the user
see what he is doing.
2018-07-24 00:07:59 +02:00
Jean-Marc Lasgouttes
c54fe6c584 Amend 20976e81: remove debug messages 2018-07-23 23:48:52 +02:00
Jean-Marc Lasgouttes
ad954a32a5 Aesthetics: off-by-one in line drawing
It is a general problem when doing graphics to know where a line
begins and where it ends pixel-wise. At the instigation of Scott, and
with the use of the kmag magnifier, this commit corrects 3 areas:

* foreign marks were larger than the row element they were supposed to
  mark. This could lead to moving lines, depending on paint ordering.

* visible spaces were drawn outside of their box (select a single
  space to see this).

* the `L' blinking caret would leave a cursor dropping because the
  horizontal part was too wide.
2018-07-23 17:16:03 +02:00
Juergen Spitzmueller
022228e56f Fix toggle-line for multi-cell selection 2018-07-23 17:00:31 +02:00
Juergen Spitzmueller
91254472e6 Allow to change multiple columns' width at once
Fixes: #11205
2018-07-23 16:36:19 +02:00
Jean-Marc Lasgouttes
e4dba53232 Do not remove character at start of paragraph when cutting
The part of code that removed space at start of paragraph have been
there forever, but its intent is unclear. For example, cutting text at
the end of a paragraph will lead to remove space at the start of this
same paragraph.

The removal of this functionality is offset by a rewrite of DEPM that
makes it more thorough.

Fixes bug #10503.
2018-07-22 23:20:21 +02:00
Jean-Marc Lasgouttes
20976e81fb Improve DEPM
Now any sequence of spaces around old cursor will be removed, even at
start or end of paragraph. Sequences of more than 2 characters are
also taken into account.

The version of DEPM which acts on a sequence of paragraphs is also
rewritten to match the local one.
2018-07-22 23:20:21 +02:00
Enrico Forestieri
16ca5290c0 Fix bug #11203
Minted does not have a language option but it is possible to enter
this option in the LyX interface for compatibility with the listings
package, and also for letting to enter a language not present in the
gui. So, this option is only used for properly specifying a language
in a listing, unless it is entered in the document settings dialog.
This case was not foreseen and thus the option was being passed to
the package as is, causing havoc. With this commit the option is
still available but is used to set a default language for a new
listing in place of the default "tex" language used so far.
2018-07-22 22:22:13 +02:00
Juergen Spitzmueller
8ef7d1aaec Amend d41c3f27d9
Quote insets are allowed in ERT.
2018-07-22 20:04:19 +02:00
Juergen Spitzmueller
611df441b6 Consider EuropeanNumberTerminator property when determining text direction
Also, use EuropeanNumberSeparator information rather than relying on an
own (incomplete) list of number separators.

Fixes: #4057
2018-07-22 12:38:22 +02:00
Jean-Marc Lasgouttes
05d3a64952 Use swap in InsetText::updateBuffer for notes ad friends
Avoid as much as possible to do full copies of all counters, since
that can be exensive. Unfortunately, it is just posible when we want
to restore the saved counters.

Explanations why we use friend swap is here:
https://stackoverflow.com/questions/5695548/public-friend-swap-member-function

Part of bug #5973.
2018-07-22 12:35:05 +02:00
Jean-Marc Lasgouttes
84328c8538 Amend 8651cd89: only full top/bottom rules are thicker 2018-07-21 20:07:33 +02:00
Juergen Spitzmueller
0bf7b3211d (a)mend edb2d14124 2018-07-21 18:33:49 +02:00
Juergen Spitzmueller
edb2d14124 Set RTL tooltips RTL
Fixes: #10672
2018-07-21 18:23:47 +02:00
Juergen Spitzmueller
114ebf00c4 Fix nesting problem with numbers in RTL text
\textcolor must precede any \beginL

Fixes: #6283
2018-07-21 15:50:35 +02:00
Jean-Marc Lasgouttes
8e9e050670 Fix disappearing blue language underline.
Make sure that the blue language underline is not below the bottom of
the row. Otherwise, it can disappear when the next row is painted.
2018-07-20 15:23:55 +02:00
Stephan Witt
b0371107ff Amend change b5c5083c6c.
Remove superfluous and broken code.
2018-07-20 07:33:09 +02:00
Jean-Marc Lasgouttes
8651cd89f6 Draw top/bottom rules heavier for booktab
This gives a better idea of the TeX output, even though the width are
not correct.
2018-07-20 00:26:41 +02:00
Jean-Marc Lasgouttes
76512a7569 Use a unicode character for menu separator on screen
Additionally, use a left pointing character in a RtL setting.
2018-07-19 23:05:00 +02:00
Jean-Marc Lasgouttes
9b3fede789 Introduce FontMetrics::xHeight
Use it instead of measuring the height of character 'x'.
2018-07-19 22:16:40 +02:00
Jean-Marc Lasgouttes
30c6d4fafe Fixup 30ec879d and 41ebc3fc
Remove the #if 0 area, which does not seem really useful. Some tweaks
to the code.
2018-07-19 21:05:15 +02:00
Kornel Benko
41ebc3fcfc Amend 30ec879, Add a translator as a fallback to Qt inner one
Add the needed strings to GuiApplication.cpp
2018-07-18 22:02:50 +02:00
Jean-Marc Lasgouttes
30ec879d3a Add a translator as a fallback to Qt inner one
This reuses code intended only for mac manus and generalizes it. The
list of strings to add to po files is found in
GuiTranslator::translate.

This is useful now that LyX relies on QDialogButtonBox class for its
dialogs. Indeed many languages are not covered natively by Qt.

It is possible to enable the "locace" debug channel to see what
strings are not covered and should be added to our own translation
tables.

In order to make things easier, a new method getIfFound() has been
added to the Messages class, which returns an empty string when no
translation has been found, as Qt's translate() does.
2018-07-18 10:13:05 +02:00
Juergen Spitzmueller
e5a9244bef Proper logos with RTL
Fixes #10423
2018-07-15 20:56:55 +02:00
Juergen Spitzmueller
3bacc3c6e7 Par alignment in floats must be swapped for all RTL langs, not only Hebrew
Fixes: #11029
2018-07-15 19:23:19 +02:00
Juergen Spitzmueller
195f62ac93 Fix bracket output in RTL languages
This is a real mess!

Fixes: #11187
2018-07-15 14:26:29 +02:00
Juergen Spitzmueller
aa1d9638fe Fix quotation marks in RTL script
Fixes: #11188
2018-07-15 12:11:10 +02:00
Juergen Spitzmueller
0148ef7e6c Use QMessageBox for toggleWarning if possible
Qt 5.2 introduces the possibility to place a checkbox on a QMessageBox,
so we need no longer to use our own crude dialog.
2018-07-10 15:00:25 +02:00
Juergen Spitzmueller
b21c512e14 QDialogButtonBox for the remaining dialogs. 2018-07-10 13:04:02 +02:00
Juergen Spitzmueller
d2afa67da9 Fix creationCode() of GuiPrintNomencl
This fixes "New Inset" in that dialog.

Candidate for stable
2018-07-10 11:01:49 +02:00
Juergen Spitzmueller
b5c5083c6c More QDialogButtonBox
Listings through Prefs.
2018-07-10 09:04:42 +02:00
Juergen Spitzmueller
d41c3f27d9 Disallow any inset inside ERT
Attempting to do this crashes in master, and is not supported anyway.
2018-07-10 07:11:59 +02:00
Richard Kimberly Heck
a007b65202 Fix bug #10177.
The left margin given at class level should apply only to the main text.
2018-07-09 12:16:45 -04:00
Juergen Spitzmueller
1f5186b2a7 More QDialogButtonBox transformation
GuiDelimiter through GuiIndex

See #11003
2018-07-09 09:46:39 +02:00
Juergen Spitzmueller
4d9fa8a0d7 Amend 0570d16a3b
When slot[Ok|Apply|Cancel]() from GuiDialog are re-implemented, we also
need to re-implement slotButtonBox()
2018-07-08 16:48:58 +02:00
Juergen Spitzmueller
0570d16a3b Start using QDialogButtonGroup rather than manual OK etc. buttons
This assures the OK/Apply/Cancel/Restore buttons use the layout/style
of the OS (button order, icons).

The goal is to move all dialogs to this for 2.4.

See #11003
2018-07-08 16:35:38 +02:00
Juergen Spitzmueller
01a74e8e95 Polish Bib(la)TeX dialog 2018-07-08 12:13:47 +02:00
Juergen Spitzmueller
4ec8bd05a4 update tex2lyx tests 2018-07-07 15:28:40 +02:00
Juergen Spitzmueller
e6e3777363 Add support for bib files encoding
File format change.

Fixes: #6223
2018-07-07 15:25:35 +02:00
Juergen Spitzmueller
1cfa56b5cb Correctly calculate cell metrics with xtabular columns
Fixes rest of #11182
2018-07-07 09:18:47 +02:00
Juergen Spitzmueller
fa9675965a Do not expand tabular cells to maxwidth on line break
Fixes part of #11182.
2018-07-06 16:15:13 +02:00
Jean-Marc Lasgouttes
ad5548cfe3 Fixes to input method handling
The goal of this patch is to make "self-insert <string>" act as a
sequence of individual self-insert calls. Once it is done, the
insertion of the commit string in GuiWorkArea can use that, which
fixes the issues described in bug 11183.

1/ in InsetMathNest, SELF_INSERT is rewritten to be a proper loop of
   interpretChar, instead of inserting the string as characters. This
   solves the issue of interpreting ^ properly.

2/ the text version does not need to be changed (the loop is rewritten
   using a range, though).

3/ Then {{{GuiWorkArea::inputMethodEvent}}} is changed to invoke
   directly self-insert. This removes the update issues.

Fixes bug 11183.
2018-07-05 14:32:37 +02:00
Enrico Forestieri
db9c8c6d02 Autodetect the EMF format
Otherwise it will be recognized only by the file extension, because
libmagic returns "application/octet-stream" as mime type. Moreover,
if the emf encapsulates a binary image format, it can be confused
with this other format and its preview on screen fails.
2018-07-04 19:52:13 +02:00
Enrico Forestieri
dfd6afb740 Fix compilation on case insensitive filesystems
In such filesystems, including either Magic.h or magic.h does not
make any difference and the one or other file is included depending
on the search order. In this case, Magic.h was trying to include
itself instead of including magic.h.
2018-07-04 09:42:04 +02:00
Jean-Marc Lasgouttes
c9fd7058ab fix compilation when libmagic is not used 2018-07-03 21:18:26 +02:00
Jean-Marc Lasgouttes
789acb4a95 Do not allow completion when there is an active selection
We do it in texted only, mathed is more difficult and not so relevant IMO.
2018-07-03 17:01:20 +02:00
Jean-Marc Lasgouttes
4c6a341ab5 Encapsulate libmagic support in a class
This makes the code much easier to read and, additionally, allows to
parse the magic file with magic_load() only once per session.

As a result, getFormatFromFile is slightly faster.
2018-07-03 11:58:01 +02:00
Juergen Spitzmueller
25f274f2a0 Amend e5c79a43ee
Consider some tabularx specifics for the display of tabular/column widths
in the workarea.
2018-07-02 19:16:22 +02:00