From d8bbd71f0d143d1a3ca0a0bbdee7864df8a10a40 2012-05-17 19:00:58 From: Ian Murray Date: 2012-05-17 19:00:58 Subject: [PATCH] Added a warning dialog box when attempting to convert a PNG to SVG (#735) --- diff --git a/IPython/frontend/qt/console/rich_ipython_widget.py b/IPython/frontend/qt/console/rich_ipython_widget.py index 18edd49..1aec78c 100644 --- a/IPython/frontend/qt/console/rich_ipython_widget.py +++ b/IPython/frontend/qt/console/rich_ipython_widget.py @@ -231,6 +231,10 @@ class RichIPythonWidget(IPythonWidget): try: svg = str(self._name_to_svg_map[match.group("name")]) except KeyError: + QtGui.QMessageBox.warning(self, 'Error converting PNG to SVG.', + 'Cannot convert a PNG to SVG. To fix this, add this to your ipython config:\n' + 'c.InlineBackendConfig.figure_format = \'svg\'', + QtGui.QMessageBox.Ok) return "Cannot convert a PNG to SVG. To fix this, add this to your config: c.InlineBackendConfig.figure_format = 'svg'" # Not currently checking path, because it's tricky to find a