home *** CD-ROM | disk | FTP | other *** search
/ Freelog 116 / FreelogNo116-JuilletSeptembre2013.iso / GestionFichiers / metamorphose / metamorphose2_0.8.2_setup.exe / metamorphose2.exe / preferences / general.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2011-01-12  |  6KB  |  124 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. import wx
  5. import utils
  6. (wxID_PANEL, wxID_PANELCLEARUNDO, wxID_PANELENCODINGGROUP, wxID_PANELENCODINGSELECT, wxID_PANELSHOWHIDDENDIRS, wxID_PANELSTATICBOX1, wxID_PANELSTATICTEXT1, wxID_PANELSTATICTEXT2, wxID_PANELUSEDIRTREE) = [ wx.NewId() for __init_ctrls in range(9) ]
  7.  
  8. class Panel(wx.Panel):
  9.     
  10.     def __init_itemsizer_items(self, parent):
  11.         parent.AddSpacer(wx.Size(8, 15), border = 0, flag = 0)
  12.         parent.AddWindow(self.clearUndo, 0, border = 15, flag = wx.LEFT)
  13.         parent.AddSpacer(wx.Size(8, 15), border = 0, flag = 0)
  14.         parent.AddWindow(self.useDirTree, 0, border = 15, flag = wx.LEFT)
  15.         parent.AddSpacer(wx.Size(5, 5), border = 10, flag = 0)
  16.         parent.AddWindow(self.showHiddenDirs, 0, border = 25, flag = wx.LEFT)
  17.         parent.AddSpacer(wx.Size(-1, 20), border = 0, flag = 0)
  18.         parent.AddSizer(self.encodingSizer, 0, border = 15, flag = wx.LEFT)
  19.         parent.AddSpacer(wx.Size(8, 35), border = 0, flag = 0)
  20.  
  21.     
  22.     def _init_encodingsizer(self, parent):
  23.         parent.AddSpacer(wx.Size(8, 8), border = 0, flag = 0)
  24.         parent.AddWindow(self.staticText1, 0, border = 5, flag = wx.ALL)
  25.         parent.AddWindow(self.encodingGroup, 0, border = 5, flag = wx.LEFT | wx.RIGHT)
  26.         parent.AddSpacer(wx.Size(-1, 15), border = 0, flag = wx.LEFT)
  27.         parent.AddWindow(self.staticText2, 0, border = 5, flag = wx.ALL)
  28.         parent.AddWindow(self.encodingSelect, 0, border = 5, flag = wx.BOTTOM | wx.LEFT | wx.RIGHT)
  29.  
  30.     
  31.     def __init_sizers(self):
  32.         self.encodingSizer = wx.StaticBoxSizer(box = self.staticBox1, orient = wx.VERTICAL)
  33.         self._init_encodingsizer(self.encodingSizer)
  34.         self.itemSizer = wx.BoxSizer(orient = wx.VERTICAL)
  35.         self._Panel__init_itemsizer_items(self.itemSizer)
  36.         self.mainSizer = wx.BoxSizer(orient = wx.VERTICAL)
  37.         self.mainSizer.AddSizer(self.itemSizer, 0, border = 10, flag = wx.ALIGN_CENTER_HORIZONTAL | wx.ALL)
  38.         self.SetSizer(self.mainSizer)
  39.  
  40.     
  41.     def __init_ctrls(self, prnt):
  42.         wx.Panel.__init__(self, id = wxID_PANEL, name = u'General', parent = prnt, style = wx.TAB_TRAVERSAL)
  43.         self.staticBox1 = wx.StaticBox(id = wxID_PANELSTATICBOX1, label = _(u'Encoding used in audio tags:'), name = 'staticBox1', parent = self)
  44.         self.clearUndo = wx.CheckBox(id = wxID_PANELCLEARUNDO, label = _(u'Clear out undo on start up'), name = u'clearUndo', parent = self)
  45.         self.useDirTree = wx.CheckBox(id = wxID_PANELUSEDIRTREE, label = _(u'Use directory tree view'), name = u'useDirTree', parent = self)
  46.         self.useDirTree.Bind(wx.EVT_CHECKBOX, self.dirTreeEnabled, id = wxID_PANELUSEDIRTREE)
  47.         self.useDirTree.SetValue(True)
  48.         self.showHiddenDirs = wx.CheckBox(id = wxID_PANELSHOWHIDDENDIRS, label = _(u'Show Hidden directories in tree view'), name = u'showHiddenDirs', parent = self)
  49.         self.staticText1 = wx.StaticText(id = wxID_PANELSTATICTEXT1, label = _(u'Select language group:'), name = 'staticText1', parent = self)
  50.         self.encodingGroup = wx.Choice(choices = [
  51.             _(u'Use System Default'),
  52.             _(u'All Languages / Unicode'),
  53.             _(u'Western Europe'),
  54.             _(u'Central & Eastern Europe'),
  55.             _(u'Esperanto, Maltese'),
  56.             _(u'Nordic Languages'),
  57.             _(u'Celtic Languages'),
  58.             _(u'Baltic Languages'),
  59.             _(u'Cyrillic Languages'),
  60.             _(u'Greek'),
  61.             _(u'Turkish'),
  62.             _(u'Hebrew'),
  63.             _(u'Arabic'),
  64.             _(u'Urdu'),
  65.             _(u'Thai'),
  66.             _(u'Vietnamese'),
  67.             _(u'Traditional Chinese'),
  68.             _(u'Simplified Chinese'),
  69.             _(u'Unified Chinese'),
  70.             _(u'Korean'),
  71.             _(u'Japanese')], id = wxID_PANELENCODINGGROUP, name = u'encodingGroup', parent = self, size = wx.Size(260, -1))
  72.         self.encodingGroup.SetSelection(0)
  73.         self.encodingGroup.Bind(wx.EVT_CHOICE, self._set_encoding_options, id = wxID_PANELENCODINGGROUP)
  74.         self.encodingSelect = wx.ComboBox(choices = [], id = wxID_PANELENCODINGSELECT, name = u'encodingSelect', parent = self, size = wx.Size(260, -1))
  75.         self.staticText2 = wx.StaticText(id = wxID_PANELSTATICTEXT2, label = _(u'Select encoding:'), name = 'staticText2', parent = self)
  76.         self._Panel__init_sizers()
  77.  
  78.     
  79.     def _make_encoding_select(self, choicesList):
  80.         self.encodingSelect = wx.ComboBox(choices = choicesList, id = wxID_PANELENCODINGSELECT, name = u'encodingSelect', parent = self, style = wx.CB_READONLY)
  81.         self.encodingSizer.AddWindow(self.encodingSelect, 0, border = 5, flag = wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.EXPAND)
  82.         self.Layout()
  83.  
  84.     
  85.     def __init__(self, parent):
  86.         global main
  87.         main = parent.GetGrandParent()
  88.         self._Panel__init_ctrls(parent)
  89.         self.Fit()
  90.  
  91.     
  92.     def init_enabled(self):
  93.         self._set_encoding_options(1)
  94.         self.dirTreeEnabled(1)
  95.  
  96.     
  97.     def _set_encoding_options(self, event):
  98.         Value = self.encodingGroup.GetStringSelection()
  99.         enable = True
  100.         if self.encodingSelect:
  101.             self.encodingSelect.Destroy()
  102.         
  103.         if Value == _(u'Use System Default'):
  104.             enable = False
  105.         
  106.         choicesList = utils.get_encoding_choices(Value)
  107.         self.staticText2.Enable(True)
  108.         self._make_encoding_select(choicesList)
  109.         self.encodingSelect.SetSelection(0)
  110.         if not enable:
  111.             self.staticText2.Enable(False)
  112.             self.encodingSelect.Enable(False)
  113.         
  114.  
  115.     
  116.     def dirTreeEnabled(self, event):
  117.         if self.useDirTree.GetValue():
  118.             allow = True
  119.         else:
  120.             allow = False
  121.         self.showHiddenDirs.Enable(allow)
  122.  
  123.  
  124.