Blame SOURCES/hplip-hpsetup-noscanjets.patch

b1d80f
diff --git a/setup.py b/setup.py
b1d80f
index 5d48aaa..88e663f 100755
b1d80f
--- a/setup.py
b1d80f
+++ b/setup.py
b1d80f
@@ -399,9 +399,19 @@ else: # INTERACTIVE_MODE
b1d80f
             #log.warning("Cannot setup fax - device does not have fax feature.")
b1d80f
             setup_fax = False
b1d80f
 
b1d80f
+        norm_model = models.normalizeModelName(model).lower()
b1d80f
+
b1d80f
+        # get out if the found model is standalone scanner, hp-setup is printer/fax setup tool
b1d80f
+        if 'scanjet' in norm_model:
b1d80f
+            log.error('The device {} is a standalone scanner. '
b1d80f
+                      'hp-setup is a printer/MFD setup tool, '
b1d80f
+                      'not scanner installation tool. '.format(model))
b1d80f
+            log.info(log.bold('Scanners do not need a installation, but they may '
b1d80f
+                              'require a binary plugin (install by \'hp-plugin -i\').'))
b1d80f
+            clean_exit(1)
b1d80f
+
b1d80f
         # ******************************* PLUGIN
b1d80f
 
b1d80f
-        norm_model = models.normalizeModelName(model).lower()
b1d80f
         plugin = mq.get('plugin', PLUGIN_NONE)
b1d80f
 
b1d80f
         if ignore_plugin_check is False and plugin > PLUGIN_NONE:
b1d80f
diff --git a/ui5/setupdialog.py b/ui5/setupdialog.py
b1d80f
index c6f234b..a5041c1 100644
b1d80f
--- a/ui5/setupdialog.py
b1d80f
+++ b/ui5/setupdialog.py
b1d80f
@@ -1326,6 +1326,18 @@ class SetupDialog(QDialog, Ui_Dialog):
b1d80f
             self.mq = device.queryModelByURI(self.device_uri)
b1d80f
             back_end, is_hp, bus, model, serial, dev_file, host, zc, port = device.parseDeviceURI(self.device_uri)
b1d80f
             self.model = models.normalizeModelName(model).lower()
b1d80f
+            if 'scanjet' in self.model:
b1d80f
+                FailureUI(self,
b1d80f
+                          self.__tr('The device {} is a standalone '
b1d80f
+                                    'scanner. 

\'hp-setup\' is a tool '

b1d80f
+                                    'for installing printers and multifunction '
b1d80f
+                                    'devices. Scanners supported by HPLIP '
b1d80f
+                                    'work out-of-the-box after HPLIP installation, '
b1d80f
+                                    'or they may require a binary plugin, which you '
b1d80f
+                                    'can install by \'hp-plugin -i\'.

'.format(model)))
b1d80f
+                self.displayPage(PAGE_DEVICES)
b1d80f
+                return
b1d80f
+
b1d80f
             self.showAddPrinterPage()
b1d80f
 
b1d80f
         elif p == PAGE_ADD_PRINTER: