From 92ff4cdf8c84e91584dd6076aa5b3c774ab0a622 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 5 Aug 2024 02:45:17 +0000 Subject: automatic import of hplip --- hplip-hpsetup-noscanjets.patch | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 hplip-hpsetup-noscanjets.patch (limited to 'hplip-hpsetup-noscanjets.patch') 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('The device {} is a standalone ' ++ 'scanner.

\'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\'.

'.format(model))) ++ self.displayPage(PAGE_DEVICES) ++ return ++ + self.showAddPrinterPage() + + elif p == PAGE_ADD_PRINTER: -- cgit v1.2.3