def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( -1,-1 ), style = wx.TAB_TRAVERSAL, name = wx.EmptyString ): wx.Panel.__init__ ( self, parent, id = id, pos = pos, size = size, style = style, name = name ) fgSizer2 = wx.FlexGridSizer( 1, 0, 0, 0 ) fgSizer2.AddGrowableCol( 0 ) fgSizer2.AddGrowableRow( 0 ) fgSizer2.SetFlexibleDirection( wx.BOTH ) fgSizer2.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_textSubPath = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_READONLY ) self.m_textSubPath.SetMinSize( wx.Size( 380,-1 ) ) fgSizer2.Add( self.m_textSubPath, 0, wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 ) m_choiceSubLangChoices = [] self.m_choiceSubLang = ChoiceLang( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choiceSubLangChoices, 0 ) self.m_choiceSubLang.SetSelection( 0 ) fgSizer2.Add( self.m_choiceSubLang, 0, wx.EXPAND|wx.BOTTOM, 5 ) self.m_buttonSubOpen = wx.BitmapButton( self, wx.ID_OPEN, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW|0 ) self.m_buttonSubOpen.SetBitmap( wx.ArtProvider.GetBitmap( wx.ART_FILE_OPEN, wx.ART_BUTTON ) ) fgSizer2.Add( self.m_buttonSubOpen, 0, wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 ) self.SetSizer( fgSizer2 ) self.Layout() fgSizer2.Fit( self ) # Connect Events self.m_choiceSubLang.Bind( wx.EVT_CHOICE, self.onChoiceSubLang ) self.m_buttonSubOpen.Bind( wx.EVT_BUTTON, self.onButtonSubOpenClick )
class SubtitlePanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(-1, -1), style=wx.TAB_TRAVERSAL) fgSizer2 = wx.FlexGridSizer(1, 0, 0, 0) fgSizer2.AddGrowableCol(0) fgSizer2.AddGrowableRow(0) fgSizer2.SetFlexibleDirection(wx.BOTH) fgSizer2.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_textSubPath = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_READONLY) self.m_textSubPath.SetMinSize(wx.Size(380, -1)) fgSizer2.Add(self.m_textSubPath, 0, wx.EXPAND | wx.BOTTOM | wx.RIGHT | wx.LEFT, 5) m_choiceSubLangChoices = [] self.m_choiceSubLang = ChoiceLang(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choiceSubLangChoices, 0) self.m_choiceSubLang.SetSelection(0) fgSizer2.Add(self.m_choiceSubLang, 0, wx.EXPAND | wx.BOTTOM, 5) self.m_buttonSubOpen = wx.BitmapButton( self, wx.ID_OPEN, wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_BUTTON), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW) fgSizer2.Add(self.m_buttonSubOpen, 0, wx.EXPAND | wx.BOTTOM | wx.RIGHT | wx.LEFT, 5) self.SetSizer(fgSizer2) self.Layout() fgSizer2.Fit(self) # Connect Events self.m_choiceSubLang.Bind(wx.EVT_CHOICE, self.onChoiceSubLang) self.m_buttonSubOpen.Bind(wx.EVT_BUTTON, self.onButtonSubOpenClick) def __del__(self): pass # Virtual event handlers, overide them in your derived class def onChoiceSubLang(self, event): event.Skip() def onButtonSubOpenClick(self, event): event.Skip()
def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=_(u"Batch Processing"), pos=wx.DefaultPosition, size=wx.Size(900, 600), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.SetSizeHints(wx.Size(900, 500), wx.DefaultSize) bSizer1 = wx.BoxSizer(wx.VERTICAL) self.m_panelMain = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) fgSizer1 = wx.FlexGridSizer(0, 1, 0, 0) fgSizer1.AddGrowableCol(0) fgSizer1.AddGrowableRow(0) fgSizer1.SetFlexibleDirection(wx.BOTH) fgSizer1.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_items = BatchList(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LC_ICON) fgSizer1.Add(self.m_items, 0, wx.ALL | wx.EXPAND, 5) self.m_panelSettings = wx.Panel(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) fgSizer2 = wx.FlexGridSizer(0, 1, 0, 0) fgSizer2.AddGrowableCol(0) fgSizer2.SetFlexibleDirection(wx.BOTH) fgSizer2.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) fgSizer3 = wx.FlexGridSizer(1, 0, 0, 0) fgSizer3.AddGrowableCol(5) fgSizer3.AddGrowableRow(0) fgSizer3.SetFlexibleDirection(wx.BOTH) fgSizer3.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_buttonAdd = wx.Button(self.m_panelSettings, wx.ID_ANY, _(u"Add"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_buttonAdd.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_BUTTON)) fgSizer3.Add(self.m_buttonAdd, 0, wx.ALL | wx.EXPAND, 5) self.m_buttonRemove = wx.Button(self.m_panelSettings, wx.ID_ANY, _(u"Remove"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_buttonRemove.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_BUTTON)) self.m_buttonRemove.Enable(False) fgSizer3.Add(self.m_buttonRemove, 0, wx.ALL | wx.EXPAND, 5) self.m_buttonStreamSel = wx.Button(self.m_panelSettings, wx.ID_ANY, _(u"Select stream"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_buttonStreamSel.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_HELP_SETTINGS, wx.ART_BUTTON)) self.m_buttonStreamSel.Enable(False) fgSizer3.Add(self.m_buttonStreamSel, 0, wx.ALL | wx.EXPAND, 5) self.m_buttonOutSel = wx.Button(self.m_panelSettings, wx.ID_ANY, _(u"Select output"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_buttonOutSel.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_HELP_SETTINGS, wx.ART_BUTTON)) self.m_buttonOutSel.Enable(False) fgSizer3.Add(self.m_buttonOutSel, 0, wx.ALL | wx.EXPAND, 5) self.m_buttonAutoSort = wx.Button(self.m_panelSettings, wx.ID_ANY, _(u"Auto sort"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_buttonAutoSort.Enable(False) fgSizer3.Add(self.m_buttonAutoSort, 0, wx.ALL | wx.EXPAND, 5) self.m_panelAutoDrop = wx.Panel(self.m_panelSettings, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.BORDER_THEME | wx.TAB_TRAVERSAL) self.m_panelAutoDrop.SetBackgroundColour( wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)) fgSizer11 = wx.FlexGridSizer(0, 2, 0, 0) fgSizer11.AddGrowableCol(0) fgSizer11.AddGrowableRow(0) fgSizer11.SetFlexibleDirection(wx.BOTH) fgSizer11.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_staticText1 = wx.StaticText( self.m_panelAutoDrop, wx.ID_ANY, _(u"Drop files here to add sorted"), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTER_HORIZONTAL | wx.ST_ELLIPSIZE_END) self.m_staticText1.Wrap(-1) fgSizer11.Add(self.m_staticText1, 0, wx.ALL | wx.EXPAND, 5) self.m_panelAutoDrop.SetSizer(fgSizer11) self.m_panelAutoDrop.Layout() fgSizer11.Fit(self.m_panelAutoDrop) fgSizer3.Add(self.m_panelAutoDrop, 1, wx.EXPAND | wx.ALL, 5) fgSizer2.Add(fgSizer3, 1, wx.EXPAND, 5) self.m_staticline1 = wx.StaticLine(self.m_panelSettings, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL) fgSizer2.Add(self.m_staticline1, 0, wx.EXPAND | wx.ALL, 5) fgSizer4 = wx.FlexGridSizer(0, 4, 0, 0) fgSizer4.AddGrowableCol(2) fgSizer4.SetFlexibleDirection(wx.BOTH) fgSizer4.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_textLang = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"Language:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textLang.Wrap(-1) fgSizer4.Add( self.m_textLang, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.RIGHT | wx.LEFT, 5) fgSizer4.Add((0, 0), 1, wx.EXPAND, 5) m_choiceLangChoices = [] self.m_choiceLang = ChoiceLang(self.m_panelSettings, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choiceLangChoices, 0) self.m_choiceLang.SetSelection(0) self.m_choiceLang.Enable(False) fgSizer4.Add( self.m_choiceLang, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.TOP | wx.RIGHT | wx.LEFT, 5) fgSizer4.Add((0, 0), 1, wx.EXPAND, 5) self.m_textMaxDistLabel = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"Max adjustment:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textMaxDistLabel.Wrap(-1) fgSizer4.Add( self.m_textMaxDistLabel, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_buttonMaxDistInfo = PopupInfoButton( self.m_panelSettings, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW | 0 | wx.BORDER_NONE) self.m_buttonMaxDistInfo.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_TIP, wx.ART_BUTTON)) fgSizer4.Add(self.m_buttonMaxDistInfo, 0, wx.ALIGN_CENTER_VERTICAL, 5) self.m_sliderMaxDist = wx.Slider(self.m_panelSettings, wx.ID_ANY, 30, 5, 180, wx.DefaultPosition, wx.Size(-1, -1), wx.SL_HORIZONTAL) fgSizer4.Add( self.m_sliderMaxDist, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_textMaxDist = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"999 min"), wx.DefaultPosition, wx.DefaultSize, wx.ST_NO_AUTORESIZE) self.m_textMaxDist.Wrap(-1) fgSizer4.Add( self.m_textMaxDist, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_textEffortLabel = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"Effort:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textEffortLabel.Wrap(-1) fgSizer4.Add(self.m_textEffortLabel, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5) self.m_buttonEffortInfo = PopupInfoButton( self.m_panelSettings, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW | 0 | wx.BORDER_NONE) self.m_buttonEffortInfo.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_TIP, wx.ART_BUTTON)) fgSizer4.Add(self.m_buttonEffortInfo, 0, wx.ALIGN_CENTER_VERTICAL, 5) self.m_sliderEffort = wx.Slider(self.m_panelSettings, wx.ID_ANY, 50, 0, 100, wx.DefaultPosition, wx.Size(-1, -1), wx.SL_HORIZONTAL) fgSizer4.Add(self.m_sliderEffort, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.ALL, 5) self.m_textEffort = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"0.50"), wx.DefaultPosition, wx.DefaultSize, wx.ST_NO_AUTORESIZE) self.m_textEffort.Wrap(-1) fgSizer4.Add(self.m_textEffort, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) fgSizer2.Add(fgSizer4, 1, wx.EXPAND, 5) self.m_panelSettings.SetSizer(fgSizer2) self.m_panelSettings.Layout() fgSizer2.Fit(self.m_panelSettings) fgSizer1.Add(self.m_panelSettings, 0, wx.EXPAND, 5) self.m_panelProgress = wx.Panel(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) self.m_panelProgress.Hide() fgSizer5 = wx.FlexGridSizer(0, 1, 0, 0) fgSizer5.AddGrowableCol(0) fgSizer5.SetFlexibleDirection(wx.BOTH) fgSizer5.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_panelSyncDone = wx.Panel(self.m_panelProgress, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) self.m_panelSyncDone.Hide() fgSizer6 = wx.FlexGridSizer(0, 1, 0, 0) fgSizer6.AddGrowableCol(0) fgSizer6.SetFlexibleDirection(wx.BOTH) fgSizer6.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) fgSizer7 = wx.FlexGridSizer(1, 0, 0, 0) fgSizer7.SetFlexibleDirection(wx.BOTH) fgSizer7.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_buttonEditFailed = wx.Button(self.m_panelSyncDone, wx.ID_ANY, _(u"Edit failed tasks"), wx.DefaultPosition, wx.DefaultSize, 0) fgSizer7.Add(self.m_buttonEditFailed, 0, wx.ALL, 5) self.m_buttonEditAll = wx.Button(self.m_panelSyncDone, wx.ID_ANY, _(u"Edit all tasks"), wx.DefaultPosition, wx.DefaultSize, 0) fgSizer7.Add(self.m_buttonEditAll, 0, wx.ALL, 5) self.m_buttonEditNew = wx.Button(self.m_panelSyncDone, wx.ID_ANY, _(u"New synchronization"), wx.DefaultPosition, wx.DefaultSize, 0) fgSizer7.Add(self.m_buttonEditNew, 0, wx.ALL, 5) fgSizer6.Add(fgSizer7, 1, wx.EXPAND, 5) self.m_staticline2 = wx.StaticLine(self.m_panelSyncDone, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL) fgSizer6.Add(self.m_staticline2, 0, wx.EXPAND | wx.ALL, 5) self.m_panelSyncDone.SetSizer(fgSizer6) self.m_panelSyncDone.Layout() fgSizer6.Fit(self.m_panelSyncDone) fgSizer5.Add(self.m_panelSyncDone, 1, wx.EXPAND, 5) fgSizer8 = wx.FlexGridSizer(0, 2, 0, 0) fgSizer8.AddGrowableCol(1) fgSizer8.SetFlexibleDirection(wx.BOTH) fgSizer8.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_textStatus = wx.StaticText(self.m_panelProgress, wx.ID_ANY, _(u"Status:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textStatus.Wrap(-1) fgSizer8.Add(self.m_textStatus, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.ALL, 5) fgSizer9 = wx.FlexGridSizer(1, 0, 0, 0) fgSizer9.SetFlexibleDirection(wx.BOTH) fgSizer9.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_bitmapStatus = wx.StaticBitmap(self.m_panelProgress, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, 0) self.m_bitmapStatus.Hide() fgSizer9.Add(self.m_bitmapStatus, 0, wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.BOTTOM | wx.LEFT, 5) self.m_textStatusVal = wx.StaticText(self.m_panelProgress, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0) self.m_textStatusVal.Wrap(-1) fgSizer9.Add(self.m_textStatusVal, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5) fgSizer8.Add(fgSizer9, 1, wx.EXPAND, 5) self.m_textCurrentProgress = wx.StaticText(self.m_panelProgress, wx.ID_ANY, _(u"Current file:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textCurrentProgress.Wrap(-1) fgSizer8.Add( self.m_textCurrentProgress, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_gaugeCurrentProgress = wx.Gauge(self.m_panelProgress, wx.ID_ANY, 100, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL) self.m_gaugeCurrentProgress.SetValue(0) fgSizer8.Add( self.m_gaugeCurrentProgress, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_textTotalProgress = wx.StaticText(self.m_panelProgress, wx.ID_ANY, _(u"Total progress:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textTotalProgress.Wrap(-1) fgSizer8.Add(self.m_textTotalProgress, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT, 5) self.m_gaugeTotalProgress = wx.Gauge(self.m_panelProgress, wx.ID_ANY, 100, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL) self.m_gaugeTotalProgress.SetValue(0) fgSizer8.Add(self.m_gaugeTotalProgress, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5) fgSizer5.Add(fgSizer8, 1, wx.EXPAND, 5) self.m_panelProgress.SetSizer(fgSizer5) self.m_panelProgress.Layout() fgSizer5.Fit(self.m_panelProgress) fgSizer1.Add(self.m_panelProgress, 1, wx.EXPAND | wx.ALL, 5) self.m_staticline3 = wx.StaticLine(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL) fgSizer1.Add(self.m_staticline3, 0, wx.EXPAND | wx.ALL, 5) fgSizer10 = wx.FlexGridSizer(1, 0, 0, 0) fgSizer10.SetFlexibleDirection(wx.BOTH) fgSizer10.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_buttonClose = wx.Button(self.m_panelMain, wx.ID_CLOSE, _(u"Close"), wx.DefaultPosition, wx.DefaultSize, 0) fgSizer10.Add(self.m_buttonClose, 1, wx.ALL | wx.EXPAND, 5) self.m_buttonStop = wx.Button(self.m_panelMain, wx.ID_STOP, _(u"Stop"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_buttonStop.Hide() fgSizer10.Add(self.m_buttonStop, 1, wx.ALL | wx.EXPAND, 5) self.m_buttonStart = wx.Button(self.m_panelMain, wx.ID_OK, _(u"Start"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_buttonStart.SetDefault() self.m_buttonStart.Enable(False) fgSizer10.Add(self.m_buttonStart, 1, wx.ALL | wx.EXPAND, 5) fgSizer1.Add(fgSizer10, 0, wx.ALIGN_RIGHT, 5) self.m_panelMain.SetSizer(fgSizer1) self.m_panelMain.Layout() fgSizer1.Fit(self.m_panelMain) bSizer1.Add(self.m_panelMain, 1, wx.EXPAND, 5) self.SetSizer(bSizer1) self.Layout() self.m_menubar = wx.MenuBar(0) self.m_menuFile = wx.Menu() self.m_menuItemNew = wx.MenuItem(self.m_menuFile, wx.ID_ANY, _(u"&New") + u"\t" + u"CTRL+N", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItemNew.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_MENU)) self.m_menuFile.Append(self.m_menuItemNew) self.m_menuFile.AppendSeparator() self.m_menuItemAddAuto = wx.MenuItem( self.m_menuFile, wx.ID_ANY, _(u"&Add files (auto sort)") + u"\t" + u"CTRL+O", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItemAddAuto.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_MENU)) self.m_menuFile.Append(self.m_menuItemAddAuto) self.m_menuItemAddSubs = wx.MenuItem( self.m_menuFile, wx.ID_ANY, _(u"Add &subtitles") + u"\t" + u"F3", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItemAddSubs.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_MENU)) self.m_menuFile.Append(self.m_menuItemAddSubs) self.m_menuItemAddRefs = wx.MenuItem( self.m_menuFile, wx.ID_ANY, _(u"Add &references") + u"\t" + u"F4", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItemAddRefs.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_MENU)) self.m_menuFile.Append(self.m_menuItemAddRefs) self.m_menuItemAddFolder = wx.MenuItem( self.m_menuFile, wx.ID_ANY, _(u"Add &folder") + u"\t" + u"F2", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItemAddFolder.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_FOLDER, wx.ART_MENU)) self.m_menuFile.Append(self.m_menuItemAddFolder) self.m_menuFile.AppendSeparator() self.m_menuItemImport = wx.MenuItem(self.m_menuFile, wx.ID_ANY, _(u"&Import list") + u"\t" + u"F9", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItemImport.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_MENU)) self.m_menuFile.Append(self.m_menuItemImport) self.m_menuItemExport = wx.MenuItem( self.m_menuFile, wx.ID_ANY, _(u"&Export list") + u"\t" + u"F10", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItemExport.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_MENU)) self.m_menuFile.Append(self.m_menuItemExport) self.m_menuFile.AppendSeparator() self.m_menuItemClose = wx.MenuItem(self.m_menuFile, wx.ID_ANY, _(u"&Close"), wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItemClose.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_QUIT, wx.ART_MENU)) self.m_menuFile.Append(self.m_menuItemClose) self.m_menubar.Append(self.m_menuFile, _(u"&File")) self.m_menuEdit = wx.Menu() self.m_menuItemAutoSort = wx.MenuItem( self.m_menuEdit, wx.ID_ANY, _(u"Au&to sort") + u"\t" + u"CTRL+S", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuEdit.Append(self.m_menuItemAutoSort) self.m_menuItemAutoSort.Enable(False) self.m_menuItemRemove = wx.MenuItem(self.m_menuEdit, wx.ID_ANY, _(u"&Remove") + u"\t" + u"DELETE", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItemRemove.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU)) self.m_menuEdit.Append(self.m_menuItemRemove) self.m_menuItemRemove.Enable(False) self.m_menuEdit.AppendSeparator() self.m_menuItemSelectAll = wx.MenuItem( self.m_menuEdit, wx.ID_ANY, _(u"Select &all") + u"\t" + u"CTRL+A", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuEdit.Append(self.m_menuItemSelectAll) self.m_menuItemSelectSubs = wx.MenuItem( self.m_menuEdit, wx.ID_ANY, _(u"Select all &subtitles") + u"\t" + u"CTRL+1", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuEdit.Append(self.m_menuItemSelectSubs) self.m_menuItemSelectRefs = wx.MenuItem( self.m_menuEdit, wx.ID_ANY, _(u"Select all &references") + u"\t" + u"CTRL+2", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuEdit.Append(self.m_menuItemSelectRefs) self.m_menuItemSelectOuts = wx.MenuItem( self.m_menuEdit, wx.ID_ANY, _(u"Select all o&utputs") + u"\t" + u"CTRL+3", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuEdit.Append(self.m_menuItemSelectOuts) self.m_menuEdit.AppendSeparator() self.m_menuItemStreamSel = wx.MenuItem( self.m_menuEdit, wx.ID_ANY, _(u"Set &input stream") + u"\t" + u"F5", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuEdit.Append(self.m_menuItemStreamSel) self.m_menuItemStreamSel.Enable(False) self.m_menuItemOutSel = wx.MenuItem( self.m_menuEdit, wx.ID_ANY, _(u"Set &output location") + u"\t" + u"F6", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuEdit.Append(self.m_menuItemOutSel) self.m_menuItemProps = wx.MenuItem(self.m_menuEdit, wx.ID_ANY, _(u"&Propeties") + u"\t" + u"F8", wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItemProps.SetBitmap( wx.ArtProvider.GetBitmap(wx.ART_HELP_SETTINGS, wx.ART_MENU)) self.m_menuEdit.Append(self.m_menuItemProps) self.m_menuItemProps.Enable(False) self.m_menubar.Append(self.m_menuEdit, _(u"&Edit")) self.m_menuHelp = wx.Menu() self.m_menuItemAbout = wx.MenuItem(self.m_menuHelp, wx.ID_ABOUT, _(u"&About"), wx.EmptyString, wx.ITEM_NORMAL) self.m_menuHelp.Append(self.m_menuItemAbout) self.m_menubar.Append(self.m_menuHelp, _(u"&Help")) self.SetMenuBar(self.m_menubar) # Connect Events self.Bind(wx.EVT_CLOSE, self.onClose) self.m_choiceLang.Bind(wx.EVT_CHOICE, self.onChoiceLangChoice) self.m_sliderMaxDist.Bind(wx.EVT_SCROLL, self.onSliderMaxDistScroll) self.m_sliderEffort.Bind(wx.EVT_SCROLL, self.onSliderEffortScroll) self.m_buttonEditFailed.Bind(wx.EVT_BUTTON, self.onButtonEditFailedClick) self.m_buttonEditAll.Bind(wx.EVT_BUTTON, self.onButtonEditAllClick) self.m_buttonEditNew.Bind(wx.EVT_BUTTON, self.onButtonEditNewClick) self.m_buttonClose.Bind(wx.EVT_BUTTON, self.onButtonCloseClick) self.m_buttonStop.Bind(wx.EVT_BUTTON, self.onButtonStopClick) self.m_buttonStart.Bind(wx.EVT_BUTTON, self.onButtonStartClick) self.Bind(wx.EVT_MENU, self.onMenuNewClick, id=self.m_menuItemNew.GetId()) self.Bind(wx.EVT_MENU, self.onMenuAddFolderClick, id=self.m_menuItemAddFolder.GetId()) self.Bind(wx.EVT_MENU, self.onMenuImportClick, id=self.m_menuItemImport.GetId()) self.Bind(wx.EVT_MENU, self.onMenuExportClick, id=self.m_menuItemExport.GetId()) self.Bind(wx.EVT_MENU, self.onMenuPropsClick, id=self.m_menuItemProps.GetId()) self.Bind(wx.EVT_MENU, self.onMenuAboutClick, id=self.m_menuItemAbout.GetId())
def __init__(self, parent): wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=_(u"Batch Processing"), pos=wx.DefaultPosition, size=wx.Size(900, 600), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) self.SetSizeHints(wx.Size(900, 500), wx.DefaultSize) bSizer1 = wx.BoxSizer(wx.VERTICAL) self.m_panelMain = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) fgSizer1 = wx.FlexGridSizer(0, 1, 0, 0) fgSizer1.AddGrowableCol(0) fgSizer1.AddGrowableRow(1) fgSizer1.SetFlexibleDirection(wx.BOTH) fgSizer1.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) fgSizer2 = wx.FlexGridSizer(0, 3, 0, 0) fgSizer2.AddGrowableCol(0) fgSizer2.AddGrowableCol(1) fgSizer2.AddGrowableCol(2) fgSizer2.SetFlexibleDirection(wx.VERTICAL) fgSizer2.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_textSubs = wx.StaticText(self.m_panelMain, wx.ID_ANY, _(u"Subtitles:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textSubs.Wrap(-1) self.m_textSubs.SetFont( wx.Font(wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, wx.EmptyString)) fgSizer2.Add(self.m_textSubs, 0, wx.TOP | wx.RIGHT | wx.LEFT | wx.EXPAND, 5) self.m_textRefs = wx.StaticText(self.m_panelMain, wx.ID_ANY, _(u"References:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textRefs.Wrap(-1) self.m_textRefs.SetFont( wx.Font(wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, wx.EmptyString)) fgSizer2.Add(self.m_textRefs, 0, wx.TOP | wx.RIGHT | wx.LEFT | wx.EXPAND, 5) self.m_textOuts = wx.StaticText(self.m_panelMain, wx.ID_ANY, _(u"Outputs:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textOuts.Wrap(-1) self.m_textOuts.SetFont( wx.Font(wx.NORMAL_FONT.GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, wx.EmptyString)) fgSizer2.Add(self.m_textOuts, 0, wx.TOP | wx.RIGHT | wx.LEFT | wx.EXPAND, 5) self.m_toolBarSub = wx.ToolBar(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TB_HORIZONTAL) self.m_toolSubAdd = self.m_toolBarSub.AddLabelTool( wx.ID_ANY, _(u"Add files"), wx.ArtProvider.GetBitmap(wx.ART_PLUS, wx.ART_TOOLBAR), wx.NullBitmap, wx.ITEM_NORMAL, _(u"Add files"), wx.EmptyString, None) self.m_toolSubRemove = self.m_toolBarSub.AddLabelTool( wx.ID_ANY, _(u"Remove files"), wx.ArtProvider.GetBitmap(wx.ART_MINUS, wx.ART_TOOLBAR), wx.NullBitmap, wx.ITEM_NORMAL, _(u"Remove files"), wx.EmptyString, None) self.m_toolSubSelStream = self.m_toolBarSub.AddLabelTool( wx.ID_ANY, _(u"Select stream"), wx.ArtProvider.GetBitmap(wx.ART_LIST_VIEW, wx.ART_TOOLBAR), wx.NullBitmap, wx.ITEM_NORMAL, _(u"Select stream"), wx.EmptyString, None) self.m_toolBarSub.Realize() fgSizer2.Add(self.m_toolBarSub, 0, wx.EXPAND, 5) self.m_toolBarRef = wx.ToolBar(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TB_HORIZONTAL) self.m_toolRefAdd = self.m_toolBarRef.AddLabelTool( wx.ID_ANY, _(u"Add files"), wx.ArtProvider.GetBitmap(wx.ART_PLUS, wx.ART_TOOLBAR), wx.NullBitmap, wx.ITEM_NORMAL, _(u"Add files"), wx.EmptyString, None) self.m_toolRefRemove = self.m_toolBarRef.AddLabelTool( wx.ID_ANY, _(u"Remove files"), wx.ArtProvider.GetBitmap(wx.ART_MINUS, wx.ART_TOOLBAR), wx.NullBitmap, wx.ITEM_NORMAL, _(u"Remove files"), wx.EmptyString, None) self.m_toolRefSelStream = self.m_toolBarRef.AddLabelTool( wx.ID_ANY, _(u"Select stream"), wx.ArtProvider.GetBitmap(wx.ART_LIST_VIEW, wx.ART_TOOLBAR), wx.NullBitmap, wx.ITEM_NORMAL, _(u"Select stream"), wx.EmptyString, None) self.m_toolBarRef.Realize() fgSizer2.Add(self.m_toolBarRef, 0, wx.EXPAND, 5) self.m_toolBarOut = wx.ToolBar(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TB_HORIZONTAL) self.m_toolOutPattern = self.m_toolBarOut.AddLabelTool( wx.ID_ANY, _(u"Set file names"), wx.ArtProvider.GetBitmap(wx.ART_LIST_VIEW, wx.ART_TOOLBAR), wx.NullBitmap, wx.ITEM_NORMAL, _(u"Set file names"), wx.EmptyString, None) self.m_toolBarOut.Realize() fgSizer2.Add(self.m_toolBarOut, 0, wx.EXPAND, 5) fgSizer1.Add(fgSizer2, 1, wx.EXPAND, 5) self.m_items = MultiColumnView(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.FULL_REPAINT_ON_RESIZE | wx.VSCROLL) self.m_items.SetScrollRate(5, 5) self.m_items.SetForegroundColour( wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)) self.m_items.SetBackgroundColour( wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)) fgSizer1.Add(self.m_items, 1, wx.EXPAND | wx.BOTTOM | wx.RIGHT | wx.LEFT, 5) fgSizer3 = wx.FlexGridSizer(1, 0, 0, 0) fgSizer3.AddGrowableCol(1) fgSizer3.SetFlexibleDirection(wx.BOTH) fgSizer3.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_textSelectedLabel = wx.StaticText(self.m_panelMain, wx.ID_ANY, _(u"selected:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textSelectedLabel.Wrap(-1) fgSizer3.Add(self.m_textSelectedLabel, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL | wx.ALIGN_RIGHT, 5) self.m_textSelected = wx.TextCtrl(self.m_panelMain, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_READONLY) fgSizer3.Add(self.m_textSelected, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5) self.m_buttonSelStream = wx.Button(self.m_panelMain, wx.ID_ANY, _(u"Select Stream"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_buttonSelStream.Enable(False) fgSizer3.Add(self.m_buttonSelStream, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) fgSizer1.Add(fgSizer3, 1, wx.EXPAND, 5) fgSizer4 = wx.FlexGridSizer(0, 1, 0, 0) fgSizer4.AddGrowableCol(0) fgSizer4.SetFlexibleDirection(wx.BOTH) fgSizer4.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_panelSettings = wx.Panel(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) fgSizer5 = wx.FlexGridSizer(0, 3, 0, 0) fgSizer5.AddGrowableCol(2) fgSizer5.SetFlexibleDirection(wx.BOTH) fgSizer5.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) fgSizer6 = wx.FlexGridSizer(0, 2, 0, 0) fgSizer6.AddGrowableCol(1) fgSizer6.SetFlexibleDirection(wx.BOTH) fgSizer6.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_textLang = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"Language:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textLang.Wrap(-1) fgSizer6.Add( self.m_textLang, 0, wx.TOP | wx.RIGHT | wx.LEFT | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5) m_choiceLangChoices = [] self.m_choiceLang = ChoiceLang(self.m_panelSettings, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choiceLangChoices, 0) self.m_choiceLang.SetSelection(0) self.m_choiceLang.Enable(False) fgSizer6.Add( self.m_choiceLang, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_textEnc = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"Character encoding:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textEnc.Wrap(-1) fgSizer6.Add(self.m_textEnc, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.ALL, 5) m_choiceEncChoices = [] self.m_choiceEnc = ChoiceCharEnc(self.m_panelSettings, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choiceEncChoices, 0) self.m_choiceEnc.SetSelection(0) self.m_choiceEnc.Enable(False) fgSizer6.Add(self.m_choiceEnc, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5) fgSizer5.Add(fgSizer6, 1, wx.EXPAND, 5) self.m_staticline3 = wx.StaticLine(self.m_panelSettings, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_VERTICAL) fgSizer5.Add(self.m_staticline3, 0, wx.EXPAND | wx.ALL, 5) fgSizer7 = wx.FlexGridSizer(0, 4, 0, 0) fgSizer7.AddGrowableCol(2) fgSizer7.SetFlexibleDirection(wx.BOTH) fgSizer7.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_textMaxDistLabel = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"Max adjustment:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textMaxDistLabel.Wrap(-1) fgSizer7.Add( self.m_textMaxDistLabel, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_buttonMaxDistInfo = PopupInfoButton( self.m_panelSettings, wx.ID_ANY, wx.ArtProvider.GetBitmap(wx.ART_TIP, wx.ART_BUTTON), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW | wx.NO_BORDER) fgSizer7.Add( self.m_buttonMaxDistInfo, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5) self.m_sliderMaxDist = wx.Slider(self.m_panelSettings, wx.ID_ANY, 30, 5, 180, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL) fgSizer7.Add( self.m_sliderMaxDist, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND | wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_textMaxDist = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"999 min"), wx.DefaultPosition, wx.DefaultSize, wx.ST_NO_AUTORESIZE) self.m_textMaxDist.Wrap(-1) fgSizer7.Add( self.m_textMaxDist, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_textEffortLabel = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"Effort:"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textEffortLabel.Wrap(-1) fgSizer7.Add(self.m_textEffortLabel, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5) self.m_buttonEffortInfo = PopupInfoButton( self.m_panelSettings, wx.ID_ANY, wx.ArtProvider.GetBitmap(wx.ART_TIP, wx.ART_BUTTON), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW | wx.NO_BORDER) fgSizer7.Add( self.m_buttonEffortInfo, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, 5) self.m_sliderEffort = wx.Slider(self.m_panelSettings, wx.ID_ANY, 50, 0, 100, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL) fgSizer7.Add( self.m_sliderEffort, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.ALL, 5) self.m_textEffort = wx.StaticText(self.m_panelSettings, wx.ID_ANY, _(u"0.50"), wx.DefaultPosition, wx.DefaultSize, wx.ST_NO_AUTORESIZE) self.m_textEffort.Wrap(-1) fgSizer7.Add(self.m_textEffort, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) fgSizer5.Add(fgSizer7, 1, wx.EXPAND, 5) self.m_panelSettings.SetSizer(fgSizer5) self.m_panelSettings.Layout() fgSizer5.Fit(self.m_panelSettings) fgSizer4.Add(self.m_panelSettings, 0, wx.EXPAND, 5) self.m_panelProgress = wx.Panel(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) self.m_panelProgress.Hide() fgSizer9 = wx.FlexGridSizer(0, 1, 0, 0) fgSizer9.AddGrowableCol(0) fgSizer9.AddGrowableRow(0) fgSizer9.SetFlexibleDirection(wx.BOTH) fgSizer9.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_textStatus = wx.StaticText(self.m_panelProgress, wx.ID_ANY, _(u"Initializing..."), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textStatus.Wrap(-1) fgSizer9.Add(self.m_textStatus, 0, wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_gaugeProgress = wx.Gauge(self.m_panelProgress, wx.ID_ANY, 100, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL) self.m_gaugeProgress.SetValue(0) fgSizer9.Add(self.m_gaugeProgress, 0, wx.ALL | wx.EXPAND, 5) self.m_staticline2 = wx.StaticLine(self.m_panelProgress, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL) fgSizer9.Add(self.m_staticline2, 0, wx.EXPAND | wx.ALL, 5) fgSizer10 = wx.FlexGridSizer(0, 2, 0, 0) fgSizer10.AddGrowableCol(0) fgSizer10.AddGrowableCol(1) fgSizer10.SetFlexibleDirection(wx.BOTH) fgSizer10.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) fgSizer11 = wx.FlexGridSizer(0, 1, 0, 0) fgSizer11.AddGrowableCol(0) fgSizer11.SetFlexibleDirection(wx.BOTH) fgSizer11.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) fgSizer12 = wx.FlexGridSizer(1, 0, 0, 0) fgSizer12.AddGrowableCol(2) fgSizer12.AddGrowableRow(0) fgSizer12.SetFlexibleDirection(wx.BOTH) fgSizer12.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_bitmapTick = wx.StaticBitmap( self.m_panelProgress, wx.ID_ANY, wx.ArtProvider.GetBitmap(wx.ART_TICK_MARK, wx.ART_MENU), wx.DefaultPosition, wx.DefaultSize, 0) self.m_bitmapTick.Hide() fgSizer12.Add(self.m_bitmapTick, 0, wx.EXPAND | wx.TOP | wx.LEFT, 5) self.m_bitmapCross = wx.StaticBitmap( self.m_panelProgress, wx.ID_ANY, wx.ArtProvider.GetBitmap(wx.ART_CROSS_MARK, wx.ART_MENU), wx.DefaultPosition, wx.DefaultSize, 0) self.m_bitmapCross.Hide() fgSizer12.Add(self.m_bitmapCross, 0, wx.TOP | wx.LEFT, 5) self.m_textFileStatus = wx.StaticText(self.m_panelProgress, wx.ID_ANY, _(u"Initializing..."), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textFileStatus.Wrap(-1) fgSizer12.Add(self.m_textFileStatus, 0, wx.TOP | wx.RIGHT | wx.LEFT, 5) fgSizer11.Add(fgSizer12, 1, wx.EXPAND, 5) self.m_gaugeFileProgress = wx.Gauge(self.m_panelProgress, wx.ID_ANY, 100, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL) self.m_gaugeFileProgress.SetValue(0) fgSizer11.Add(self.m_gaugeFileProgress, 0, wx.ALL | wx.EXPAND, 5) fgSizer10.Add(fgSizer11, 1, wx.EXPAND, 5) self.m_panelError = wx.Panel(self.m_panelProgress, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) self.m_panelError.Hide() fgSizer13 = wx.FlexGridSizer(0, 2, 0, 0) fgSizer13.AddGrowableCol(1) fgSizer13.AddGrowableRow(0) fgSizer13.SetFlexibleDirection(wx.BOTH) fgSizer13.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_bitmapErrorIcon = wx.StaticBitmap( self.m_panelError, wx.ID_ANY, wx.ArtProvider.GetBitmap(wx.ART_WARNING, wx.ART_CMN_DIALOG), wx.DefaultPosition, wx.DefaultSize, 0) fgSizer13.Add( self.m_bitmapErrorIcon, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.TOP | wx.BOTTOM | wx.LEFT, 5) fgSizer14 = wx.FlexGridSizer(0, 1, 0, 0) fgSizer14.AddGrowableCol(0) fgSizer14.AddGrowableRow(0) fgSizer14.AddGrowableRow(1) fgSizer14.SetFlexibleDirection(wx.BOTH) fgSizer14.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_textErrorMsg = wx.StaticText(self.m_panelError, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0) self.m_textErrorMsg.Wrap(-1) fgSizer14.Add(self.m_textErrorMsg, 0, wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.RIGHT | wx.LEFT, 5) self.m_textErrorDetails = wx.StaticText(self.m_panelError, wx.ID_ANY, _(u"[details]"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_textErrorDetails.Wrap(-1) self.m_textErrorDetails.SetForegroundColour( wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHT)) fgSizer14.Add( self.m_textErrorDetails, 0, wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM | wx.RIGHT | wx.LEFT, 5) fgSizer13.Add(fgSizer14, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5) self.m_panelError.SetSizer(fgSizer13) self.m_panelError.Layout() fgSizer13.Fit(self.m_panelError) fgSizer10.Add(self.m_panelError, 0, wx.ALIGN_BOTTOM | wx.EXPAND | wx.LEFT, 20) fgSizer9.Add(fgSizer10, 1, wx.EXPAND, 5) self.m_panelProgress.SetSizer(fgSizer9) self.m_panelProgress.Layout() fgSizer9.Fit(self.m_panelProgress) fgSizer4.Add(self.m_panelProgress, 1, wx.EXPAND | wx.ALL, 5) fgSizer1.Add(fgSizer4, 1, wx.EXPAND, 5) self.m_staticline1 = wx.StaticLine(self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL) fgSizer1.Add(self.m_staticline1, 0, wx.EXPAND | wx.ALL, 5) fgSizer15 = wx.FlexGridSizer(1, 0, 0, 0) fgSizer15.SetFlexibleDirection(wx.BOTH) fgSizer15.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED) self.m_buttonMenu = wx.Button(self.m_panelMain, wx.ID_ANY, _(u"Menu"), wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT) self.m_menu = wx.Menu() self.m_menuItemAddFiles = wx.MenuItem(self.m_menu, wx.ID_ANY, _(u"Add files"), wx.EmptyString, wx.ITEM_NORMAL) self.m_menu.Append(self.m_menuItemAddFiles) self.m_menu.AppendSeparator() self.m_menuItemImportList = wx.MenuItem(self.m_menu, wx.ID_ANY, _(u"Import file list"), wx.EmptyString, wx.ITEM_NORMAL) self.m_menu.Append(self.m_menuItemImportList) self.m_menuItemExportList = wx.MenuItem(self.m_menu, wx.ID_ANY, _(u"Export file list"), wx.EmptyString, wx.ITEM_NORMAL) self.m_menu.Append(self.m_menuItemExportList) self.m_menu.AppendSeparator() self.m_menuItemClearList = wx.MenuItem(self.m_menu, wx.ID_ANY, _(u"Clear file list"), wx.EmptyString, wx.ITEM_NORMAL) self.m_menu.Append(self.m_menuItemClearList) self.m_buttonMenu.Bind(wx.EVT_RIGHT_DOWN, self.m_buttonMenuOnContextMenu) fgSizer15.Add(self.m_buttonMenu, 1, wx.ALL | wx.EXPAND, 5) self.m_buttonClose = wx.Button(self.m_panelMain, wx.ID_CLOSE, _(u"Close"), wx.DefaultPosition, wx.DefaultSize, 0) fgSizer15.Add(self.m_buttonClose, 1, wx.ALL | wx.EXPAND, 5) self.m_buttonStart = wx.Button(self.m_panelMain, wx.ID_OK, _(u"Start"), wx.DefaultPosition, wx.DefaultSize, 0) self.m_buttonStart.SetDefault() self.m_buttonStart.Enable(False) fgSizer15.Add(self.m_buttonStart, 1, wx.ALL | wx.EXPAND, 5) fgSizer1.Add(fgSizer15, 0, wx.ALIGN_RIGHT, 5) self.m_panelMain.SetSizer(fgSizer1) self.m_panelMain.Layout() fgSizer1.Fit(self.m_panelMain) bSizer1.Add(self.m_panelMain, 1, wx.EXPAND, 5) self.SetSizer(bSizer1) self.Layout() self.m_menuItems = wx.Menu() self.m_menuItemsRemove = wx.MenuItem(self.m_menuItems, wx.ID_ANY, _(u"Remove"), wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItems.Append(self.m_menuItemsRemove) self.m_menuItemsProps = wx.MenuItem(self.m_menuItems, wx.ID_ANY, _(u"Properties"), wx.EmptyString, wx.ITEM_NORMAL) self.m_menuItems.Append(self.m_menuItemsProps) self.Bind(wx.EVT_RIGHT_DOWN, self.BatchWinOnContextMenu) self.Centre(wx.BOTH) # Connect Events self.Bind(wx.EVT_CLOSE, self.onClose) self.Bind(wx.EVT_TOOL, self.onSubAddClick, id=self.m_toolSubAdd.GetId()) self.Bind(wx.EVT_TOOL, self.onSubRemoveClick, id=self.m_toolSubRemove.GetId()) self.Bind(wx.EVT_TOOL, self.onSubSelStreamClick, id=self.m_toolSubSelStream.GetId()) self.Bind(wx.EVT_TOOL, self.onRefAddClick, id=self.m_toolRefAdd.GetId()) self.Bind(wx.EVT_TOOL, self.onRefRemoveClick, id=self.m_toolRefRemove.GetId()) self.Bind(wx.EVT_TOOL, self.onRefSelStreamClick, id=self.m_toolRefSelStream.GetId()) self.Bind(wx.EVT_TOOL, self.onOutPatternClick, id=self.m_toolOutPattern.GetId()) self.m_items.Bind(wx.EVT_LEFT_DCLICK, self.onItemsLeftDClick) self.m_buttonSelStream.Bind(wx.EVT_BUTTON, self.onButtonSelStreamClick) self.m_choiceLang.Bind(wx.EVT_CHOICE, self.onChoiceLangChoice) self.m_choiceEnc.Bind(wx.EVT_CHOICE, self.onChoiceEncChoice) self.m_sliderMaxDist.Bind(wx.EVT_SCROLL, self.onSliderMaxDistScroll) self.m_sliderEffort.Bind(wx.EVT_SCROLL, self.onSliderEffortScroll) self.m_textErrorDetails.Bind(wx.EVT_LEFT_UP, self.onTextErrorDetailsClick) self.m_buttonMenu.Bind(wx.EVT_BUTTON, self.onButtonMenuClick) self.Bind(wx.EVT_MENU, self.onMenuItemAddFilesClick, id=self.m_menuItemAddFiles.GetId()) self.Bind(wx.EVT_MENU, self.onMenuItemImportListClick, id=self.m_menuItemImportList.GetId()) self.Bind(wx.EVT_MENU, self.onMenuItemExportListClick, id=self.m_menuItemExportList.GetId()) self.Bind(wx.EVT_MENU, self.onMenuItemClearListClick, id=self.m_menuItemClearList.GetId()) self.m_buttonClose.Bind(wx.EVT_BUTTON, self.onButtonCloseClick) self.m_buttonStart.Bind(wx.EVT_BUTTON, self.onButtonStartClick) self.Bind(wx.EVT_MENU, self.onMenuItemsRemoveClick, id=self.m_menuItemsRemove.GetId()) self.Bind(wx.EVT_MENU, self.onMenuItemsPropsClick, id=self.m_menuItemsProps.GetId())
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Select stream"), pos = wx.DefaultPosition, size = wx.Size( 620,480 ), style = wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.RESIZE_BORDER ) self.SetSizeHints( wx.Size( 440,480 ), wx.DefaultSize ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) self.m_panelMain = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) fgSizer14 = wx.FlexGridSizer( 0, 1, 0, 0 ) fgSizer14.AddGrowableCol( 0 ) fgSizer14.AddGrowableRow( 3 ) fgSizer14.SetFlexibleDirection( wx.BOTH ) fgSizer14.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_staticText1 = wx.StaticText( self.m_panelMain, wx.ID_ANY, _(u"Input file:"), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) fgSizer14.Add( self.m_staticText1, 0, wx.EXPAND|wx.TOP|wx.RIGHT|wx.LEFT, 5 ) fgSizer1 = wx.FlexGridSizer( 1, 0, 0, 0 ) fgSizer1.AddGrowableCol( 0 ) fgSizer1.AddGrowableRow( 0 ) fgSizer1.SetFlexibleDirection( wx.BOTH ) fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_textPath = wx.TextCtrl( self.m_panelMain, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_READONLY ) fgSizer1.Add( self.m_textPath, 0, wx.EXPAND|wx.BOTTOM|wx.LEFT, 5 ) self.m_buttonOpen = wx.BitmapButton( self.m_panelMain, wx.ID_OPEN, wx.ArtProvider.GetBitmap( wx.ART_FILE_OPEN, wx.ART_BUTTON ), wx.DefaultPosition, wx.DefaultSize, wx.BU_AUTODRAW ) fgSizer1.Add( self.m_buttonOpen, 0, wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 ) fgSizer14.Add( fgSizer1, 0, wx.EXPAND, 5 ) self.m_staticText2 = wx.StaticText( self.m_panelMain, wx.ID_ANY, _(u"Select stream:"), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) fgSizer14.Add( self.m_staticText2, 0, wx.TOP|wx.RIGHT|wx.LEFT|wx.EXPAND, 5 ) self.m_listStreams = StreamList( self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LC_ALIGN_LEFT|wx.LC_REPORT|wx.LC_SINGLE_SEL ) fgSizer14.Add( self.m_listStreams, 0, wx.ALL|wx.EXPAND, 5 ) fgSizer2 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer2.AddGrowableCol( 1 ) fgSizer2.SetFlexibleDirection( wx.BOTH ) fgSizer2.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_staticText3 = wx.StaticText( self.m_panelMain, wx.ID_ANY, _(u"Language:"), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText3.Wrap( -1 ) fgSizer2.Add( self.m_staticText3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5 ) m_choiceLangChoices = [] self.m_choiceLang = ChoiceLang( self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choiceLangChoices, 0 ) self.m_choiceLang.SetSelection( 0 ) fgSizer2.Add( self.m_choiceLang, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 ) self.m_staticText4 = wx.StaticText( self.m_panelMain, wx.ID_ANY, _(u"Character encoding:"), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText4.Wrap( -1 ) fgSizer2.Add( self.m_staticText4, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5 ) m_choiceEncodingChoices = [] self.m_choiceEncoding = ChoiceCharEnc( self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choiceEncodingChoices, 0 ) self.m_choiceEncoding.SetSelection( 0 ) self.m_choiceEncoding.Enable( False ) fgSizer2.Add( self.m_choiceEncoding, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) self.m_staticText5 = wx.StaticText( self.m_panelMain, wx.ID_ANY, _(u"Audio channels:"), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText5.Wrap( -1 ) fgSizer2.Add( self.m_staticText5, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5 ) fgSizer3 = wx.FlexGridSizer( 1, 0, 0, 0 ) fgSizer3.AddGrowableCol( 0 ) fgSizer3.AddGrowableRow( 0 ) fgSizer3.SetFlexibleDirection( wx.BOTH ) fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_textChannels = wx.TextCtrl( self.m_panelMain, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_READONLY ) self.m_textChannels.Enable( False ) fgSizer3.Add( self.m_textChannels, 0, wx.TOP|wx.BOTTOM|wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 ) self.m_buttonSelectChannels = wx.Button( self.m_panelMain, wx.ID_ANY, _(u"Select"), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_buttonSelectChannels.Enable( False ) fgSizer3.Add( self.m_buttonSelectChannels, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 ) fgSizer2.Add( fgSizer3, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 ) fgSizer14.Add( fgSizer2, 1, wx.EXPAND, 5 ) self.m_staticline8 = wx.StaticLine( self.m_panelMain, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) fgSizer14.Add( self.m_staticline8, 0, wx.EXPAND |wx.ALL, 5 ) fgSizer4 = wx.FlexGridSizer( 1, 0, 0, 0 ) fgSizer4.SetFlexibleDirection( wx.BOTH ) fgSizer4.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) self.m_buttonCancel = wx.Button( self.m_panelMain, wx.ID_CANCEL, _(u"Cancel"), wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer4.Add( self.m_buttonCancel, 0, wx.ALL, 5 ) self.m_buttonOk = wx.Button( self.m_panelMain, wx.ID_OK, _(u"OK"), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_buttonOk.SetDefault() fgSizer4.Add( self.m_buttonOk, 0, wx.ALL, 5 ) fgSizer14.Add( fgSizer4, 1, wx.ALIGN_RIGHT, 5 ) self.m_panelMain.SetSizer( fgSizer14 ) self.m_panelMain.Layout() fgSizer14.Fit( self.m_panelMain ) bSizer1.Add( self.m_panelMain, 1, wx.EXPAND |wx.ALL, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.m_buttonOpen.Bind( wx.EVT_BUTTON, self.onButtonOpenClick ) self.m_listStreams.Bind( wx.EVT_LEFT_DCLICK, self.onListStreamsDClick ) self.m_listStreams.Bind( wx.EVT_LIST_ITEM_DESELECTED, self.onListStreamsSelect ) self.m_listStreams.Bind( wx.EVT_LIST_ITEM_SELECTED, self.onListStreamsSelect ) self.m_choiceLang.Bind( wx.EVT_CHOICE, self.onChoiceLangChoice ) self.m_choiceEncoding.Bind( wx.EVT_CHOICE, self.onChoiceEncChoice ) self.m_buttonSelectChannels.Bind( wx.EVT_BUTTON, self.onButtonSelectChannelsClick )