Commit Graph

8335 Commits

Author SHA1 Message Date
Guillaume Munch
e0e765f6a9 Get rid of dirty BufferView pointer
Now that there is a signal to inform the controller when the buffer view has
changed, it is no longer necessary to store a perishable pointer to a buffer
view in the dialog view. (Indeed, it was only really useful for checking whether
the new buffer view pointer was different from the old one.)

TODO: other dialogs should be audited for similar hazards.
2016-10-17 00:16:59 +02:00
Guillaume Munch
de19b8fc2d Take advantage of new bufferViewChanged signal 2016-10-17 00:16:59 +02:00
Guillaume Munch
c438d794ff Factor code after buffer change 2016-10-17 00:16:59 +02:00
Guillaume Munch
f4c390712e New virtual method frontend::Dialog::on_BufferViewChanged()
This is called anytime the buffer view attached to the GuiView changes.
2016-10-17 00:16:59 +02:00
Guillaume Munch
9b4926c6e6 Fit cursor and update screen after reverse-search 2016-10-17 00:16:59 +02:00
Guillaume Munch
01d6333db2 Implement reverse-search in the source panel
Double-clicking on a line in the source panel triggers the selection of the
corresponding line in the Buffer View.
2016-10-17 00:16:59 +02:00
Guillaume Munch
67805de7de New LFUN paragraph-goto id_start pos_start id_end pos_end
This selects from start to end.

id_end must be in the same buffer as id_start.
2016-10-17 00:16:59 +02:00
Guillaume Munch
1f945177b9 Docstringify getLongString in general and preamble snippets in particular
Prepare ground for TexRow InPreamble
2016-10-17 00:16:59 +02:00
Enrico Forestieri
ded8b1b3da Remove context help button hint from file dialogs
This removes the useless '?' button that appears in Windows builds
when using non-native dialogs. Complements cf26d53e.
2016-10-10 01:25:07 +02:00
Scott Kostyshak
f411040a33 Further amend 168d3557 to satisfy GCC 4.6
GCC 4.6 does not support non-static data member initializers.

As Guillaume points out, changing to static does not change the
intent.
2016-10-09 18:08:42 -04:00
Scott Kostyshak
5fd21db9d4 Amend 168d3557
I forgot to append an underscore for the private data member.
2016-10-09 17:22:22 -04:00
Scott Kostyshak
168d355721 Factor out magic zoom minimum to a const member
The limit of 10% is used in both getStatus() and dispatch() to set a
minimum zoom level. Having it centralized makes the code more
readable and makes changing the minimum less error-prone.
2016-10-09 17:18:07 -04:00
Scott Kostyshak
6a0e5571c5 Whitespace 2016-10-09 17:18:07 -04:00
Daniel Ramöller
cf26d53e03 Remove question marks from Windows dialogs 2016-10-09 19:50:34 +02:00
Guillaume Munch
79a947c904 Work around dangling pointer
A better solution would be to entirely get rid of this borrowed pointer with
unclear lifetime, but this requires to introduce a new signal for when the
buffer view attached to the GuiView has changed.
2016-09-29 12:37:19 +02:00
Guillaume Munch
3d7ede6059 Clarify that the Dialog::lyxview_ pointer is in fact a reference 2016-09-29 12:37:19 +02:00
Guillaume Munch
f0959cc292 explicit operator bool 2016-09-23 23:39:48 +02:00
Jean-Marc Lasgouttes
7cbc0c16a8 Simplify the code that sets the read-only emblem in status bar
Actually QIcon is able to handle transparently the svg icons.

Patch from Enrico.
2016-09-23 11:18:28 +02:00
Guillaume Munch
ca58674267 Better title for ViewSource
The title is changed to "LaTeX (pdflatex) Preview", etc. depending on the
format. The actual default format is computed.

