Commit Graph

118 Commits

Author SHA1 Message Date
Enrico Forestieri
a3d5f27038 Remove the iconScaleFactor() method from src/support.
I am moving the corresponding code directly to InsetInfo.cpp.
Moreover, the size of the image displayed by the info inset is
now dynamically set according to the text size.
2015-03-25 21:26:32 +01:00
Enrico Forestieri
1af2242c7e Refine fix for #9453
It is better to introduce a dummy blank dir in TEXINPUTS rather than
appending a blank at the end. Even if I have checked that this is not
a problem with MikTeX, some other engine (maybe texlive, but I cannot
check) could not ignore this space and take it as the name of a dir.
In this case, TEXINPUTS would not end with an empty element and the
standard search path would not be inserted there.
2015-03-16 10:55:54 +01:00
Enrico Forestieri
0a5e1f20fc Fix bug #9453
This was due to a problem with the QProcess parser.
See #9453 for details.
2015-03-16 00:34:35 +01:00
Enrico Forestieri
7be2a5d815 Prefer svg icons.
If a compressed svg icon is present, load it instead of a png one.
Also introduce two more sizes (huge and giant icons) that should be
useful when using hires displays, as svg icons automatically scale
to the desired size without loss of quality.
2015-03-13 00:47:21 +01:00
Enrico Forestieri
d00dcc2ca7 Use the nominal theme's icon size for displaying the icon in an info inset. 2015-03-13 00:38:05 +01:00
Enrico Forestieri
bd9f5408cf Properly name an uncompressed sgvz file.
Some tools may rely on the extension and do not actually check whether
a svg file is compressed or not.
2015-03-13 00:34:53 +01:00
Scott Kostyshak
36c3495a3a Correct the spelling of "occured" to "occurred" 2015-02-09 18:44:02 -05:00
Georg Baum
b0361fb3c5 tex2lyx: Run configure.py if needed (bug #8539)
Since tex2lyx reads some LyX config files it needs to run configure.py if
they do not exist or are out of date.
2014-12-29 23:46:25 +01:00
Georg Baum
158b9a0e55 ::readlink() needs unistd.h
this is included in some gcc headers, but not in c++11 mode, that is the
reason why we did not get a compile error so far.
2014-12-21 18:13:33 +01:00
Enrico Forestieri
11b7b7234e Fix bug #9342: LaTeX build get stuck for unconventional path name
The reason being that the TEXINPUTS path list was not quoted on Windows.
This was no problem with spaces but some special characters are
interpreted by the shell and can cause problems. In this particular
case, the '&' character was being interpreted as a command separator.
2014-11-27 21:59:09 +01:00
Georg Baum
a180414975 Fix viewer file paths on windows (bug #8892)
Some applications do not accept forward slashes, so call external viewers
and editors with backward slashes which is the usual convention under windows.
2014-11-19 22:47:36 +01:00
Stephan Witt
e7163a0999 #9130 Text in main work area isn't rendered with high resolution
Add search mode check_hidpi to ease the lookup for images with double size to use for displays with high resolution.
2014-10-18 15:19:47 +02:00
Enrico Forestieri
f439609304 Make binary file detection more robust.
The magic library can detect the charset used by a file. While this
detection is not full proof, actually the library seems to be infallible
as regards the binary nature of a file. So, use libmagic for the detection
and fallback to the previous method if the library is not installed or
its database cannot be loaded.
2014-06-11 23:04:39 +02:00
Georg Baum
f09a9fe2e6 Remove unsafe method FileName::tempName()
FileName::tempName() created a new temp file name by using qt to create a
temporary file with a unique name, and then deleting that file and returning
the name. This was unsafe, since other processes or even other threads of the
running LyX could create files with the same name between deletion and then
using the temp name.
This is fixed by using the TempFile class instead. As a side effect, a few
cases where the temp files were not deleted after usage were fixed as well.
The only place that is still unsafe is createTmpDir().
2014-06-09 13:05:50 +02:00
Scott Kostyshak
fc19148f6d Fix a GCC warning: comparing signed vs. unsigned
This also changes the type of an int to an ssize_t.

nRead is initialized as an ssize_t because it could
be negative. It is cast to a size_t for comparison
to the size of a vector, but only after we check
that nRead is not negative.
2014-05-20 08:01:49 -04:00
Scott Kostyshak
1821c6d8a3 Centralize substitution of python commands
The code for detecting python commands and substituting in the
correct prefix is now merged with what used to be libScriptSearch()
and is now renamed to commandPrep(). This commit does not change
any functionality and just improves organization to reduce the
chance of bugs in the future.
2014-05-14 15:45:20 -04:00
Scott Kostyshak
8b66f9cedf Centralize replacement of "$$s"
Now the replacement is done in startScript(). In addition to making
the code cleaner and more consistent, this commit fixes a bug where
"$$s" was not replaced when "latex=" was specified in the extra flags
of a converter.

Note that the temporary fix at 731b8610 is reverted with this commit.
2014-05-14 15:45:20 -04:00
Richard Heck
fdbe775b9f This is the result of an audit of all static variables, looking
for possible thread conflicts, of the sort Georg resolved at
6a30211f. I have made static variables const where possible,
and marked cases that looked potentially problematic with the
comment:
	// FIXME THREAD
Many of these definitely are vulnerable to concurrent access, such
as the static variables declared at the start of output_latex.cpp.
Suppose, e.g., we were outputting latex and also displaying the
source of a different document.

I'd appreciate it if others could grep for "FIXME THREAD" and see
if some of these are harmless, or what.
2014-04-21 11:51:57 -04:00
Pavel Sanda
0f8a2d2860 Squash gcc warning.
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg183142.html
2014-03-27 01:12:26 -07:00
Kornel Benko
5efd59733a Remove warning 2014-01-05 10:04:23 +01:00
Kornel Benko
805e51eff8 Implement file locking and apply to configure
Functions for file locking are added. They are used for ensuring that
for specified userdir only one LyX process runs configure.
2013-11-20 19:40:32 +01:00
Jean-Marc Lasgouttes
14e01a92a4 Rename Path.h to PathChanger.h (actual name of the class) 2013-02-06 11:51:06 +01:00
Jean-Marc Lasgouttes
16fd47ad8f Fix bug #7741: incorrect locale when starting R from LyX?
The goal here is to get rid of the old code that modified variables
LANGUAGE and LC_ALL, therefore creating the problems mentionned
in the ticket.

In the new system, there is no explicit "GUI" message handler, that
needs to be reset at each language change. Instead, getGuiMessages
calls getMessages with the correct parameter. This allows to simplify
greatly the code and to remove a lot of old cruft.
2012-07-15 22:22:10 +02:00
Georg Baum
9fe72c3501 Move readBB_from_PSFile() out of support (no code change),
since it soon will need to use the Formats class.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40757 a592a061-630c-0410-9148-cb99ea01b6c8
2012-02-15 20:50:52 +00:00
Georg Baum
a6f843aacb get rid of dead code and silly function
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40605 a592a061-630c-0410-9148-cb99ea01b6c8
2012-01-12 19:48:08 +00:00
Jean-Marc Lasgouttes
d7320ad89b Fix shortenng of file names in MakeDisplayPath: it is not a good idea to slice an utf8 string at arbitrary offsets, we have to work on a docstring instead. We need unfortunately to switch back and orth between utf8 and docstring.
This is a candidate for branch too, although the bug is minor.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40149 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-06 22:36:14 +00:00
Georg Baum
07fc1c3abc Replace a half-baked attempt to remove \lyxdot from the directory part of
file names with a proper one: Only replace dots in the base name, and only
request the lyxdot feature if it is needed. This is a partial fix of bug #7650.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40115 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-31 20:27:21 +00:00
Enrico Forestieri
37ba87cfb1 Avoid unnecessary spaces with the Windows shell.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39824 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-09 21:53:35 +00:00
Enrico Forestieri
9c365e841e Apparently, the env program does not strip quotes around the values of the
environment variables. So, replace single quotes by double ones, such that
the QProcess parser will strip them, and strip them by ourselves in ForkedCall.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39761 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-25 20:33:06 +00:00
Enrico Forestieri
b53445e6cd Adjust the simple parser in ForkedCalls.cpp to also account for quotes
don't delimiting an entire word and adapt the quoting such that it works
for Systemcall, ForkedCall, and also for the case when QProcess in not used.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39759 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-25 16:32:31 +00:00
Enrico Forestieri
e5cc5ac2e8 Manage the setting of the latex environment for Systemcall and ForkedCall
in a central place.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39758 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-25 13:35:42 +00:00
Enrico Forestieri
6eabcc2dd3 Protect against autorun commands on Windows (see also bug #7718).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39550 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-28 16:53:38 +00:00
Enrico Forestieri
d68309ee17 On Windows, also fix call to octave (related to bug #7715).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39513 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-23 18:45:46 +00:00
Enrico Forestieri
f3f38f492b Fix #7715 (Lyx 2.0.0 doesn't work with Mathematica 8: call to 'math' problem?)
The fix also allows to execute again batch files when using runCommand.
Unfortunately, this is still not possible with QProcess as that code is not
under our control.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39504 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-22 01:39:49 +00:00
John C. McCabe-Dansted
2885ea3921 Fix bug #7467: build failure on GNU/Hurd, which doesn't define PATH_MAX.
(Patch from Pino, adapted for trunk by Sven)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39333 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-17 12:32:00 +00:00
Enrico Forestieri
1717ef203c Introduce the possibility of setting a prefix for the TEXINPUTS environment
variable. This is done in the preferences, much like as the PATH prefix.
A single '.' in the paths will get replaced with the current document dir
and also non-absolute paths will be prefixed with that dir.

The default semantics of TEXINPUTS apply, such that, for example, if a
path is terminated with a double slash, all subdirectories will be also
searched by both the TeX engine and ancillary programs such as dvi
previewers or dvips. As an example, if the prefix is set to ".:figs", the
TEXINPUTS variable will be set as ".:<docdir>:<docdir>/figs:$ORIGTEXINPUTS",
where <docdir> is the document directory.

The initial '.' is necessary to address the actual current dir (this will
be the temp dir at preview time), while if TEXINPUTS was initially unset,
such that $ORIGTEXINPUTS is empty, a colon (or semicolon on Windows) will
end the path list. This is very important, because we don't want to replace
the system directories but to complement them and, in order to do that, an
empty element has to be present in the list. Indeed, according to the
TEXINPUTS semantics, an empty element means the standard search path.
This works whether TEXINPUTS is originally set or not, because if the
original TEXINPUTS starts with a colon (meaning that the standard search
path is wanted there) we will have an empty element at that point,
otherwise the final colon will simply serve as a path separator.

Of course, on Windows a ';' has to be used as a path separator. LyX will
take care of transforming the platform path list into one understandable
by the TeX engine. For example, this will be the case for a Cygwin version
of LyX using a native Windows TeX engine or viceversa. I tested all of
this and it works for me.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38681 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-09 23:25:51 +00:00
Peter Kümmel
dd64477e3b #7407, home_dir could be a static function and also be called by the
Package constructor


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38370 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-13 19:11:55 +00:00
Enrico Forestieri
a99340cd10 Infrastructure for choosing different icon sets. This currently works
through the rc setting \icon_set. Preferences dialog will follow shortly.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38038 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-25 01:59:34 +00:00
Joost Verburg
1e190a2af2 use return value of regex_match to check whether a match was found
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37722 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-17 19:39:07 +00:00
Joost Verburg
75218491f9 fix replacement of multiple environment variables (result was not cleared for next iteration)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37699 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-16 18:59:19 +00:00
Stephan Witt
9e16f14464 introduce the lyx_dir() of Package, automatically set LyXDir environment, correct the replaceEnvironmentPath() function (see #4177) and replace environment variables in path_prefix at runtime
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37326 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-25 21:10:49 +00:00
Richard Heck
f7bfb018a7 Update error message.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37244 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-17 21:49:28 +00:00
Richard Heck
0e2828917b Utility functions for converting preference files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37230 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-16 19:51:02 +00:00
Jürgen Spitzmüller
0a34b1e047 fix some typos. Patch by Yuri Chornoivan.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37039 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-29 16:57:04 +00:00
Jean-Marc Lasgouttes
bbea06a0c6 fix comment
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36905 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-16 17:51:30 +00:00
Georg Baum
53a72a4526 fix bug #6584
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36687 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-03 17:48:06 +00:00
Uwe Stöhr
b33182bc3d filetools.cpp: introduce a new method to be able to distinguish between valid LaTeX filenames and filenames causing troubles on some DVI viewers.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35514 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-27 02:39:22 +00:00
Uwe Stöhr
f772315090 filetools.cpp: revert r35499 until we found a proper solution as discussed in http://article.gmane.org/gmane.editors.lyx.devel/129471
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35500 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-25 16:04:52 +00:00
Uwe Stöhr
052f689daa filetools.cpp: fix #6916 - round parentheses are valid in filenames (they are even standard in paths in WinXP 64bit); they should also make no problems on UNIX systems
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35499 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-25 14:25:19 +00:00
Abdelrazak Younes
ef3c8c10e1 Fix gcc warning.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35294 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-06 07:11:27 +00:00