diff --git a/data/data.qrc b/data/data.qrc
index 1f2db687b..38ff67edb 100644
--- a/data/data.qrc
+++ b/data/data.qrc
@@ -47,5 +47,6 @@
last.fm/my_friends.png
last.fm/my_neighbours.png
last.fm/user_purple.png
+ list-remove.png
diff --git a/data/list-remove.png b/data/list-remove.png
new file mode 100644
index 000000000..2bb1a5983
Binary files /dev/null and b/data/list-remove.png differ
diff --git a/src/lastfmservice.cpp b/src/lastfmservice.cpp
index fe5dd91f6..35058a96c 100644
--- a/src/lastfmservice.cpp
+++ b/src/lastfmservice.cpp
@@ -47,12 +47,14 @@ LastFMService::LastFMService(QObject* parent)
config_->ui_.scrobble->setEnabled(scrobbling_enabled_);
play_action_ = context_menu_->addAction(QIcon(":media-playback-start.png"), "Add to playlist", this, SLOT(AddToPlaylist()));
+ remove_action_ = context_menu_->addAction(QIcon(":list-remove.png"), "Remove", this, SLOT(Remove()));
context_menu_->addSeparator();
add_artist_action_ = context_menu_->addAction(QIcon(":last.fm/icon_radio.png"), "Play artist radio...", this, SLOT(AddArtistRadio()));
add_tag_action_ = context_menu_->addAction(QIcon(":last.fm/icon_tag.png"), "Play tag radio...", this, SLOT(AddTagRadio()));
context_menu_->addAction(QIcon(":configure.png"), "Configure Last.fm...",
config_, SLOT(show()));
+ remove_action_->setEnabled(false);
add_artist_action_->setEnabled(false);
add_tag_action_->setEnabled(false);
}
@@ -391,6 +393,17 @@ void LastFMService::Ban() {
void LastFMService::ShowContextMenu(RadioItem* item, const QPoint &global_pos) {
context_item_ = item;
+ switch (item->type) {
+ case Type_Artist:
+ case Type_Tag:
+ remove_action_->setEnabled(true);
+ break;
+
+ default:
+ remove_action_->setEnabled(false);
+ break;
+ }
+
play_action_->setEnabled(item->playable);
context_menu_->popup(global_pos);
}
@@ -523,3 +536,14 @@ void LastFMService::RestoreList(const QString &name, ItemType item_type,
}
settings.endArray();
}
+
+void LastFMService::Remove() {
+ int type = context_item_->type;
+
+ context_item_->parent->DeleteNotify(context_item_->row);
+
+ if (type == Type_Artist)
+ SaveList("artists", artist_list_);
+ else if (type == Type_Tag)
+ SaveList("tags", tag_list_);
+}
diff --git a/src/lastfmservice.h b/src/lastfmservice.h
index 4a8097726..36f1b4282 100644
--- a/src/lastfmservice.h
+++ b/src/lastfmservice.h
@@ -85,6 +85,7 @@ class LastFMService : public RadioService {
void AddToPlaylist();
void AddArtistRadio();
void AddTagRadio();
+ void Remove();
private:
RadioItem* CreateStationItem(ItemType type, const QString& name,