The menu name "Source Pane" is replaced by "Code Preview Pane" to better reflect
its purpose.
2016-09-21 16:42:38 +02:00
Jean-Marc Lasgouttes
bbe36ce6ce Do not use em dash in window title
It seems that only KDE does that. Gnome does not, Windows does not either.
I do not think that we can/want to detect a KDE environment at run-time.
2016-09-21 13:56:28 +02:00
Guillaume Munch
8da87f9dbf amend 4d991120 2016-09-18 14:43:26 +01:00
Juergen Spitzmueller
7d4292918e Remove unnecessary directives and preset search on fly. 2016-09-18 09:10:24 +02:00
Juergen Spitzmueller
f1ae30919f Connect filter reset button and remove unnecessary directives. 2016-09-18 09:02:23 +02:00
Juergen Spitzmueller
47ea77a8d7 Fix string 2016-09-17 13:06:41 +02:00
Juergen Spitzmueller
774becf693 Clean up the crossrefs dialog. 2016-09-17 13:03:33 +02:00
Juergen Spitzmueller
3294b16bf6 Keep citation style settings bot within and between sessions.
Fixes: #10256
2016-09-16 19:39:53 +02:00
Juergen Spitzmueller
0c1a023c70 Citation dialog: add & improve tooltips. 2016-09-16 13:47:26 +02:00
Juergen Spitzmueller
5225418d8a CitationUi: Fix small layout glitch 2016-09-16 10:35:06 +02:00
Juergen Spitzmueller
824e24ca60 Citation dialog redesign 2016-09-16 09:21:04 +02:00
Jean-Marc Lasgouttes
9313f8565b Set window title before stting modified state
Fixes message "QWidget::setWindowModified: The window title does not
contain a '[*]' placeholder" when opening a non-existent file.
2016-09-14 22:37:06 +02:00
Juergen Spitzmueller
c0a425a319 Move wrap check for simple search/replace to lyxfind
This gets rid of some dirty dispatch tricks and fixes wrap-around
on replace and in the spellchecker

Fixes: #10378
2016-09-14 10:23:39 +02:00
Juergen Spitzmueller
4c27c921f0 Minor amendment to b95262f487
Just for consistency.
2016-09-10 10:32:40 +02:00
Jean-Marc Lasgouttes
82808fea04 Set window title according to platform UI
The window title is built from the current file name and its
mofidication state. We use our own code instead of the automatic title
bar provided when windowFileName() is set because

1/ Qt does not keep the full path name
2/ Qt does not yield a nice application name

The "read only" and "version control" status are shown in the status bar:

* for read only we use the tab read only emblem (with the right size)
* for version control, we show the name of the backend (using a new
  vcname() method of the backend).

The iconText() of the view is not updated anymore, since this is
deprecated in Qt5.
2016-09-08 15:59:44 +02:00
Juergen Spitzmueller
b95262f487 Sanitize Ref dialog validation.
Fixes: #10376
2016-09-08 15:04:58 +02:00
Georg Baum
646d47ae93 Fix filter filter regex
Now the external material file dialog shows the file types defined in the
template again. Before this fix it did only show "All files (*)".
I don't know what the old syntax was supposed to do or whether it ever worked
with boost::regex, but with std::regex the new one is correct.
2016-09-05 22:49:59 +02:00
Scott Kostyshak
03684ae05e Improve status check of LFUN_BUFFER_ZOOM_{OUT,IN}
buffer-zoom-out can actually zoom in (by giving a positive number as
the argument), so it should only be disabled at the minimum zoom
level if it is indeed zooming out.

Similarly, buffer-zoom-in can zoom out, so it should be disabled if
the user is at the minimum zoom and it is called to zoom out.

This commit amends 8884c404.
2016-08-30 10:25:45 -04:00
Guillaume Munch
4d99112056 Action.cpp: replace a reference with a shared_ptr
Replace the member reference to FuncRequest in Action.cpp with a
shared_ptr. Compared to copying the FuncRequest, the shared_ptr has two
advantages:

* Recreating the menu each time creates a lot of new actions, so we avoid a lot
  of copies.

