From b288c6c4903382914c50cb1a70da66978dc299be Mon Sep 17 00:00:00 2001 From: raziman Date: Tue, 18 Aug 2020 16:44:55 +0800 Subject: [PATCH] add confirmation popup for clearing the queue bump version --- gomu.go | 2 +- queue.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gomu.go b/gomu.go index 6607dc81..567d0af5 100644 --- a/gomu.go +++ b/gomu.go @@ -9,7 +9,7 @@ import ( "github.com/ztrue/tracerr" ) -const VERSION = "v1.4.1" +const VERSION = "v1.5.0" var gomu *Gomu diff --git a/queue.go b/queue.go index ebe1c3ae..a9e21477 100644 --- a/queue.go +++ b/queue.go @@ -386,7 +386,12 @@ func newQueue() *Queue { case 'd': queue.deleteItem(queue.GetCurrentItem()) case 'D': - queue.clearQueue() + + confirmationPopup("Are you sure to clear the queue?", func(_ int, label string) { + if label == "yes" { + queue.clearQueue() + } + }) case 'l': a, err := queue.deleteItem(queue.GetCurrentItem()) if err != nil {