Commit Graph

1635 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
7a7b9abf1b Tracking correctly available translations (take 2)
The previous scheme of loading all possible translations and checking
whether the work is a bit too much "brute force" and causes problems
on Mac OS X (documents loaded with the wrong language).

Now there is an helper static method in Messages class that checks
whether a readable .mo file exist for the language. There should be an
API in gettext for doing that, but alas it is not possible.

As a consequence the method Language::translated() has been removed,
along with its cache.
2012-09-08 16:59:19 +02:00
Stephan Witt
4674c3e1c5 Patch from Benjamin Piwowar - see ticket #8185:
In order to interact with native osx applications, AppleScript support is a plus.
Here is a patch that makes LyX respond to a simple command (run) and that allows to communicate with LyX as with the LyX client.
Example of use:
	tell application "LyX" to run "server-get-filename" with argument ""'
returns
	message:/Users/bpiwowar/newfile1.lyx, code:0
with a message and the error code
2012-08-19 22:27:20 +02:00
Juergen Spitzmueller
bfec6d2552 typo 2012-08-17 17:24:09 +02:00
Jean-Marc Lasgouttes
2e1c618824 Typo introduced in commit 16fd47ad. 2012-07-16 00:30:28 +02:00
Pavel Sanda
7b1b9823ff Add comment in lstrings.h 2012-07-15 23:25:58 +02: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
Juergen Spitzmueller
0062538a54 Add some more characters that need to be escaped in labels etc. 2012-06-30 01:24:40 +02:00
Jean-Marc Lasgouttes
92e3cc456f Make debug messages more readable
Shorten the file names output by LYXERR so that they start right after /src/.
2012-06-11 15:03:29 +02:00
Richard Heck
9e678569ad Typo. 2012-06-06 18:20:02 -04:00
Jean-Marc Lasgouttes
992eae2524 Typos 2012-06-05 12:22:13 +02:00
Richard Heck
ead697d4b6 Deal with memory issue reported some time ago in connection with DocumentClass
objects. The problem that led to the leak is that these objects can be held in
memory long after the Buffer that created them is gone, mostly due to their
use in the CutStack. So they were previously held in a storage facility, the
DocumentClassBundle. Unfortunately, they were now being created too often,
especially by cloning. It's not really a leak, because they're accessible, but
we weren't ever destroying them.

This new approach uses a shared_ptr instead.

Thanks to Vincent for pointing out const_pointer_cast.
2012-05-31 12:34:29 -04:00
Pavel Sanda
4ce24954aa Strip gecos on Unix systems on user name only.
Patch from Scott Kostyshak.
2012-05-06 13:36:54 +02:00
Vincent van Ravesteijn
5e4e4b674c Always require a mask to get a temporary filename
If no mask is supplied or the mask is attached to the end of the filename, we end up with unexpected names like
  <system-temp-dir>\lyx_tmpdir.qHp780.vcr780_<mask>
instead of a temporary file in the lyx temporary directory like
  <system-temp-dir>\lyx_tmpdir.qHp780\<mask>.vcr780.
2012-05-03 16:14:37 +02:00
Georg Baum
a2e8cb758b Translations for listings insets
The listings inset and include inset of type listings use two english terms
that are not localized yet: "Listing" for the caption and "Listings" for the
list of listings (not supported natively by LyX yet). The existing layout
translation mechanism has been extended to translate these terms as well:

1) Support [[stuff]] context in lib/layouttranslations
2) Support BabelPreamble and LangPreamble in InsetLayout
3) Use a InsetLayout for InsetInclude of type listings
4) Define BabelPreamble and LangPreamble in the layouts for InsetInclude
   and InsetListings
2012-04-10 20:21:01 +02:00
Lars Gullik Bjønnes
c7bb190fd3 Setup .gitignore for generated files
Setting up .gitignore or .git/info/excludes is something that should
be done. Not doing it makes it a lot harder to see actual new files
that should be added.

