if self.cur_device is not None and self.cur_device.supported and self.cur_device.device_state != DEVICE_STATE_NOT_FOUND:
if self.cur_device.device_settings_ui is not None:
self.addItem('device_settings', self._ScrollToolView__tr('<b>Device Settings</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_settings.png')), self._ScrollToolView__tr('Your device has special device settings. You may alter these settings here.'), self._ScrollToolView__tr('Device Settings...'), self.deviceSettingsButton_clicked)
if self.cur_device.fax_type:
self.addItem('fax_settings', self._ScrollToolView__tr('<b>Fax Setup</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_fax.png')), self._ScrollToolView__tr('Fax support must be setup before you can send faxes.'), self._ScrollToolView__tr('Setup Fax...'), self.faxSettingsButton_clicked)
self.addItem('fax_address_book', self._ScrollToolView__tr('<b>Fax Address Book</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_fax.png')), self._ScrollToolView__tr('Setup fax phone numbers to use when sending faxes from the PC.'), self._ScrollToolView__tr('Fax Address Book...'), self.faxAddressBookButton_clicked)
self.addItem('testpage', self._ScrollToolView__tr('<b>Print Test Page</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_testpage.png')), self._ScrollToolView__tr('Print a test page to test the setup of your printer.'), self._ScrollToolView__tr('Print Test Page >>'), self.PrintTestPageButton_clicked)
self.addItem('printer_info', self._ScrollToolView__tr('<b>View Printer (Queue) Information</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_cups.png')), self._ScrollToolView__tr('View the printers (queues) installed in CUPS.'), self._ScrollToolView__tr('View Printer Information >>'), self.viewPrinterInformation)
self.addItem('device_info', self._ScrollToolView__tr('<b>View Device Information</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_info.png')), self._ScrollToolView__tr('This information is primarily useful for debugging and troubleshooting (advanced).'), self._ScrollToolView__tr('View Device Information >>'), self.viewInformation)
if self.cur_device.pq_diag_type:
self.addItem('pqdiag', self._ScrollToolView__tr('<b>Print Quality Diagnostics</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_pq_diag.png')), self._ScrollToolView__tr('Your printer can print a test page to help diagnose print quality problems.'), self._ScrollToolView__tr('Print Diagnostic Page...'), self.pqDiag)
if self.cur_device.fw_download:
self.addItem('fwdownload', self._ScrollToolView__tr('<b>Download Firmware</b>'), QPixmap(os.path.join(prop.image_dir, 'download.png')), self._ScrollToolView__tr('Download firmware to your printer (required on some devices after each power-up).'), self._ScrollToolView__tr('Download Firmware...'), self.downloadFirmware)
if self.cur_device.clean_type:
self.addItem('clean', self._ScrollToolView__tr('<b>Clean Cartridges</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_clean.png')), self._ScrollToolView__tr('You only need to perform this action if you are having problems with poor printout quality due to clogged ink nozzles.'), self._ScrollToolView__tr('Clean Cartridges...'), self.CleanPensButton_clicked)
if self.cur_device.align_type:
self.addItem('align', self._ScrollToolView__tr('<b>Align Cartridges</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_align.png')), self._ScrollToolView__tr('This will improve the quality of output when a new cartridge is installed.'), self._ScrollToolView__tr('Align Cartridges...'), self.AlignPensButton_clicked)
if self.cur_device.color_cal_type:
self.addItem('colorcal', self._ScrollToolView__tr('<b>Perform Color Calibration</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_colorcal.png')), self._ScrollToolView__tr("Use this procedure to optimimize your printer's color output."), self._ScrollToolView__tr('Color Calibration...'), self.ColorCalibrationButton_clicked)
if self.cur_device.linefeed_cal_type:
self.addItem('linefeed', self._ScrollToolView__tr('<b>Perform Line Feed Calibration</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_linefeed_cal.png')), self._ScrollToolView__tr('Use line feed calibration to optimize print quality (to remove gaps in the printed output).'), self._ScrollToolView__tr('Line Feed Calibration...'), self.linefeedCalibration)
if self.cur_device.embedded_server_type and self.cur_device.bus == 'net':
self.addItem('ews', self._ScrollToolView__tr('<b>Access Embedded Web Page</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_ews.png')), self._ScrollToolView__tr("You can use your printer's embedded web server to configure, maintain, and monitor the device from a web browser."), self._ScrollToolView__tr('Open in Browser...'), self.OpenEmbeddedBrowserButton_clicked)
self.addItem('support', self._ScrollToolView__tr('<b>View Documentation</b>'), QPixmap(os.path.join(prop.image_dir, 'icon_support2.png')), self._ScrollToolView__tr('View documentation installed on your system.'), self._ScrollToolView__tr('View Documentation...'), self.viewSupport)
self.form.WarningUI(self._ScrollToolView__tr('<p><b>Both cartridges are required for alignment.</b><p>Please install both cartridges and try again.'))
def InvalidPenUI(self):
self.form.WarningUI(self._ScrollToolView__tr('<p><b>One or more cartiridges are missing from the printer.</b><p>Please install cartridge(s) and try again.'))
def PhotoPenRequiredUI(self):
self.form.WarningUI(self._ScrollToolView__tr('<p><b>Both the photo and color cartridges must be inserted into the printer to perform color calibration.</b><p>If you are planning on printing with the photo cartridge, please insert it and try again.'))
def PhotoPenRequiredUI2(self):
self.form.WarningUI(self._ScrollToolView__tr('<p><b>Both the photo (regular photo or photo blue) and color cartridges must be inserted into the printer to perform color calibration.</b><p>If you are planning on printing with the photo or photo blue cartridge, please insert it and try again.'))
def NotPhotoOnlyRequired(self):
self.form.WarningUI(self._ScrollToolView__tr('<p><b>Cannot align with only the photo cartridge installed.</b><p>Please install other cartridges and try again.'))
self.form.FailureUI(self._ScrollToolView__tr('<p><b>Unable to run command. No command specified.</b><p>Use <pre>Configure...</pre> to specify a command to run.'))
log.error('No command specified. Use settings to configure commands.')
QMessageBox.information(self, self.caption(), self._ScrollTestpageView__tr('<p><b>A test page should be printing on your printer.</b><p>If the page fails to print, please visit http://hplip.sourceforge.net for troubleshooting and support.'), QMessageBox.Ok, QMessageBox.NoButton, QMessageBox.NoButton)
if self.toolbox_hosted:
self.form.SwitchMaintTab('tools')
else:
self.form.close()
def __tr(self, s, c = None):
return qApp.translate('ScrollTestpageView', s, c)
class ScrollPrinterInfoView(ScrollView):
def __init__(self, toolbox_hosted = True, parent = None, form = None, name = None, fl = 0):
ScrollView.__init__(self, parent, name, fl)
self.form = form
self.toolbox_hosted = toolbox_hosted
def fillControls(self):
ScrollView.fillControls(self)
printers = []
for p in self.printers:
if p.device_uri == self.cur_device.device_uri or p.device_uri.replace('hpfax:', 'hp:') == self.cur_device.device_uri:
printers.append(p)
continue
if not printers:
self.addGroupHeading('error_title', self._ScrollPrinterInfoView__tr('No printers found for this device.'))