~chipaca/unity-lens-video/recently-glanced-at-from-afar

« back to all changes in this revision

Viewing changes to src/video-lens.vala

  • Committer: David Callé
  • Date: 2012-02-02 19:43:07 UTC
  • Revision ID: davidc@framli.eu-20120202194307-rnvkhkvldcbdvj5t
Move to a decent branch name and lp project. Thanks a lot Marco\!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2011, Marco Trevisan (Treviño) <mail@3v1n0.net>
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify
5
 
 * it under the terms of the GNU General Public License version 3 as
6
 
 * published by the Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 */
17
 
 
18
 
using Unity;
19
 
 
20
 
public class VideoLens : Lens
21
 
{
22
 
  private const string ICON_PATH = "/usr/share/icons/unity-icon-theme/places/svg";
23
 
 
24
 
  public VideoLens()
25
 
  {
26
 
    base("/net/3v1n0/dev/unity/lens/video", "video");
27
 
 
28
 
    search_hint = _("Search Videos");
29
 
 
30
 
    visible = true;
31
 
    search_in_global = false;
32
 
 
33
 
    setup_categories();
34
 
    setup_filters();
35
 
  }
36
 
 
37
 
  private void setup_categories()
38
 
  {
39
 
    var cat = new List<Category>();
40
 
    var icon_dir = File.new_for_path(ICON_PATH);
41
 
    var icon_down = new FileIcon(icon_dir.get_child ("group-downloads.svg"));
42
 
 
43
 
    cat.append(new Category(_("Streamable videos"), icon_down));
44
 
    categories = cat;
45
 
 
46
 
    /*categories.append(new Category("Autos & Vehicles", icon_down));
47
 
    categories.append(new Category("Art", icon_down));
48
 
    categories.append(new Category("Comedy", icon_down));
49
 
    categories.append(new Category("Education", icon_down));
50
 
    categories.append(new Category("Shows", icon_down));
51
 
    categories.append(new Category("Film & Animation", icon_down));
52
 
    categories.append(new Category("Gaming", icon_down));
53
 
    categories.append(new Category("Howto & Style", icon_down));
54
 
    categories.append(new Category("Music", icon_down));
55
 
    categories.append(new Category("News & Politics", icon_down));
56
 
    categories.append(new Category("Non-profits & Activism", icon_down));
57
 
    categories.append(new Category("People & Blogs", icon_down));
58
 
    categories.append(new Category("Pets & Animals", icon_down));
59
 
    categories.append(new Category("Science & Technology", icon_down));
60
 
    categories.append(new Category("Sport", icon_down));
61
 
    categories.append(new Category("Travel & Events", icon_down));
62
 
    categories.append(new Category("Nature", icon_down));
63
 
    categories.append(new Category("Experimental", icon_down));*/
64
 
  }
65
 
 
66
 
  private void setup_filters()
67
 
  {
68
 
    var f = new List<Filter>();
69
 
 
70
 
    var time = new RadioOptionFilter("time", _("Uploaded time"));
71
 
    time.add_option ("today", _("Today"));
72
 
    time.add_option ("this-week", _("This Week"));
73
 
    time.add_option ("this-month", _("This Month"));
74
 
    f.append(time);
75
 
 
76
 
    var category = new CheckOptionFilter("category", _("Category"));
77
 
    category.add_option("art", _("Art"));
78
 
    category.add_option("comedy", _("Comedy"));
79
 
    category.add_option("education", _("Education"));
80
 
    category.add_option("shows", _("Entertainment"));
81
 
    category.add_option("film_animation", _("Film & Animation"));
82
 
    category.add_option("gaming", _("Gaming"));
83
 
    category.add_option("howto", _("Howto & Style"));
84
 
    category.add_option("music", _("Music"));
85
 
    category.add_option("news", _("News & Politics"));
86
 
    category.add_option("activism", _("Non-profits & Activism"));
87
 
    category.add_option("people", _("People & Blogs"));
88
 
    category.add_option("pets", _("Pets & Animals"));
89
 
    category.add_option("science", _("Science & Technology"));
90
 
    category.add_option("sport", _("Sport"));
91
 
    category.add_option("travel", _("Travel & Events"));
92
 
    category.add_option("nature", _("Nature"));
93
 
    category.add_option("experimental", _("Experimental"));
94
 
    f.append(category);
95
 
 
96
 
    var rating = new RatingsFilter("rating", _("Rating"));
97
 
    f.append(rating);
98
 
 
99
 
    filters = f;
100
 
  }
101
 
}