diff --git a/src/controller/buffers/audio.py b/src/controller/buffers/audio.py index c45fae5..f445fe8 100644 --- a/src/controller/buffers/audio.py +++ b/src/controller/buffers/audio.py @@ -11,7 +11,7 @@ from pubsub import pub from vk_api import upload from mutagen.id3 import ID3 from presenters import player -from wxUI.tabs import home +from wxUI.tabs import audio from sessionmanager import utils from mysc.thread_utils import call_threaded from wxUI import commonMessages, menus @@ -22,7 +22,7 @@ log = logging.getLogger("controller.buffers.audio") class audioBuffer(wallBuffer): def create_tab(self, parent): - self.tab = home.audioTab(parent) + self.tab = audio.audioTab(parent) self.tab.name = self.name self.connect_events() if self.name == "me_audio": diff --git a/src/controller/buffers/audioAlbum.py b/src/controller/buffers/audioAlbum.py index 8278c61..78c6519 100644 --- a/src/controller/buffers/audioAlbum.py +++ b/src/controller/buffers/audioAlbum.py @@ -3,7 +3,7 @@ import logging import wx import widgetUtils import output -from wxUI.tabs import home +from wxUI.tabs import audioAlbum from .audio import audioBuffer log = logging.getLogger("controller.buffers.audioPlaylist") @@ -13,7 +13,7 @@ class audioAlbumBuffer(audioBuffer): but is deprecated as VK removed its audio support for third party apps.""" def create_tab(self, parent): - self.tab = home.audioAlbumTab(parent) + self.tab = audioAlbum.audioAlbumTab(parent) self.tab.play.Enable(False) self.tab.play_all.Enable(False) self.connect_events() diff --git a/src/controller/buffers/chat.py b/src/controller/buffers/chat.py index d6fa6a3..3861195 100644 --- a/src/controller/buffers/chat.py +++ b/src/controller/buffers/chat.py @@ -11,7 +11,7 @@ import widgetUtils import output from pubsub import pub from vk_api.exceptions import VkApiError -from wxUI.tabs import home +from wxUI.tabs import chat from mysc.thread_utils import call_threaded from wxUI import commonMessages, menus from sessionmanager import renderers @@ -76,7 +76,7 @@ class chatBuffer(homeBuffer): event.Skip() def create_tab(self, parent): - self.tab = home.chatTab(parent) + self.tab = chat.chatTab(parent) self.attachments = list() self.connect_events() self.tab.name = self.name @@ -187,7 +187,7 @@ class chatBuffer(homeBuffer): if i["type"] == "photos_list": continue try: - rendered_object = add_attachment(i) + rendered_object = renderers.add_attachment(i) except: log.exception("Error parsing the following attachment on chat: %r" % (i,)) attachments.append(rendered_object) diff --git a/src/controller/buffers/communityBoard.py b/src/controller/buffers/communityBoard.py index 3d3ddfe..a9add16 100644 --- a/src/controller/buffers/communityBoard.py +++ b/src/controller/buffers/communityBoard.py @@ -8,7 +8,7 @@ import views import interactors import widgetUtils from pubsub import pub -from wxUI.tabs import home +from wxUI.tabs import communityBoard from mysc.thread_utils import call_threaded from .wall import wallBuffer @@ -17,7 +17,7 @@ log = logging.getLogger("controller.buffers.communityBoard") class communityBoardBuffer(wallBuffer): def create_tab(self, parent): - self.tab = home.topicTab(parent) + self.tab = communityBoard.communityBoardTab(parent) self.connect_events() self.tab.name = self.name if "can_create_topic" not in self.session.db["group_info"][self.kwargs["group_id"]*-1] or ("can_create_topic" in self.session.db["group_info"][self.kwargs["group_id"]*-1] and self.session.db["group_info"][self.kwargs["group_id"]*-1]["can_create_topic"] != True): diff --git a/src/controller/buffers/communityDocuments.py b/src/controller/buffers/communityDocuments.py index aa54398..a662822 100644 --- a/src/controller/buffers/communityDocuments.py +++ b/src/controller/buffers/communityDocuments.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import logging -from wxUI.tabs import home +from wxUI.tabs import communityDocuments from .documents import documentsBuffer log = logging.getLogger("controller.buffers.communityDocuments") @@ -9,7 +9,7 @@ class communityDocumentsBuffer(documentsBuffer): can_get_items = True def create_tab(self, parent): - self.tab = home.documentCommunityTab(parent) + self.tab = communityDocuments.communityDocumentsTab(parent) self.connect_events() self.tab.name = self.name if hasattr(self, "can_post") and self.can_post == False and hasattr(self.tab, "post"): diff --git a/src/controller/buffers/communityWall.py b/src/controller/buffers/communityWall.py index 0475d6f..ea28a90 100644 --- a/src/controller/buffers/communityWall.py +++ b/src/controller/buffers/communityWall.py @@ -8,7 +8,7 @@ import interactors import widgetUtils import output from pubsub import pub -from wxUI.tabs import home +from wxUI.tabs import communityWall from mysc.thread_utils import call_threaded from .wall import wallBuffer @@ -21,7 +21,7 @@ class communityWallBuffer(wallBuffer): self.group_id = self.kwargs["owner_id"] def create_tab(self, parent): - self.tab = home.communityTab(parent) + self.tab = communityWall.communityWallTab(parent) self.connect_events() self.tab.name = self.name self.tab.post.Enable(False) diff --git a/src/controller/buffers/documents.py b/src/controller/buffers/documents.py index 0e9c49f..e6049a3 100644 --- a/src/controller/buffers/documents.py +++ b/src/controller/buffers/documents.py @@ -8,7 +8,7 @@ import languageHandler import widgetUtils import output from pubsub import pub -from wxUI.tabs import home +from wxUI.tabs import documents from sessionmanager import utils from mysc.thread_utils import call_threaded from wxUI import menus @@ -20,7 +20,7 @@ class documentsBuffer(wallBuffer): can_get_items = False def create_tab(self, parent): - self.tab = home.documentTab(parent) + self.tab = documents.documentsTab(parent) self.connect_events() self.tab.name = self.name if hasattr(self, "can_post") and self.can_post == False and hasattr(self.tab, "post"): diff --git a/src/controller/buffers/empty.py b/src/controller/buffers/empty.py index bcf7c12..2c6fef0 100644 --- a/src/controller/buffers/empty.py +++ b/src/controller/buffers/empty.py @@ -2,14 +2,14 @@ """ A buffer is a (virtual) list of items. All items belong to a category (wall posts, messages, persons...)""" import logging import output -from wxUI.tabs import home +from wxUI.tabs import empty log = logging.getLogger("controller.buffers.empty") class emptyBuffer(object): def __init__(self, name=None, parent=None, *args, **kwargs): - self.tab = home.empty(parent=parent, name=name) + self.tab = empty.emptyTab(parent=parent, name=name) self.name = name def get_items(self, *args, **kwargs): diff --git a/src/controller/buffers/notification.py b/src/controller/buffers/notification.py index 3e04e14..8d2a9cb 100644 --- a/src/controller/buffers/notification.py +++ b/src/controller/buffers/notification.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import logging -from wxUI.tabs import home +from wxUI.tabs import notification from .wall import wallBuffer log = logging.getLogger("controller.buffers") @@ -8,7 +8,7 @@ log = logging.getLogger("controller.buffers") class notificationBuffer(wallBuffer): def create_tab(self, parent): - self.tab = home.notificationTab(parent) + self.tab = notification.notificationTab(parent) self.connect_events() self.tab.name = self.name diff --git a/src/controller/buffers/people.py b/src/controller/buffers/people.py index d98d4dd..548c153 100644 --- a/src/controller/buffers/people.py +++ b/src/controller/buffers/people.py @@ -11,7 +11,7 @@ import interactors import languageHandler import widgetUtils from pubsub import pub -from wxUI.tabs import home +from wxUI.tabs import people from wxUI.dialogs import timeline from mysc.thread_utils import call_threaded from wxUI import commonMessages, menus @@ -37,7 +37,7 @@ class peopleBuffer(wallBuffer): call_threaded(pub.sendMessage, "post", parent_endpoint="wall", child_endpoint="post", from_buffer=self.name, attachments_list=attachments, post_arguments=post_arguments) def create_tab(self, parent): - self.tab = home.peopleTab(parent) + self.tab = people.peopleTab(parent) self.connect_events() self.tab.name = self.name if hasattr(self, "can_post") and self.can_post == False and hasattr(self.tab, "post"): diff --git a/src/controller/buffers/video.py b/src/controller/buffers/video.py index a9c66a7..d227b99 100644 --- a/src/controller/buffers/video.py +++ b/src/controller/buffers/video.py @@ -4,7 +4,7 @@ import webbrowser import wx import widgetUtils import output -from wxUI.tabs import home +from wxUI.tabs import video from wxUI import commonMessages, menus from controller import selector from .wall import wallBuffer @@ -15,7 +15,7 @@ class videoBuffer(wallBuffer): """ This buffer represents video elements, and it can be used for showing videos for the logged user or someone else.""" def create_tab(self, parent): - self.tab = home.videoTab(parent) + self.tab = video.videoTab(parent) self.connect_events() self.tab.name = self.name if hasattr(self, "can_post") and self.can_post == False and hasattr(self.tab, "post"): diff --git a/src/controller/buffers/videoAlbum.py b/src/controller/buffers/videoAlbum.py index 3b7c590..2297eec 100644 --- a/src/controller/buffers/videoAlbum.py +++ b/src/controller/buffers/videoAlbum.py @@ -3,7 +3,7 @@ import logging import wx import widgetUtils import output -from wxUI.tabs import home +from wxUI.tabs import videoAlbum from .video import videoBuffer log = logging.getLogger("controller.buffers") @@ -11,7 +11,7 @@ log = logging.getLogger("controller.buffers") class videoAlbumBuffer(videoBuffer): def create_tab(self, parent): - self.tab = home.videoAlbumTab(parent) + self.tab = video.videoAlbumTab(parent) self.tab.play.Enable(False) self.connect_events() self.tab.name = self.name diff --git a/src/controller/buffers/wall.py b/src/controller/buffers/wall.py index 5e8c054..2715cad 100644 --- a/src/controller/buffers/wall.py +++ b/src/controller/buffers/wall.py @@ -10,7 +10,6 @@ import widgetUtils import output from pubsub import pub from vk_api.exceptions import VkApiError -from wxUI.tabs import home from mysc.thread_utils import call_threaded from wxUI import commonMessages from .home import homeBuffer diff --git a/src/wxUI/tabs/audio.py b/src/wxUI/tabs/audio.py new file mode 100644 index 0000000..bcdb07e --- /dev/null +++ b/src/wxUI/tabs/audio.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +import wx +import widgetUtils +from .home import homeTab + +class audioTab(homeTab): + def create_list(self): + self.lbl = wx.StaticText(self, wx.NewId(), _("Mu&sic")) + self.list = widgetUtils.multiselectionList(self, *[_("Title"), _("Artist"), _("Duration")], style=wx.LC_REPORT, name=_("Music")) + self.list.set_windows_size(0, 160) + self.list.set_windows_size(1, 380) + self.list.set_windows_size(2, 80) + self.list.set_size() + self.list.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnKeyDown) + + def create_post_buttons(self): + self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) + self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Upload audio")) + self.post.Enable(False) + self.play = wx.Button(self.postBox.GetStaticBox(), -1, _("P&lay")) + self.play_all = wx.Button(self.postBox.GetStaticBox(), -1, _("Play &All")) + self.postBox.Add(self.post, 0, wx.ALL, 5) + self.postBox.Add(self.play, 0, wx.ALL, 5) + self.postBox.Add(self.play_all, 0, wx.ALL, 5) + + def get_file_to_upload(self): + openFileDialog = wx.FileDialog(self, _("Select the audio file to be uploaded"), "", "", _("Audio files (*.mp3)|*.mp3"), wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) + if openFileDialog.ShowModal() == wx.ID_CANCEL: + return None + return openFileDialog.GetPath() + + def get_download_path(self, filename="", multiple=False): + if multiple == False: + d = wx.FileDialog(self, _("Save this file"), "", filename, _("Audio Files(*.mp3)|*.mp3"), wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) + else: + d = wx.DirDialog(None, _("Select a folder to save all files")) + if d.ShowModal() == wx.ID_OK: + return d.GetPath() + d.Destroy() \ No newline at end of file diff --git a/src/wxUI/tabs/audioAlbum.py b/src/wxUI/tabs/audioAlbum.py new file mode 100644 index 0000000..dc426b0 --- /dev/null +++ b/src/wxUI/tabs/audioAlbum.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +import wx +from .audio import audioTab + +class audioAlbumTab(audioTab): + + def create_post_buttons(self): + self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) + self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load buffer")) + self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post")) + self.play = wx.Button(self.postBox.GetStaticBox(), -1, _("P&lay")) + self.play_all = wx.Button(self.postBox.GetStaticBox(), -1, _("Play &All")) + self.postBox.Add(self.load, 0, wx.ALL, 5) + self.postBox.Add(self.post, 0, wx.ALL, 5) + self.postBox.Add(self.play, 0, wx.ALL, 5) + self.postBox.Add(self.play_all, 0, wx.ALL, 5) \ No newline at end of file diff --git a/src/wxUI/tabs/chat.py b/src/wxUI/tabs/chat.py new file mode 100644 index 0000000..5a2d22a --- /dev/null +++ b/src/wxUI/tabs/chat.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +import wx +import widgetUtils +from pubsub import pub + +class chatTab(wx.Panel): + + def insert_attachments(self, attachments): + for i in attachments: + self.attachments.insert_item(False, *i) + + def __init__(self, parent): + super(chatTab, self).__init__(parent=parent) + sizer = wx.BoxSizer(wx.VERTICAL) + sizer.Add(self.create_controls()) + sizer.Add(self.create_attachments(), 0, wx.ALL, 5) + sizer.Add(self.create_chat(), 0, wx.ALL, 5) + self.attachment = wx.Button(self, wx.NewId(), _("Add")) + sizer.Add(self.attachment, 0, wx.ALL, 5) + self.send = wx.Button(self, -1, _("Send")) + sizer.Add(self.send, 0, wx.ALL, 5) + self.SetSizer(sizer) + + def create_controls(self): + lbl1 = wx.StaticText(self, wx.NewId(), _("History")) + self.history = wx.TextCtrl(self, wx.NewId(), style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, 300)) + selectId = wx.NewId() + self.Bind(wx.EVT_MENU, self.onSelect, id=selectId) + self.accel_tbl = wx.AcceleratorTable([(wx.ACCEL_CTRL, ord('A'), selectId)]) + self.SetAcceleratorTable(self.accel_tbl) + box = wx.BoxSizer(wx.HORIZONTAL) + box.Add(lbl1, 0, wx.ALL, 5) + box.Add(self.history, 0, wx.ALL, 5) + return box + + def onSelect(self, event, *args, **kwargs): + if self.history.HasFocus(): + self.history.SelectAll() + else: + self.text.SelectAll() + event.Skip() + + def create_attachments(self): + lbl = wx.StaticText(self, -1, _("Attachments")) + self.attachments = widgetUtils.list(self, _("Type"), _("Title"), style=wx.LC_REPORT) + box = wx.BoxSizer(wx.HORIZONTAL) + box.Add(lbl, 0, wx.ALL, 5) + box.Add(self.attachments.list, 0, wx.ALL, 5) + self.attachments.list.Enable(False) + return box + + def create_chat(self): + lbl2 = wx.StaticText(self, -1, _("Write a message")) + self.text = wx.TextCtrl(self, -1, size=(400, -1), style=wx.TE_MULTILINE) + box = wx.BoxSizer(wx.HORIZONTAL) + box.Add(lbl2, 0, wx.ALL, 20) + box.Add(self.text, 0, wx.ALL, 5) + return box + + def set_focus_function(self, focus_function): + self.history.Bind(wx.EVT_KEY_UP , focus_function) + + def add_message(self, message, reverse=False): + old_line = self.history.GetNumberOfLines()#.count("\n") + point = self.history.GetInsertionPoint() + if reverse: + wx.CallAfter(self.history.SetValue, message+"\n"+self.history.GetValue()) + else: + wx.CallAfter(self.history.AppendText, message+"\n") + wx.CallAfter(self.history.SetInsertionPoint, point) + new_line = self.history.GetNumberOfLines()#.count("\n") + return (old_line, new_line) \ No newline at end of file diff --git a/src/wxUI/tabs/communityBoard.py b/src/wxUI/tabs/communityBoard.py new file mode 100644 index 0000000..916a4cc --- /dev/null +++ b/src/wxUI/tabs/communityBoard.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +import wx +import widgetUtils +from .home import homeTab + +class communityBoardTab(homeTab): + def create_list(self): + self.lbl = wx.StaticText(self, wx.NewId(), _("Topics")) + self.list = widgetUtils.list(self, *[_("User"), _("Title"), _("Posts"), _("Last")], style=wx.LC_REPORT) + self.list.set_windows_size(0, 200) + self.list.set_windows_size(1, 64) + self.list.set_windows_size(2, 15) + self.list.set_windows_size(2, 250) + self.list.set_size() + self.list.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnKeyDown) diff --git a/src/wxUI/tabs/communityDocuments.py b/src/wxUI/tabs/communityDocuments.py new file mode 100644 index 0000000..79e37c3 --- /dev/null +++ b/src/wxUI/tabs/communityDocuments.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +import wx +import widgetUtils +from .home import homeTab + +class communityDocumentsTab(homeTab): + def create_list(self): + self.lbl = wx.StaticText(self, wx.NewId(), _("Documents")) + self.list = widgetUtils.list(self, *[_("User"), _("Title"), _("Type"), _("Size"), _("Date")], style=wx.LC_REPORT) + self.list.set_windows_size(0, 200) + self.list.set_windows_size(1, 128) + self.list.set_windows_size(2, 35) + self.list.set_windows_size(3, 15) + self.list.set_windows_size(4, 25) + self.list.set_size() + self.list.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnKeyDown) + + def get_download_path(self, filename): + saveFileDialog = wx.FileDialog(self, _("Save document as"), "", filename, _("All files (*.*)|*.*"), wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) + if saveFileDialog.ShowModal() == widgetUtils.OK: + return saveFileDialog.GetPath() \ No newline at end of file diff --git a/src/wxUI/tabs/communityWall.py b/src/wxUI/tabs/communityWall.py new file mode 100644 index 0000000..1770f34 --- /dev/null +++ b/src/wxUI/tabs/communityWall.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +import wx +from .home import homeTab + +class communityWallTab(homeTab): + + def create_post_buttons(self): + self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) + self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load buffer")) + self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post in group")) + self.postBox.Add(self.load, 0, wx.ALL, 5) + self.postBox.Add(self.post, 0, wx.ALL, 5) \ No newline at end of file diff --git a/src/wxUI/tabs/documents.py b/src/wxUI/tabs/documents.py new file mode 100644 index 0000000..379f259 --- /dev/null +++ b/src/wxUI/tabs/documents.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +import wx +from .communityDocuments import communityDocumentsTab + +class documentsTab(communityDocumentsTab): + def create_post_buttons(self): + self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) + self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load buffer")) + self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post")) + self.postBox.Add(self.load, 0, wx.ALL, 5) + self.postBox.Add(self.post, 0, wx.ALL, 5) \ No newline at end of file diff --git a/src/wxUI/tabs/empty.py b/src/wxUI/tabs/empty.py new file mode 100644 index 0000000..b24d238 --- /dev/null +++ b/src/wxUI/tabs/empty.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +import wx + +class emptyTab(wx.Panel): + def __init__(self, parent, name): + super(emptyTab, self).__init__(parent=parent, name=name) + self.name = name + sizer = wx.BoxSizer(wx.VERTICAL) + self.SetSizer(sizer) \ No newline at end of file diff --git a/src/wxUI/tabs/notification.py b/src/wxUI/tabs/notification.py new file mode 100644 index 0000000..b33a493 --- /dev/null +++ b/src/wxUI/tabs/notification.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +import wx +import widgetUtils +from pubsub import pub +from .home import homeTab + +class notificationTab(homeTab): + def OnKeyDown(self, ev=None): + pub.sendMessage("show-notification", buffer=self.name) + ev.Skip() + + def create_list(self): + self.lbl = wx.StaticText(self, wx.NewId(), _("Po&sts")) + self.list = widgetUtils.list(self, *[_("Notification"), _("Date")], style=wx.LC_REPORT) + self.list.set_windows_size(0, 190) + self.list.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnKeyDown) \ No newline at end of file diff --git a/src/wxUI/tabs/people.py b/src/wxUI/tabs/people.py new file mode 100644 index 0000000..177945e --- /dev/null +++ b/src/wxUI/tabs/people.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +import wx +import widgetUtils +from pubsub import pub +from .home import homeTab + +class peopleTab(homeTab): + + def create_list(self): + self.lbl = wx.StaticText(self, wx.NewId(), _("Friends")) + self.list = widgetUtils.list(self, *[_("Name"), _("Last seen")], style=wx.LC_REPORT) + self.list.set_windows_size(0, 190) + self.list.set_windows_size(1, 100) + self.list.set_size() + self.list.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnKeyDown) + + def create_post_buttons(self): + self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) + self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post on user's wall")) + self.new_chat = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Send message")) + self.postBox.Add(self.post, 0, wx.ALL, 5) + self.postBox.Add(self.new_chat, 0, wx.ALL, 5) diff --git a/src/wxUI/tabs/photoAlbum.py b/src/wxUI/tabs/photoAlbum.py new file mode 100644 index 0000000..4208ffa --- /dev/null +++ b/src/wxUI/tabs/photoAlbum.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +import wx +import widgetUtils +from pubsub import pub +from .home import homeTab + +class albumTab(homeTab): + def __init__(self, parent): + super(albumTab, self).__init__(parent=parent) + self.name = "albums" + + def OnKeyDown(self, ev=None): + pub.sendMessage("show-album", buffer=self.name) + ev.Skip() + + def create_list(self): + self.list = widgetUtils.list(self, *[_("User"), _("Name"), _("Description"), _("Photos"), _("Created at")], style=wx.LC_REPORT) + self.list.set_windows_size(0, 190) + self.list.set_windows_size(1, 320) + self.list.set_windows_size(2, 513) + self.list.set_windows_size(3, 390) + self.list.set_windows_size(4, 180) + self.list.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnKeyDown) \ No newline at end of file diff --git a/src/wxUI/tabs/video.py b/src/wxUI/tabs/video.py new file mode 100644 index 0000000..3f66800 --- /dev/null +++ b/src/wxUI/tabs/video.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +import wx +import widgetUtils +from .home import homeTab + +class videoTab(homeTab): + def create_list(self): + self.lbl = wx.StaticText(self, wx.NewId(), _("Video&s")) + self.list = widgetUtils.list(self, *[_("Title"), _("Description"), _("Duration")], style=wx.LC_REPORT) + self.list.set_windows_size(0, 160) + self.list.set_windows_size(1, 380) + self.list.set_windows_size(2, 80) + self.list.set_size() + self.list.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnKeyDown) + + def create_post_buttons(self): + self.postBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) + self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post")) + self.play = wx.Button(self.postBox.GetStaticBox(), -1, _("P&lay")) + self.postBox.Add(self.post, 0, wx.ALL, 5) + self.postBox.Add(self.play, 0, wx.ALL, 5) \ No newline at end of file diff --git a/src/wxUI/tabs/videoAlbum.py b/src/wxUI/tabs/videoAlbum.py new file mode 100644 index 0000000..1a808e9 --- /dev/null +++ b/src/wxUI/tabs/videoAlbum.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +import wx +from .video import videoTab + +class videoAlbumTab(videoTab): + + def create_post_buttons(self): + self.postBox = wx.BoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Actions")) + self.load = wx.Button(self.postBox.GetStaticBox(), wx.NewId(), _("Load buffer")) + self.post = wx.Button(self.postBox.GetStaticBox(), -1, _("&Post")) + self.play = wx.Button(self.postBox.GetStaticBox(), -1, _("P&lay")) + self.postBox.Add(self.post, 0, wx.ALL, 5) + self.postBox.Add(self.play, 0, wx.ALL, 5)