diff --git a/Persephone/AppDelegate.swift b/Persephone/AppDelegate.swift
index c828494..e013915 100644
--- a/Persephone/AppDelegate.swift
+++ b/Persephone/AppDelegate.swift
@@ -135,6 +135,27 @@ class AppDelegate: NSObject,
App.store.dispatch(MPDPrevTrackAction())
}
+ @IBAction func removeQueueSongMenuAction(_ sender: NSMenuItem) {
+ guard let queueItem = App.store.state.uiState.selectedQueueItem
+ else { return }
+
+ App.store.dispatch(MPDRemoveTrack(queuePos: queueItem.queuePos))
+ }
+ @IBAction func clearQueueMenuAction(_ sender: NSMenuItem) {
+ let alert = NSAlert()
+ alert.alertStyle = .informational
+ alert.messageText = "Are you sure you want to clear the queue?"
+ alert.informativeText = "You can’t undo this action."
+ alert.addButton(withTitle: "Clear")
+ alert.addButton(withTitle: "Cancel")
+
+ let result = alert.runModal()
+
+ if result == .alertFirstButtonReturn {
+ App.store.dispatch(UpdateQueueAction(queue: []))
+ }
+ }
+
@IBAction func playSelectedSongAction(_ sender: NSMenuItem) {
guard let song = App.store.state.uiState.selectedSong
else { return }
diff --git a/Persephone/Controllers/QueueViewController.swift b/Persephone/Controllers/QueueViewController.swift
index ec3cb90..bf41fd5 100644
--- a/Persephone/Controllers/QueueViewController.swift
+++ b/Persephone/Controllers/QueueViewController.swift
@@ -93,6 +93,16 @@ class QueueViewController: NSViewController,
}
}
+ func outlineViewSelectionDidChange(_ notification: Notification) {
+ if queueView.selectedRow >= 1 {
+ let queueItem = dataSource.queue[queueView.selectedRow - 1]
+
+ App.store.dispatch(SetSelectedQueueItem(selectedQueueItem: queueItem))
+ } else {
+ App.store.dispatch(SetSelectedQueueItem(selectedQueueItem: nil))
+ }
+ }
+
func cellForSongTitle(_ outlineView: NSOutlineView, with queueItem: QueueItem) -> NSView {
let cellView = outlineView.makeView(
withIdentifier: .queueSongTitle,
diff --git a/Persephone/Resources/Base.lproj/Main.storyboard b/Persephone/Resources/Base.lproj/Main.storyboard
index b11f160..b477c31 100644
--- a/Persephone/Resources/Base.lproj/Main.storyboard
+++ b/Persephone/Resources/Base.lproj/Main.storyboard
@@ -79,8 +79,18 @@