Removed audio elements in menus and main window

This commit is contained in:
Manuel Cortez 2017-09-26 05:19:30 -05:00
parent 268138d726
commit ba2ba9bc58
3 changed files with 43 additions and 49 deletions

View File

@ -67,10 +67,8 @@ class Controller(object):
self.window.insert_buffer(home.tab, _(u"Home"), self.window.search("posts")) self.window.insert_buffer(home.tab, _(u"Home"), self.window.search("posts"))
self.repeatedUpdate = RepeatingTimer(180, self.update_all_buffers) self.repeatedUpdate = RepeatingTimer(180, self.update_all_buffers)
self.repeatedUpdate.start() self.repeatedUpdate.start()
self.readMarker = RepeatingTimer(120, self.mark_as_read) self.readMarker = RepeatingTimer(120, self.mark_as_read)
self.readMarker.start() self.readMarker.start()
feed = buffers.feedBuffer(parent=self.window.tb, name="me_feed", composefunc="compose_status", session=self.session, endpoint="get", parent_endpoint="wall", extended=1, count=self.session.settings["buffers"]["count_for_wall_buffers"]) feed = buffers.feedBuffer(parent=self.window.tb, name="me_feed", composefunc="compose_status", session=self.session, endpoint="get", parent_endpoint="wall", extended=1, count=self.session.settings["buffers"]["count_for_wall_buffers"])
self.buffers.append(feed) self.buffers.append(feed)
# Translators: Own user's wall name in the tree view. # Translators: Own user's wall name in the tree view.
@ -93,7 +91,6 @@ class Controller(object):
# albums = buffers.empty(parent=self.window.tb, name="albums") # albums = buffers.empty(parent=self.window.tb, name="albums")
# self.buffers.append(albums) # self.buffers.append(albums)
# self.window.insert_buffer(albums.tab, _(u"Albums"), self.window.search("audios")) # self.window.insert_buffer(albums.tab, _(u"Albums"), self.window.search("audios"))
videos = buffers.empty(parent=self.window.tb, name="videos") videos = buffers.empty(parent=self.window.tb, name="videos")
self.buffers.append(videos) self.buffers.append(videos)
# Translators: name for the videos category in the tree view. # Translators: name for the videos category in the tree view.
@ -104,14 +101,12 @@ class Controller(object):
video_albums = buffers.empty(parent=self.window.tb, name="video_albums") video_albums = buffers.empty(parent=self.window.tb, name="video_albums")
self.buffers.append(video_albums) self.buffers.append(video_albums)
self.window.insert_buffer(video_albums.tab, _(u"Albums"), self.window.search("videos")) self.window.insert_buffer(video_albums.tab, _(u"Albums"), self.window.search("videos"))
people = buffers.empty(parent=self.window.tb, name="people") people = buffers.empty(parent=self.window.tb, name="people")
self.buffers.append(people) self.buffers.append(people)
self.window.add_buffer(people.tab, _(u"People")) self.window.add_buffer(people.tab, _(u"People"))
friends = buffers.peopleBuffer(parent=self.window.tb, name="friends_", composefunc="compose_person", session=self.session, endpoint="get", parent_endpoint="friends", count=5000, fields="uid, first_name, last_name, last_seen") friends = buffers.peopleBuffer(parent=self.window.tb, name="friends_", composefunc="compose_person", session=self.session, endpoint="get", parent_endpoint="friends", count=5000, fields="uid, first_name, last_name, last_seen")
self.buffers.append(friends) self.buffers.append(friends)
self.window.insert_buffer(friends.tab, _(u"Friends"), self.window.search("people")) self.window.insert_buffer(friends.tab, _(u"Friends"), self.window.search("people"))
requests_ = buffers.empty(parent=self.window.tb, name="requests") requests_ = buffers.empty(parent=self.window.tb, name="requests")
self.buffers.append(requests_) self.buffers.append(requests_)
self.window.insert_buffer(requests_.tab, _(u"Friendship requests"), self.window.search("people")) self.window.insert_buffer(requests_.tab, _(u"Friendship requests"), self.window.search("people"))
@ -121,7 +116,6 @@ class Controller(object):
outgoing_requests = buffers.requestsBuffer(parent=self.window.tb, name="friend_requests_sent", composefunc="compose_person", session=self.session, count=1000, out=1) outgoing_requests = buffers.requestsBuffer(parent=self.window.tb, name="friend_requests_sent", composefunc="compose_person", session=self.session, count=1000, out=1)
self.buffers.append(outgoing_requests) self.buffers.append(outgoing_requests)
self.window.insert_buffer(outgoing_requests.tab, _(u"I follow"), self.window.search("requests")) self.window.insert_buffer(outgoing_requests.tab, _(u"I follow"), self.window.search("requests"))
chats = buffers.empty(parent=self.window.tb, name="chats") chats = buffers.empty(parent=self.window.tb, name="chats")
self.buffers.append(chats) self.buffers.append(chats)
self.window.add_buffer(chats.tab, _(u"Chats")) self.window.add_buffer(chats.tab, _(u"Chats"))
@ -134,8 +128,8 @@ class Controller(object):
log.debug("Connecting events to responses...") log.debug("Connecting events to responses...")
pub.subscribe(self.in_post, "posted") pub.subscribe(self.in_post, "posted")
pub.subscribe(self.download, "download-file") pub.subscribe(self.download, "download-file")
pub.subscribe(self.play_audio, "play-audio") # pub.subscribe(self.play_audio, "play-audio")
pub.subscribe(self.play_audios, "play-audios") # pub.subscribe(self.play_audios, "play-audios")
pub.subscribe(self.view_post, "open-post") pub.subscribe(self.view_post, "open-post")
pub.subscribe(self.update_status_bar, "update-status-bar") pub.subscribe(self.update_status_bar, "update-status-bar")
pub.subscribe(self.chat_from_id, "new-chat") pub.subscribe(self.chat_from_id, "new-chat")
@ -145,35 +139,35 @@ class Controller(object):
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.update_buffer, menuitem=self.window.update_buffer) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.update_buffer, menuitem=self.window.update_buffer)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.check_for_updates, menuitem=self.window.check_for_updates) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.check_for_updates, menuitem=self.window.check_for_updates)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.window.about_dialog, menuitem=self.window.about) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.window.about_dialog, menuitem=self.window.about)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.search_audios, menuitem=self.window.search_audios) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.search_audios, menuitem=self.window.search_audios)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.search_videos, menuitem=self.window.search_videos) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.search_videos, menuitem=self.window.search_videos)
widgetUtils.connect_event(self.window, widgetUtils.MENU,self.remove_buffer, menuitem=self.window.remove_buffer_) widgetUtils.connect_event(self.window, widgetUtils.MENU,self.remove_buffer, menuitem=self.window.remove_buffer_)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.get_more_items, menuitem=self.window.load_previous_items) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.get_more_items, menuitem=self.window.load_previous_items)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.changelog, menuitem=self.window.changelog) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.changelog, menuitem=self.window.changelog)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.configuration, menuitem=self.window.settings_dialog) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.configuration, menuitem=self.window.settings_dialog)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.new_timeline, menuitem=self.window.timeline) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.new_timeline, menuitem=self.window.timeline)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.create_audio_album, menuitem=self.window.audio_album) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.create_audio_album, menuitem=self.window.audio_album)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.delete_audio_album, menuitem=self.window.delete_audio_album) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.delete_audio_album, menuitem=self.window.delete_audio_album)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.create_video_album, menuitem=self.window.video_album) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.create_video_album, menuitem=self.window.video_album)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.delete_video_album, menuitem=self.window.delete_video_album) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.delete_video_album, menuitem=self.window.delete_video_album)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.check_documentation, menuitem=self.window.documentation) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.check_documentation, menuitem=self.window.documentation)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_pause, menuitem=self.window.player_play) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_pause, menuitem=self.window.player_play)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_next, menuitem=self.window.player_next) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_next, menuitem=self.window.player_next)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_previous, menuitem=self.window.player_previous) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_previous, menuitem=self.window.player_previous)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_all, menuitem=self.window.player_play_all) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_play_all, menuitem=self.window.player_play_all)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_stop, menuitem=self.window.player_stop) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_stop, menuitem=self.window.player_stop)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_volume_down, menuitem=self.window.player_volume_down) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_volume_down, menuitem=self.window.player_volume_down)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_volume_up, menuitem=self.window.player_volume_up) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_volume_up, menuitem=self.window.player_volume_up)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_mute, menuitem=self.window.player_mute) # widgetUtils.connect_event(self.window, widgetUtils.MENU, self.menu_mute, menuitem=self.window.player_mute)
pub.subscribe(self.get_chat, "order-sent-message") pub.subscribe(self.get_chat, "order-sent-message")
def disconnect_events(self): def disconnect_events(self):
log.debug("Disconnecting some events...") log.debug("Disconnecting some events...")
pub.unsubscribe(self.in_post, "posted") pub.unsubscribe(self.in_post, "posted")
pub.unsubscribe(self.download, "download-file") # pub.unsubscribe(self.download, "download-file")
pub.unsubscribe(self.play_audio, "play-audio") # pub.unsubscribe(self.play_audio, "play-audio")
pub.unsubscribe(self.authorisation_failed, "authorisation-failed") pub.unsubscribe(self.authorisation_failed, "authorisation-failed")
pub.unsubscribe(self.play_audios, "play-audios") # pub.unsubscribe(self.play_audios, "play-audios")
pub.unsubscribe(self.view_post, "open-post") pub.unsubscribe(self.view_post, "open-post")
pub.unsubscribe(self.update_status_bar, "update-status-bar") pub.unsubscribe(self.update_status_bar, "update-status-bar")

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from microsofttranslator import Translator #from microsofttranslator import Translator
def translate(text="", source="auto", target="en"): def translate(text="", source="auto", target="en"):
t = Translator("twblue", "4KZA26GYIfmVAqQA/z16Hlucbg64hVSDTIpRjT2FqIU=") t = Translator("twblue", "4KZA26GYIfmVAqQA/z16Hlucbg64hVSDTIpRjT2FqIU=")

