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
23 from base.codes import *
26 from setupsettings_base import SetupSettings_base
28 class SetupSettings(SetupSettings_base):
29 def __init__(self, bus, filter, search, ttl, timeout, parent=None, name=None, modal=0, fl = 0):
30 SetupSettings_base.__init__(self, parent, name, modal, fl)
35 self.timeout = timeout
37 log.debug("filter is %s" % filter)
38 if prop.fax_build and prop.scan_build:
40 self.filterButtonGroup.setButton(0)
42 self.filterButtonGroup.setButton(1)
43 self.faxCheckBox.setChecked('fax' in filter)
44 self.scanCheckBox.setChecked('scan' in filter)
45 self.pcardCheckBox.setChecked('pcard' in filter)
46 self.copyCheckBox.setChecked('copy' in filter)
48 self.filterButtonGroup.setEnabled(False)
50 self.searchTermLineEdit.setText(self.search)
52 self.ttlSpinBox.setValue(self.ttl)
53 self.timeoutSpinBox.setValue(self.timeout)
55 if not prop.net_build:
56 self.ttlSpinBox.setEnabled(False)
57 self.timeoutSpinBox.setEnabled(False)
58 self.groupBox3.setEnabled(False)
59 self.textLabel7.setEnabled(False)
60 self.textLabel8.setEnabled(False)
62 def faxCheckBox_toggled(self,a0):
65 def scanCheckBox_toggled(self,a0):
68 def pcardCheckBox_toggled(self,a0):
71 def copyCheckBox_toggled(self,a0):
74 def filterButtonGroup_clicked(self, a0):
77 def searchTermLineEdit_textChanged(self, a0):
78 self.search = unicode(a0)
80 def ttlSpinBox_valueChanged(self, a0):
84 def timeoutSpinBox_valueChanged(self, a0):
86 log.debug(self.timeout)
88 def updateFilter(self, id=-1):
95 if self.faxCheckBox.isChecked():
96 self.filter.append('fax')
98 if self.scanCheckBox.isChecked():
99 self.filter.append('scan')
101 if self.pcardCheckBox.isChecked():
102 self.filter.append('pcard')
104 if self.copyCheckBox.isChecked():
105 self.filter.append('copy')
108 # filter.append('none')
110 log.debug(self.filter)
113 def defaultsPushButton_clicked(self):
114 self.filterButtonGroup.setButton(0)
116 self.searchTermLineEdit.setText('')
117 self.ttlSpinBox.setValue(4)
118 self.timeoutSpinBox.setValue(5)
120 def __tr(self,s,c = None):
121 return qApp.translate("SetupSettings_base",s,c)