Commit Graph

238 Commits

Author SHA1 Message Date
Enrico Forestieri
5665209caa Ensure that QT_VERSION is defined
Otherwise checks such as "#if QT_VERSION >= 0x050600" will fail silently.
2017-02-07 11:16:05 +01:00
Enrico Forestieri
ebd96fadd5 Ignore QT_SCALE_FACTOR for Qt < 5.6
This environment variable was introduced in Qt 5.6.0
2017-01-25 20:00:54 +01:00
Enrico Forestieri
9e6cf6e05a Allow to properly scale the GUI with Qt5
Starting with Qt 5.6, setting the environment variable QT_SCALE_FACTOR
makes everything accordingly bigger. So, if QT_SCALE_FACTOR=1.2, all
text and GUI elements are rendered 20% bigger. However, if an application
does not account for this, everything will also look "blocky".
With this commit, all text and images will be scaled remaining sharp.
This works whether a HiDpi screen is used or not, but is mostly useful
with a HiDpi screen, as all GUI elements are more spaced apart and one
can use the mouse for selecting things without requiring a high precision.
2017-01-22 01:06:00 +01:00
Juergen Spitzmueller
74f774d6cf Merge branch 'master' into biblatex2 2017-01-11 10:45:48 +01:00
Juergen Spitzmueller
96ffb70cd5 Command line option to ignore error msgs
Needed by the test framework
2017-01-11 09:21:13 +01:00
Juergen Spitzmueller
97aea7e5b1 Disentangle CiteEngines and Modules
These two are different beasts and thus should be handled differently.
2017-01-01 07:56:24 +01:00
Guillaume Munch
9a9288d67d Fix memory leak with WordLists
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg198230.html
2016-12-31 15:29:43 +01:00
Scott Kostyshak
892593fbdc Change default working directory from ~/ to "."
Note that the lyxrc.document_path variable corresponds to what we
call the "Working directory" in the GUI preferences dialog.

Setting document_path to "." makes it so when LyX is started from a
directory, that directory is the default path for many of LyX's
operations, such as the following:

- new file, new from template
- adding a custom BibTeX file
- GUI compare dialog
- local layout button in document settings
- external material file browser
- graphics browser, include browser

The best guess for where the user wants to save or find files is the
directory the user started LyX from. Before, the default was always
the home directory. If desired, the old behavior can be restored by
changing the default path in Preferences > "Working directory".

This commit takes advantage of 9b64d7bd, which allows the use of a
relative path for path preferences.
2016-10-11 22:25:42 -04: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
Guillaume Munch
489dca71cd Simplifications, mainly removal of boost::function and useless std::bind 2016-07-03 01:39:32 +02:00
Richard Heck
a48adfa6d6 Fix coverity issue #127197.
We may fail to get a buffer when we request one.
2016-06-12 00:26:38 -04:00
Guillaume Munch
ca8709aaf5 Replace boost::scoped_ptr with unique_ptr 2016-06-09 15:21:39 +01:00
Richard Heck
a8f57334e2 Fix bug #9096: Load all the files specified on the command line, and then dispatch whatever commands we are given to those Buffers.
Original patch due to Benjamin Piwowarski. Updated for 2.2 by Richard Heck.
2015-11-29 11:25:21 -05:00
Guillaume Munch
a8c1161d7b Move tmpdir error message to stderr
http://thread.gmane.org/gmane.editors.lyx.general/85638/focus=157802
2015-11-10 08:04:19 +00:00
Stephan Witt
bdc9977264 Improved symlink creation for Mac OS for first LyX start 2015-07-22 06:27:21 +02:00
Jean-Marc Lasgouttes
7ac700920f Auto feature for minibuffer toolbar
Now the minibuffer toolbar is "auto" by default. It is opened by
command-execute (M-x) and closed when the command is executed without error.

* make lyx::dispatch return a DispatchResult struct

* there is a new MINIBUFFER type of toolbar, that can be used for this use.

* remove special handling of M-x in minnibuffer; Escape can be used instead. Fix focus in this case.

* when minibuffer toolbar is "auto", make the toolbar close itself after
  - a command has been executed without error
  - an empty command has been executed
  - the Escape key has been used

[this is actually commit fdcff02a, which was later reverted at dd61d8cf]
2015-07-15 17:41:09 +02:00
Jean-Marc Lasgouttes
dd61d8cf3f Revert "Auto feature for minibuffer toolbar"
This reverts commit fdcff02a31.