View File

@ -7,20 +7,20 @@ class mainWindow(wx.Frame):
mb = wx.MenuBar() mb = wx.MenuBar()
app_ = wx.Menu() app_ = wx.Menu()
create = wx.Menu() create = wx.Menu()
self.audio_album = create.Append(wx.NewId(), _(u"Audio album")) # self.audio_album = create.Append(wx.NewId(), _(u"Audio album"))
self.audio_album.Enable(False) # self.audio_album.Enable(False)
self.video_album = create.Append(wx.NewId(), _(u"Video album")) self.video_album = create.Append(wx.NewId(), _(u"Video album"))
app_.AppendMenu(wx.NewId(), _(u"Create"), create) app_.AppendMenu(wx.NewId(), _(u"Create"), create)
delete = wx.Menu() delete = wx.Menu()
self.delete_audio_album = delete.Append(wx.NewId(), _(u"Audio album")) # self.delete_audio_album = delete.Append(wx.NewId(), _(u"Audio album"))
self.delete_audio_album.Enable(False) # self.delete_audio_album.Enable(False)
self.delete_video_album = delete.Append(wx.NewId(), _(u"Video album")) self.delete_video_album = delete.Append(wx.NewId(), _(u"Video album"))
app_.AppendMenu(wx.NewId(), _(u"Delete"), delete) app_.AppendMenu(wx.NewId(), _(u"Delete"), delete)
self.settings_dialog = app_.Append(wx.NewId(), _(u"Preferences")) self.settings_dialog = app_.Append(wx.NewId(), _(u"Preferences"))
buffer = wx.Menu() buffer = wx.Menu()
search = wx.Menu() search = wx.Menu()
self.search_audios = search.Append(wx.NewId(), _(u"Audio")) # self.search_audios = search.Append(wx.NewId(), _(u"Audio"))
self.search_audios.Enable(False) # self.search_audios.Enable(False)
self.search_videos = search.Append(wx.NewId(), _(u"Video")) self.search_videos = search.Append(wx.NewId(), _(u"Video"))
self.timeline = buffer.Append(wx.NewId(), _(u"&New timeline")) self.timeline = buffer.Append(wx.NewId(), _(u"&New timeline"))
buffer.AppendMenu(wx.NewId(), _(u"Search"), search) buffer.AppendMenu(wx.NewId(), _(u"Search"), search)
@ -29,31 +29,31 @@ class mainWindow(wx.Frame):
self.remove_buffer_ = buffer.Append(wx.NewId(), _(u"&Remove buffer")) self.remove_buffer_ = buffer.Append(wx.NewId(), _(u"&Remove buffer"))
mb.Append(app_, _(u"Application")) mb.Append(app_, _(u"Application"))
mb.Append(buffer, _(u"Buffer")) mb.Append(buffer, _(u"Buffer"))
player = wx.Menu() # player = wx.Menu()
self.player_play = player.Append(wx.NewId(), _(u"Play")) # self.player_play = player.Append(wx.NewId(), _(u"Play"))
self.player_play.Enable(False) # self.player_play.Enable(False)
self.player_play_all = player.Append(wx.NewId(), _(u"Play all")) # self.player_play_all = player.Append(wx.NewId(), _(u"Play all"))
self.player_play_all.Enable(False) # self.player_play_all.Enable(False)
self.player_stop = player.Append(wx.NewId(), _(u"Stop")) # self.player_stop = player.Append(wx.NewId(), _(u"Stop"))
self.player_stop.Enable(False) # self.player_stop.Enable(False)
self.player_previous = player.Append(wx.NewId(), _(u"Previous")) # self.player_previous = player.Append(wx.NewId(), _(u"Previous"))
self.player_previous.Enable(False) # self.player_previous.Enable(False)
self.player_next = player.Append(wx.NewId(), _(u"Next")) # self.player_next = player.Append(wx.NewId(), _(u"Next"))
self.player_next.Enable(False) # self.player_next.Enable(False)
self.player_shuffle = player.AppendCheckItem(wx.NewId(), _(u"Shuffle")) # self.player_shuffle = player.AppendCheckItem(wx.NewId(), _(u"Shuffle"))
self.player_shuffle.Enable(False) # self.player_shuffle.Enable(False)
self.player_volume_down = player.Append(wx.NewId(), _(u"Volume down")) # self.player_volume_down = player.Append(wx.NewId(), _(u"Volume down"))
self.player_volume_down.Enable(False) # self.player_volume_down.Enable(False)
self.player_volume_up = player.Append(wx.NewId(), _(u"Volume up")) # self.player_volume_up = player.Append(wx.NewId(), _(u"Volume up"))
self.player_volume_up.Enable(False) # self.player_volume_up.Enable(False)
self.player_mute = player.Append(wx.NewId(), _(u"Mute")) # self.player_mute = player.Append(wx.NewId(), _(u"Mute"))
self.player_mute.Enable(False) # self.player_mute.Enable(False)
help_ = wx.Menu() help_ = wx.Menu()
self.about = help_.Append(wx.NewId(), _(u"About {0}").format(application.name,)) self.about = help_.Append(wx.NewId(), _(u"About {0}").format(application.name,))
self.documentation = help_.Append(wx.NewId(), _(u"Manual")) self.documentation = help_.Append(wx.NewId(), _(u"Manual"))
self.check_for_updates = help_.Append(wx.NewId(), _(u"Check for updates")) self.check_for_updates = help_.Append(wx.NewId(), _(u"Check for updates"))
self.changelog = help_.Append(wx.NewId(), _(u"Chan&gelog")) self.changelog = help_.Append(wx.NewId(), _(u"Chan&gelog"))
mb.Append(player, _(u"Audio player")) # mb.Append(player, _(u"Audio player"))
mb.Append(help_, _(u"Help")) mb.Append(help_, _(u"Help"))
self.SetMenuBar(mb) self.SetMenuBar(mb)