diff options
Diffstat (limited to 'hplip-hpsetup-noscanjets.patch')
-rw-r--r-- | hplip-hpsetup-noscanjets.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/hplip-hpsetup-noscanjets.patch b/hplip-hpsetup-noscanjets.patch new file mode 100644 index 0000000..5c956a0 --- /dev/null +++ b/hplip-hpsetup-noscanjets.patch @@ -0,0 +1,48 @@ +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: |