[PrintPreview] bug when cancelling printer selection dialog
```
Traceback (most recent call last):
  File "/users/knobel/git/silx/build/lib.linux-x86_64-2.7/silx/gui/plot/PrintPreviewToolButton.py", line 181, in _plotToPrintPreview
    svgRenderer, viewBox = self._getSvgRendererAndViewbox()
  File "/users/knobel/git/silx/build/lib.linux-x86_64-2.7/silx/gui/plot/PrintPreviewToolButton.py", line 211, in _getSvgRendererAndViewbox
    viewbox = self._getViewBox()
  File "/users/knobel/git/silx/build/lib.linux-x86_64-2.7/silx/gui/plot/PrintPreviewToolButton.py", line 231, in _getViewBox
    dpix = printer.logicalDpiX()
AttributeError: 'NoneType' object has no attribute 'logicalDpiX'
```

To reproduce this, run `python bootstrap.py examples/printPreview.py`, click on the action then `print`. Click `Cancel` in the dialog asking you to select a printer. 

diff --git a/silx/gui/plot/PrintPreviewToolButton.py b/silx/gui/plot/PrintPreviewToolButton.py
index c5479b858..b48505df9 100644
--- a/silx/gui/plot/PrintPreviewToolButton.py
+++ b/silx/gui/plot/PrintPreviewToolButton.py
@@ -1,7 +1,7 @@
 # coding: utf-8
 # /*##########################################################################
 #
-# Copyright (c) 2017 European Synchrotron Radiation Facility
+# Copyright (c) 2017-2018 European Synchrotron Radiation Facility
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -175,7 +175,8 @@ class PrintPreviewToolButton(qt.QToolButton):
     def _plotToPrintPreview(self):
         """Grab the plot widget and send it to the print preview dialog.
         Make sure the print preview dialog is shown and raised."""
-        self.printPreviewDialog.ensurePrinterIsSet()
+        if not self.printPreviewDialog.ensurePrinterIsSet():
+            return
 
         if qt.HAS_SVG:
             svgRenderer, viewBox = self._getSvgRendererAndViewbox()
diff --git a/silx/gui/widgets/PrintPreview.py b/silx/gui/widgets/PrintPreview.py
index 78d1bd72c..94a8ed4d4 100644
--- a/silx/gui/widgets/PrintPreview.py
+++ b/silx/gui/widgets/PrintPreview.py
@@ -411,6 +411,9 @@ class PrintPreviewDialog(qt.QDialog):
         """If the printer is not already set, try to interactively
         setup the printer using a QPrintDialog.
         In case of failure, hide widget and log a warning.
+
+        :return: True if printer was set. False if it failed or if the
+            selection dialog was canceled.
         """
         if self.printer is None:
             self.setup()
@@ -418,6 +421,7 @@ class PrintPreviewDialog(qt.QDialog):
             self.hide()
             _logger.warning("Printer setup failed or was cancelled, " +
                             "but printer is required.")
+        return self.printer is not None
 
     def setOutputFileName(self, name):
         """Set output filename.
['silx/gui/widgets/PrintPreview.py', 'silx/gui/plot/PrintPreviewToolButton.py']