Blame SOURCES/hplip-hpsetup-noscanjets.patch

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

\'hp-setup\' is a tool '

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

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