Commit Graph

9416 Commits

Author SHA1 Message Date
Juergen Spitzmueller
6efdd1c399 Cosmetics 2019-03-22 14:18:17 +01:00
Juergen Spitzmueller
58c4c11c4c Use GuiLyXFiles also for ui, kbd and bind files in prefs 2019-03-22 14:14:33 +01:00
Juergen Spitzmueller
9a2c5b515a Disable language combo if there is nothing to select 2019-03-22 14:14:33 +01:00
Juergen Spitzmueller
b7f6c16a48 Fix duplicate language entry 2019-03-22 14:14:32 +01:00
Juergen Spitzmueller
55012674c8 Add forgotten replacement 2019-03-22 11:25:20 +01:00
Juergen Spitzmueller
ca024383e0 Fix problematic characters in example/template file names
For (, ) and & we use URL encoding now.
2019-03-22 11:10:49 +01:00
Juergen Spitzmueller
9a473a4954 Fix header case 2019-03-21 19:31:46 +01:00
Juergen Spitzmueller
7403fd2f88 Replace Type combo, which was considered irritating, with a Type filter
The new one allows to display only user or system files.
2019-03-21 19:25:10 +01:00
Jean-Marc Lasgouttes
e170051909 typo 2019-03-21 18:45:46 +01:00
Juergen Spitzmueller
4b2cce9e0f Consider files only in lang subtrees 2019-03-21 14:39:33 +01:00
Juergen Spitzmueller
cd9f52da89 GuiLyXFiles: fix icons and tooltips 2019-03-21 14:18:03 +01:00
Juergen Spitzmueller
7f39be8664 GuiLyXFiles: prefill language combo 2019-03-21 13:40:11 +01:00
Jean-Marc Lasgouttes
5d30f790dd Compilation fix
For some reason I need this (maybe a Qt4/5 discrepancy).
2019-03-21 10:28:16 +01:00
Juergen Spitzmueller
7be8307768 GuiLyXFiles: rework language selector
Now only the languages available for the selected file are displayed.
By default, LyX pre-selects the GUI language (and falls back to English
if this is not available). Once another language has been selected by
the user, this one is preferred before the GUI language (and the English
fallback).
2019-03-21 09:13:09 +01:00
Juergen Spitzmueller
ca67b8aa2c GuiLyXFiles: add icons that indicate whether a file is from user or system 2019-03-20 18:38:07 +01:00
Juergen Spitzmueller
1222ce3bfe Add Qt-internal string for translation 2019-03-20 18:37:34 +01:00
Juergen Spitzmueller
f3ee82fb87 Do not close LyXFiles dialog on double-clicking header 2019-03-20 12:37:55 +01:00
Juergen Spitzmueller
07e20fbb2f Amend 0c8eea0fe5 2019-03-20 12:36:39 +01:00
Jean-Marc Lasgouttes
0c8eea0fe5 Compilation fix for Qt < 5.2. 2019-03-20 11:45:29 +01:00
Jean-Marc Lasgouttes
d3979e798c Cache the value of GuiFontMetrics::lbearing().
This seems to be necessary on windows, where math editing can get very
slow. Note that other methods like rbearing already use a cache.

In the future all these caches for single characters shall be unified.
2019-03-20 11:14:43 +01:00
Juergen Spitzmueller
b52cb87e9a GuiLyXFiles: add language selector. 2019-03-19 17:55:19 +01:00
Juergen Spitzmueller
52d2ba16ed GuiLyXFiles: A bit more work towards generalization
Bind and Ui files can be displayed in this dialog now (via lfun
dialog-show lyxfiles ui|bind), although it is not yet usable in prefs.
2019-03-19 17:00:01 +01:00
Juergen Spitzmueller
adbe5121fe cosmetics 2019-03-19 13:36:05 +01:00
Juergen Spitzmueller
e141781aad GuiLyXFiles: minor generalization 2019-03-19 13:29:32 +01:00
Juergen Spitzmueller
7271325ba7 Fix strings 2019-03-19 07:42:11 +01:00
Juergen Spitzmueller
9faae1284b Add new dialog for templates and examples
This lists all respective files from user, build and system directory
in a structured way and thus allows for easier access to them.

Fixes: #2396, #6861
2019-03-19 06:59:24 +01:00
Günter Milde
406b1e7fcf Small formatting and comments update. 2019-03-16 12:59:34 +01:00
Kornel Benko
7ac04a2b75 Fix #11505. Count and display number of replaced strings in FindAdv 2019-03-13 14:06:18 +01: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
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
Jean-Marc Lasgouttes
91fc45ed35 Do not use trailing underscore for local variable 2019-02-18 16:04:15 +01:00
Jean-Marc Lasgouttes
66a3d64346 Try to compute row height like it should be done
Currently, our computation of row height is not completely standard:
* we ignore completely the QFontMetrics::leading() parameter

* we add arbitrarily 2 hardcoded pixels to the height.

This patch reverses these two choices, which leads to
* slightly larger spacing for MinionPro (which has a big leading).

* an additional spacing of 20% font height that depends on dpi and zoom.

Visual inspection with LibreOffice seems to imply that it disregards
the font leading but uses a interline which is 20% larger than the
font height.
2019-01-16 11:04:53 +01:00
Richard Kimberly Heck
6848dbfd2b Remove empty file discovered by Kornel.
Looks like an accidental commit.

> git log GuiGraphicsUi.h
commit a1cec91afa
Author: André Pönitz <poenitz@gmx.net>
Date:   Fri Aug 31 05:53:55 2007 +0000

    move our stuff off the Q* namespace

    git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19935 a592a061-630c-0410-9148-cb99ea01b6c8

That's all a rename, basically. The original file, QGraphicsUi.h, was commited at 12e5a52b92, and it was empty then, too.
2019-01-10 13:23:33 -05:00
Richard Kimberly Heck
c4fdab6993 Use combo box data rather than looking up info from InsetRef. 2019-01-06 17:46:40 -05:00
Richard Kimberly Heck
b35d90014e Add comment. 2019-01-06 13:02:40 -05:00
Richard Kimberly Heck
b91e2b9998 Remove debugging code. 2019-01-06 13:00:21 -05:00
Richard Kimberly Heck
9b3f9cc687 Fix problem caused by re-ordering of menu at 5f6332bf4.
This broke the activation and de-activation of plural, capitalize,
etc. I guess that tells us how much those get used....
2019-01-06 12:52:44 -05:00
Jean-Marc Lasgouttes
d8498d4785 Fix vertical offset of fonts like MinionPro
For some reason, adding a LTR/RTL Override unicode character before a
MinionPro string increases the ascent of the line.

This creates vertical offset issues when painting if the ascent used
as reference is the one of the font. Use the QTextLine ascent instead
for better results.

This is a followup to 1bed76e2a.

Fixes (reopened) ticket #11284.
2019-01-03 12:19:47 +01:00
Jean-Marc Lasgouttes
c8f4b68423 Add override statements to please clang
Eventually, all overridden virtual methods should be marked properly.
Currently, clang only warns about those in classes that already use
override in at least one place (which was the case dor GuiApplication).
2019-01-02 18:49:23 +01:00
Jean-Marc Lasgouttes
fba9f5b9e8 Remove premature (and bad) optimization
When blinking the caret, it looks like a cool idea to only update the
small rectangle containing the caret. Actually it is an awful idea, since
the paint event will paint some rows, and these rows will not be
properly painted outside of the small rectangle. Unfortunately, the
painter will skip those "painted" rows on next paint events.

This leads to painting errors that depend on the ordering of "real"
and "caret" paint events. This is the reason why they only appeared
with split screens.

Quote of the day: ``The real problem is that programmers have spent far
too much time worrying about efficiency in the wrong places and at the
wrong times; premature optimization is the root of all evil (or at
least most of it) in programming.''
-- Donald Knuth, The Art of Computer Programming.

Fixes bug #11354.
2019-01-02 18:36:02 +01:00
Juergen Spitzmueller
8f332f4429 Fix Include dialog UI
#11443
2019-01-02 09:19:45 +01:00
Pavel Sanda
33284ee5c8 Completion popup menu did not respond to Esc.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg207346.html
2018-12-29 14:36:38 +01:00
Juergen Spitzmueller
a67c541d6b Fixup LocalLayout ui after [3847e0ef/lyxgit] 2018-12-29 11:47:37 +01:00
Richard Kimberly Heck
ac3693c04f Fix bug #11422.
We need to load the master document before applying the params, since
otherwise the TOC reset (and other things) happen before the master
has been loaded (and set as parent).
2018-12-29 00:23:26 -05:00
Juergen Spitzmueller
254affa0b9 Fix regression introduced in a65f1e54dc 2018-12-28 17:25:53 +01:00
Juergen Spitzmueller
a65f1e54dc Properly set up paste and textstyle-apply MenuButtons when no buffer is open. 2018-12-28 14:34:14 +01:00
Juergen Spitzmueller
4d010d97fa style 2018-12-28 12:44:55 +01:00
Juergen Spitzmueller
d50e02d07c Always set main Icon Button to the QMenuButton 2018-12-28 12:41:19 +01:00
Juergen Spitzmueller
e704cc6e82 Add "Reset to Default" item to textstyle-apply button menu
Fixes: #5922.
2018-12-27 14:16:38 +01:00
Juergen Spitzmueller
c57d04908f No need for an extra icon 2018-12-27 11:18:13 +01:00
Juergen Spitzmueller
eb1b88aba7 Use more convenient MenuButtonPopup 2018-12-27 11:09:52 +01:00
Juergen Spitzmueller
01872b4dd5 Remove unused variable 2018-12-27 08:51:17 +01:00
Juergen Spitzmueller
9495ff665d Make "paste recent" accessible from toolbar
via button menu
2018-12-26 17:11:24 +01:00
Juergen Spitzmueller
154b4fdece Give textstyle-apply a history
The last 20 applications are saved now and accessible both via the lfun
(textstyle-apply n) and the toolbar (via button menu)

Fixes: #7133

This also changes the default icon and toolbar position of the action,
as requested in #11427
2018-12-26 15:46:14 +01:00
Juergen Spitzmueller
0492239be0 Fix qt4 build 2018-12-25 18:35:52 +01:00
Juergen Spitzmueller
7610179bc7 More alignment fixes 2018-12-25 18:20:02 +01:00
Juergen Spitzmueller
47ecd75d7f Unify group box style across dialogs. 2018-12-25 17:02:18 +01:00
Juergen Spitzmueller
7674a83ce9 Prefs dialog: some layout fixes. 2018-12-24 18:38:23 +01:00
Juergen Spitzmueller
e52bd7bb00 Advanced F&R layout fixed
Patch by Daniel Ramöller (racoon)
2018-12-24 17:02:11 +01:00
Juergen Spitzmueller
5258cee93e Fix height of paragraph dialog
Patch by Daniel Ramöller (racoon)
2018-12-24 16:48:22 +01:00
Juergen Spitzmueller
fa5703196f Fix Text Properties dialog height
Patch by Daniel Ramöller (racoon)
2018-12-24 16:18:54 +01:00
Juergen Spitzmueller
9ee4a914da Tabular Create layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 16:13:29 +01:00
Juergen Spitzmueller
499871d141 Messages panes layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 16:08:39 +01:00
Juergen Spitzmueller
30d527895e Layout fixes for compare dialog
Based on a patch by racoon.
2018-12-24 16:00:43 +01:00
Juergen Spitzmueller
4c7b3fc109 Theasurus dialog layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 15:24:03 +01:00
Juergen Spitzmueller
5936edfe24 Spellchecker dialog alignment fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 15:16:28 +01:00
Juergen Spitzmueller
d2527038a3 Polishment of the simple Search dialog
Based on a patch by racoon.
2018-12-24 14:47:48 +01:00
Juergen Spitzmueller
4d51206585 When cancelling saving of a children, cancel the whole process.
Fixes remainder of #11405
2018-12-24 13:02:41 +01:00
Juergen Spitzmueller
4f67cf2344 Fix prefs color layout
the list widget is too narrow with some localizations.
2018-12-23 12:08:54 +01:00
Juergen Spitzmueller
81e4f8dfb6 Allow to restore default UI colors in prefs
Patch by Daniel Ramöller (racoon), with slight modifications of mine.

