# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t


from SpecificEntry import SpecificEntry
from Entry import Entry
from wh import xlt
  name=xlt("Samba")
  canClasses="sambaGroupMapping"

  def __init__(self, dlg, notebook, resname=None):
    SpecificEntry.__init__(self, dlg, notebook, resname)
    _SambaRidObject.__init__(self)
    self.Bind("sambaDomainSid", self.OnChangeDomain)

  def OnRidGen(self, evt):
    if self.generateRid("gidNumber", 1):
      self['RidGen'].Disable()


  def Check(self):
    if self.SambaGroupMapping:
      ok=True
      ok=self.dialog.CheckValid(ok, self.sambaDomainSid, xlt("Select Samba Domain first"))
      if not ok:
        return False
    return SpecificEntry.Check(self)

  def Go(self):
    self.initDomains()

    SpecificEntry.Go(self)
    if not self.sambaGroupMapping:
      return

    if self.dialog.node and self.sambaSid:
      ss=self.sambaSid.split('-')

# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t


# Path: modLdap/Samba.py
from SpecificEntry import SpecificEntry
from Entry import Entry
from wh import xlt

  name=xlt("Samba")
  canClasses="sambaGroupMapping"

  def __init__(self, dlg, notebook, resname=None):
    SpecificEntry.__init__(self, dlg, notebook, resname)
    _SambaRidObject.__init__(self)
    self.Bind("sambaDomainSid", self.OnChangeDomain)

  def OnRidGen(self, evt):
    if self.generateRid("gidNumber", 1):
      self['RidGen'].Disable()


  def Check(self):
    if self.SambaGroupMapping:
      ok=True
      ok=self.dialog.CheckValid(ok, self.sambaDomainSid, xlt("Select Samba Domain first"))
      if not ok:
        return False
    return SpecificEntry.Check(self)

  def Go(self):
    self.initDomains()

    SpecificEntry.Go(self)
    if not self.sambaGroupMapping:
      return

    if self.dialog.node and self.sambaSid:
      ss=self.sambaSid.split('-')

      self.sambaRid = ss[7]