def __init__(self): wx.Dialog.__init__(self, None, wx.ID_ANY, _("Source Chooser"), pos=wx.DefaultPosition, size=wx.DefaultSize) # From top to bottom, two video sources; GStreamer pipeline; button vert = wx.BoxSizer(wx.VERTICAL) # row = wx.BoxSizer(wx.HORIZONTAL) self.left, w = self.makeSource(_("Left eye"), "Left eye", self.setLeftToFile) row.Add(w, 1, wx.ALIGN_LEFT | wx.EXPAND) self.right, w = self.makeSource(_("Right eye"), "Right eye", self.setRightToFile) row.Add(w, 1, wx.ALIGN_LEFT | wx.EXPAND) vert.Add(row, 0, wx.ALIGN_LEFT | wx.EXPAND | wx.ALL, 32) # w = wx.StaticText(self, wx.ID_ANY, _("GStreamer pipeline")) vert.Add(w, 0, wx.ALIGN_CENTRE) previous = self.getStoredList("pipeline") currPipe = "" if len(previous) == 0: previous = gstvideo.defaultPipes() self.storeList("pipeline", previous) else: idx = self.getStoredInt("pipeline") if isinstance(idx, int): currPipe = previous[idx] self.pipeline = wx.ComboBox(self, wx.ID_ANY, choices=previous) self.pipeline.SetValue(currPipe) vert.Add(self.pipeline, 0, wx.ALIGN_LEFT | wx.EXPAND | wx.LEFT | wx.RIGHT, 32) # self.ok = wx.Button(self, wx.ID_OK, "OK") self.ok.SetDefault() vert.Add(self.ok, 0, wx.ALIGN_CENTRE | wx.ALL, 32) # self.SetSizer(vert) self.Fit()
def saveChoices(self): """App must invoke this, it's not automatic""" leftURI, rightURI = self.getVideoSources() self.storeListEntry("Left eye", leftURI) self.storeListEntry("Right eye", rightURI) pipe = self.getGSTPipeline() if len(pipe) > 0: self.storeListEntry("pipeline", pipe, len(gstvideo.defaultPipes()))