* FuncRequest can remain forward-declared in Action.h.
2016-08-28 22:49:21 +01:00
Guillaume Munch
0779b3c36c Change "Format" into "Formats"
The plural form seems more appropriate and the tag [[output]] is added for
disambiguation (e.g. for the French translation).
2016-08-28 18:26:58 +01:00
Guillaume Munch
76d0c6759f Trivial clean-up 2016-08-28 02:34:54 +01:00
Guillaume Munch
cb0a4c6639 Fix Unicode use in Format's prettyname
The field prettyname can accept Unicode and therefore must be parsed into a
docstring.

Little simplification of the code on the way.

* For other fields, either a validator should be set to prevent non-ascii input
  in the preferences, or they should be transformed into docstring too.
2016-08-28 01:30:53 +01:00
Juergen Spitzmueller
40d9c6ec48 Implement proper dialog titles in InsetParamsDialogs
Fixes: #10329
2016-08-26 11:35:12 +02:00
Jean-Marc Lasgouttes
65b0e84b54 Let M-x give focus to minibuffer when it is already open 2016-08-22 18:20:09 +02:00
Enrico Forestieri
6adf079796 Quote filenames used for forward-search with SumatraPDF
Single quotes are special to our parser and must be either escaped or
quoted if they are part of a filename, otherwise they are stripped out.

See #10342.
2016-08-21 23:33:01 +02:00
Jean-Marc Lasgouttes
e7a33cacf1 Simplify menus when there is only one caption type
This removes the submenu indirection in Insert and the type changer in
contextual menu. Interestingly, the code was there, but it did not
work at all.
2016-08-19 14:07:08 +02:00
Enrico Forestieri
2a371bb4b3 Add verbose option
Using the option -v (--verbose) all spawned commands are print
on the terminal. Note that this was done by default on previous
versions.
2016-08-17 22:32:14 +02:00
Jean-Marc Lasgouttes
6e88c0062c Use proper QPalette::NoRole enum value instead of our own 2016-08-17 12:10:25 +02:00
Guillaume Munch
5ded0d002d Assertions when doing Export As... (#10321)
Fix assertion with gcc 6: The comparison function must be a strict weak
orderings and not give x < x.

Fix assertion when a custom exportable document format is given a non-ASCII
name. Use qt_ to be consistent with the rest of the code.

Use Qt's locale-aware comparison for appropriate sorting.
2016-08-15 13:23:29 +01:00
Guillaume Munch
0e672fed21 Partially revert "Replace static with thread_local when used for caching"
As noticed by Stephan, clang on Mac is nowhere near to support thread_local for
some reason:
http://stackoverflow.com/questions/28094794/why-does-apple-clang-disallow-c11-thread-local-when-official-clang-supports

It does not look realistic to me to provide a configure-based alternative. The
solution is to not use thread_local until it is reasonably supported on
Mac. According to sources, this means requiring Xcode >= 8.

This reverts commit 82d4f1a446 partially.
2016-08-04 13:39:27 +01:00
Scott Kostyshak
60515b996b New LFUN lyx-activate to focus LyX window
On Linux and Mac OS, this action brings the LyX window into focus.
Such behavior is not allowed by Windows OS so instead the color of
the taskbar entry is changed to indicate that the window has changed
in some way.

The action is hidden in the shortcuts menu because it would make
sense to assign a shortcut to it. The only way to execute shortcut
would be if the LyX window is already activated.

lyx-activate will be used (see next commit) to allow the PDF viewer
to switch to LyX after executing a reverse search.
2016-08-04 01:46:13 -04:00
Guillaume Munch
82d4f1a446 Replace static with thread_local when used for caching
thread_local is a per-thread static variable, so it is thread-safe and can be
used for caching purpose.

Remove the cache for parameter lists as discussed on the list
http://mid.gmane.org/6e871431-0e87-ed2a-3e31-b63356c2391e@lyx.org.

(requires gcc >= 4.8)
2016-08-01 23:44:16 +01:00