2 # -*- coding: utf-8 -*-
4 # (c) Copyright 2003-2009 Hewlett-Packard Development Company, L.P.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 __title__ = 'Print Quality Diagnostic Utility'
26 __doc__ = "Print quality diagnostic utility for HPLIP supported inkjet printers. (Note: Most printers do not require the use of this utility)."
38 from base import device, utils, maint, tui, module
43 mod = module.Module(__mod__, __title__, __version__, __doc__, None,
44 (GUI_MODE,), (UI_TOOLKIT_QT4,))
46 mod.setUsage(module.USAGE_FLAG_DEVICE_ARGS,
47 see_also_list=['hp-align', 'hp-clean', 'hp-colorcal',
50 opts, device_uri, printer_name, mode, ui_toolkit, lang = \
53 device_uri = mod.getDeviceUri(device_uri, printer_name)
55 if not utils.canEnterGUIMode4():
56 log.error("%s -u/--gui requires Qt4 GUI support. Exiting." % __mod__)
60 from PyQt4.QtGui import QApplication
61 from ui4.pqdiagdialog import PQDiagDialog
63 log.error("Unable to load Qt4 support. Is it installed?")
66 app = QApplication(sys.argv)
68 dlg = PQDiagDialog(None, device_uri) # TODO: add device_uri
71 log.debug("Starting GUI loop...")
73 except KeyboardInterrupt:
78 except KeyboardInterrupt:
79 log.error("User exit")