+#!/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 <http://www.gnu.org/licenses/>.
+#
+# 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 <thpinfo.com>
+# (based on http://pygstdocs.berlios.de/pygst-tutorial/seeking.html)
+#
import gtk
-import hildon
+try:
+ import hildon
+except:
+ import helldon as hildon
import jamaendo
from playerwindow import open_playerwindow
from showartist import ShowArtist
from showalbum import ShowAlbum
+from albumlist import MusicList
class SearchWindow(hildon.StackableWindow):
def __init__(self):
hildon.StackableWindow.__init__(self)
self.set_title("Search")
+ self.idmap = {}
vbox = gtk.VBox(False, 0)
# Results list
self.panarea = hildon.PannableArea()
+ self.musiclist = MusicList()
self.result_store = gtk.ListStore(str, int)
#self.result_store.append(['red'])
self.result_view = gtk.TreeView(self.result_store)
hbox.pack_start(self.entry, True, True, 0)
hbox.pack_start(btn, False)
vbox.pack_start(hbox, False)
-
-
self.add(vbox)
- self.idmap = {}
+ self.create_menu()
+
+ def create_menu(self):
+ def on_player(*args):
+ from playerwindow import open_playerwindow
+ open_playerwindow()
+ self.menu = hildon.AppMenu()
+ player = hildon.GtkButton(gtk.HILDON_SIZE_AUTO)
+ player.set_label("Open player")
+ player.connect("clicked", on_player)
+ self.menu.append(player)
+ self.menu.show_all()
+ self.set_app_menu(self.menu)
def mode_changed(self, selector, user_data):
- current_selection = selector.get_current_text()
- print current_selection
+ pass
+ #current_selection = selector.get_current_text()
def on_search(self, w):
mode = self.mode.get_active()
treeiter = self.result_store.get_iter(path)
title, _id = self.result_store.get(treeiter, 0, 1)
item = self.idmap[_id]
- print _id, item
+ #print _id, item
self.open_item(item)
def open_item(self, item):