Now is possible to move an audio to an album with the menu key or right click in the item

This commit is contained in:
Manuel Cortez 2016-06-29 04:08:37 -05:00
parent 42c8d9bbb7
commit d00e8cf64f
2 changed files with 13 additions and 0 deletions

View File

@ -13,6 +13,9 @@
* Read messages will be marked as read in the social network, so it'll cause that your friends could see that you have read the message and socializer will not load chat buffers with read messages at startup. * Read messages will be marked as read in the social network, so it'll cause that your friends could see that you have read the message and socializer will not load chat buffers with read messages at startup.
* Included a brief manual in the help menu. Currently available only in English. * Included a brief manual in the help menu. Currently available only in English.
* Included a context menu in list items. Currently there are functions not available. Menu for chat buffers is not implemented yet. * Included a context menu in list items. Currently there are functions not available. Menu for chat buffers is not implemented yet.
* Implemented audio album load (in the music buffer), creation (in the application menu) and deletion (in the application menu, too).
* audios can be moved to albums by pressing the menu key or doing a right click in the item, and selecting "move to album". Audios will be added to the album in the next update (there is a programmed update in 3 minutes), or you can update the buffer manually (from the buffer menu in the menu bar). This option will be available in audio buffers (searches or audio buffers).
## Changes on build 2016.05.25 ## Changes on build 2016.05.25

View File

@ -9,6 +9,7 @@ import posts
import player import player
import output import output
import logging import logging
import selector
from wxUI.tabs import home from wxUI.tabs import home
from pubsub import pub from pubsub import pub
from sessionmanager import session from sessionmanager import session
@ -359,11 +360,20 @@ class audioBuffer(feedBuffer):
if int(result) == 1: if int(result) == 1:
output.speak(_(u"Removed audio from library")) output.speak(_(u"Removed audio from library"))
def move_to_album(self, *args, **kwargs):
album = selector.audioAlbum(_(u"Select the album where you want to move this song"), self.session)
if album.item == None: return
id = self.get_post()["id"]
response = self.session.vk.client.audio.moveToAlbum(album_id=album.item, audio_ids=id)
if response == 1:
output.speak(_(u"Moved"))
def get_menu(self): def get_menu(self):
p = self.get_post() p = self.get_post()
m = menus.audioMenu() m = menus.audioMenu()
widgetUtils.connect_event(m, widgetUtils.MENU, self.open_post, menuitem=m.open) widgetUtils.connect_event(m, widgetUtils.MENU, self.open_post, menuitem=m.open)
widgetUtils.connect_event(m, widgetUtils.MENU, self.play_audio, menuitem=m.play) widgetUtils.connect_event(m, widgetUtils.MENU, self.play_audio, menuitem=m.play)
widgetUtils.connect_event(m, widgetUtils.MENU, self.move_to_album, menuitem=m.move)
# if owner_id is the current user, the audio is added to the user's audios. # if owner_id is the current user, the audio is added to the user's audios.
if p["owner_id"] == self.session.user_id: if p["owner_id"] == self.session.user_id:
m.library.SetItemLabel(_(u"&Remove from library")) m.library.SetItemLabel(_(u"&Remove from library"))