Notify user of fully downloaded song with a system notification
This commit is contained in:
parent
182b783987
commit
0efab2a4ff
@ -126,7 +126,7 @@ class audioPlayer(object):
|
|||||||
break
|
break
|
||||||
transcoder.release()
|
transcoder.release()
|
||||||
os.rename(temporary_path, path)
|
os.rename(temporary_path, path)
|
||||||
pub.sendMessage("change_status", status="")
|
pub.sendMessage("download_finished", file=os.path.basename(path))
|
||||||
# print(state)
|
# print(state)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
@ -62,5 +62,5 @@ def download_file(url, local_filename):
|
|||||||
done = int(100 * dl / total_length)
|
done = int(100 * dl / total_length)
|
||||||
msg = _(u"Downloading {0} ({1}%).").format(os.path.basename(local_filename), done)
|
msg = _(u"Downloading {0} ({1}%).").format(os.path.basename(local_filename), done)
|
||||||
pub.sendMessage("change_status", status=msg)
|
pub.sendMessage("change_status", status=msg)
|
||||||
pub.sendMessage("change_status", status="")
|
pub.sendMessage("download_finished", file=os.path.basename(local_filename))
|
||||||
return local_filename
|
return local_filename
|
||||||
|
@ -100,3 +100,7 @@ class mainWindow(wx.Frame):
|
|||||||
if saveFileDialog.ShowModal() == wx.ID_OK:
|
if saveFileDialog.ShowModal() == wx.ID_OK:
|
||||||
return saveFileDialog.GetPath()
|
return saveFileDialog.GetPath()
|
||||||
saveFileDialog.Destroy()
|
saveFileDialog.Destroy()
|
||||||
|
|
||||||
|
def notify(self, title, text):
|
||||||
|
self.notification = wx.adv.NotificationMessage(title, text, parent=self)
|
||||||
|
self.notification.Show()
|
Loading…
x
Reference in New Issue
Block a user