Beremiz.py
changeset 1740 b789b695b5c6
parent 1739 ec153828ded2
child 1741 dd94b9a68c61
equal deleted inserted replaced
1739:ec153828ded2 1740:b789b695b5c6
    41         self.buildpath = None
    41         self.buildpath = None
    42         self.splash = None
    42         self.splash = None
    43         self.splashPath = self.Bpath("images", "splash.png")
    43         self.splashPath = self.Bpath("images", "splash.png")
    44 
    44 
    45     def Bpath(self, *args):
    45     def Bpath(self, *args):
    46         return os.path.join(self.app_dir,*args)
    46         return os.path.join(self.app_dir, *args)
    47 
    47 
    48     def ShowSplashScreen(self):
    48     def ShowSplashScreen(self):
    49         from wx.lib.agw.advancedsplash import AdvancedSplash
    49         from wx.lib.agw.advancedsplash import AdvancedSplash
    50         bmp = wx.Image(self.splashPath).ConvertToBitmap()
    50         bmp = wx.Image(self.splashPath).ConvertToBitmap()
    51         self.splash = AdvancedSplash(None, bitmap=bmp)
    51         self.splash = AdvancedSplash(None, bitmap=bmp)
    54         # even the events generated by splash themself during showing
    54         # even the events generated by splash themself during showing
    55         if wx.Platform == '__WXMSW__':
    55         if wx.Platform == '__WXMSW__':
    56             self.splash.Show()
    56             self.splash.Show()
    57             self.splash.ProcessEvent(wx.PaintEvent())
    57             self.splash.ProcessEvent(wx.PaintEvent())
    58         else:
    58         else:
    59             for i in range(0,30):
    59             for i in range(0, 30):
    60                 wx.Yield()
    60                 wx.Yield()
    61                 time.sleep(0.01);
    61                 time.sleep(0.01);
    62 
    62 
    63 
    63 
    64     def Usage(self):
    64     def Usage(self):
   160 
   160 
   161             def updateinfoproc():
   161             def updateinfoproc():
   162                 global updateinfo
   162                 global updateinfo
   163                 try:
   163                 try:
   164                     import urllib2
   164                     import urllib2
   165                     updateinfo = urllib2.urlopen(self.updateinfo_url,None).read()
   165                     updateinfo = urllib2.urlopen(self.updateinfo_url, None).read()
   166                 except:
   166                 except:
   167                     updateinfo = _("update info unavailable.")
   167                     updateinfo = _("update info unavailable.")
   168 
   168 
   169             from threading import Thread
   169             from threading import Thread
   170             self.splash.SetText(text=updateinfo)
   170             self.splash.SetText(text=updateinfo)
   179 
   179 
   180     def InstallExceptionHandler(self):
   180     def InstallExceptionHandler(self):
   181         import version
   181         import version
   182         import tempfile
   182         import tempfile
   183         logpath = tempfile.gettempdir()+os.sep+'Beremiz'
   183         logpath = tempfile.gettempdir()+os.sep+'Beremiz'
   184         BeremizIDE.AddExceptHook(logpath,version.app_version)
   184         BeremizIDE.AddExceptHook(logpath, version.app_version)
   185 
   185 
   186     def ShowUI(self):
   186     def ShowUI(self):
   187         self.frame = BeremizIDE.Beremiz(None, self.projectOpen, self.buildpath)
   187         self.frame = BeremizIDE.Beremiz(None, self.projectOpen, self.buildpath)
   188         if self.splash:
   188         if self.splash:
   189             self.splash.Close()
   189             self.splash.Close()