Esempio n. 1
0
 def row_activated(self, treeview, path, view_column):
     sel = self.playlistlist.get_playlist_name(path)
     pl = settings.get_playlist(sel)
     if pl:
         from showplaylist import ShowPlaylist
         wnd = ShowPlaylist(sel, pl)
         wnd.show_all()
Esempio n. 2
0
def create_new_playlist(wnd):
    dia_name = gtk.Dialog()
    dia_name.set_title("New playlist")
    dia_name.add_button( gtk.STOCK_OK, gtk.RESPONSE_OK )
    entry = hildon.Entry(gtk.HILDON_SIZE_FINGER_HEIGHT)
    entry.set_placeholder("Enter name")
    entry.set_max_length(32)
    entry.connect('activate', lambda entry, dialog: dialog.response(gtk.RESPONSE_OK), dia_name)
    dia_name.vbox.pack_start(entry, True, True, 0)
    dia_name.show_all()
    if dia_name.run() != gtk.RESPONSE_OK:
        return False
    selected_playlist = entry.get_text()
    dia_name.destroy()
    if selected_playlist == '' or selected_playlist == 'New...':
        return False
    elif settings.get_playlist(selected_playlist):
        _show_banner(wnd, "Playlist '%s' already exists!" % (selected_playlist))
        return False
    return selected_playlist