hplip/hplip-hpsetup-noscanjets.patch

49 lines
2.3 KiB
Diff

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