File: view.py

package info (click to toggle)
griffith 0.9.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,912 kB
  • ctags: 5,224
  • sloc: python: 27,496; xml: 543; ansic: 325; makefile: 252
file content (50 lines) | stat: -rw-r--r-- 1,966 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: UTF-8 -*-

__revision__ = '$Id: view.py 908 2008-01-27 23:03:39Z piotrek $'

# Copyright (c) 2005-2008 Vasco Nunes, Piotr Ożarowski
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA

# You may use and distribute this software under the terms of the
# GNU General Public License, version 2 or later

from gettext import gettext as _

def filter_not_seen(self):
	self.populate_treeview()
	self.update_statusbar(_("Filter activated. Showing only not seen movies."))

def filter_loaned(self):
	self.populate_treeview()
	self.update_statusbar(_("Filter activated. Showing only loaned movies."))

def filter_all(self):
	self.populate_treeview()

def filter_by_volume(self, volume_id):
	from quick_filter import clear_filter
	clear_filter(self)
	self.populate_treeview(where={'volume_id':volume_id})
	volume_name = self.db.Volume.get_by(volume_id=volume_id).name
	self.update_statusbar(_("Filter activated. Showing only movies from volume: %s")%volume_name)

def filter_by_collection(self, collection_id):
	from quick_filter import clear_filter
	clear_filter(self)
	self.populate_treeview(where={'collection_id':collection_id})
	collection_name = self.db.Collection.get_by(collection_id=collection_id).name
	self.update_statusbar(_("Filter activated. Showing only movies from collection: %s")%collection_name)