Signed-off-by: Lars Gullik Bjønnes <larsbj@gullik.org>
2012-03-22 02:16:12 +01:00
Stephan Witt
8be18455fd #7855 subversion 1.7.x support: use svn info to check if a file is under version control; this works for 1.6.x too; to avoid excessive forks of child processes check for the existence of a .svn directory in current dir and parent directories
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40911 a592a061-630c-0410-9148-cb99ea01b6c8
2012-03-11 11:12:12 +00:00
Jürgen Spitzmüller
44ed83dd86 Work around qt bug that prevents the glyph LATIN CAPITAL LETTER SHARP S from being pasted (bug #8057).
Candidate for branch.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40829 a592a061-630c-0410-9148-cb99ea01b6c8
2012-03-02 09:06:09 +00:00
Georg Baum
de6e4a2937 Make guessFormatFromContents() a bit more private, since it is not supposed
to be used in new code.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40790 a592a061-630c-0410-9148-cb99ea01b6c8
2012-02-21 20:46:37 +00:00
Georg Baum
26e5f1a8ec Use libmagic for file format detection if available.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40789 a592a061-630c-0410-9148-cb99ea01b6c8
2012-02-21 20:29:44 +00:00
Enrico Forestieri
3018614da1 On *nix, a proper forward definition of docstring is necessary for
overriding a pure virtual method (part of bug #8032).
I wonder why it was working on Windows and why it works for QString.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40783 a592a061-630c-0410-9148-cb99ea01b6c8
2012-02-19 21:44:47 +00:00
Enrico Forestieri
1eb41a88f2 Fix bug #8032 (timeout when using the Sweave module)
After the timeout elapses, the user is notified that a command is taking
a long time to complete and is given the choice to stop it. If the user
decides to let the command run, the timeout is increased, otherwise the
command is killed. One is prompted a first time after 3 mins, a second
time after 9 mins, a third time after 27 mins, and so on, i.e., the n-th
prompt occurs after 3^n minutes.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40775 a592a061-630c-0410-9148-cb99ea01b6c8
2012-02-18 14:16:25 +00: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
29627f1680 Fix converters with input redirection, such as the second htlatex one.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40647 a592a061-630c-0410-9148-cb99ea01b6c8
2012-01-22 12:35:07 +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
Georg Baum
3dba00246c Quick fix bug #4267.
A real fix would be to ditch the home made file format detection and use libmagic.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40587 a592a061-630c-0410-9148-cb99ea01b6c8
2012-01-07 19:18:38 +00:00
Peter Kümmel
56cbb9eb11 cleanup before unsubscribing
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40517 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-18 12:03:42 +00:00
Peter Kümmel
c2ff9de084 timeout_min is platform independent
#7928

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40402 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-06 20:52:19 +00:00
Stephan Witt
42e7089a61 correct capitalization of AppKit framework - for case sensitive Mac OS X filesystems
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40316 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-29 20:41:08 +00:00
Peter Kümmel
8abb5429b9 prepare switch to switch-case in when parsing tex files
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40232 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-20 19:44: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
0dee3eff18 Fix bug #4213: Change tracking support for tex2lyx.
Of course this will only work if output_changes was true when creating the
.tex file.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40139 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-06 17:03:59 +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
c58f009c9b Properly account for output redirection with QProcess.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40110 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-31 02:02:27 +00:00
Enrico Forestieri
ef4f08daef Compile fix for *nix...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40053 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-28 14:58:27 +00:00
Enrico Forestieri
775466100f Detect the correct version of python at runtime and store the result
for later calls. The check is only performed on the major version
number, such as to avoid using python 3.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40049 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-28 11:51:48 +00:00
Enrico Forestieri
8a4b25875a Thinking about it, it is better to always convert to docstrings all
utf8 strings, and not only if they contain encoding changes. This is
because if the output encoding was previously changed and an utf8
string is inserted in the stream, the encoding changes cannot occur.
This was not a problem until now because normal strings could not be
inserted in a odocstream, as them would have been exchanged with encoding
changes. Indeed, the SetEnc struct has only a std::string member and
outputting a std::string would be interpreted by the compiler the same
as inserting setEncoding(std::string). However, a std::string can be
inserted in an otexstream and it is better to account for this.
I wonder whether trying "os << std::string", where os is an odocstream,
should produce an error instead of actually trying to change the stream
output encoding, but this has not been a problem until now...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39944 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-23 14:24:17 +00:00
Enrico Forestieri
7fec736162 As stated in r39928, conversion on the fly only works for docstrings
and not for utf8 ones. But the simple solution is to convert to a
docstring before outputting to the underlying docstream.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39930 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-23 03:04:09 +00:00
Enrico Forestieri
bbca759363 Restore r39921, as a simple solution exists.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39929 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-23 03:02:02 +00:00
Enrico Forestieri
936ae8020f Revert r39921. This would not work because proper facets for converting
on the fly are only available for ucs4 encoded strings and not for utf8
ones. So, it does only work with docstrings.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39928 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-23 02:33:38 +00:00
Enrico Forestieri
5a69c96ccd Fix typo.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39922 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-22 18:29:11 +00:00
Enrico Forestieri
0cac034d10 Also account for possible encoding changes embedded in utf8 strings
other than docstrings.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39921 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-22 18:27:56 +00:00
Enrico Forestieri
d703d90574 Fix bug #7835 (Relative paths are not supported by the TEXINPUTS prefix)
This restores \input@path handling, which turns out to be necessary, as
the TEXINPUTS mechanism is not used with relative paths. It turns out
that both methods must be used, because \input@path does not work in all
cases (most notably with tikz).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39918 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-22 15:10:43 +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
6c85f8338f No need for the more expensive to_utf8() here.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39821 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-08 22:21:01 +00:00
Enrico Forestieri
33c5f6d628 Fix bug #7800 (Lyx cannot create dvi with Russian)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39820 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-08 22:13:38 +00:00
Enrico Forestieri
3bcfee0627 Make sure to check command for emptiness, instead of prefix+command.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39762 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-25 20:49:53 +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
a749b73d95 The second argument of Systemcall::startscript is supposed to be encoded
in the filesystem encoding, i.e., the local 8 bit encoding.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39760 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-25 16:38:51 +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