Add notification when a download is completed

- fyne notication looks for the app icon to display it in the notication, so I setted the icon  in `main.go`.
- deleting points after "Download" option in grid view that I mistakenly leave it in a previous PR.
- adding the new paremeter `downloadName`

Screenshot:

Fixes #202
This commit is contained in:
natilou
2023-06-21 14:17:15 -03:00
parent 5f83c2cd95
commit d59ed11647
7 changed files with 35 additions and 14 deletions
+4 -4
View File
@@ -76,7 +76,7 @@ type Tracklist struct {
OnAddToPlaylist func(trackIDs []string)
OnSetFavorite func(trackIDs []string, fav bool)
OnSetRating func(trackIDs []string, rating int)
OnDownload func(tracks []*mediaprovider.Track)
OnDownload func(tracks []*mediaprovider.Track, downloadName string)
OnShowArtistPage func(artistID string)
OnShowAlbumPage func(albumID string)
@@ -511,7 +511,7 @@ func (t *Tracklist) onShowContextMenu(e *fyne.PointEvent, trackIdx int) {
}))
t.ctxMenu.Items = append(t.ctxMenu.Items,
fyne.NewMenuItem("Download", func() {
t.onDownload(t.selectedTracks())
t.onDownload(t.selectedTracks(), "Selected tracks")
}))
t.ctxMenu.Items = append(t.ctxMenu.Items, fyne.NewMenuItemSeparator())
t.ctxMenu.Items = append(t.ctxMenu.Items,
@@ -587,9 +587,9 @@ func (t *Tracklist) onAlbumTapped(albumID string) {
}
}
func (t *Tracklist) onDownload(tracks []*mediaprovider.Track) {
func (t *Tracklist) onDownload(tracks []*mediaprovider.Track, downloadName string) {
if t.OnDownload != nil {
t.OnDownload(tracks)
t.OnDownload(tracks, downloadName)
}
}