Commit Graph

1743 Commits

Author SHA1 Message Date
Benjamin Piwowarski
ac8b77fc03 Fix problem with python and change of PATH
- waits that lyxrc has been read before finding python
- when the PATH changes, resets the value
2014-03-29 22:19:03 +01: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
Vincent van Ravesteijn
3c67d6f77c Add a comment for the special code on Windows 2014-03-19 21:07:43 +01:00
Vincent van Ravesteijn
d44b465efa Do not use QProcess::startDetached on Windows
QProcess::startDetached cannot provide environment variables. When the
environment variables are set using the latexEnvCmdPrefix, a console
window is shown every time a viewer is started.

On Windows, this reverts commit 5225821242.

Fixes: #9035.
2014-03-19 08:29:38 +01:00
Georg Baum
f7e06dbf16 Fix wrong comment (thanks Enrico) 2014-03-13 21:02:41 +01:00
Georg Baum
362630fba1 Add comments about putenv() usage
Again thanks to Enrico.
2014-03-10 20:59:03 +01:00
Benjamin Piwowarski
908c92e831 Updates to AppleScript support, and documentaoin for it. 2014-03-05 15:46:27 -05:00
Georg Baum
07afd76b7c Fix compilation with libc++
libc++ (http://libcxx.llvm.org/) is used on OS X with newer XCode.
The patch is from Benjamin Piwowarski <benjamin.piwowarski@lip6.fr>, I only
added more comments.
The changes regarding implicit conversion to bool of std::iostream work
because both the C++98 and C++11 standards guarantee that boolean evaluation
of streams returns !fail(). See e.g.
http://stackoverflow.com/questions/1334858/why-dont-iostream-objects-overload-operator-bool
for details.
2014-03-04 23:27:57 +01:00
Richard Heck
7b46aa8fbb Forgot in previous commit to deal with case. As I'm doing it now,
it's easy to use the existing docstring routine, so I've commented
out the string version of lowercase I had introduced. I've left the
code in case someone else needs it later.
2014-02-23 12:04:56 -05:00
Richard Heck
e5ea535952 If the selection is some sort of URL, then make it the target, not
the name, in the hyperlink. Fixes bug #8792.

This also fixes a bug discovered while working on this code: The
params passed to GuiHyperlink were never used.
2014-02-23 11:36:54 -05:00
Stephan Witt
cfe9724a4c add -fobjc-exceptions for compiling linkback sources with g++ and cmake on Mac
Original patch is from Ramanathan Vishnampet
2014-02-19 16:11:03 +01: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
Enrico Forestieri
45a6a9362c Ditch the quote_python flag.
This was discussed on the list some months ago:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg179563.html
2013-10-13 23:57:33 +02:00
Jean-Marc Lasgouttes
50af06c29b Implement reading of mo files with bad byte endianness 2013-10-11 17:21:16 +02:00
Georg Baum
6a30211fef Make encoding conversions thread safe
This is the result of the discussion on the list "2.1.0 Blocker". Thanks to
all contributors!
The main idea is to use thread-local storage for all static variables.
This solution does not need any mutex. For more details, see the comment in
unicode.h.
2013-10-10 21:20:44 +02:00
Georg Baum
3e83380350 Remove questionable Mutex copy code
It is no longer needed, and it had a comment that it needed review...
Now anybody who tries to make a copy again is forced to think about it,
instead of trying and using possibly wrong semantics by accident.
2013-10-08 22:06:55 +02:00
Jean-Marc Lasgouttes
72c13323d8 Remove dependency on NO_LAYOUT_CSS #define in Layout.cpp
Remove all traces of this #define.
2013-09-29 15:26:15 +02:00
Vincent van Ravesteijn
72f70cbe5e Fix bug #8830: Compile error with disabled NLS
The Messages::gui_lang_ variable is instantiated in the '#ifdef ENABLE_NLS' block. To prevent compile problems, we should also instantiate it when NLS is disabled.
2013-09-09 16:25:53 +02:00
Jean-Marc Lasgouttes
56e2448546 Fix compilation on Solaris 11.1 (bug #8783)
Make sure that the configure script only checks features using the C++ compiler.

Also get rid of our last C files, since they are not compiled nor distributed anyway.
2013-09-09 11:02:14 +02:00
Stephan Witt
bb2a75b778 add frameworks to linker flags for Mac OS X 2013-07-20 21:24:56 +02:00
Scott Kostyshak
5225821242 Prevent zombie processes (#8774)
Using Systemcall::startscript() with Starttype::DontWait used to create
zombie processes, as nobody would collect them. This patch starts those
processes as detached, hence preventing them from becoming zombies.

In addition to #8774, this bug was also reported here:
https://bugs.launchpad.net/ubuntu/+source/lyx/+bug/1096666

Patch from Guy Rutenberg. For reference, see this email thread:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg180034.html
2013-07-16 01:02:28 -04:00
Jean-Marc Lasgouttes
deb6e16e79 Move a Qt workaround to the Qt frontend. 2013-06-04 12:08:36 +02:00
Vincent van Ravesteijn
129d43c5c9 Correctly find the gmo files in build dir
The path to the lyx binary is either <build_dir>/bin (CMake) or
<build_dir>/src (autotools). This means the po directory can be found one
directory up.
2013-06-02 15:32:35 +02:00
Kornel Benko
22d52f5f08 cmake: Use provided gmo-files if platform lacks python or gettext tools.
Running lyx from the build-directory now searches for the gmo-files
first in the build dir and then in source dir
2013-06-02 11:38:27 +02:00
Georg Baum
12554c93d8 Remove ugly multiple definition hack
Since 00387b2a38 it is possible to construct a dummy Messages object
which does not translate at all. With the old gettext implementation, a
Messages object without a defined language would have used a language from
an environment variable. Therefore, the duplicate definition of _() is no
longer needed. This gettext removal was really a good idea!
2013-05-31 22:07:14 +02:00
Jean-Marc Lasgouttes
00387b2a38 Fix crash at startup for tex2ylx and lyxclient
This is done by handling explicitly a dummy Message object, where no parsing of mo file is attempted. This avoids in turn that the lyxerr object is used during initialization of a global dummy Message object.
2013-05-31 11:59:52 +02:00
Stephan Witt
3f59d7e2cc add toFilesystemEncoding for --binary-dir argument 2013-05-31 09:00:28 +02:00
Uwe Stöhr
bf7af9fd07 Package.cpp: correctly quote configure call
- fixes bug #8711
2013-05-31 04:23:40 +02:00
Jean-Marc Lasgouttes
149b574b07 Read the right .gmo files when running in place
With gettext, we have been forced to install .mo files at the right place in order to read them. Now that we have our code, the situation changes.

* Add new method Package::messages_file(code), when returns the right path, depending on whether we are running in place.
* In Messages class use that intead of the existing one.
2013-05-30 22:10:01 +02:00
Vincent van Ravesteijn
a3c864102a CMake: Remove libintl 2013-05-30 22:10:01 +02:00
Jean-Marc Lasgouttes
d7e2705228 Get rid of all traces of libintl.
This requires to re-add some tests in configure.ac.

Note that the code to generate a Makefile in po/ has been kept.
2013-05-30 22:10:01 +02:00
Jean-Marc Lasgouttes
19024f7255 Implement native reading of mo files.
Get the default language by a mix of QLocale and LyXRC::gui_language

Known limitations:
   * encoding is supposed to be UTF-8 (the charset parameter is checked);
   * context is not handled (implemented differently in LyX);
   * plural forms not implemented (not used for now in LyX);.
   * tThe byte endianness of the machine on which the .mo file have been
     built is expected to be the same as the one of the machine where this
     code is run.
2013-05-30 22:10:01 +02:00
Vincent van Ravesteijn
762c4eca57 Increase the uniqueness of the temp directories
Now, the temporary directories are composed of the PID + 8 random
characters. This used to be the PID + 2 random characters.

See also 327f7ed90d.
2013-05-19 14:09:06 +02:00
Vincent van Ravesteijn
19418730dd Add a special regfile for filetools test on windows 2013-05-15 09:11:25 +02:00
Vincent van Ravesteijn
0b9714f8df Revert "qt5: Fix use of zlib"
This reverts commits ba3332c6 and f96583e8.
2013-05-14 17:34:51 +02:00
Vincent van Ravesteijn
ba3332c62d qt5: Fix use of zlib
As Qt5 includes zlib as well, we have to use the same naming convention.
2013-05-14 14:24:12 +02:00
Vincent van Ravesteijn
fec57fe959 Implement the use of [[Context]] for placeholders
When placeholders are used, the context can indicate what will be
substituted for the placeholder (e.g. "%1$s[[date]], %1$s[[time]]).
2013-05-13 22:21:33 +02:00
Georg Baum
b79c88034e Add test for Layout::write()
When running the test, you'll get the following messages:

Testing ../../src/../lib/layouts/siamltex.layout...
Layout.cpp (268): Cannot copy unknown style `Enumerate'
Testing ../../src/../lib/layouts/svglobal.layout...
Cannot delete style `Dedication'
Testing ../../src/../lib/layouts/svjog.layout...
Cannot delete style `Dedication'
Testing ../../src/../lib/layouts/svprobth.layout...
Cannot delete style `Dedication'

These are no errors of Layout::write(), but they indicate problems in the
definition of the layout files.

Kornel, it would be nice if you could do the cmake part.
2013-05-13 21:53:28 +02:00
Lars Gullik Bjønnes
704328d348 Remove ; from end of function definitions 2013-05-12 13:04:18 +02:00
Jean-Marc Lasgouttes
cc00530743 Remove cruft 2013-05-08 15:12:42 +02:00
Richard Heck
edd127f993 Make strings used in various assertions non-static. 2013-05-02 15:21:19 -04:00
Jean-Marc Lasgouttes
bd2e7480b1 A first batch of potential bugs spotted by llvm/clang
There are more warnings left, but these are the easiest to fix. And some of them are real bugs (assignments with == instead of =).
2013-05-02 16:38:25 +02:00
Jean-Marc Lasgouttes
fb0827f8bb Small changes to Poor man's profiler
* report results in milliseconds instead of microseconds
* report total time spent in block, additionally to mean time
* cause compilation error with --enable-stdlib-debug
2013-04-30 16:43:29 +02:00
Richard Heck
68408556c7 Clean up comments a bit. 2013-04-28 12:08:30 -04:00
Richard Heck
d79225ae98 Remove all messages to user related to assertions. We'll just use
a basic message which is defined in lassert.cpp now.
2013-04-27 17:52:55 -04:00
Richard Heck
1b1f8dd235 Audit all the LASSERT calls, and try to do something sensible at
each failure.

There are several places I was not sure what to do. These are marked
by comments beginning "LASSERT:" so they can be found easily. At the
moment, they are at:

Author.cpp:105: // LASSERT: What should we do here?
Author.cpp:121: // LASSERT: What should we do here?
Buffer.cpp:4525:        // LASSERT: Is it safe to continue here, or should we just return?
Cursor.cpp:345:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:403:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:1143:                // LASSERT: There have been several bugs around this code, that seem
CursorSlice.cpp:83:     // LASSERT: This should only ever be called from an InsetMath.
CursorSlice.cpp:92:     // LASSERT: This should only ever be called from an InsetMath.
LayoutFile.cpp:303:                     // LASSERT: Why would this fail?
Text.cpp:995:           // LASSERT: Is it safe to continue here?
2013-04-25 17:27:10 -04:00
Richard Heck
62df59cde4 Add additional LASSERT-type macros for dealing with various kinds
of situations.
2013-04-25 17:22:07 -04:00
Richard Heck
88d9f08806 Add a bunch of comments about the different exceptions. 2013-04-25 17:22:07 -04:00
Vincent van Ravesteijn
6f8a74791b Adjust CMake for Qt5 2013-04-23 21:45:49 +02:00