New shortcut: remove current playing song from playlist (#5723)
This commit is contained in:
parent
583eb25cfc
commit
8953227c65
@ -79,6 +79,9 @@ GlobalShortcuts::GlobalShortcuts(QWidget* parent)
|
||||
SIGNAL(Love()));
|
||||
AddShortcut("ban_last_fm_scrobbling", tr("Ban (Last.fm scrobbling)"),
|
||||
SIGNAL(Ban()));
|
||||
AddShortcut("remove_current_song_from_playlist",
|
||||
tr("Remove current song from playlist"),
|
||||
SIGNAL(RemoveCurrentSong()));
|
||||
|
||||
AddRatingShortcut("rate_zero_star", tr("Rate the current song 0 stars"),
|
||||
rating_signals_mapper_, 0);
|
||||
|
@ -82,6 +82,7 @@ signals:
|
||||
void ToggleScrobbling();
|
||||
void Love();
|
||||
void Ban();
|
||||
void RemoveCurrentSong();
|
||||
|
||||
private:
|
||||
void AddShortcut(const QString& id, const QString& name, const char* signal,
|
||||
|
@ -494,6 +494,10 @@ void PlaylistManager::RemoveItemsWithoutUndo(int id,
|
||||
playlists_[id].p->RemoveItemsWithoutUndo(indices);
|
||||
}
|
||||
|
||||
void PlaylistManager::RemoveCurrentSong() {
|
||||
active()->removeRows(active()->current_index().row(), 1);
|
||||
}
|
||||
|
||||
void PlaylistManager::InvalidateDeletedSongs() {
|
||||
for (Playlist* playlist : GetAllPlaylists()) {
|
||||
playlist->InvalidateDeletedSongs();
|
||||
|
@ -225,6 +225,8 @@ class PlaylistManager : public PlaylistManagerInterface {
|
||||
// Removes items with given indices from the playlist. This operation is not
|
||||
// undoable.
|
||||
void RemoveItemsWithoutUndo(int id, const QList<int>& indices);
|
||||
// Remove the current playing song
|
||||
void RemoveCurrentSong();
|
||||
|
||||
private slots:
|
||||
void SetActivePlaying();
|
||||
|
@ -848,6 +848,8 @@ MainWindow::MainWindow(Application* app, SystemTrayIcon* tray_icon, OSD* osd,
|
||||
|
||||
connect(global_shortcuts_, SIGNAL(RateCurrentSong(int)),
|
||||
app_->playlist_manager(), SLOT(RateCurrentSong(int)));
|
||||
connect(global_shortcuts_, SIGNAL(RemoveCurrentSong()),
|
||||
app_->playlist_manager(), SLOT(RemoveCurrentSong()));
|
||||
|
||||
// Fancy tabs
|
||||
connect(ui_->tabs, SIGNAL(ModeChanged(FancyTabWidget::Mode)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user