Commit Graph

199 Commits

Author SHA1 Message Date
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
813c00a21f Use [[Context]] for the msgid of some strings 2013-05-13 22:22:04 +02:00
Vincent van Ravesteijn
cba5060e74 Translate build version strings 2013-05-13 12:57:21 +02: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
Scott Kostyshak
d42c5fcd23 Exit with error if required filename is not given
This is a second attempt to fix the problem described in
6df4a7bb (2c2c1767 reverted the first attempt).

The solution here is more general: if we get to a certain point
in the code and there is no filename, an error is given.

The following command now gives an error:

  lyx -e pdf2

And the following command continues to not give an error:

  lyx myfile.lyx -e pdf
2013-03-30 00:01:39 -04:00
Scott Kostyshak
70eddf2c30 Give an error message when LyX cannot load a file
Before, the following commands correctly exited with code 1, but now
a reason for exiting is also given:

  lyx -e pdf2 doesNotExist
  lyx doesNotExist -e pdf2
2013-03-29 23:58:43 -04:00
Scott Kostyshak
2c2c17675d Revert "Exit with error if no filename given to -e switch"
This reverts commit 6df4a7bb40.

As Vincent points out, this commit is not correct. For one reason,
it would incorrectly exit with error for the following syntax:

lyx myfile.lyx -e pdf

I will look for a correct solution to the problem specified in the
message of the reverted commit.
2013-03-29 11:20:23 -04:00
Scott Kostyshak
6df4a7bb40 Exit with error if no filename given to -e switch
Before, 'lyx -e pdf2' would give no error and would exit with 0. A use
case is if a user has in a bash script the following command:

lyx -e pdf2 "${mylxyfile}" || exit 1

where 'lyx' is mispelled as 'lxy' and thus yields an empty
string. If LyX does not exit with an error, the script continues where
the user probably intends for it to stop.
2013-03-29 01:57:29 -04:00
Scott Kostyshak
cc138f6e68 Remove an empty line to make style consistent 2013-03-29 01:57:29 -04:00
Jean-Marc Lasgouttes
14e01a92a4 Rename Path.h to PathChanger.h (actual name of the class) 2013-02-06 11:51:06 +01:00
Scott Kostyshak
0247f726aa Improve -help output regarding --export switch
Thanks to Jean-Pierre Chrétien.
2013-01-22 03:26:59 -05:00
Lars Gullik Bjønnes
6b2232a29c src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
Lars Gullik Bjønnes
d52c9fda34 Use new T not new T() 2012-10-27 01:25:38 +02:00
Scott Kostyshak
80c126b092 Typos
Clean up some comments, LFUN documentation, an error message,
and lyx --help output.
2012-09-12 19:38:26 -04:00
Scott Kostyshak
4c1d45aac9 -help, -version, & unqualified -dbg now go to cout
Makes output consistent with other programs and allows for piping that
is more user-friendly.
2012-09-11 01:22:23 -04:00
Juergen Spitzmueller
869b84aef9 Clean up LaTeX font handling (#4999)
The LaTeX font information are now centralized and outsourced. This removes a lot of hardcoding and duplication and makes it easier to support new LaTeX fonts.
2012-08-16 13:23:39 +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
Jean-Marc Lasgouttes
a756403301 "Performance" fixes suggested by cppcheck
While cppcheck did not turn out any suspicious error messages, using
the "performance" flag highlighted several nitpicks in three categories
 * do not use it++ for iterators, ++it is better
 * do not use size() to test for emptyness, empty() is here
 * do not use "const T" as a function parameter, "const & T" is better

I doubt that any of these is a real performance problem, but the code is cleaner anyway.
2012-05-28 22:42:44 +02:00
Vincent van Ravesteijn
fa438c1699 Remove read_only parameter from newBuffer
This parameter defaults to false and it is never set to true. So, we can
better remove the parameter.
2012-05-12 14:35:04 +02:00
Tommaso Cucinotta
79716cbcd0 Clean up word lists on exit. Not really a concrete issue, but just
get less "noise" when debugging for memory leaks.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39865 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-15 13:38:52 +00:00
Tommaso Cucinotta
eff76bd3ab Added -E option to specify export format and destination file-name (and export folder).
Addressing #4501.
See also http://comments.gmane.org/gmane.editors.lyx.devel/138329


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39678 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-15 01:07:49 +00:00
Abdelrazak Younes
850e4d80c0 Graphics cleanup: get rid of Previews.{h,cpp}
The PreviewLoader is created directly by Buffer on demand. The PreviewLoader cache was complex and unneeded because there is one and only one PreviewLoader per Buffer.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39276 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-12 12:43:11 +00:00
Peter Kümmel
1af61e659c run in-place: don't speculate where the lyx binary is, search for it at the common places
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38753 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-14 12:26:11 +00:00
Kornel Benko
45b61c6ecf 1.) Corrected internal compilation for Libintl
2.) Changed cmake-files accordingly
Patch from Jean-Marc Lasgouttes


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38606 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-06 19:24:54 +00:00
Peter Kümmel
97a5c0882d Messages::init(); needs Package. this fixes a crash on windows which presents parsing of the argument
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38139 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-29 22:18:21 +00:00
Peter Kümmel
b391929ece undo
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38136 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-29 21:38:52 +00:00
Peter Kümmel
774d215750 don't just crash when it couldn't find chkconfig.ltx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38134 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-29 20:53:53 +00:00
Pavel Sanda
f8d1586364 Glitch with new line breaking from Qt.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37847 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-04 18:30:40 +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
0de73b8866 Don't try to convert any of the preference files except the user's own.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37243 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-17 15:54:51 +00:00
Richard Heck
eb353f1b58 Previous two commits did the wrong thing. This is right.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37242 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-17 15:07:54 +00:00
Richard Heck
9c00df4112 Thanks, Vincent.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37240 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-17 14:59:59 +00:00
Pavel Sanda
3998065582 Follow Vincent's advice
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36855 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-13 00:51:30 +00:00
Pavel Sanda
723160f7c0 String correction
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg164054.html


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36725 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-04 22:43:37 +00:00
Enrico Forestieri
22ffc93467 The "single instance" patch.
By default, if the lyxpipe is set up and working, loading of documents
is deferred to an already running instance. Note that an already running
instance is only used for loading, such that export from command line
still works as usual.

