dialogs/PouActionDialog.py
changeset 2305 56f1d8aca886
parent 2301 5b8a7dd43f9f
child 3303 0ffb41625592
equal deleted inserted replaced
2273:a0efe3d9c853 2305:56f1d8aca886
    34 def GetActionLanguages():
    34 def GetActionLanguages():
    35     _ = NoTranslate
    35     _ = NoTranslate
    36     return [_("IL"), _("ST"), _("LD"), _("FBD")]
    36     return [_("IL"), _("ST"), _("LD"), _("FBD")]
    37 
    37 
    38 
    38 
    39 ACTION_LANGUAGES_DICT = dict([(_(language), language) for language in GetActionLanguages()])
       
    40 
       
    41 
       
    42 class PouActionDialog(wx.Dialog):
    39 class PouActionDialog(wx.Dialog):
    43 
    40 
    44     def __init__(self, parent):
    41     def __init__(self, parent):
    45         wx.Dialog.__init__(self, parent, title=_('Create a new action'))
    42         wx.Dialog.__init__(self, parent, title=_('Create a new action'))
       
    43 
       
    44         self.ACTION_LANGUAGES_DICT = dict([(_(language), language)
       
    45                                            for language in GetActionLanguages()])
    46 
    46 
    47         main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
    47         main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
    48         main_sizer.AddGrowableCol(0)
    48         main_sizer.AddGrowableCol(0)
    49         main_sizer.AddGrowableRow(0)
    49         main_sizer.AddGrowableRow(0)
    50 
    50 
   129                 self.Language.SetStringSelection(_(value))
   129                 self.Language.SetStringSelection(_(value))
   130 
   130 
   131     def GetValues(self):
   131     def GetValues(self):
   132         values = {}
   132         values = {}
   133         values["actionName"] = self.ActionName.GetValue()
   133         values["actionName"] = self.ActionName.GetValue()
   134         values["language"] = ACTION_LANGUAGES_DICT[self.Language.GetStringSelection()]
   134         values["language"] = self.ACTION_LANGUAGES_DICT[self.Language.GetStringSelection()]
   135         return values
   135         return values