~ubuntu-branches/ubuntu/utopic/gramps/utopic

« back to all changes in this revision

Viewing changes to src/Filters/SideBar/_MediaSidebarFilter.py

  • Committer: Package Import Robot
  • Author(s): James A. Treacy
  • Date: 2012-05-22 17:18:36 UTC
  • mfrom: (39.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20120522171836-35fi62lp4w7jnrd7
Tags: 3.4.0-1
* New upstream version
* Updated desktop file. Closes: #667472

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
20
#
21
21
 
22
 
# $Id: _MediaSidebarFilter.py 16612 2011-02-12 19:52:27Z nick-h $
 
22
# $Id: _MediaSidebarFilter.py 17965 2011-07-25 22:47:57Z nick-h $
23
23
 
24
24
#-------------------------------------------------------------------------
25
25
#
40
40
# GRAMPS modules
41
41
#
42
42
#-------------------------------------------------------------------------
 
43
from gui import widgets
43
44
from Filters.SideBar import SidebarFilter
44
45
from Filters import GenericFilterFactory, build_filter_model, Rules
45
46
from Filters.Rules.MediaObject import (RegExpIdOf, HasIdOf, HasMedia, HasTag,
56
57
 
57
58
    def __init__(self, dbstate, uistate, clicked):
58
59
        self.clicked_func = clicked
59
 
        self.filter_id = gtk.Entry()
60
 
        self.filter_title = gtk.Entry()       
61
 
        self.filter_type = gtk.Entry()
62
 
        self.filter_path = gtk.Entry()
63
 
        self.filter_date = gtk.Entry()
64
 
 
65
 
        self.filter_note = gtk.Entry()
 
60
        self.filter_id = widgets.BasicEntry()
 
61
        self.filter_title = widgets.BasicEntry()
 
62
        self.filter_type = widgets.BasicEntry()
 
63
        self.filter_path = widgets.BasicEntry()
 
64
        self.filter_date = widgets.BasicEntry()
 
65
        self.filter_note = widgets.BasicEntry()
66
66
 
67
67
        self.filter_regex = gtk.CheckButton(_('Use regular expressions'))
68
68
 
93
93
        self.add_text_entry(_('Note'), self.filter_note)
94
94
        self.add_entry(_('Tag'), self.tag)
95
95
        self.add_filter_entry(_('Custom filter'), self.generic)
96
 
        self.add_entry(None, self.filter_regex)
 
96
        self.add_regex_entry(self.filter_regex)
97
97
 
98
98
    def clear(self, obj):
99
99
        self.filter_id.set_text('')
129
129
                    rule = HasIdOf([gid])
130
130
                generic_filter.add_rule(rule)
131
131
 
132
 
            rule = HasMedia([title, mime, path, date])
 
132
            rule = HasMedia([title, mime, path, date], use_regex=regex)
133
133
            generic_filter.add_rule(rule)
134
134
                
135
135
            if note: