# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t
# 
# def modPath(name, mod):
#   """
#   str modPath(filename, module)
#   
#   prepend module's path to filename
#   """
#   if mod:
#     if not isinstance(mod, StringType):
#       mod=mod.__module__
#     ri=mod.rfind('.')
#     if ri > 0:
#       return os.path.join(loaddir, mod[0:ri].replace('.', '/'), name)
# 
#   return os.path.join(loaddir, name)
# 
# def localizePath(path):
#   """
#   str localizePath(path)
#   
#   returns the localized version path of a file if it exists, else the global.
#   """
#   #locale='de_DE'
#   #locPath=os.path.join(os.path.dirname(path), locale, os.path.basename(path))
#   #if os.path.exists(locPath):
#   #  return locPath
#   return path


import adm
import os
import wx.html
import version as admVersion
from wh import xlt, modPath, localizePath
# (c) 2013-2014 Andreas Pflug
#
# Licensed under the Apache License, 
# see LICENSE.TXT for conditions of usage


class PasswordDlg(adm.Dialog):
  def __init__(self, parentWin, msg, caption):
    adm.Dialog.__init__(self, parentWin)
    self.SetTitle(caption)
    self.staticPassword=msg

  def Save(self):
    return True

class AboutDlg(adm.Dialog):
  def __init__(self, parent):
    super(AboutDlg, self).__init__(parent)
    stdFont=self.GetFont()
    pt=stdFont.GetPointSize()
    family=stdFont.GetFamily()
    bigFont=wx.Font(pt*2 , family, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
    mediumFont=wx.Font(pt*1.4, family, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
    self['Admin'].SetFont(bigFont)
    self['Version'].SetFont(mediumFont)

    self.Admin=admVersion.appName
    self.Version=xlt("Version %s") % str(admVersion.version)

    if not adm.IsPackaged():

# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t
# 
# def modPath(name, mod):
#   """
#   str modPath(filename, module)
#   
#   prepend module's path to filename
#   """
#   if mod:
#     if not isinstance(mod, StringType):
#       mod=mod.__module__
#     ri=mod.rfind('.')
#     if ri > 0:
#       return os.path.join(loaddir, mod[0:ri].replace('.', '/'), name)
# 
#   return os.path.join(loaddir, name)
# 
# def localizePath(path):
#   """
#   str localizePath(path)
#   
#   returns the localized version path of a file if it exists, else the global.
#   """
#   #locale='de_DE'
#   #locPath=os.path.join(os.path.dirname(path), locale, os.path.basename(path))
#   #if os.path.exists(locPath):
#   #  return locPath
#   return path


# Path: AdmDialogs.py
import adm
import os
import wx.html
import version as admVersion
from wh import xlt, modPath, localizePath

# (c) 2013-2014 Andreas Pflug
#
# Licensed under the Apache License, 
# see LICENSE.TXT for conditions of usage


class PasswordDlg(adm.Dialog):
  def __init__(self, parentWin, msg, caption):
    adm.Dialog.__init__(self, parentWin)
    self.SetTitle(caption)
    self.staticPassword=msg

  def Save(self):
    return True

class AboutDlg(adm.Dialog):
  def __init__(self, parent):
    super(AboutDlg, self).__init__(parent)
    stdFont=self.GetFont()
    pt=stdFont.GetPointSize()
    family=stdFont.GetFamily()
    bigFont=wx.Font(pt*2 , family, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
    mediumFont=wx.Font(pt*1.4, family, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
    self['Admin'].SetFont(bigFont)
    self['Version'].SetFont(mediumFont)

    self.Admin=admVersion.appName
    self.Version=xlt("Version %s") % str(admVersion.version)

    if not adm.IsPackaged():

        self.Revision = xlt("(%s)\nunknown changes") % admVersion.revDate 