Added basics for timelines support

This commit is contained in:
2016-04-12 15:36:30 -05:00
parent a4d4148a82
commit 69f4964158
4 changed files with 70 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
import wx
import widgetUtils
class timelineDialog(widgetUtils.BaseDialog):
def __init__(self, users=[]):
super(timelineDialog, self).__init__(parent=None, title=_(u"New timeline for {0}").format(users[0],))
panel = wx.Panel(self)
sizer = wx.BoxSizer(wx.HORIZONTAL)
userLabel = wx.StaticText(panel, -1, _(u"User"))
self.cb = wx.ComboBox(panel, -1, choices=users, value=users[0])
self.cb.SetFocus()
userSizer = wx.BoxSizer()
userSizer.Add(userLabel, 0, wx.ALL, 5)
userSizer.Add(self.cb, 0, wx.ALL, 5)
actionsstatic = wx.StaticBox(panel, label=_(u"Buffer type"))
self.audio = wx.RadioButton(panel, wx.NewId(), _(u"&Audios"), style=wx.RB_GROUP)
radioSizer = wx.StaticBoxSizer(actionsstatic, wx.HORIZONTAL)
radioSizer.Add(self.audio, 0, wx.ALL, 5)
sizer.Add(radioSizer, 0, wx.ALL, 5)
ok = wx.Button(panel, wx.ID_OK, _(u"&OK"))
ok.SetDefault()
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"&Close"))
btnsizer = wx.BoxSizer()
btnsizer.Add(ok, 0, wx.ALL, 5)
btnsizer.Add(cancel, 0, wx.ALL, 5)
sizer.Add(btnsizer, 0, wx.ALL, 5)
panel.SetSizer(sizer)
self.SetClientSize(sizer.CalcMin())
def get_user(self):
return self.cb.GetValue()
def get_buffer_type(self):
if self.audio.GetValue() == True:
return "audio"

View File

@@ -10,7 +10,8 @@ class mainWindow(wx.Frame):
buffer = wx.Menu()
self.new_buffer = wx.Menu()
self.search_audios = self.new_buffer.Append(wx.NewId(), _(u"Audio"))
buffer.AppendMenu(wx.NewId(), _(u"New buffer"), self.new_buffer)
buffer.AppendMenu(wx.NewId(), _(u"Search"), self.new_buffer)
self.timeline = buffer.Append(wx.NewId(), _(u"&New timeline"))
self.update_buffer = buffer.Append(wx.NewId(), _(u"Update current buffer"))
self.load_previous_items = buffer.Append(wx.NewId(), _(u"Load previous items"))
self.remove_buffer_ = buffer.Append(wx.NewId(), _(u"&Remove buffer"))