The default behavior can be changed through a preference setting, and,
whatever the default is, it can be overridden by command line options.
Unticking the "Single instance" check box in the preferences, LyX behaves
exactly as before the introduction of this feature.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36278 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-13 11:55:05 +00:00
Vincent van Ravesteijn
afa873dc5f Remove the FileName parameter of Buffer::loadLyXFile and friends. Now, getAutosaveFileNameFor and getEmergencyFileNamefor can be removed too. Last, the call to lyxvc.file_found_hook can now be centralized and can be given the correct parameter (d->filename instead of the name of the emergency/autosave file).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36145 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-05 21:21:01 +00:00
Vincent van Ravesteijn
75773f3c22 Use Buffer::ReadStatus as a return value for Buffer::loadLyXFile.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35818 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-25 10:18:42 +00:00
Richard Heck
2291614a6c Introduce a typedef for vector<Buffer *>. No change in behavior
anticipated.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35529 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-29 11:55:10 +00:00
Stephan Witt
dec437fbac add cache of spell checker results to speed up native speller engine on macosx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35362 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-14 05:24:04 +00:00
Abdelrazak Younes
c3b1ff6229 revert r35282
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35290 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-06 06:38:48 +00:00
Abdelrazak Younes
857bc69012 whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35289 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-06 06:37:40 +00:00
Abdelrazak Younes
22df620984 LyX::exec(): add an alert if sysdir not found.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35282 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-05 09:08:49 +00:00
Peter Kümmel
ffec54c980 msvc stops on unused variables.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35254 a592a061-630c-0410-9148-cb99ea01b6c8
2010-09-01 14:18:32 +00:00
Stephan Witt
31dbbc43d9 #6848 correct load order of files to open on startup - author of patch: Punyashloka Biswal
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35182 a592a061-630c-0410-9148-cb99ea01b6c8
2010-08-21 16:49:30 +00:00
Jean-Marc Lasgouttes
8a9d765739 Bug #6842, part II
Make sure that Package can be initialized several time.s
Make sure that Package is not used before being initialized.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35080 a592a061-630c-0410-9148-cb99ea01b6c8
2010-08-07 11:42:27 +00:00
Jean-Marc Lasgouttes
547773f0d0 set locale correctly before parsing command line (bug #6842)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35078 a592a061-630c-0410-9148-cb99ea01b6c8
2010-08-07 11:18:04 +00:00
Enrico Forestieri
161af56f4e By default, overwrite the main file on export, but allow changing default
behavior through the environment variable LYX_FORCE_OVERWRITE.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34946 a592a061-630c-0410-9148-cb99ea01b6c8
2010-07-17 17:55:46 +00:00
Stephan Witt
7b34b13b71 avoid LYX_PLATFORM_DARWIN10 macro
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34861 a592a061-630c-0410-9148-cb99ea01b6c8
2010-07-11 21:30:47 +00:00
Stephan Witt
f4aedbe672 correct ifdef+defined construct
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34813 a592a061-630c-0410-9148-cb99ea01b6c8
2010-07-08 10:39:24 +00:00