Added context menu for tracks and file downloads

This commit is contained in:
2018-01-26 12:56:50 -06:00
parent 834b1d2dd7
commit d307ca1784
4 changed files with 63 additions and 3 deletions

View File

@@ -69,4 +69,10 @@ class mainWindow(wx.Frame):
return t
def get_item(self):
return self.list.GetSelection()
return self.list.GetSelection()
def get_destination_path(self, filename):
saveFileDialog = wx.FileDialog(self, _(u"Save this file"), "", filename, _(u"Audio Files(*.mp3)|*.mp3"), wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
if saveFileDialog.ShowModal() == wx.ID_OK:
return saveFileDialog.GetPath()
saveFileDialog.Destroy()

10
src/wxUI/menus.py Normal file
View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
import wx
class contextMenu(wx.Menu):
def __init__(self, *args, **kwargs):
super(contextMenu, self).__init__(*args, **kwargs)
self.play = wx.MenuItem(self, wx.NewId(), _("Play"))
self.AppendItem(self.play)
self.download = wx.MenuItem(self, wx.NewId(), _("Download"))
self.AppendItem(self.download)