Fixes: #10062
2018-12-22 18:44:58 +01:00
Juergen Spitzmueller
7c31bfa423 Compile fix for Qt < 5.7
Only after that version, the QAction argument is optional.
2018-12-21 13:37:07 +01:00
Juergen Spitzmueller
4ea64ca89a GuiThesaurus: maintain default state of Replace button
Rest of #11417
2018-12-21 12:56:02 +01:00
Juergen Spitzmueller
ac8aac5b36 GuiCharacter: Add menu to Restore button
and allow for resetting all widgets to "No Change" besides "Default"
2018-12-21 12:31:25 +01:00
Juergen Spitzmueller
e6b562d027 Rename ambiguous enum 2018-12-21 12:14:11 +01:00
Juergen Spitzmueller
7fae26c9a7 Handle GuiParagraph for OK default button issue as well 2018-12-20 15:12:53 +01:00
Juergen Spitzmueller
44a0748ba3 Add forgotten initialization 2018-12-20 13:46:41 +01:00
Juergen Spitzmueller
e087722900 Maintain default status for all dialogs using ButtonController
Should fix rest of #11417
2018-12-20 12:56:30 +01:00
Juergen Spitzmueller
33344c6015 Also check for dirty children on QUIT
Fixes rest of #11405
2018-12-20 11:37:19 +01:00
Pavel Sanda
99bfe20120 Properly clean cache which binds inset and dialog.
We fill up edited insets into cache when editing inset is triggered, but
this cache is never cleared up for dialogs unassociated with some inset
- thus when e.g. graphics dialog is open for completely new image the
old cache is (wrongly) used.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg207192.html
2018-12-19 21:31:26 +01:00
Juergen Spitzmueller
af5909beac Maintain default status for InsetParams dialogs
Part of #11417
2018-12-19 11:39:04 +01:00
Juergen Spitzmueller
6dce63496d Maintain default status for ref dialog
Part of #11417
2018-12-19 11:09:32 +01:00
Juergen Spitzmueller
6d4a63d86b Add Qt-internal GUI string 2018-12-17 13:39:45 +01:00
Juergen Spitzmueller
5f03889609 GuiCharacter: Add "Reset" and "Restore Defaults" buttons
Addresses #11415
2018-12-17 12:59:40 +01:00
Juergen Spitzmueller
1b6ce0e827 GuiCharacter: INHERIT is OFF for the tristate buttons. 2018-12-17 10:38:05 +01:00
Juergen Spitzmueller
bf2bf2eaed GuiCharacter: Consider default settings for underline, strikeout and language 2018-12-17 10:12:02 +01:00
Juergen Spitzmueller
f87218bbb5 Check for hidden dirty child on close
Fixes: #11405
2018-12-17 09:11:34 +01:00
Juergen Spitzmueller
ab5c08b3f0 Amend 9705b88251 2018-12-17 09:03:46 +01:00
Juergen Spitzmueller
9705b88251 Use current_font, not real_current_font, in character dialog
The latter has the workarea font settings, which are not of interest
here.

Fixes: #11385
2018-12-16 12:29:15 +01:00
Jean-Marc Lasgouttes
57feb0fed0 Fix undo after breaking a nested paragraph
We have to take into account that Buffer::updateBuffer can modify the document.

