1 # -*- coding: utf-8 -*-
3 # (c) Copyright 2001-2007 Hewlett-Packard Development Company, L.P.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 from setupmanualfind_base import SetupManualFind_base
27 class SetupManualFind(SetupManualFind_base):
28 def __init__(self, bus, parent=None, name=None, modal=0, fl = 0):
29 SetupManualFind_base.__init__(self, parent, name, modal, fl)
34 self.findHeadingText.setText(self.__tr("""Please enter the printer's network hostname or IP address."""))
35 self.hintTextLabel.setText(self.__tr("""<i>(IPv4 address "a.b.c.d" or "hostname".)</i>"""))
36 self.findTextLabel.setText(self.__tr("""Hostname or IP Address:"""))
38 elif self.bus == 'usb':
39 self.findHeadingText.setText(self.__tr("""Please enter the USB ID for the printer."""))
40 self.hintTextLabel.setText(self.__tr("""<i>("xxx:yyy" where xxx is the USB bus ID and yyy is the USB device ID. The ':' and all leading zeroes must be present. Use 'lsusb' to determine this information.)</i>"""))
41 self.findTextLabel.setText(self.__tr("""USB ID:"""))
42 self.findLineEdit.setInputMask("000:000;0")
44 elif self.bus == 'par':
45 self.findHeadingText.setText(self.__tr("""Please enter the filesystem device node for the printer."""))
46 self.hintTextLabel.setText(self.__tr(""" <i>("/dev/parportX", X=0,1,2,...)</i>"""))
47 self.findTextLabel.setText(self.__tr("""Device Node:"""))
49 def findLineEdit_textChanged(self,a0):
50 self.param = unicode(a0)
53 bus, dev = self.param.split(':')
54 self.param = ''.join(['0'*(3-len(bus)), bus, ':', '0'*(3-len(dev)), dev])
56 def __tr(self,s,c = None):
57 return qApp.translate("SetupManualFind_base",s,c)