1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Filename: preferenceFilter.py
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class preferenceFilter(QWidget):
def __init__(self, parent = None, *args):
QWidget.__init__(self, parent)
mainLayout = QVBoxLayout(None)
mainLayout.setContentsMargins(5, 10, 20, 200)
self.filterCheckBox = QCheckBox(_('Enable filter function'), self)
self.filterCheckBox.setChecked(True)
self.filterCap = QCheckBox(_('Case insensitive'), self)
self.comment = QLabel(_('(Filter keywords are separated by \"|\"; supporting regular expression)'), self)
self.filterKeyWold = QLineEdit(self)
mainLayout.addWidget(self.filterCheckBox)
mainLayout.addWidget(self.filterCap)
mainLayout.addWidget(self.comment)
mainLayout.addWidget(self.filterKeyWold)
self.setLayout(mainLayout)
self.connect(self.filterCheckBox, SIGNAL("toggled(bool)"), self.filterChecked)
def filterChecked(self,checked):
if(checked):
self.comment.setEnabled(True)
self.filterKeyWold.setEnabled(True)
self.filterCap.setEnabled(True)
else:
self.comment.setEnabled(False)
self.filterKeyWold.setEnabled(False)
self.filterCap.setEnabled(False)
|