Beremiz.py
changeset 1947 7c2cd9d33070
parent 1941 cde74a39df51
child 1953 5736d25bb393
equal deleted inserted replaced
1946:95fa4e05e30f 1947:7c2cd9d33070
    50         self.debug = os.path.exists("BEREMIZ_DEBUG")
    50         self.debug = os.path.exists("BEREMIZ_DEBUG")
    51 
    51 
    52     def Bpath(self, *args):
    52     def Bpath(self, *args):
    53         return os.path.join(self.app_dir, *args)
    53         return os.path.join(self.app_dir, *args)
    54 
    54 
    55     def ShowSplashScreen(self):
       
    56         bmp = wx.Image(self.splashPath).ConvertToBitmap()
       
    57         self.splash = AdvancedSplash(None, bitmap=bmp, agwStyle=AS_NOTIMEOUT | AS_CENTER_ON_SCREEN)
       
    58 
       
    59 
       
    60     def Usage(self):
    55     def Usage(self):
    61         print("Usage:")
    56         print("Usage:")
    62         print("%s [Options] [Projectpath] [Buildpath]" % sys.argv[0])
    57         print("%s [Options] [Projectpath] [Buildpath]" % sys.argv[0])
    63         print("")
    58         print("")
    64         print("Supported options:")
    59         print("Supported options:")
   108 
   103 
   109         BeremizAppType = wx.App if wx.VERSION >= (3, 0, 0) else wx.PySimpleApp
   104         BeremizAppType = wx.App if wx.VERSION >= (3, 0, 0) else wx.PySimpleApp
   110         class BeremizApp(BeremizAppType):
   105         class BeremizApp(BeremizAppType):
   111             def OnInit(_self):
   106             def OnInit(_self):
   112                 self.ShowSplashScreen()
   107                 self.ShowSplashScreen()
   113                 wx.CallAfter(self.AppStart)
       
   114                 return True
   108                 return True
   115 
   109 
   116         self.app = BeremizApp(redirect=self.debug)
   110         self.app = BeremizApp(redirect=self.debug)
   117         self.app.SetAppName('beremiz')
   111         self.app.SetAppName('beremiz')
   118         if wx.VERSION < (3, 0, 0):
   112         if wx.VERSION < (3, 0, 0):
   119             wx.InitAllImageHandlers()
   113             wx.InitAllImageHandlers()
       
   114 
       
   115     def ShowSplashScreen(self):
       
   116         class Splash(AdvancedSplash):
       
   117             def OnPaint(_self, event):
       
   118                 AdvancedSplash.OnPaint(_self, event)
       
   119                 wx.CallAfter(self.AppStart)
       
   120         bmp = wx.Image(self.splashPath).ConvertToBitmap()
       
   121         self.splash = Splash(None, 
       
   122                              bitmap=bmp, 
       
   123                              agwStyle=AS_NOTIMEOUT | AS_CENTER_ON_SCREEN)
       
   124 
   120 
   125 
   121     def BackgroundInitialization(self):
   126     def BackgroundInitialization(self):
   122         self.InitI18n()
   127         self.InitI18n()
   123         self.CheckUpdates()
   128         self.CheckUpdates()
   124         self.LoadExtensions()
   129         self.LoadExtensions()