move LaTeX no-PIL-software warning into method which needs it
This commit is contained in:
@ -215,6 +215,7 @@ register('interface.filter-editor-height', 350)
|
|||||||
register('interface.fullscreen', False)
|
register('interface.fullscreen', False)
|
||||||
register('interface.grampletbar-close', False)
|
register('interface.grampletbar-close', False)
|
||||||
register('interface.ignore-gexiv2', False)
|
register('interface.ignore-gexiv2', False)
|
||||||
|
register('interface.ignore-pil', False)
|
||||||
register('interface.ignore-osmgpsmap', False)
|
register('interface.ignore-osmgpsmap', False)
|
||||||
register('interface.lds-height', 450)
|
register('interface.lds-height', 450)
|
||||||
register('interface.lds-width', 600)
|
register('interface.lds-width', 600)
|
||||||
|
@ -57,14 +57,7 @@ from gramps.gen.plug.docbackend import DocBackend
|
|||||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
|
|
||||||
|
|
||||||
_LOG = logging.getLogger(".latexdoc")
|
_LOG = logging.getLogger(".latexdoc")
|
||||||
if not HAVE_PIL:
|
|
||||||
_LOG.warning(_("PIL (Python Imaging Library) not loaded. "
|
|
||||||
"Production of jpg images from non-jpg images "
|
|
||||||
"in LaTeX documents will not be available. "
|
|
||||||
"Use your package manager to install python-imaging "
|
|
||||||
"or python-pillow or python3-pillow"))
|
|
||||||
|
|
||||||
_CLICKABLE = '\\url{\\1}'
|
_CLICKABLE = '\\url{\\1}'
|
||||||
|
|
||||||
@ -1239,9 +1232,21 @@ class LaTeXDoc(BaseDoc, TextDoc):
|
|||||||
'\n *** to ', outfile,
|
'\n *** to ', outfile,
|
||||||
'%\n')))
|
'%\n')))
|
||||||
elif not HAVE_PIL:
|
elif not HAVE_PIL:
|
||||||
|
from gramps.gen.config import config
|
||||||
|
if not config.get('interface.ignore-pil'):
|
||||||
|
from gramps.gen.constfunc import has_display
|
||||||
|
if has_display():
|
||||||
|
from gramps.gui.dialog import MessageHideDialog
|
||||||
|
title = _("PIL (Python Imaging Library) not loaded.")
|
||||||
|
message = _("Production of jpg images from non-jpg images "
|
||||||
|
"in LaTeX documents will not be available. "
|
||||||
|
"Use your package manager to install "
|
||||||
|
"python-imaging or python-pillow or "
|
||||||
|
"python3-pillow")
|
||||||
|
MessageHideDialog(title, message, 'interface.ignore-pil')
|
||||||
self.emit(''.join(('%\n *** Error: cannot convert ', infile,
|
self.emit(''.join(('%\n *** Error: cannot convert ', infile,
|
||||||
'\n *** to ', outfile,
|
'\n *** to ', outfile,
|
||||||
'PIL not installed %\n')))
|
'\n *** PIL not installed %\n')))
|
||||||
|
|
||||||
if self.in_table:
|
if self.in_table:
|
||||||
self.pict_in_table = True
|
self.pict_in_table = True
|
||||||
|
Reference in New Issue
Block a user