This was pushed too early, we are not ready yet.
2015-06-30 11:09:48 +02:00
Jean-Marc Lasgouttes
fdcff02a31 Auto feature for minibuffer toolbar
Now the minibuffer toolbar is "auto" by default. It is opened by
command-execute (M-x) and closed when the command is executed without error.

* make lyx::dispatch return a DispatchResult struct

* there is a new MINIBUFFER type of toolbar, that can be used for this use.

* remove special handling of M-x in minnibuffer; Escape can be used instead. Fix focus in this case.

* when minibuffer toolbar is "auto", make the toolbar close itself after
  - a command has been executed without error
  - an empty command has been executed
  - the Escape key has been used
2015-06-29 09:21:15 +02:00
Stephan Witt
e4fada8c57 #7896: LyX templates folder is empty - create a symlink to system templates in user template directory at run time 2015-06-23 08:41:43 +02:00
Jessica Hamilton
dcfb918f15 Add packaging support for Haiku
See bug #7568 for details.
2015-06-08 17:18:14 +02:00
Georg Baum
84cca2dd94 Fix indentation 2015-05-17 17:27:27 +02:00
Jean-Marc Lasgouttes
e4fe294bdc Make builds reproducible
We do not really need to use __TIME__ and __DATE__, which prevent from making LyX builds reproducible.

Fixes bug #9415.
2015-03-26 18:14:45 +01:00
Jean-Marc Lasgouttes
a0fd54b2e7 Remove variable properly now
This is a follow-up to db1979f398.
2015-03-05 12:48:01 +01:00
Jean-Marc Lasgouttes
db1979f398 Remove unused member.
Fixes coverity issue 23413.
2015-03-05 12:30:12 +01:00
Richard Heck
fc9e6326b9 Micro-optimization. 2015-02-24 13:43:33 -05:00
Jean-Marc Lasgouttes
b627b8701b Some performance stuff reported by cppcheck 2015-02-24 18:38:20 +01:00
Georg Baum
7b48e2aac0 Start qt event loop for commandline usage
This is needed since src/support calls lots of qt code, and some parts of it
(e.g. QFileInfo) require a running event loop. This fixes bug #4917 which is
a symptom of the problem.
The fix is to create a QCoreApplication for tex2lyx, lyxclient and LyX running
without GUI. In the future this could be extended, i.e. to split up the
frontend Application class in a GUI and a console class, and having the
console class use LyXConsoleApp in the same way as Application now uses
GuiApplication. If that is done, one could also think of moving
support/ConsoleApplication to frontend/console/ConsoleApplication.
2015-01-11 14:06:17 +01: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
Jean-Marc Lasgouttes
8d6d21c6d9 Add new variables lyx_build_date/time
These are now in version.cpp. The build machinery should therefore make sure
that version.cpp is recompiled at every compilation.

These variables are now referred to by the other places that made use of __DATE__ and __TIME__.
2014-11-25 18:58:35 +01:00
Stephan Witt
941868e8d7 #9317 add method cleanDuplicateEnvVars() to correct the broken environment with duplicate PATH values passed by Yosemite's launchd(8) 2014-11-16 17:21:46 +01:00
Jean-Marc Lasgouttes
8ecb96c09a Add the git commit (if applicable) to LyX version
This only works for autotools right now, but adding that to cmake is trivial
2014-10-10 12:12:17 +02:00
Stephan Witt
ce57594afd Remove Qt4 artifacts in comments 2014-10-01 10:06:17 +02:00
Peter Kümmel
2f17858115 On Linux show in crash message box the backtrace 2014-06-14 11:25:25 +02:00
Jean-Marc Lasgouttes
f8da042312 Do not store Languages objects in completion words lists
In the current code each paragraph contains a map<Language,
WordList*>, which means that it contains a full copy of the language
object. Since these objects contain translation tables nowadays, this
is a very bad idea.

This patch simply replaces the Language key by a string.

When loading the Userguide on linux/x86_64, the total memory
consumption decreases from 36.27MB to 31.50MB.
2014-04-21 11:51:59 -04:00
Georg Baum
e3714947b0 Add comment (thanks Enrico) 2014-03-10 20:52:51 +01:00
Vincent van Ravesteijn
ce26efcbd4 Revert "Fix opening files from command line"
Reverted because of
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181795.html.

This reverts commit d1db30a188.
2014-03-10 20:05:48 +01:00
Vincent van Ravesteijn
d1db30a188 Fix opening files from command line
Fixes: 9c4461de
2013-12-10 19:19:17 +01:00
Georg Baum
08c5d34922 Make -userdir available to child processes
Otherwise tex2lyx would not find textclass.lst, and thus TeX import and
paste from LaTeX would not work.
2013-12-01 22:11:55 +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
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