Disable preview converters that need dv2dt if dv2dt is not available.

This gives a better error message on the console (although it is still
impossible to figure out what went wrong from the GUI).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37407 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2011-02-01 20:03:01 +00:00
parent 50eeed7811
commit cfc81ea3d7
2 changed files with 17 additions and 6 deletions

View File

@ -219,7 +219,7 @@ least version 2.14 for proper work.
4.) INSTANT PREVIEW:
Make sure that dv2dt (often part of LaTeX distributions) is installed
on your system.
on your system. Instant preview wil be disabled if dv2dt is not found.
Known issues in version 2.0.0

View File

@ -726,10 +726,17 @@ def checkConverterEntries():
rc_entry = [ r'\converter dvi pdf3 "%%" ""' ])
#
path, dvipng = checkProg('dvipng', ['dvipng'])
if dvipng == "dvipng":
path, dv2dt = checkProg('DVI to DTL converter', ['dv2dt'])
if dvipng == "dvipng" and dv2dt == 'dv2dt':
addToRC(r'\converter lyxpreview png "python -tt $$s/scripts/lyxpreview2bitmap.py" ""')
else:
# set empty converter to override the default imagemagick
addToRC(r'\converter lyxpreview png "" ""')
if dv2dt == 'dv2dt':
addToRC(r'\converter lyxpreview ppm "python -tt $$s/scripts/lyxpreview2bitmap.py" ""')
else:
# set empty converter to override the default imagemagick
addToRC(r'\converter lyxpreview ppm "" ""')
#
checkProg('a fax program', ['kdeprintfax $$i', 'ksendfax $$i', 'hylapex $$i'],
rc_entry = [ r'\converter ps fax "%%" ""'])
@ -833,10 +840,15 @@ def checkConverterEntries():
version_number = match.groups()[0]
version = version_number.split('.')
if int(version[0]) > 2 or (len(version) > 1 and int(version[0]) == 2 and int(version[1]) >= 13):
addToRC(r'\converter lyxpreview-lytex ppm "python -tt $$s/scripts/lyxpreview-lytex2bitmap.py" ""')
if dvipng == "dvipng":
if dv2dt == 'dv2dt':
addToRC(r'\converter lyxpreview-lytex ppm "python -tt $$s/scripts/lyxpreview-lytex2bitmap.py" ""')
else:
# set empty converter to override the default imagemagick
addToRC(r'\converter lyxpreview-lytex ppm "" ""')
if dvipng == "dvipng" and dv2dt == 'dv2dt':
addToRC(r'\converter lyxpreview-lytex png "python -tt $$s/scripts/lyxpreview-lytex2bitmap.py" ""')
else:
# set empty converter to override the default imagemagick
addToRC(r'\converter lyxpreview-lytex png "" ""')
# Note: The --lily-output-dir flag is required because lilypond-book
# does not process input again unless the input has changed,
@ -860,8 +872,7 @@ def checkConverterEntries():
# checkProg('Image converter', ['convert $$i $$o'])
#
# Entries that do not need checkProg
addToRC(r'''\converter lyxpreview ppm "python -tt $$s/scripts/lyxpreview2bitmap.py" ""
\converter lyxpreview-platex ppm "python -tt $$s/scripts/lyxpreview-platex2bitmap.py" ""
addToRC(r'''\converter lyxpreview-platex ppm "python -tt $$s/scripts/lyxpreview-platex2bitmap.py" ""
\converter csv lyx "python -tt $$s/scripts/csv2lyx.py $$i $$o" ""
\converter date dateout "python -tt $$s/scripts/date.py %d-%m-%Y > $$o" ""
\converter docbook docbook-xml "cp $$i $$o" "xml"