Fix bug #11292.
2018-11-23 16:53:53 +01:00
Enrico Forestieri
7822d11361 Fix reloading of local layout file (bug #11120) 2018-11-16 21:47:24 +01:00
Jean-Marc Lasgouttes
7db99672e6 Avoid extra space in tooltips
When using QTextDocument to check the natutal size of a text, one has
to remove the text margin, which is not useful here.

Fixes bug #11353.
2018-11-04 14:02:42 -10:00
Jean-Marc Lasgouttes
1bed76e2a1 Fix selection of unmarked RtL text
With Qt 5.11 at least, RtL text will be drawn RtL even when the
(undocumented) flag Qt::TextForceLeftToRight is applied to the
QTextLayout object. This creates selection issues for Hebrew text
marked as English.

The solution is to do the same as in breakAt_helper, that is prepend
the string with a direction override unicode character.

Doing this requires to introduce a TEXTLAYOUT_OFFSET constant that has
to be used wisely to account for this extra character.

Fixes bug #11284.
2018-11-04 08:23:49 +00:00
Juergen Spitzmueller
b8932afed5 Dispay pre- and posttext widgets if non-empty also if unapplied
Fixes: #11352
2018-10-30 17:23:08 +01:00
Scott Kostyshak
73b1c658a2 Use underline in (+ bold) for char match in layout
When showing the match characters in, e.g., the layout box, we now
underline (in addition to bold) the matched characters. This makes
the matched characters stand out even more.

See 4b716dd6 and the following ML thread:

  https://www.mail-archive.com/search?l=mid&q=20181019155649.dqqk6u25wdcdimrj%40barna
2018-10-22 21:16:56 -04:00
Richard Kimberly Heck
4b716dd63d Use bold instead of underlining to mark the characters we're matching. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
1410eeb10e Simplify the code that adds underlining to the layout combo. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
1cc859d713 Refactor 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
35fac4ab51 Re-organize and simplify now. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
ae65fb2c98 Whitespace. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
d7f4346a19 Fix bug #6096.
We used to need a hack to set the size of the layout combo, but
the code was changed in Qt 4.5 or so. Hence the appearance of this
bug in 2009. We can now just remove this hack, and all seems to
work correctly.
2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
938ef60258 Filter on consecutive sequences of characters.
The filters for the layout combo and document class combo share a
problem: If you type "beam", e.g, in the latter case, then we will
show any document class that contains those letters, in that order,
but not necessarily consecutively. This is extremely confusing and,
as José put it, just weird. So let's fix it.

I'd call this a bug so would be happy to see this in stable, too.
2018-10-18 21:49:31 -04:00
Jean-Marc Lasgouttes
17e2ad927e Followup to 9fe101e8: remove unused method. 2018-10-08 16:04:32 +02: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
Richard Kimberly Heck
4f0ccae399 Fix bug #9004.
I'm not entirely happy with this way of doing it. It seems messy.
But there is not another clear option right now.
2018-10-04 20:37:03 -04:00
Richard Kimberly Heck
944b0ae55d Update the Advanced F&R document class when switching buffers. 2018-10-04 20:30:01 -04:00
Richard Kimberly Heck
5064c09e9f Copy modules into the Advanced F&R pane as well. 2018-10-04 20:30:01 -04:00
Guillaume Munch
1979496399 Make tab movement visible (#10733)
The nice hand-made solution for moving tabs has made its time. Use Qt's feature
instead from now on.
2018-10-04 19:52:21 -04:00
Richard Heck
5f6332bf46 Fix bug 9798.
Nameref support for math references.
2018-10-04 14:04:48 -04:00
Richard Kimberly Heck
2553b0073f Fix bug #11275.
Show module name with description.
2018-10-04 14:02:01 -04:00
Jean-Marc Lasgouttes
2617a4dd50 Fixup 38f09c177b: limit to paint rectangle 2018-10-04 14:27:43 +02:00
Jean-Marc Lasgouttes
38f09c177b When ignoring an update, request one for later
If we were not ready to paint the screen, this does not mean that we
should give up on repainting, just potpone it.

I thought that it was bad to call update() in the paint event, but I
cannot find reference to this anymore and everything seems to work as
intended.
2018-10-03 15:57:11 +02:00
Juergen Spitzmueller
f973855bde Amend cab46ff9d1 2018-09-29 10:29:02 +02:00
Juergen Spitzmueller
cab46ff9d1 GuiCitation: Add some tooltips for the sake of keyboard users
Addresses #11317
2018-09-29 09:18:26 +02:00
Juergen Spitzmueller
90b1345203 Do not store empty posttext for qualified citations
Fixes: #11308
2018-09-25 13:13:56 +02:00
Juergen Spitzmueller
33d6499bbc GuiCitation: don't reset filter on show
Addresses #11291
2018-09-22 10:37:22 +02:00
Jean-Marc Lasgouttes
2cfbc5ecf6 Ignore horizontal wheel scrolling in workarea
We do not know what to do with horizontal scrolling events, so we ignore them.

Note that the code has to be different between Qt4 and Qt5.

Fixes bug #11257.
2018-09-20 23:25:42 +02:00
Jean-Marc Lasgouttes
819cf53c22 Handle branches with space in their name
1/ Handle space in color name in set-color (with quoting)

2/ read properly branch inset when name has a space

Fixes bug #11108.
2018-09-08 13:07:07 +02:00
Jean-Marc Lasgouttes
dd8fd3d90a Get rid of monolithic build support for autoconf
It is not useful anymore on modern machines with several cores.
2018-08-30 11:35:37 +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
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
c12fe77c94 Remove inclusion of obsolete header 2018-08-12 08:29:16 +02:00
Juergen Spitzmueller
07d760ef30 Rework BibTeX dialog
Fixes concerns reported in #11239
2018-08-11 12:17:42 +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
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
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
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
8d45179403 More GuiInfo usability work 2018-08-01 09:28:03 +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
b6eacd8d4f Make the InsetInfo dialog a bit less esoteric. 2018-07-26 16:02:03 +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
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
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
Stephan Witt
b0371107ff Amend change b5c5083c6c.
Remove superfluous and broken code.
2018-07-20 07:33:09 +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
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
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
e6e3777363 Add support for bib files encoding
File format change.

Fixes: #6223
2018-07-07 15:25:35 +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
Juergen Spitzmueller
fc9d47f7f4 Handle correctly zero table special arguments.
Fixes: #10247
2018-06-26 10:51:16 +02:00
Juergen Spitzmueller
8db5ff18cf With xltabular, multi-page tables can have a fixed width 2018-06-25 10:53:40 +02:00
Juergen Spitzmueller
4d80cd60ea GuiTabular: set focus on column width LE if custom is selected 2018-06-25 10:34:57 +02:00
Juergen Spitzmueller
f38816bf16 Add support for tabularx/xltabular
I.e., variable width columns in single and multiple page tables

Files format change.

Fixes: #4154, #4155
2018-06-24 10:05:15 +02:00
Jean-Marc Lasgouttes
f1ea7fee5c Unbreak completion in text mode
Completion uses a complicated async scheme based on timers to update
itself. This is probably not necessary anymore and is fragile to
event order changes.

This is what happens with the new painting scheme. Therefore the
asyncHideXXX() methods have to be made more robust and detect whether
completion state has changed by the time they are triggered.
2018-06-08 10:32:47 +02:00
Richard Kimberly Heck
51f8ba9d35 Fix up 3847e0ef7. 2018-06-06 13:55:59 -04:00
Richard Heck
3847e0ef77 Fix bug #991.
Patch adapts Georg's work on #7404 to this case.
2018-06-05 22:26:16 -04:00
Jean-Marc Lasgouttes
c7496a11b2 Skip paint event when in the middle of a buffer operation
This is detected when an undo group is open and contains at east one
element. This means indeed that changes are in progress. Note that the
group is in general opened in GuiApplication::dispatch. The code there
is changed to ensure that the group is closed before updating the
screen.

This patch is experimental. It is expected to be replaced in master by
a more complete solution. It could in the meantime be backported to 2.3.x.

Fixes bug #11159.
2018-05-31 23:26:17 +02:00
Jean-Marc Lasgouttes
b54fcc0b7f Fixup 7900e995: avoid null dereference
Spotted by Coverity.
2018-05-29 15:23:28 +02:00
Jean-Marc Lasgouttes
d1d3f75548 Fixup dd79338c: avoid hypothetical division by zero
Spotted by Coverity.
2018-05-29 15:18:01 +02:00
Jean-Marc Lasgouttes
c76b8b3a25 Fixup 57dc8175: initialize GuiCharacter::nospellcheck_
Spotted by coverity.
2018-05-29 15:08:38 +02:00
Jean-Marc Lasgouttes
947527084b Remove trailing _ to local variable
We reserve these to private members.
2018-05-28 11:43:24 +02:00
Juergen Spitzmueller
0aeeb78f3c Simplify cite engines code
As opposed to modules (from which the framework was initially borrowed),
we only allow one cite engine per document. Thus, we don't need to fiddle
with lists.
2018-05-20 12:27:03 +02:00
Juergen Spitzmueller
e077255aea Do not start from a non-reveant parent in Buffer cloning. 2018-05-16 08:35:21 +02:00
Jean-Marc Lasgouttes
d03deeca0c Avoid black screen on macOS
When paintEvent is triggered on macOS, the least we can do is to copy
our backing store to the screen.
2018-05-15 10:22:03 +02:00
Juergen Spitzmueller
a78dad7487 Align some strings 2018-05-11 12:59:26 +02:00
Juergen Spitzmueller
aa9543fa2b Add support for global float alignment
It is now possible in the float settings (doc dialog) to specify a global
(inner) alignment for floats, and in the float settings, this can be
overridden (just as with float placement)

Fixes: #8665

File format change.
2018-05-10 20:15:11 +02:00
Juergen Spitzmueller
3313e7d0ab Separate Text Styles and Text Properties 2018-05-08 07:46:53 +02:00
Juergen Spitzmueller
3825b25aed GuiCharacter: Reset > Default 2018-05-07 09:03:45 +02:00
Juergen Spitzmueller
57dc817581 Add \nospellcheck font property
This revives a ten year old idea (and patch) by Dov.

You can now mark in the character dialog text and exclude it from spell
checking.

Fixes: #1042

File format change

Remaining issue: The instant spell checking marks are not immediately
removed, but only after some editing.
2018-05-06 19:48:21 +02:00
Juergen Spitzmueller
16918f9706 More UI tuning following Scott's suggestions 2018-05-05 18:48:43 +02:00
Juergen Spitzmueller
9c0bea33b6 Fine-tune character dialog UI 2018-05-05 17:45:17 +02:00
Juergen Spitzmueller
7be3805a65 Further BC fixes to GuiCharacter 2018-05-05 17:24:09 +02:00
Juergen Spitzmueller
01ca601877 Fix BC issue with autoapply 2018-05-05 12:35:07 +02:00
Juergen Spitzmueller
fe18bea3d0 Have OK/Apply buttons initially disabled. 2018-05-05 11:33:45 +02:00
Juergen Spitzmueller
164e8d1dc8 Add missing transition to button controller
(needed by GuiCharacter, the only user of that specific policy)
2018-05-05 11:32:56 +02:00
Juergen Spitzmueller
d4598bab62 Remove unused code 2018-05-05 11:28:54 +02:00
Juergen Spitzmueller
6c35d5cb5b Fix signals 2018-05-05 10:29:26 +02:00
Juergen Spitzmueller
a320403590 Remove hack that's no longer needed 2018-05-05 10:28:43 +02:00
Juergen Spitzmueller
fe6b0e2670 Add and correct tooltips 2018-05-05 10:05:01 +02:00
Juergen Spitzmueller
01ffcd5f67 Add translator hints 2018-05-05 10:04:46 +02:00
Juergen Spitzmueller
0a8ec32a3b Remove connections
We have on_emphCB_clicked() and on_nounCB_cklicked() that call
change_adaptor at the end (after doing other things)
2018-05-05 10:00:20 +02:00
Richard Kimberly Heck
a2030abab9 Constify. 2018-05-04 15:42:01 -04:00
Richard Kimberly Heck
7f4f14786d Add missing connection after fb393b45. 2018-05-04 15:11:53 -04:00
Juergen Spitzmueller
f888afeb9e Small cosmetic addon to the character dialog redesign 2018-05-04 19:50:41 +02:00
Juergen Spitzmueller
fb393b450d Towards a sane character dialog
This is a proposal, but I think you should try it out in order to comment

What this does, is:

1. Remove the toggle madness. This is really not something anyone
understands without knowing the code, and its very unusual UI
(fixes #4836)

2. Separate and group things that were put all into the "Misc" trashcan
combo

3. Let the dialog reflect the font settings at cursor (selection)

Now the dialog looks more like character dialogs from other applications,
and I think it is more in line with what users expect.

Comments very welcome (and of course I will revert if you want to have
the old idiosyncratic thing back).
2018-05-04 19:34:09 +02:00
Richard Heck
cc4bfc7f04 Add toolbar menus for custom insets and character styles.
I'm open to putting this elsewhere on the toolbar, or even on a
different toolbar. Also, we need decent icons. These ones are not
intended seriously but were just borrowed for testing purposes.
Anyone have good ideas about icons?
2018-05-02 20:31:24 -04:00
Juergen Spitzmueller
dd79338cff Try to make an educated guess about the logo extension on the banner 2018-04-30 12:59:54 +02:00
Juergen Spitzmueller
54aa0addee Allow adjustment of banner slogan size to localized slogan 2018-04-29 11:56:17 +02:00
Juergen Spitzmueller
0423d381e6 Localize slogan on LyX banner
Fixes: #11107
2018-04-29 11:26:25 +02:00
Scott Kostyshak
4f7a5f8c3e Fix duplicate, disabled "Separated Frame Below"
This commit fixes an issue where the menu option "Insert Separated
Frame Below" would show up twice, with one instance disabled. This
occurred when there was a "Standard" environment nested in a
"Frame". With this commit, the duplicate instance is removed.
2018-04-28 11:45:17 -04:00
Juergen Spitzmueller
c7bdb3b342 Rework OK/Apply/Cancel UI of prefs dialog
Instead of "Save" (permanently) and "Apply" (temporarily), OK and Apply
now always save permanently, unless the new checkbox "Apply to current
session only" is checked.

Addresses: #10016
2018-04-28 11:19:26 +02:00
Scott Kostyshak
e49a10729e Initialize toolbarsMovable_
Valgrind detected a conditional jump because this member was not
initialized.
2018-04-27 21:20:56 -04:00
Richard Kimberly Heck
19e6977b5b Try to fix bug #10989.
The problem is that popping dialogs during reload can cause paint
events for which we are not ready. If this does not work, then we
can introduce a new flag, besides 'busy', for that case. But busy
does not seem to be used very widely, so hopefully this works.
2018-04-25 23:46:13 -04:00
Richard Kimberly Heck
34c559edeb Whitespace 2018-04-22 21:45:36 -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
Scott Kostyshak
8be514258f buffer-forall now disables async
Before, the command

  buffer-forall buffer-export

only exported one buffer for me. With async disabled, the command
works as documented and successfully exports all buffers.

Also before, I received an assertion from

  buffer-forall buffer-close

which caused a SIGSEGV at #9422. Now, the action works as expected.
2018-04-21 22:59:26 -04:00
Richard Kimberly Heck
97021ee369 Avoid warning. 2018-04-21 21:41:47 -04:00
Richard Kimberly Heck
0fc50a2637 Fix problem with synchronous export.
It surprises me a bit that the code is different in this case
from the case when EXPORT_in_THREAD is not set. I should check
to see if there's a problem in the other case, too.
2018-04-21 19:50:22 -04:00
Richard Heck
2477493cf5 Fix #8338.
The idea here is to force commands to be run syncrhonously when
they are launched via "command-sequence" or "repeat". We do this
by using a new flag in FuncRequest.
2018-04-20 23:37:58 -04:00
Richard Heck
c4c7053d1d Fix bug #11118.
Adds LFUN_MASTER_BUFFER_EXPORT.
2018-04-19 00:09:41 -04:00
Richard Heck
02e6a5ea19 Formatting. 2018-04-18 22:42:44 -04:00
Richard Heck
87ce258627 Formatting. 2018-04-18 22:33:55 -04:00
Jean-Marc Lasgouttes
01fea56eb6 Update cursor position after committing IM string 2018-04-18 17:41:23 +02:00
Juergen Spitzmueller
feab528fd1 Add support for rotated longtabulars (via [pdf]lscape)
Fixes: #9194

See #9194 for why we use an earlier file format change here.
2018-04-18 13:22:29 +02:00
Richard Heck
83fded8fea Fix some problems with background cancellation.
The problem was that, if we killed export when some graphic was
being converted, or some external template was being handled, it
would only cancel that process, and then it would just continue.
To deal with that, we need to do a few things:
1. Modify the return values for some of the Converters routines,
   and similarly the routines for external templates,  so we can
   tell when something has been canceled.
2. Throw an exception from InsetGraphics or InsetExternal when this
   has happened during export, but ONLY when the Buffer is a clone.
   We shouldn't be able to 'cancel' export when we're, say, generating
   code for the preview pane, but this keeps us on the safe side..
The exception then has to be caught, obviously, back in the export
routines in Buffer.

Probably Coverity will be unhappy about something here, but I'll
deal with that problem as it arises.
2018-04-16 14:02:20 -04:00
Scott Kostyshak
7900e9957c Refactor code showing error dialogs
This commit follows 8d2b121e and is not expected to change
functionality (e.g., I confirmed that the cases of #7330 and #11106
are still fixed). The advantages of this refactoring are the
following:

- Remove some preprocessor directives:
  processingThreadFinished() is only called in the case that
  EXPORT_in_THREAD is 1, so by moving some code up in the call list,
  the directives are not needed.

- If errors() is called when there is no error, there will not be unexpected
  behavior (e.g., as was the case before 8d2b121e).
  Note that errors() is still only called by the code touched by this commit
  if there is an error, but that is for efficiency and readability.

- The "from_master" argument now has a constant meaning. Before, it
  could be the case that "from_master" was set to false but that the
  master's error dialog was shown.
2018-04-14 13:45:31 -04:00
Joel A. Kulesza
869e2fe9b9 Changed Settings->Local Layout to FixedWidth & Nowrap
This change is made in response to Ticket 10992.

The change made is consistent with those captured in Ticket 9966.
2018-04-09 00:48:29 -04:00
Scott Kostyshak
f648f25991 Whitespace 2018-04-08 17:29:37 -04:00
Scott Kostyshak
8d2b121ef5 Do not show master's errors if compiling child
If a master document is compiled and has errors, and then a child is
compiled without error, the errors from the master compilation were
shown.

The setup of the relevant code is the following:

  processingThreadFinished() calls errors().  errors() makes the
  assumption that if it is called, there must have been an error
  somewhere.

The logic of the setup is the following:

  processingThreadFinished() knows whether there was an error on
  the most recent preview/export, although it doesn't know whether
  the error is from master or child (i.e. does not know whether the
  user was compiling the child, or whether master-buffer-view was
  called).  Inside error(), if there is no error in the child, it is
  assumed the error is from master.

For the above logic to work, errors() should only be called if there
was an error.

This commit fixes #11106 and preserves the fix to #7330.
2018-04-08 09:51:01 -04:00
Pavel Sanda
1a4404944b Upstreaming compilation patch needed for Gentoo. 2018-04-02 15:39:56 +02:00
Richard Heck
b4d885ac69 8-char tab stops are too big in the preamble editor. 2018-04-01 22:07:21 -04:00
Richard Heck
e666b5eced Fix bug 11099.
Adds simple search/find functionality to preamble.
2018-04-01 22:07:16 -04: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
Juergen Spitzmueller
126e0c3dac Open ExternalInset dialog on first tab for new insets
Fixes: #11081
2018-03-18 18:30:48 +01:00
Juergen Spitzmueller
3face5e119 Properly fix math packages table in Document Settings
Fixes: #10777
2018-03-18 12:11:26 +01:00
Pavel Sanda
8725614e3f Fix Undocked Outliner & multiple window crashes (#11004).
There are more independent crashes occuring in this scenario and this
fix targets only one of them, in particular the one in which different
window's outliner sends outliner command to a wrong window. The fix
itself gives an option for lfun to know which window it belongs to.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg203619.html
2018-03-12 14:34:24 +01:00
Pavel Sanda
9cdae51688 Allow reload if buffer is externally modified.
Follow-up of 2df82c4a44.
2018-03-02 20:48:08 +01:00
Pavel Sanda
3cb271ceda Filter in citation dialog is not respected when reloading databaze. 2018-03-02 00:50:32 +01:00
Richard Heck
94222e6170 Re-amend ca4426e5. 2018-02-26 16:18:49 -05:00
Richard Heck
ef5d741ba5 Amend ca4426e5.
Thanks for Patrick De Visschere for noticing.
2018-02-25 17:23:46 -05:00
Richard Heck
77a7df1003 Fix bug #10890. 2018-02-24 01:04:20 -05:00
Richard Heck
1a74a654e8 Fix bug #10879. 2018-02-24 01:01:34 -05:00
Juergen Spitzmueller
e0a5babde7 Add literal param to InsetInclude
This is used by lstinput

File format change.

Fixes: #10544.
2018-02-23 08:58:16 +01:00
Richard Heck
f8e8877f83 Respect "literal" setting when entering citation via LyX server.
This requires moving the bool that tracks this somewhere that it
is visible from BufferView. It seemed to make sense to put it as
a static member of InsetCitation.
2018-02-22 15:28:01 -05:00
Pavel Sanda
4ad98b9491 Fix little bit the garbled output for translators. 2018-02-22 20:55:35 +01:00
Richard Heck
9dcaf40452 Fix bug #10893. 2018-02-22 00:34:52 -05:00
Richard Heck
59498fa0cd Fix bug #10892. 2018-02-22 00:33:28 -05:00
Richard Heck
ca4426e553 Fix bug #10888. 2018-02-22 00:29:31 -05:00
Richard Heck
2e13deb561 Fix bug #10886. 2018-02-22 00:23:37 -05:00
Richard Heck
c1d8efcf4b Fix bug #10883. 2018-02-22 00:21:41 -05:00
Richard Heck
4393388508 Fix bug #10882. 2018-02-22 00:20:19 -05:00
Richard Heck
4d88ef32da Fix bug #10881. 2018-02-22 00:17:46 -05:00
Richard Heck
470d83de1e Fix bug #10880. 2018-02-22 00:15:07 -05:00
Richard Heck
1c59eb9688 Fix bug #10866. 2018-02-22 00:12:24 -05:00
Alexander Dunlap
cca365f26c save session when we save a buffer
Implements enhancement #10712.
2018-02-21 11:53:19 +01:00
Juergen Spitzmueller
ab6bd5e319 Fix list of viewable formats in view/update menu.
Also fix list in (currently unused) Export toolbar button.

Fixes: #11044
2018-02-21 10:17:10 +01:00
Juergen Spitzmueller
578cf77f6f Localize items in view/update popup icons
Fixes: #11040
2018-02-20 16:42:01 +01:00
Jean-Marc Lasgouttes
5861df7172 Another go at fixing string metrics
This time, it is the problems with \int in esint and cmex that we are
trying to work around. This code is becoming too complicated to my
taste.
2018-02-17 16:57:35 +01:00
Juergen Spitzmueller
47e85b37eb Disable unsupported ref types in mathed.
Also repair prettyref in InsetMathRef.

Part of #9798
2018-02-14 17:18:24 +01:00
Richard Heck
5ee3396459 Fix crash when citeengine is unknown. 2018-02-12 16:27:14 -05:00
Juergen Spitzmueller
1437ae3f9c Disable BUFFER_EXPORT and BUFFER_EXPORT_AS while buffer is processed
I am rather irritated we didn't do this already, since synchronous runs
with BUFFER_VIEW or BUFFER_UPDATE leads to all sorts of problems,
including crashes.

Fixes the crash in #8338 (but not the bug itself).
2018-02-11 09:50:38 +01:00
Juergen Spitzmueller
be4d49ebd1 amend 71fea63326 2018-02-10 19:02:35 +01:00
Juergen Spitzmueller
71fea63326 Disable CheckTeX while buffer is processed
Since CheckTeX itself processes the tex file, a synchronous run with
a TeX process can lead to all sorts of conflicts, including crashes.

Fixes: #7434.
2018-02-10 18:18:43 +01:00
Juergen Spitzmueller
dadec50a18 Fix race condition in processFuncRequestQueue
The issue here was that the element was only removed from the queue
after the func request was processed, but within that process, other
function could access the queue, so the queue could even be empty
when this function finally wanted to remove the item.

Fixes: #10406.
2018-02-10 15:35:12 +01:00
Pavel Sanda
b7caaf6196 Proper naming of LFUN_SET_GRAPHICS_GROUP. 2018-02-08 21:59:41 +01:00
Juergen Spitzmueller
2f6ada6644 Consider class-provided citation engines
Do not attempt to load, nor allow to set, a different engine in this
case.

Fixes: #11022
2018-02-08 13:25:19 +01:00
Juergen Spitzmueller
6236bcb653 Add missing connection.
This activates the OK/Apply when a biblatex style file is changed
manually
2018-02-06 12:45:22 +01:00
Juergen Spitzmueller
5ce36019e5 Enable CompressorProxy for all Workareas (incl. EmbeddedWorkarea)
This fixes the Advanced F&R.
2018-02-01 14:58:49 +01:00
Juergen Spitzmueller
e2160ec960 Use proper localization chain for Box special width/height
Fixes: #11000
2018-01-27 12:26:01 +01:00
Juergen Spitzmueller
6ed7bbbf7e Make another GUI string translatable
Part of #10999.
2018-01-27 11:20:11 +01:00
Juergen Spitzmueller
26755a015e Make GUI string translatable
Part of #10999
2018-01-27 10:57:33 +01:00
Jean-Marc Lasgouttes
e63b891de5 Better debug message 2018-01-24 14:05:57 +01:00
Pavel Sanda
46826155a8 * LFUN_BUFFER_RELOAD - allow dropping of the changes.
Useful in scripts.
2018-01-13 19:19:18 +01:00
Jean-Marc Lasgouttes
2ba00ecb7b Initialize properly class member
Spotted by coverity.
2018-01-12 16:54:32 +01:00
Juergen Spitzmueller
aab58fed6b Use qt4-compatible connect() syntax.
Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
2018-01-12 15:42:04 +01:00
Guillaume MM
43e4b80734 Install a new compressor
A brand new event compressor based on Kuba Ober's cleverly simple
solution: <https://stackoverflow.com/a/21006207>.

Fix #9362, #9461, #9933: Lyx suddenly gets keyboard keys wrong, and
deadlocks

Fix #9790: LyX should perform key event compression (for improving the
remote X connections one would also need to implement
Qt::WA_KeyCompression)

Fix #10516: slowness on repeated arrow keys with IBus and Qt5

Patch pulled from
https://github.com/gadmm/lyx-unstable/commit/bf5a1efb0db5bfc2b

Signed-off-by: Juergen Spitzmueller <spitz@lyx.org>
2018-01-12 11:03:07 +01:00
Jean-Marc Lasgouttes
3aa10c8dba Fix compilation in monolithic mode 2018-01-06 20:46:06 +01:00
Jean-Marc Lasgouttes
af9f3fe8bd Remove unused variables 2018-01-06 15:48:36 +01:00
Juergen Spitzmueller
f965d23633 Disable useless environment-split function at the core. 2018-01-03 13:16:07 +01:00
Juergen Spitzmueller
7d2764fb9e Use the command-alternatives sequence as defined in menus.bind
Otherwise, the shortcut is not displayed in the menu.
2018-01-03 10:58:30 +01:00
Jean-Marc Lasgouttes
39a8000589 Do not use Application for a 'cancel export' boolean
It is not good for a support function to depend of anything outside of
it, especially Application.

Here the boolean that indicates that export should be canceled is put
in Systemcall. This allows to remove all the dummy theApp() function
that have been added here and there for linking needs.
2018-01-02 16:01:07 +01:00
Juergen Spitzmueller
8f86feb260 Prepend "Insert " in the context menu for environment separators. 2018-01-01 13:40:49 +01:00
Juergen Spitzmueller
c8abe0cf7b Move environment-split from Edit to Insert, as requested. 2017-12-30 17:54:09 +01:00
Juergen Spitzmueller
612536305b Don't show append function where it does not make sense. 2017-12-30 17:04:10 +01:00
Juergen Spitzmueller
87a6c75d9d Introduce environment-split before
This one prepends the new environment rather than appending it.

Easy way to add a new beamer frame before the current one.
2017-12-28 14:17:40 +01:00
Juergen Spitzmueller
2907160fff Introduce environment-split previous
This one checks for an environment in the previous paragraph (outside
the nesting scope).
2017-12-28 12:28:01 +01:00
Juergen Spitzmueller
931f87f508 Introduce "inherit" encoding for latex_language
This gets rid of the hardcoded latin1 encoding for verbatim. Instead,
verbatim now inherits the encoding from the context, which is what is
actually wanted here.

Fixes: #9012, #9258
2017-12-24 17:10:42 +01:00
Richard Heck
76214e6012 LFUN and basic code to enable cancellation of background
processes.
2017-12-21 18:55:39 -05:00
Juergen Spitzmueller
74607702a5 Fix typo.
This had the effect that for file dialogs supposed to use two buttons,
only the second one was displayed, while file dialogs supposed to use
one button did not have a button at all.

Candidate for 2.3.x and 2.2.x.
2017-12-20 12:17:04 +01:00
Juergen Spitzmueller
25a17d72e1 Get rid of idiosyncratic accelerator syntax 2017-12-20 11:37:13 +01:00
Juergen Spitzmueller
1371dbb240 Amend d56a5447f3
LaTeX only breaks after dashes (even though unicode suggests optional
line breaks also before em dashes).
2017-12-17 09:19:26 +01:00
Juergen Spitzmueller
d56a5447f3 Consistent output of breakable/non-breakable dashes on all TeX engines.
Fixes: #10839
2017-12-16 16:12:26 +01:00
Richard Heck
4c093a50c2 Fix #10871 compiler warnings. 2017-12-16 09:58:52 -05:00
Richard Heck
e869ec4bc9 Fix #10869 compiler warnings. 2017-12-16 09:55:25 -05:00
Richard Heck
fb93733fee Fix #10867 compiler warnings. 2017-12-16 09:45:38 -05:00
Richard Heck
37f8efe9f7 Fix #10891 compiler warnings. 2017-12-16 00:55:45 -05:00
Richard Heck
05c876568a Fix #10887 compiler warnings. 2017-12-16 00:50:35 -05:00
Richard Heck
8a1377f6ff Fix #10884 compiler warnings. 2017-12-16 00:48:34 -05:00
Richard Heck
e0672b36f3 Fix #10874 compiler warnings. 2017-12-16 00:46:16 -05:00
Richard Heck
69d46542ed Fix #10872 compiler warnings. 2017-12-16 00:03:36 -05:00
Richard Heck
63d96191b1 Fix #10868 compiler warnings. 2017-12-15 23:59:19 -05:00
Jean-Marc Lasgouttes
2316435f2f Use a backing store on macOS
Qt on macOS does not respect the Qt::WA_OpaquePaintEvent attribute and
clears the widget backing store at each update. Therefore, we use our
own backing store in this case.

This restores a simplified version of the code that was removed at 24c29908.
2017-12-15 17:30:20 +01:00
Jean-Marc Lasgouttes
cd9e42dc35 Improve UndoGroupHelper and use it more
Now the helper class contains logic that checks whether buffer are
known before closing them. This avoids potential crashes.

Use it in different places to siplify code. It is not clear at this
point whether it should be used everywhere.

Followup to bug #10847.
2017-12-13 11:10:49 +01:00
Jean-Marc Lasgouttes
8b107f0490 Handle properly undo groups in embedded work areas
When a buffer is in an embedded work area (adv. find&replace), it is
not found by BufferList:::exists(), and therefore the undo group
created in GuiApplication::dispatch and in the handling of
LFUN_COMMAND_SEQUENCE will not be closed.. Crashes can ensue, as
described in Ubuntu bug:
https://bugs.launchpad.net/bugs/1737429

The solution is to introduce BufferList::isInternal and act on it.

Fixes bug #10847.
2017-12-13 10:46:54 +01:00
Uwe Stöhr
4d0c1c030c GuiApplication.cpp: remove unused includes 2017-12-13 02:59:05 +01:00
Jean-Marc Lasgouttes
f3656600f9 Use UndoGroupHelper to track undo group lifetime 2017-11-29 14:55:56 +01:00
Richard Heck
5f9f3e49da Fix #10819: Set title for print nomencl dialog. 2017-11-26 22:00:14 -05:00
Kornel Benko
3b9705da19 Cmake build: Add option to use native file dialog also for linux 2017-11-26 18:50:53 +01:00
Juergen Spitzmueller
84f7dafe89 Disable non-functional table rotation for longtables
In the long run, proper longtable rotation via [pdf]lscape should
be implemented.

See #9194
2017-11-19 14:34:19 +01:00
Juergen Spitzmueller
dd45c67468 Whitespace 2017-11-10 14:57:19 +01:00
Uwe Stöhr
56670d7322 GuiDocument.cpp: change back alignment for column with package names
- as discussed in bug #10777 the first column should be left-aligned
2017-11-05 13:39:09 +01:00
Uwe Stöhr
a69f1a9e16 GuiDocument.cpp: fix bug 10777
- the column width must be as wide as the column header text
- also center the radiobuttons in the table
- also use alternating colors for the table rows
2017-11-02 22:25:26 +01:00
Juergen Spitzmueller
b851a349b6 Enable OK/Apply buttons when resetting to class defaults. 2017-11-01 12:03:54 +01:00
Jean-Marc Lasgouttes
785c6d4e05 Fix comment 2017-10-25 12:16:16 +02:00
Enrico Forestieri
3b43fbfbb1 Speed up exit time
Instantiating a single QSettings and using it for each ui element
can significantly shorten the time required to save the various
states at exit. The speed up can be better appreciated on *nix,
where the settings are saved on disk, rather than on Windows where
they are held in memory (in the registry).
2017-10-18 13:12:20 +02: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
Juergen Spitzmueller
c462fadff5 Some improvements to the graphics dialog
* Describe the viewport/bb situation more accurate
* Use generic term "coordinates", since bb and viewport are flavor-specific
* Add some tooltips
* Increase the width of the options widget.
2017-10-13 11:25:55 +02:00
Jean-Marc Lasgouttes
e7122d7926 Some improvements related to Debug::PAINTING
Avoid blinking the cursor when these debug messages are active.
This avoids a lot of debug information.
2017-10-11 17:39:02 +02:00
Richard Heck
af381a2fb2 Reset cursor before beginning reload sequence. 2017-10-08 23:06:32 -04:00
Jean-Marc Lasgouttes
add342d088 Create new method GuiWorkArea::Private:::updateCaretGeometry
This replaces a showCaret/hideCaret pair and avoids an update.

Also remove an update() call in resizeBufferView: is is not necessary
since we are already in a pintEvent handler.
2017-10-02 17:14:55 +02:00
Jean-Marc Lasgouttes
9df59aac63 Fix bad refresh when changing zoom level
Replace the tricky code in LFUN_SCREEN_FONT_UPDATE and replace it with
proper use of DispatchResult flags.

LFUN_BUFFER_ZOOM* does not need to call LFUN_SCREEN_FONT_UPDATE, since
it already does everything that is required.
2017-09-27 18:08:20 +02:00
Juergen Spitzmueller
b498646b2e Fix some spelling errors reported by Sven
Fixes: #10678
2017-09-22 09:29:16 +02:00
Jean-Marc Lasgouttes
275d306c73 Do not presume what the defaults for a new QPainter are 2017-09-18 11:21:18 +02:00
Jean-Marc Lasgouttes
6532e5104d Remember correctly pixel ratio used for painting
This avoids endless resize issues on HiDPI systems (e.g. Retina Mac).

Rename pixel_ratio_ to last_pixel_ratio_ to emphasize that this is a
cached value.

Inline needResize method to make the logic clearer in paintEvent.
2017-09-18 10:58:07 +02:00
Jean-Marc Lasgouttes
a31d3dc67d Compute metrics when graphics is updated
Remove the old schedule_redraw_ mechanism that was only useful because
of our synchronous drawing code. Now that actual painting is
scheduled instead of forced, it becomes pointless.

Rename WorkArea::redraw(bool) to scheduleRedraw(bool), to show that
the drawing is not done right away.

In GuiView::updateInset, call scheduleRedraw(true), so that metrics
are correctly computed (this was the whole point of the exercise).
2017-09-14 15:50:30 +02:00
Jean-Marc Lasgouttes
bef0a9137f Remove unused private field from Painter
Clang is good at seeing those, gcc is not.
2017-09-13 15:02:17 +02:00
Stephan Witt
1460e8fe6f #10662 use drawers for bibliography dialogs
This change solves dialog stacking problems on newer Mac OS X in combination with the OS provided file open dialog.

(cherry picked from commit 97dc585138)
2017-09-12 11:14:16 +02:00
Juergen Spitzmueller
4ac94fecb6 GuiBibtex: Use appropriate title when using Biblatex 2017-09-10 10:59:05 +02:00
Juergen Spitzmueller
ed1b67b7ca Use default btprint value in the UI if none is given. 2017-09-10 10:53:35 +02:00
Juergen Spitzmueller
eff50597c0 Disallow newlines in biblatex options
Fixes: #10757
2017-09-10 10:06:47 +02: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
b0737d2589 Rename more instances of "cursor" to "caret"
Thanks to Pavel for the hint.
2017-09-08 16:57:22 +02:00
Jean-Marc Lasgouttes
14320e5b9a Make input methods support great again
This unbreaks input methods by splitting the part of the code that
does the actual drawing to a separate paintPreeditText() method which
is called from paintEvent().

The proper solution would have been to introduce the preedit string in
the Row object, like is done for completion, but this is too complex
to do at this point.

The only change in behavior is that now the commit string is inserted
in one fell swoop, intead of emulating a number of key events.
2017-09-08 16:57:21 +02:00
Jean-Marc Lasgouttes
1a7e342652 Cleanup and simplify WorkArea code
Rename cursor to caret to in order to avoid ambiguity. The caret is
now the blinking thing only.

Remove unused header contents, and some not so useful methods.

No intended change of behavior.
2017-09-08 16:57:21 +02:00
Jean-Marc Lasgouttes
e7fdce0b5a Fix caret painting
The trick is to remember in BufferView what has been done at the
previous draw, so that the row that contained the caret can be
repainted if needed.

To this end, add an argument paint_caret to BufferView, although
painting the caret is not the job of the BufferView (at this point).

BufferView::needRepaint will act as an interface with
TextMetrics::drawParagraph to know whether the painting of a given
row should be forced.

Currently everything is done at the top row level, so that, if the
caret is in a large table, the whole table will have to be repainted.
It is not clear yet that this is necessary.
2017-09-08 16:57:21 +02:00
Jean-Marc Lasgouttes
24c29908bd Do the actual drawing in the paint event
Historically, because of two-stage drawing, LyX has been painting on a
Pixmap, and this pixmap is copied to screen at paint event time.

Now that we have three-stage drawing, it is possible to delay the
painting to actual paint event and avoid the intermediate Pixmap.

Known bug: the cursor is never erased.
2017-09-08 16:55:11 +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
Jean-Marc Lasgouttes
efc7359015 three-stage drawing: add a nodraw stage
Normally the two stages of drawing are
1/ compute metrics of insets/rows/paragraphs/mathrow...
2/ draw the elements and cache their positions

Now the three stages are
1/ metrics
2/ nodraw: do not draw the elements, but cache their position
3/ draw the elements (and store again their position; it does not
   seems to hurt performance).

Revive the NullPainter: this replaces the setDrawingEnabled mechanism
with a painter that does nothing. The advantage is that updatePosCache
(renamed from setPosCache) does not need anymore to be invoked from
the frontend.

updatePosCache (the nodraw stage) is called at the end of
BufferView::updateMetrics.
2017-08-29 16:37:07 +02:00
Jean-Marc Lasgouttes
c874641e95 Fix computation of string width when using a QTextLayout
It was not a good idea to rely on QTextLine::naturalTextWidth() to
compute a string width. The correct method is horizontalAdvance().

Also round the value to the nearest pixel, since this is what
QFontMetrics::width() does.

Fixes bug #10700 (and maybe others).
2017-08-28 14:05:45 +02:00
Scott Kostyshak
acc1cc394f Remove a sometimes blocked call to dispatch
Dispatching LFUN_BUFFER_ZOOM inside of GuiView::restoreLayout() was
blocked in some cases because the function can be called without a
buffer (and the LFUN is marked as needing a buffer). Instead of
conditioning on a buffer, the call is removed because in testing it
does not appear why it is needed.

This commit removes the status message that is displayed if starting
LyX without opening a buffer:

    "Command not allowed without any document open"

See discussion at:

    https://www.mail-archive.com/search?l=mid&q=20170718084344.3kjmu7hzoyajt7vd%40steph

This commit amends 4183a9f4.
2017-08-12 11:46:11 -04: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
b73879691f Another (IMHO false) fall-through warning silenced
With a FIXME. The case should be checked.
2017-08-12 08:59:26 +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
Enrico Forestieri
40e9dea551 Use the OK/Apply paradigm for all document settings
Due to its peculiarity of not being saved in the document, the
shell escape setting was applied immediately without the need
for hitting the Apply or OK buttons. However, for uniformity
sake, it is better to adhere to the established paragdim of
confirming any changes before applying them.
2017-08-10 01:32:23 +02:00
Juergen Spitzmueller
9a36ffd1e3 Sort external templates locale-aware
Fixes: #10738
2017-08-09 16:09:50 +02:00
Enrico Forestieri
f11bfe1697 The shell escape patch
Allow a LaTeX backend to run external commands after user confirmation.
This is a per document and per machine setting. The authorization has
to be given through the document settings pane, but is not recorded in
the document itself. Moving the document to either another computer or
another directory on the same computer revokes the authorization.
This can also be done by right clicking the red icon that appears in
the status bar when a document is marked as one requiring shell escape.
The patch also checks whether the user has added the -shell-escape
option to a LaTeX converter and nags the user to remove the option
(which would be used for all documents) in favor of the (per document)
support offered by LyX.
2017-08-03 13:07:41 +02:00
Enrico Forestieri
44babaf656 Properly warn on missing pygmentize command
- Do not warn when the document properties pane is opened but only
  when minted is selected and the pygmentize command was not found.
- Warn before launching latex if minted is selected and the document
  actually uses listings insets.
2017-07-31 11:32:28 +02:00
Tommaso Cucinotta
770ab9a824 prefs/needauth: avoid show of warning dialog in corner cases (amending [8a4fcd3d/lyxgit]) 2017-07-27 20:00:41 +02:00
Tommaso Cucinotta
8a4fcd3d95 prefs/needauth: added warning if user tries to disable authorization for needauth converters. 2017-07-27 00:05:45 +02:00
Guillaume MM
764c61a08f Fix scrollbar not appearing in new documents unless reloaded (#10729)
QSignalBlocker in updateScrollbar is too strong and prevents the scroll bar from
communicating with its scroll area. The only solution to block signals between
specifically between two objects is to disconnect. This makes sense in this
case, by making updateScrollbar responsible for managing the connection in the
first place.
2017-07-25 00:33:48 +02:00
Jean-Marc Lasgouttes
9fe8190364 Make "devel mode" configurable at run time
Traditionally LyX behaves differently when the directive DEVEL_VERSION
is defined at compile time. This covers
* more detailed description of current position in status bar
* the help files are open in read/write mode
* more detailed debug output in the View Source panel

This patch introduces the new function devel-mode-toggle that allows
to use devel mode in stable releases, and vice versa.

The information is saved in the session file. The default is to
disable devel mode.

Remove all traces of DEVEL_VERSION in autoconf and cmake
2017-07-24 22:00:44 +02:00
Juergen Spitzmueller
9b128671a5 {Over,under}full [hv]box warning is a warning.
Since this is something one should be aware of, make it more prominent
in the Log dialog.
2017-07-24 09:09:48 +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
Juergen Spitzmueller
94d45d9c56 Some comments wrt log file encoding (#10728) 2017-07-23 12:06:58 +02:00
Christian Ridderström
5078448111 Fix minor whitespace error.
Fix the whitespace in e.g. 'QString&' to 'QString &' as this
incorrect, but primarily to simplify a comparison related to
later possibly introducing the use of .clang-format.
2017-07-17 22:23:17 +02:00
Jean-Marc Lasgouttes
449b594a72 Fix unitialized member
Spotted by coverity.
2017-07-06 14:45:21 +02:00
Jean-Marc Lasgouttes
ab81c23656 Do not use toobar menu as fallback context menu
This is a consequence of e91572a0, although it is not clear why. The
contextMenuEvent code of the workarea should not delegate context
menu when it cannot honor it.

Also fix a small memory leak.

Fixes bug #10616.
2017-07-05 12:28:26 +02:00
Richard Heck
fd5a950d7f Fix whitespace in some more files. 2017-07-03 14:46:27 -04:00
Richard Heck
00e4902ea3 Fix trailing whitespace in txt files. 2017-07-03 13:53:41 -04:00
Richard Heck
75bfed5507 Fix trailing whitespace in cpp files. 2017-07-03 13:53:14 -04:00
Richard Heck
51aebc9327 Fix whitespace at EOL. 2017-07-03 13:46:30 -04:00
Bernhard M. Wiedemann
b8e3615492 sort svgz file list
(required because filesystems return listings in undeterministic order)
to generate Resources.qrc and thereby Resources.cpp and the lyx binary
in a reproducible way

Setting LC_ALL=C because sort order might vary with locales.

See https://reproducible-builds.org/ for why this matters.

Fixes #10711.
2017-06-27 16:04:33 +02:00
Jean-Marc Lasgouttes
4efb129ccb Avoid crash when selecting long text
In some (not yet understood) situations, the paragraph metrics cache
is empty in generateSyntheticMouseEvent(). We just avoid a crash in
this case, but there is probably an underlying problem that deserves
being fixed.

Fixes bug #10324.
2017-06-19 12:23:17 +02:00
Jean-Marc Lasgouttes
62b06c64ed Use the same code for editable and non-editable buttons
This removes the use of rectText in RenderButton. The fact that this
gave different spacing than buttonText was a problem.

Now buttonText requires to specify
* the offset, so that INSET_TO_TEXT_OFFSET is not used anymore in
  src/frontends/, which will be useful later.
* the background and frame color, in replacement for the hover state.

Remove the methods button() and buttonFrame() from GuiPainter.

Remove some unused header files.

Fixes bug #10704.
2017-06-15 15:40:30 +02:00
Enrico Forestieri
c86f9d81e7 Avoid a crash if an external template is not installed 2017-06-12 21:24:52 +02: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
Enrico Forestieri
887445537a Switch parameters validation even before applying the changes
In the document settings allow to immediately switch from one
package to the other for parameters validation without the need
of first applying the changes.
2017-06-12 11:54:59 +02:00
Guillaume MM
5fda4e85c7 Unhide buffers that are marked dirty as a result of external modifications
Several comments in the code point to the fact that hidden buffers are assumed
to be clean.

The other solution was to adapt the closing & saving code to take into account
hidden dirty buffers. Experience shows that it is more useful to unhide the
buffers at the moment of the external modification, in the context of a git
workflow where one has to reload the modified children buffers one-by-one.

Fixes crash at #10603
2017-06-11 19:51:17 +02:00
Guillaume MM
db58111360 Properly track the lifetime of signals2::slots (#8261)
Starting at 61b2bd5e, boost::bind was progressively replaced with
std::bind. They are not interchangeable though. boost::bind implements
the tracking of boost::signals{,2}::trackable objects. Now that
std::bind has completely replaced boost::bind, tracking never occurred.

This commit replaces boost::signals2::trackable with the new preferred
boost::signals2 methods: scoped_connections or slot::track_foreign. The
support::Trackable class introduced is less safe but easier for transitioning
old code.

Fixes the crash at #8261.
2017-06-11 19:51:17 +02:00
Enrico Forestieri
55223bdcaa Add accelerator 2017-06-11 13:58:34 +02:00
Guillaume MM
48a73a9e05 Make a string translatable 2017-06-11 06:01:04 +02:00
Guillaume MM
40cfede2bf Clearer message when about to discard an unsaved document entirely. 2017-06-11 06:01:04 +02:00
Juergen Spitzmueller
f34f0c1db4 Oops: currentData() is Qt 5 only. 2017-06-10 18:17:43 +02:00
Juergen Spitzmueller
5685080356 Correct restoration of citation style selection between engine switches
We stored the combo position index, but this changes on engine switch.

This also fixes a crash due to out-of-bound index at engine switch.

Fixes: #10692
2017-06-10 14:29:07 +02:00
Enrico Forestieri
8fa0e539e5 Extend minted support to listings as child documents
This was slipping through the cracks, apparently...
2017-06-08 19:35:48 +02:00
Enrico Forestieri
aae04d25b9 Fix a small glitch
When choosing a code language that has dialects in the languages
combo box, the dialects combo gets activated also when minted is
in use. However, minted does not support the concept of dialects
and the combo should not be enabled. This is harmless because the
dialects are simply ignored and the dialects status is restored
after apply, but it may fool the user in thinking that a dialect
can be actually selected. So, always disable it with minted.
2017-06-07 15:31:13 +02:00
Enrico Forestieri
8dab1cfe7e Fix bug #9101
Update the listings inset to optionally use the minted package
(instead of the listings one) for typesetting code listings.
Only one of the two packages can be used in a document, but it
is possible to switch packages without issues if the used options
are the same. If a switch is made and the options differ, one needs
to manually adjust them if they were entered in the advanced options
tab, or apply again the gui settings.
Note that minted requires the -shell-escape option for the latex
backend and the installation of additional software (python pygments).
2017-06-07 00:55:23 +02:00
Richard Heck
60bd141f1b Keep track of the last manually set state of the literal
checkbox in the citation dialog. Use that information to
set it appropriately for new citations.
2017-05-29 22:53:11 -04:00
Enrico Forestieri
922d1ddc8c Fix bug #10469 2017-05-17 22:31:27 +02:00
Guillaume MM
161f7b7f62 Improve wording (#10670) 2017-05-16 00:28:43 +02:00
Jean-Marc Lasgouttes
676ce147da Fix compilation failure 2017-05-15 10:29:09 +02:00
Jean-Marc Lasgouttes
5354c64b27 Cache QTextLayout objects with Qt/Mac
It seems that the internal Qt5 caching does not work well here,
especially in the case of Herbrew documents.
2017-05-15 10:14:42 +02:00
Guillaume MM
700225c26f Fix colours of buttons in notification frame 2017-05-15 02:28:48 +02:00
Uwe Stöhr
0dd3311dd4 rename buffer parameter math_number_before to math_numbering_side
this is a fileformat change

also try to fix an UI issue that JMarc gets
2017-05-13 20:39:45 +02:00
Jean-Marc Lasgouttes
d4685f2806 Never, never use a string for something that has 3 values
This commit replaces the string math_number_before by a proper math_number enum.

Note that the _before naming was misleading. It was chosen at a time
when we were not sure whether leqno was always left or could be right
in RtL documents.

Note that the token in LyX document is still \math_number_before and
this should be changed.

Fixup for 19cc4a1f.
2017-05-12 12:00:43 +02:00
Uwe Stöhr
19cc4a1fcb GuiDocument: support also the class option reqno
as discussed our support for the formula numbering side should be complete. There are document classes that uses left numbering as default and with the class option "reqno" this can be changed to right numbering. reqno requires the loading of amsamth.
2017-05-12 01:06:05 +02:00
Uwe Stöhr
f109206c05 GuiDocument: rename a function to follow the naming guideline 2017-05-09 21:02:03 +02:00
Uwe Stöhr
902b5f368b GuiDocument: fix bug #10653
- also rename a function because we have the same function name in BufferParams
2017-05-09 01:00:36 +02:00
Guillaume MM
1acb42911a Cosmetic 2017-05-07 14:18:17 +02:00
Daniel Ramöller
e2f864efe4 Lock toolbars (#10283)
- LFUNs to (un)lock toolbars positions (both individually and all at once)

- corresponding menu entry to "Lock Toolbars" menu.
2017-05-07 14:17:54 +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
Daniel Ramöller
9bf8ac4432 Color Preferences: Disable colors rather than hide them (#10483) 2017-05-07 14:17:54 +02:00
Guillaume MM
6b64d462ef Cosmetic 2017-05-07 00:07:24 +02:00
Tommaso Cucinotta
0fc8bd0c5f Revert "Create new graphics from within LyX choosing a sample file to copy from."
This reverts commit 7b6e26ad91.
2017-05-06 09:21:50 +02:00
Tommaso Cucinotta
7b6e26ad91 Create new graphics from within LyX choosing a sample file to copy from. 2017-05-06 00:26:00 +02:00
Uwe Stöhr
1b016f5f67 GuiDocument.cpp: correct a name
No math numbering placement option means default. The default could be already the left side for special document classes.
2017-05-02 23:09:36 +02:00
Uwe Stöhr
8f9a08a4cb TextLayoutUi.ui: remove trace of a moved feature
fixes bug #10647
2017-05-02 23:05:30 +02:00
Uwe Stöhr
0ff8ec57e2 GuiDocument.cpp: change naming of formula numbering option 2017-04-26 00:32:13 +02:00
Uwe Stöhr
da8b732443 Move mathindent from text layout to math settings as discussed 2017-04-25 03:01:39 +02:00
Uwe Stöhr
3f8c15a7c6 support for the document class option leqno
- fileformat change
2017-04-25 02:28:10 +02:00
Stephan Witt
a91402dc64 use examples folder setting from preferences 2017-04-21 11:27:11 +02:00
Uwe Stöhr
6cabf4948f GuiDocument: re-introduce allowMathIndent()
was accidentally reverted by [d86954eb/lyxgit]
2017-04-20 23:21:11 +02:00
Jean-Marc Lasgouttes
df6b2f4470 Rewrite mathindent without HSpace class
Use Length instead of HSpace for math_indentation and rename it to mathindent.
Get rid of the string version.

Rename (g|s)etMathIndentation() to (g|s)etMathIndent().

Remove the HSpace class altogether.

Some cleanups to parindent support to look like mathindent.
2017-04-19 17:55:56 +02:00
Jean-Marc Lasgouttes
d86954eb81 Revert "BufferParams: get rid of the HSpace class for mathindent as requested by JMarc"
This reverts commit d9a2a40268.

This is not the right way of getting rid of HSpace. We need a proper
Length, not a string.
2017-04-19 16:19:18 +02:00
Uwe Stöhr
17a53bbcf9 GuiDocument.cpp: add missing validation code 2017-04-17 20:58:09 +02:00
Uwe Stöhr
d9a2a40268 BufferParams: get rid of the HSpace class for mathindent as requested by JMarc 2017-04-17 20:32:31 +02:00
Jean-Marc Lasgouttes
fc4ca36403 Cleanup parindent support
Rename (g|s)etter to (get|set)ParIndent(), and rename member variables
accordingly.

Do not rely on HSpace anymore, since Length does have all we need.
2017-04-17 18:30:33 +02:00
Scott Kostyshak
742b39f49d Do not open or close branches after doc settings
When applying or saving Document Settings, LyX no longer opens or
closes branch insets. The intent of the previous code was to open
branch insets of a branch that is activated, and close branch insets
of a branch that is deactivated.

After some discussion [1], it was decided that the behavior intended
by the previous code was inconsistent with activating/deactivating a
branch in the context-menu of a branch inset, and the previous code
assumed a workflow of the user, rather than letting the user
separate opening/closing branch insets from activating/deactivating
them.

This commit modifies fd6cd728.

[1] https://www.mail-archive.com/search?l=mid&q=20161030220813.3zlp3zgqgomhx35y%40steph
2017-04-16 16:54:29 -04:00
Uwe Stöhr
58e6c6c876 InsetFloat: allow float placement for rotated floats
- fixes bug #10270
- fileformat change
- fixes also a bug that unwanted placement was output to LaTeX on certain cases
2017-04-15 06:57:52 +02:00
Juergen Spitzmueller
953876a46c Tiny clean up 2017-04-13 09:59:06 +02:00
Uwe Stöhr
fc1c5c6f28 BufferParams: rename formula_indent to math_indent etc. as requested
- also add flyx2lyx feature to import existing document class option as requested by JMarc
- also don't use a real default indentation length
2017-04-13 02:31:26 +02:00
Juergen Spitzmueller
06fb58a2da FontUi: Fix layout
The old layout resulted in a too wide dialog
(especially in some localizations)
2017-04-12 12:50:44 +02:00
Juergen Spitzmueller
cbde0e16e2 TextLayout.ui: small layout fixes. 2017-04-12 12:10:58 +02:00
Juergen Spitzmueller
9068d1902e No need to translate number 2017-04-12 11:57:43 +02:00
Uwe Stöhr
d2ac0d2cf4 TextLayoutUi.ui: correct a tooltip 2017-04-10 23:34:20 +02:00
Jean-Marc Lasgouttes
94114fd121 Better implementation for corssOutLines
When trying to do implement a LaTeX feature on screen, it is always
good to see how LaTeX does it, just in case it is easy to implement on
our side.

Then we have a correct output at all DPI sizes.
2017-04-10 10:27:08 +02:00
Uwe Stöhr
e5c313fc3b GuiDocument.cpp: commit missing part
This should have been committed with the previous commit but failed for an unknown reason.
2017-04-08 02:16:05 +02:00
Uwe Stöhr
c9dde702f0 MathsUi.ui. move formula indentation to text layout as requested by Jmarc 2017-04-08 02:12:35 +02:00
Uwe Stöhr
f37fa674f8 MathsUi.ui: next attempt to make it look correct also under Linux 2017-04-08 01:39:08 +02:00
Uwe Stöhr
74bcd5d26c MathsUi.ui: adjust dimensions as requested 2017-04-07 02:14:34 +02:00
Jean-Marc Lasgouttes
3bd49d1f75 Make it clear that current_view_ is available when needed
In particular the LATTEST in createView tells coverity that creating a
view sets it as current_view_.
2017-04-06 13:03:05 +02:00
Uwe Stöhr
2b0969c31c MathsUi.ui: adjust the size to fit better 2017-04-06 03:07:58 +02:00
Uwe Stöhr
808339790c support to indent formulas
- adds support for the general document class option fleqn
- adds support to specify the formula indentation
- fileformat change
2017-04-05 22:22:47 +02:00
Jean-Marc Lasgouttes
60810e0ae2 Use assertions to declare things we know for sure
Doing it that way makes coverity happy.
2017-04-05 11:53:17 +02:00
Jean-Marc Lasgouttes
abc0aaec12 Replace coverity annotation by an assertion
And reorganize the code a bit.
2017-04-05 11:29:51 +02:00
Uwe Stöhr
e575e7eebd Add support to cross out characters
- adds support for the command \xout of the LateX package ulem
- fileformat change
2017-04-05 00:01:19 +02:00
Tommaso Cucinotta
621ccc5e4e Restrict file cache expiry time to positive values. 2017-04-02 14:55:33 +02:00
Jean-Marc Lasgouttes
da590925cd Work around bug in QTextLine::xToCursor
With RtL text, the method can be non-monotonic wrt x value (which is a
Qt bug). To work around this, we check whether positions adjacent to
those returned by xToCursor look better. Depending on whether the new
x position is too small or too large, we look backward or forward for
a better solution.

The performance is probably not great, but this is only needed for
user interactions, so the performance penalty should not be a problem.

Fixes #10569.
2017-03-31 16:56:06 +02:00
Jean-Marc Lasgouttes
6b2444a7df Replace coverity annotation by assertions 2017-03-31 11:47:47 +02:00
Jean-Marc Lasgouttes
5890e9b831 When destructing a workarea, ignore buffer exceptions
Spotted by coverity, but probably harmless.
2017-03-31 11:17:00 +02:00
Kornel Benko
0d6c64a4eb Cmake build: Project names *should* be uniq 2017-03-30 14:01:56 +02:00
Jean-Marc Lasgouttes
4488c45d09 Make LFUN_REPEAT more robust by limiting to 10000 iterations 2017-03-28 11:30:18 +02:00
Jean-Marc Lasgouttes
5c03cb340c Use convert instead of a stream to read LFUN_REPEAT count
At least coverity should find it safer.
2017-03-28 11:04:39 +02:00
Jean-Marc Lasgouttes
522f3517e1 Handle properly exception that can be thrown by to_local8bit
Remove the use of this function in GuiAlert.

This was spotted by coverity
2017-03-27 16:13:26 +02:00
Enrico Forestieri
91ca310d1d Amend 16d5c49b
Remove redundant action when toggling the dashes check box.
2017-03-27 15:08:30 +02:00
Juergen Spitzmueller
f9b8cc9aa9 Translate file filters for external material 2017-03-26 18:10:30 +02:00
Juergen Spitzmueller
8f6491f073 GuiExternal: use proper model/view separation and sort the templates 2017-03-26 17:56:47 +02:00
Jean-Marc Lasgouttes
72af7f340c Pass big parameters by address
Spotted by coverity.
2017-03-24 15:11:21 +01:00
Enrico Forestieri
16d5c49b38 Further amendment to 72a488d7
Rephrase positively the check box for the output of en- and em-dashes
and disable it when using non-TeX fonts. The state of the check box
is remembered, so that toggling the non-TeX fonts check box does not
cause information loss.
2017-03-21 00:04:08 +01:00
Enrico Forestieri
72a488d7e6 Fix output of en- and em-dashes with TeX fonts
This commit fixes the regression introduced in 2.2 about the
output of en- and em-dashes. In 2.2 en- and em-dashes are output as
the \textendash and \textemdash macros when using TeX fonts, causing
changed output in old documents and also bugs (for example, #10490).

Now documents produced with older versions work again as intended,
while documents produced with 2.2 can be made to produce the exact
same output by simply checking "Don't use ligatures for en-and
em-dashes" in Document->Settings->Fonts.

When exporting documents using TeX fonts to earlier versions, in order
to avoid changed output, a zero-width space character is inserted after
each en/em-dash if dash ligatures are allowed. These characters are
removed when reloading  documents with 2.3, so that they don't accumulate.
2017-03-19 20:50:34 +01:00
Guillaume Munch
340d747fff Clean up
Only keep one dynamic-cast. This fixes coverity warnings.
2017-03-18 15:09:07 +01:00
Richard Heck
50060053e3 Move the global formats and system_formats variables into the
LyX singleton.

Mostly, this is very boring, but it might be good if someone would
check what I did about the dummy implementation in tex2lyx.
2017-03-13 23:40:29 -04:00
Guillaume Munch
22ce6636ef Clarify dialog 2017-03-11 00:50:57 +01:00
Guillaume Munch
0cb85e9206 Disable edition when external modifications are detected
Introduce a distinction between being read-only and having the read-only flag. A
buffer is read-only if either it has been externally modified or if it has the
read-only flag.
2017-03-11 00:50:57 +01:00
Guillaume Munch
b6b56d8518 Notification of external modification inspired by gedit 2017-03-11 00:50:57 +01:00
Guillaume Munch
299242bb16 New LFUN buffer-external-modification-clear 2017-03-11 00:50:57 +01:00
Guillaume Munch
1e57fd12b1 Display externally modified status 2017-03-11 00:50:57 +01:00
Guillaume Munch
cf3c035266 Implement real-time detection of external modifications 2017-03-11 00:50:57 +01:00
Guillaume Munch
3dec5826da buffer-export default 2017-03-11 00:50:57 +01:00
Jean-Marc Lasgouttes
0f220503ff Small cleanup to LayoutBox and CategorizedCombo
Coverity does not find it obvious that p is never negative. Normally
it is the case (because the items have been filtered), but it is
better to play safe.
2017-03-10 15:57:31 +01:00
Jean-Marc Lasgouttes
5a62e37add Handle the case where doc_bv is null
It might only happens in specific cases where no file is open and for
some reason the new file cannot be opened.
2017-03-09 14:41:27 +01:00
Jean-Marc Lasgouttes
2d86b2debb Fix missing initialization
This was already fixed after coverity report at bad511f3fe,
but this part was missing.
2017-03-08 16:41:42 +01:00
Guillaume Munch
3d2d02510a Amend 841825aa56
sort alphabetically
2017-03-06 01:01:11 +01:00
Guillaume Munch
841825aa56 Add default export to the menu 2017-03-05 08:45:52 +01:00
Guillaume Munch
a0ce37147c Allow Ctrl+Enter in GuiCitation even if the citation is already there 2017-03-05 08:45:52 +01:00
Guillaume Munch
494ce6647a buffer-export * synonymous to buffer-export 2017-03-05 08:45:52 +01:00
Jean-Marc Lasgouttes
f4f84ef9a3 Initialisize properly member variables
Instead of using a coverity annotation (that does not work) it is
better to really iinitialize the members of the object, just in case
somebody decides to actually use the DisplayPath() constructor.
2017-03-02 15:20:46 +01:00
Jean-Marc Lasgouttes
1f10969bb5 Add missing initialization
Spotted by coverity
2017-03-01 17:25:03 +01:00
Jean-Marc Lasgouttes
af45bfaee1 Initialize class members to please coverity 2017-03-01 16:28:30 +01:00
Guillaume Munch
a1faa41c83 buffer-export without argument exports the default format
buffer-export is proposed as a default binding in the preferences so now it does
what a user expects when binding it to a key.
2017-02-28 00:46:33 +01:00
Guillaume Munch
887722dbfa Remove LyXToolBox
It extended QToolBox with size calculation to fix UI issues with the previous
design of GuiCitation. Since it always needed some kind of hack and since
QToolBoxes do not appear so popular, it probably won't be used anymore.
2017-02-26 22:16:10 +01:00
Guillaume Munch
06416763ac Give focus to the filter in GuiRef
This is now consistent with GuiCitation. Compared to the previous behaviour
there is only one down key press difference.
2017-02-26 22:16:10 +01:00
Guillaume Munch
750c48eda3 Fix focus events in GuiCitation 2017-02-26 22:16:10 +01:00
Guillaume Munch
d50b66fc88 Whitespace and remove obsolete #ifdef. 2017-02-26 22:16:10 +01:00
Guillaume Munch
eab83ec678 Implement down key press in FancyLineEdit 2017-02-26 22:16:10 +01:00
Guillaume Munch
e6180e9914 Implement left-right navigation in GuiCitation 2017-02-26 22:16:10 +01:00
Guillaume Munch
26b2cc89d3 Fix 18 memory leaks
Also whitespace.
2017-02-26 22:16:10 +01:00
Jean-Marc Lasgouttes
83cf59cf94 Remove unreachable return statement
ALso re-indent a bit.

Fixes coverity issue 134137
2017-02-25 00:32:58 +01:00
Guillaume Munch
0a7ba185a3 GuiCitation: set instant search as the default
It was already supposed to be the default after 7d429291, but one has to set the
default value at the level of the QSettings.
2017-02-22 16:58:38 +01:00
Jean-Marc Lasgouttes
5211ca52ca Move comment
It is slightly more useful here.
2017-02-21 06:52:34 +01:00
Guillaume Munch
33b696c8ac Introduce support/Cache.h
Useful to cache copies of objects, including shared_ptrs. No risks of dangling
pointer, and avoid naked pointers in the source.

Fix memory leak when compiling with Qt5.
2017-02-21 00:06:07 +01:00
Jean-Marc Lasgouttes
9a54376aef Better handling for negative position in pos2x
This code is already in stable actually. The old one does not work
well in RtL text.
2017-02-20 15:39:28 +01:00
Juergen Spitzmueller
450344a9b7 Mention style-dependency of of features in the tooltips, part 2
Some amendments to c7126dc4f9.
2017-02-06 13:17:38 +01:00
Juergen Spitzmueller
c7126dc4f9 Mention style-dependency of some features in the tooltips. 2017-02-06 12:21:53 +01:00
Jean-Marc Lasgouttes
ba8da35afd Fix monolithic build
I gave up understanding why operator==(docstring,char cont *) does not
work in this case.
2017-02-06 11:39:16 +01:00
Juergen Spitzmueller
95eecc8e4a Use localized item when calculating the panel stack's tree widget width.
The current version was wrong for non-English dialogs, and even for
the English one, due to the translator commands that were not removed
for calculation (as in "Formats[[output]]").

Candidate for stable.
2017-02-05 18:02:34 +01:00
Juergen Spitzmueller
517ca4f1cc Disable literal cb if there is nothing to latexify. 2017-02-05 15:43:01 +01:00
Juergen Spitzmueller
06af852293 Correctly enable/disable citation dialog widgets on initialization.
Thanks Guillaume for pointing this out.

(candidate for stable)
2017-02-05 15:42:03 +01:00
Juergen Spitzmueller
bedebfc45a Support for multiple bibliographies setting "per child"
This adds support for the chapterbib package, but also adds ways to
produce this sort of multibib with biblatex and bibtopic (which are
both incompatible with chapterbib).

File format change.
2017-02-04 19:23:45 +01:00
Juergen Spitzmueller
7ca20b292c Support for multiple bibliographies
Using refsection=unit in biblatex, or bibtopic's btUnit environments
in BibTeX.

File format change.
2017-02-04 12:02:00 +01:00
Jean-Marc Lasgouttes
2ea4b1dcdf Revert "Fix crash"
A better fix is forthcoming.

This reverts commit 177ad3d4a4.
2017-02-01 10:11:20 +01:00
Guillaume Munch
177ad3d4a4 Fix crash
Thanks Kornel for the report:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg198630.html

Apparently sanitize can crash. Use the safer fixIfBroken even though it
truncates the cursor.
2017-01-31 22:55:00 +01:00
Juergen Spitzmueller
580efe45ab Nomencl.ui: minor layout improvement. 2017-01-30 09:14:21 +01:00
Juergen Spitzmueller
e15a8f3551 Extend LATEXIFY command param handling and add literal param.
File format change.

This allows for the relevant InsetCommand-based dialogs (such as
citation text before/after, Bibitem label, hyperlink name etc.)
to provide both the input of verbatim code or text that is transformed
to proper LaTeX code.

Some dialogs (Nomencl, Href) already had some methods (although they
could not be toggled), which are now centralized and streamlined.

The initial work of this patch has been done by Georg Baum (see
http://www.lyx.org/trac/attachment/ticket/2751/x.diff)

Fixes: #2751, #8227.
2017-01-30 07:44:55 +01:00
Enrico Forestieri
9e6cf6e05a Allow to properly scale the GUI with Qt5
Starting with Qt 5.6, setting the environment variable QT_SCALE_FACTOR
makes everything accordingly bigger. So, if QT_SCALE_FACTOR=1.2, all
text and GUI elements are rendered 20% bigger. However, if an application
does not account for this, everything will also look "blocky".
With this commit, all text and images will be scaled remaining sharp.
This works whether a HiDpi screen is used or not, but is mostly useful
with a HiDpi screen, as all GUI elements are more spaced apart and one
can use the mouse for selecting things without requiring a high precision.
2017-01-22 01:06:00 +01:00
Juergen Spitzmueller
68ab4023cc Support for "qualified citation lists"
These are biblatex-specific multicite commands that allow for multiple
pre- and postnotes, as in:

\cites(pre)(post)[pre1][post1]{key1}[pre2][post2]{key2}...

with an optional general pre- and postnote, which applies to the whole
list (like [][] in normal cite commands) and an optional pre- and
postnotes for each item, so that pagination can actually be specified in
multi-cite references, as in:
(cf. Miller 2015, 2; furthermore Smith 2013, 23-23; Jenkins 2012, 103,
also refer to chapter 6 in this book)

See the biblatex manual, sec. 3.8.3., for details.

File format change.
2017-01-21 14:25:17 +01:00
Enrico Forestieri
633ad2032e Add clarifying comment 2017-01-20 20:30:06 +01:00
Jean-Marc Lasgouttes
4a935ed768 Fix metrics of math characters with 0 width
It seems that QTextLayout does not handle properly a single character
with 0 width. This breaks drawing of things like \not.

Actually the problem had been worked around already in lib/symbol. The
work around can therefore by removed now.
[additionally, remove extra spacing from \mapsto, \Mapsto]
2017-01-20 10:53:06 +01:00
Juergen Spitzmueller
4859a1f6bb Don't load bibtopic with Biblatex 2017-01-15 15:40:20 +01:00
Guillaume Munch
3391fed36a Make the generation of children's tocs more robust
Let the children directly access the TocBuilders, instead of concatenating
after the fact.
2017-01-14 23:13:14 +01:00
Guillaume Munch
461fda9ca9 Collect the outliner names for the children's tocs
Fixes missing outliner names in various situations. Now if the warning "Missing
outliner name" appears in the console, this correctly hints at an actual issue
with the layout.
2017-01-14 23:13:14 +01:00
Guillaume Munch
bd1ce03b40 Two separators collapse into one
It seems guaranteed by the Qt docs that two menu separators collapse into
one. This allows this little simplification.
2017-01-14 23:13:14 +01:00
Juergen Spitzmueller
33fa147fca Minor string fixes 2017-01-14 17:48:37 +01:00
Juergen Spitzmueller
34943a4e5f Make Japanese Biblatex-aware
Biblatex can be used with Japanese, but then, biber (not pbibtex) should
be used as processor.

I this context, bring the jbibtex UI in line with bibtex, allowing for
a selection of alternatives.
2017-01-14 12:13:33 +01:00
Juergen Spitzmueller
1eb43536da Add an "Automatic" bibliography processor pref option
This is now set as default. It selects biber for Biblatex (with
fall-back to first bibtex8, then bibtex, if the former is not
installed), and bibtex for BibTeX-based engines.

With this, users do not normally need to care for the processor when
they switch cite engines.
2017-01-13 19:18:35 +01:00
Juergen Spitzmueller
fc546b7dcc Basic support for natbib & jurabib options
This re-uses the options line edit introduced for biblatex.
2017-01-13 18:23:42 +01:00
Juergen Spitzmueller
d401a46267 Clear styles widgets only if needed. 2017-01-13 10:57:53 +01:00
Juergen Spitzmueller
7f97ace83b Merge branch 'master' into biblatex2 2017-01-13 09:11:04 +01:00
Juergen Spitzmueller
6b214804f6 Assure long tooltip is correctly formatted.
Amendment to ffb195b5e9
2017-01-13 09:07:44 +01:00
Juergen Spitzmueller
9b13217f7b Use master buffer params when appropriate 2017-01-12 12:19:14 +01:00
Juergen Spitzmueller
425c190d62 merge recent changes from master 2017-01-09 20:04:32 +01:00
Juergen Spitzmueller
ffb195b5e9 Clarify layout and add some tooltips
Addresses: #9795
2017-01-09 18:54:49 +01:00
Guillaume Munch
e11a3cb895 Remove some hardcoded addToToc: note, footnote, marginalnote, branch
Define their Toc from the layout instead.
2017-01-09 18:27:26 +01:00
Guillaume Munch
28dfc48fb2 Implement AddToToc layout command for Flex insets
Enables TOC for FiXme, ToDo, Knitr, Sweave (#7790)
2017-01-09 18:22:22 +01:00
Guillaume Munch
089b80fc7d Menus: Factor Toc code 2017-01-09 18:22:22 +01:00
Guillaume Munch
ab98adf925 Move Tocs to the "Other lists" submenu based on a blacklist
This causes user-defined Tocs to appear in the main list
2017-01-09 18:22:22 +01:00
Juergen Spitzmueller
8319b3e9d6 Biblatex support
File format change
2017-01-08 09:39:46 +01:00
Juergen Spitzmueller
ecbd047cff Merge branch 'master' into biblatex2 2017-01-08 09:06:26 +01:00
Richard Heck
21259b66b5 Allow use of noprefix option even if we're not using refstyle.
I'm not sure why that would be useful, but there's no reason not
to allow it.
2017-01-07 17:26:06 -05:00
Richard Heck
ff3690a5fd Add a "noprefix" option to the "labelonly" version of the reference
inset.

If the reference is "sec:mysec", then this will output just "mysec".
This is what is needed, e.g., to use refstyle's range commands, e.g.,
    \secrangeref{mysec1}{mysec2}
You *cannot* use:
    \secrangeref{sec:mysec1}{sec:mysec2}
even if those are the actual labels.

Eventually, I'd like to add native support for this, but I'm a bit
frightened of trying to make the reference dialog support multiple
selections.
2017-01-07 15:07:44 -05:00
Juergen Spitzmueller
6974e1ceb2 Correctly set quote styles combo 2017-01-07 20:07:45 +01:00
Juergen Spitzmueller
db889bc6a7 Add items to toggle "Force uppercase" and "Full author list" to the context menu 2017-01-07 17:37:35 +01:00
Juergen Spitzmueller
eba2f0479e Implement display of starred cite commands
This entails a change of getAbbrAuthor to getAuthorList (the default is
still abbreviated with respect to MaxCiteItems, but the list can be, at
explicit request, shortened or full notwithstanding MaxCiteItems.
2017-01-07 17:32:45 +01:00
Juergen Spitzmueller
6933051747 Implement display of forceUpperCase 2017-01-07 17:21:41 +01:00
Juergen Spitzmueller
3a0d1d1049 Implement CiteItem in the chain
This allows us to get rid of many idiosyncratic arguments and gives us
a cleaner chain (plus easier extensibility).
2017-01-07 17:17:02 +01:00
Juergen Spitzmueller
23c231c761 Merge branch 'master' into biblatex2 2017-01-05 14:30:26 +01:00
Juergen Spitzmueller
4590f1016b Tweaks to the quotes GUI
This follows some suggestions put forward yesterday.
2017-01-05 14:25:36 +01:00
Richard Heck
fe0d73dead Not sure why "notr = 'true'" got in there. 2017-01-04 16:01:32 -05:00
Richard Heck
e2ef07207e Some tooltips. 2017-01-04 12:50:51 -05:00
Juergen Spitzmueller
7fe596b459 Consider possibility of empty tooltip 2017-01-04 13:29:57 +01:00
Juergen Spitzmueller
f6d4bce123 Merge branch 'master' into biblatex2 2017-01-03 21:49:56 +01:00
Juergen Spitzmueller
e6666bd62a Generalize starred cite commands
Not all of them expand the author list. Thus rename the parameter to
hasStarredVersion and provide a means to adjust the GUI accordingly.
2017-01-03 17:25:41 +01:00
Juergen Spitzmueller
958f6193ed Differentiate InsetCite
Next to the cmd name, introduce optional latex names (that might differ
from the cmd name) and aliases (that are "obsoleted by" the cmd).

This enhances portability between the engines.
2017-01-03 13:11:11 +01:00
Juergen Spitzmueller
0b4d9d8d4a Generalize uppercase test
Biblatex has \Textcite and friends.
2017-01-03 13:01:41 +01:00
Richard Heck
73f59e87bd Add ability to use refstyle's plural and capitalization features. 2017-01-02 22:32:36 -05:00
Richard Heck
c513c26e62 Label only command for reference dialog. 2017-01-02 18:08:30 -05:00
Juergen Spitzmueller
ee653e1968 Amend 8add88ee49: Show Biblatex files in the TeXInfo dialog
UI file was forgotten.
2017-01-02 12:05:14 +01:00
Juergen Spitzmueller
8cadee45e9 GuiLog: Detect Biber for the GUI. 2017-01-02 12:00:10 +01:00
Juergen Spitzmueller
8add88ee49 Show Biblatex files in the TeXInfo dialog 2017-01-01 11:34:35 +01:00
Juergen Spitzmueller
5d58bfadbc Make biblio_style private
This should never ever be accessed directly
2017-01-01 08:37:56 +01:00
Juergen Spitzmueller
ff93aea509 Rework default bibliography style UI
* Use a combo with all available styles
* Correctly reset default on engine change
* Consider that EngineTypes might have different defaults
2017-01-01 08:07:03 +01:00
Juergen Spitzmueller
59a4f263a4 Properly support the cite engines in the GUI
Instead of hardcoding 3 engines, we now support all engines which are
defined in the *.citeengines files.
2017-01-01 07:56:24 +01:00
Guillaume Munch
832b99a394 Remove a redundant deletion of a QObject 2016-12-31 15:16:15 +01:00
Guillaume Munch
cde3f6b84c TocWidget: Remove possibly dangling BufferView pointer 2016-12-31 15:16:15 +01:00
Guillaume Munch
3d6a7a1200 Fix dangling inset pointers after buffer reload
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg198191.html

The root of the issue is in Buffer::reload() called during "Save As".  After
loadLyXFile() there, all the insets have been deleted, and therefore the Inset
pointer GuiView::documentBufferView()->cursor().inset() is dangling. Immediately
after loadLyXFile(), reload() calls updateBuffer() which causes a segfault.

While debugging I got other segfaults caused by the same dangling Inset pointer
in Cursor, notably: 1) a trace identical to the second one from
<http://www.lyx.org/trac/ticket/10520>, and 2) a similar segfault in the
critical path after emergency saving (call to inMathed()).

Having to "refresh" by hand the inset pointer cache in CursorSlice is very
unsatisfactory, but there does not appears to be a consistent strategy for
managing these Inset pointers in CursorSlice.
2016-12-31 15:16:15 +01:00
Guillaume Munch
550567d8f2 Remove outdated comment
UpdateToolbars is no longer slow
2016-12-31 15:01:12 +01:00
Jean-Marc Lasgouttes
eeb6e8333c Fixup c49cd699: QString::toStdString is not always available
This method requires STL support in Qt. Fortunately, it is not needed
here.
2016-12-28 22:44:40 +01:00
Juergen Spitzmueller
c49cd69998 From c7899a30a0b5975bf599a69ecd11ab25e1cdf1a4 Mon Sep 17 00:00:00 2001
From: "Joel A. Kulesza" <jkulesza@gmail.com>
Date: Mon, 24 Oct 2016 17:37:58 -0600
Subject: [PATCH] Add "Swap & Reverse" to math delimiter dialog

When "Keep matched" is unchecked, a button becomes enabled to "Swap &
Reverse" the left and right delimiters.  This is expected to be of use
with line-wrapped equations featuring one or more set of delimiters that
break across the lines.  When "Keep matched" is checked, the button is
visible but disabled.

The most common use case is expected to be the user entering a pair of
unmatched delimiters on the first line of an equation (e.g., "(" and
"(None)"), entering the inner text, going to the next line, and
inserting the opposite set of delimiters (e.g., "(None)" and ")").
This button will negate the need to find the correct corresponding
combination.  However, it relies on the dialog's memory of the previous
unmatched set.

This change addresses Ticket #10457

-----------

Modifications by spitz to the original patch:

* Only enable the button if an unmatched pair is selected
* Consider l7n when locating the string "(None)"
* Add an accelerator and a tooltip to the dialog
* Simplify the code a bit
2016-12-28 16:34:44 +01:00
Juergen Spitzmueller
89ce0c9069 Support for CJK quotation marks
File format change

Fixes: #2712
2016-12-26 14:03:48 +01:00
Juergen Spitzmueller
229f3863f9 Do not attempt to add dynamic quotes to the style combo 2016-12-26 11:25:34 +01:00
Juergen Spitzmueller
7533e7a0a1 Use master buffer params for quote style
+ some formatting polishment
2016-12-25 17:23:07 +01:00
Juergen Spitzmueller
36a679344a Implement dynamic quotation marks
File format change.
2016-12-25 12:19:02 +01:00
Juergen Spitzmueller
237193f8a8 Some new quote styles
* b    `british'    (``inner quotation'')
* w    >>swedishg>> ('inner quotation')   ["g" = Guillemets]
* f    <<french>>   (``inner quotation'')
* i    <<frenchin>> (<<inner quotation>>) ["in" = Imprimerie Nationale]
* r    <<russian>>  (,,inner quotation``)

Rename "french" to "swiss"

Also rename "single/double" to "secondary/primary" ("inner/outer" in
the UI) and "left/right" to "opening/closing". Note that the inset
identifier string is left as is ("s/d" and "l/r")
2016-12-24 14:27:00 +01:00
Juergen Spitzmueller
45df1e87a9 Fix glitch introduced in 2e255b1c4f
set correct combo values.
2016-12-24 13:32:49 +01:00
Juergen Spitzmueller
2e255b1c4f Restructure InsetQuotes for better extensibilty
The current char-based implementation gets increasingly unreadable,
especially if styles are added that do not follow the strict
single-double paradigm.
2016-12-24 10:13:51 +01:00
Juergen Spitzmueller
1ed70d10fd Add "Plain" quotation mark style
File format change
2016-12-21 15:17:30 +01:00
Juergen Spitzmueller
cce4639b55 Rename some quote-related params
Quote Language -> Quote Style
Quote Times-> Quote Level

No change in functionality.
2016-12-20 17:55:43 +01:00
Guillaume Munch
ea7704a354 Do not rely on toolTip() to generate LaTeX code 2016-12-20 00:15:59 +01:00
Guillaume Munch
6d375ddeac Fix compilation with Qt5.8dev 2016-12-20 00:15:58 +01:00
Jean-Marc Lasgouttes
c5119c97fc Add caching for the QTextLayout objects we use
The QTextLayout handling is terribly slow on Qt 4.8.7, but some
caching has been added in Qt5 that makes it much faster. For some
reason, it is not that slow with Qt 4.8.1.

Caches are introduced for the three following methods

* width(doctring), controlled by CACHE_METRICS_WIDTH. This cache already
  existed, but the code has been cleaned up

* getTextLayout, controlled by CACHE_METRICS_QTEXTLAYOUT (disabled by
  default on Qt5, which does its own caching). This is used for pos2x
  and x2pos and now for drawing of text too. The previous code used a
  trivial caching scheme of the last used QTextLayout, but now they
  are properly kept in a QCache. Moreover, the cacheEnabled() property
  is enabled for these QTextLayout object (not sure what this does).

* breakAt, controlled by CACHE_METRICS_BREAKAT. This is the only user
  of QTextLayout which did not have some kind of caching already.

For some weird reasons related to Argument-dependent look-up, the
qHash(docstring) function has to be defined in std namespace, since
lyx::docstring is actually std::basic_string<wchar_t>.

[NOTE: this version has profiling hooks, enabled by commenting out the line
  #define DISABLE_PMPROF
that should eventually be removed.]
2016-12-19 18:47:18 +01:00
Juergen Spitzmueller
5c1fb98885 Whitespace 2016-12-17 12:59:03 +01:00
Juergen Spitzmueller
197c193e21 Context menu for quote insets
Allows to switch quote type.
2016-12-17 12:58:33 +01:00
Jean-Marc Lasgouttes
c8a829d273 Handle negative values gracefully.
It may happen (for example with on the fly spell checking) that
GuiFontMetrics::pos2x is called with a negative pos value. Add a
special case for this situation.

Fixes bug #10506
2016-12-06 16:16:57 +01:00
Guillaume Munch
588d939722 Cosmetic changes to the needauth dialogs
* Use rich text for this complicated message

* More concise

* Fix line breaking issues

* Remove "Do not show again" checkbox
2016-12-04 18:28:03 +01:00
Guillaume Munch
f9528c63c8 GuiAlert: Convert html to plain text on console output 2016-12-04 18:28:03 +01:00
Guillaume Munch
dbcbf305b2 Improve prediction of block outside covered areas 2016-12-04 18:28:02 +01:00
Guillaume Munch
b329b471d4 Remove useless return leftover from earlier code 2016-12-04 18:28:02 +01:00
Tommaso Cucinotta
f0f555b5be Converters Prefs UI layout clarification. 2016-12-04 17:09:30 +01:00
Guillaume Munch
ee0e95aafb GuiSymbols: Better handling of empty blocks
* endInsertRow was incorrectly placed before endResetModel, sometimes leading to
  bad access by the view before it was informed that the model was empty. In
  fact begin/endInsertRows were redundant with begin/endResetModel.

* Empty blocks are not supposed to be shown. This happened when moving the
  cursor. A valid block is now selected intead. Due to the design/optimisation
  of the model update, this requires a first update with an empty
  model. Simplify the old code.
2016-12-03 23:35:15 +01:00
Guillaume Munch
a19be0314b GuiSymbols: fix char->block lookup 2016-12-03 23:35:15 +01:00