Added empty panels for organisation in posts and music buffers

This commit is contained in:
Manuel Cortez 2016-03-23 08:57:16 -06:00
parent 4eebec68ab
commit 33b779887e
3 changed files with 30 additions and 6 deletions

View File

@ -158,4 +158,16 @@ class audioBuffer(feedBuffer):
def play_all(self, *args, **kwargs):
selected = self.tab.list.get_selected()
audios = [i["url"] for i in self.session.db[self.name]["items"][selected:]]
pub.sendMessage("play-audios", audios=audios)
pub.sendMessage("play-audios", audios=audios)
class empty(object):
def __init__(self, name=None, parent=None, *args, **kwargs):
self.tab = home.empty(parent=parent, name=name)
self.name = name
def get_items(self, *args, **kwargs):
pass
def update(self, *args, **kwargs):
pass

View File

@ -40,23 +40,29 @@ class Controller(object):
call_threaded(updater.do_update)
def create_controls(self):
posts_ = buffers.empty(parent=self.window.tb, name="posts")
self.buffers.append(posts_)
self.window.add_buffer(posts_.tab, _(u"Posts"))
home = buffers.baseBuffer(parent=self.window.tb, name="home_timeline", session=self.session, composefunc="compose_new", endpoint="newsfeed")
self.buffers.append(home)
self.window.add_buffer(home.tab, _(u"Home"))
self.window.insert_buffer(home.tab, _(u"Home"), self.window.search("posts"))
self.repeatedUpdate = RepeatingTimer(180, self.update_all_buffers)
self.repeatedUpdate.start()
feed = buffers.feedBuffer(parent=self.window.tb, name="me_feed", composefunc="compose_status", session=self.session, endpoint="get", parent_endpoint="wall")
self.buffers.append(feed)
self.window.add_buffer(feed.tab, _(u"My wall"))
self.window.insert_buffer(feed.tab, _(u"My wall"), self.window.search("posts"))
audios = buffers.empty(parent=self.window.tb, name="audios")
self.buffers.append(audios)
self.window.add_buffer(audios.tab, _(u"Music"))
audio = buffers.audioBuffer(parent=self.window.tb, name="me_audio", composefunc="compose_audio", session=self.session, endpoint="get", parent_endpoint="audio", full_list=True)
self.buffers.append(audio)
self.window.add_buffer(audio.tab, _(u"My audios"))
self.window.insert_buffer(audio.tab, _(u"My audios"), self.window.search("audios"))
p_audio = buffers.audioBuffer(parent=self.window.tb, name="popular_audio", composefunc="compose_audio", session=self.session, endpoint="getPopular", parent_endpoint="audio", full_list=True)
self.buffers.append(p_audio)
self.window.add_buffer(p_audio.tab, _(u"Popular audios"))
self.window.insert_buffer(p_audio.tab, _(u"Popular audios"), self.window.search("audios"))
r_audio = buffers.audioBuffer(parent=self.window.tb, name="recommended_audio", composefunc="compose_audio", session=self.session, endpoint="getRecommendations", parent_endpoint="audio", full_list=True)
self.buffers.append(r_audio)
self.window.add_buffer(r_audio.tab, _(u"Recommendations"))
self.window.insert_buffer(r_audio.tab, _(u"Recommendations"), self.window.search("audios"))
def connect_events(self):
pub.subscribe(self.in_post, "posted")

View File

@ -108,3 +108,9 @@ class friendsTab(homeTab):
self.list.set_windows_size(0, 400)
self.list.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnKeyDown)
class empty(wx.Panel):
def __init__(self, parent, name):
super(empty, self).__init__(parent=parent, name=name)
self.name = name
sizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(sizer)