Improve the playlists-choose dialog
This commit is contained in:
parent
d93f2ee188
commit
4c7317f71d
8 changed files with 191 additions and 52 deletions
|
@ -39,6 +39,11 @@ XCollection::on_connect (XClient *client)
|
|||
client->collection ()->list ("Playlists")
|
||||
(Xmms::bind (&XCollection::handle_playlists_list, this));
|
||||
|
||||
client->playlist ()->currentActive ()
|
||||
(Xmms::bind (&XCollection::handle_active_pls_changed, this));
|
||||
client->playlist ()->broadcastLoaded ()
|
||||
(Xmms::bind (&XCollection::handle_active_pls_changed, this));
|
||||
|
||||
m_client = client;
|
||||
}
|
||||
|
||||
|
@ -93,6 +98,19 @@ XCollection::on_collection_modified (const Xmms::Dict &value)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
XCollection::remove (QString name, QString ns) {
|
||||
if (!m_client->isConnected ()) return false;
|
||||
|
||||
m_client->collection ()->remove (name.toStdString (), ns.toAscii ());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* idList (Playlist) stuff
|
||||
*/
|
||||
|
||||
bool
|
||||
XCollection::handle_playlists_list (const Xmms::List< std::string > &list)
|
||||
{
|
||||
|
@ -125,6 +143,16 @@ XCollection::setActivePlaylist (QString name) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
XCollection::handle_active_pls_changed (const std::string &name) {
|
||||
QString tmp = m_activePlaylist;
|
||||
m_activePlaylist = XClient::stdToQ (name);
|
||||
|
||||
emit activePlaylistChanged (m_activePlaylist, tmp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// FIXME: should be done in a more generic way
|
||||
bool
|
||||
XCollection::addIdlist (QString name) {
|
||||
|
@ -134,12 +162,3 @@ XCollection::addIdlist (QString name) {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
XCollection::remove (QString name, QString ns) {
|
||||
if (!m_client->isConnected ()) return false;
|
||||
|
||||
m_client->collection ()->remove (name.toStdString (), ns.toAscii ());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue