X-Git-Url: http://git.maemo.org/git/?p=jamaendo;a=blobdiff_plain;f=jamaui%2Fradios.py;fp=jamaui%2Fradios.py;h=0000000000000000000000000000000000000000;hp=ac3e2ed4c4414ff15007eef3703563e6dbf000b5;hb=83aa28b815d862cf2a4fda177c4bef87cd0f6590;hpb=e671a4f6b6ab6f73f4052222c259570b8d31567b diff --git a/jamaui/radios.py b/jamaui/radios.py deleted file mode 100644 index ac3e2ed..0000000 --- a/jamaui/radios.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python -# -# This file is part of Jamaendo. -# Copyright (c) 2010 Kristoffer Gronlund -# -# Jamaendo 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 3 of the License, or -# (at your option) any later version. -# -# Jamaendo 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Jamaendo. If not, see . -# -# Player code heavily based on http://thpinfo.com/2008/panucci/: -# A resuming media player for Podcasts and Audiobooks -# Copyright (c) 2008-05-26 Thomas Perl -# (based on http://pygstdocs.berlios.de/pygst-tutorial/seeking.html) -# -import gtk -try: - import hildon -except: - import helldon as hildon -import jamaendo -from playerwindow import open_playerwindow -from albumlist import RadioList -from fetcher import Fetcher - -class RadiosWindow(hildon.StackableWindow): - def __init__(self): - hildon.StackableWindow.__init__(self) - self.fetcher = None - self.radios = {} - - self.set_title("Radios") - self.connect('destroy', self.on_destroy) - - # Results list - self.panarea = hildon.PannableArea() - self.radiolist = RadioList() - self.radiolist.connect('row-activated', self.row_activated) - self.panarea.add(self.radiolist) - self.add(self.panarea) - - self.start_radio_fetcher() - - def on_destroy(self, wnd): - if self.fetcher: - self.fetcher.stop() - self.fetcher = None - - def row_activated(self, treeview, path, view_column): - name, _id = self.radiolist.get_radio_id(path) - wnd = open_playerwindow() - wnd.play_radio(name, _id) - - def start_radio_fetcher(self): - if self.fetcher: - self.fetcher.stop() - self.fetcher = None - self.fetcher = Fetcher(jamaendo.starred_radios, self, - on_item = self.on_radio_result, - on_ok = self.on_radio_complete, - on_fail = self.on_radio_complete) - self.fetcher.start() - - def on_radio_result(self, wnd, item): - if wnd is self: - self.radios[item.ID] = item - self.radiolist.add_radios([item]) - - def on_radio_complete(self, wnd, error=None): - if wnd is self: - self.fetcher.stop() - self.fetcher = None