Skip to content

Commit

Permalink
wxGUI/splashscreen: use standard one, try to show it before main app,…
Browse files Browse the repository at this point in the history
… increase timeout (#1718)

* remove testing code
  • Loading branch information
petrasovaa committed Jul 12, 2021
1 parent 94bcea4 commit e151423
Showing 1 changed file with 14 additions and 43 deletions.
57 changes: 14 additions & 43 deletions gui/wxpython/wxgui.py
Expand Up @@ -71,54 +71,25 @@ def OnInit(self):
introImagePath = os.path.join(globalvar.IMGDIR, "splash_screen.png")
introImage = wx.Image(introImagePath, wx.BITMAP_TYPE_PNG)
introBmp = introImage.ConvertToBitmap()
if SC and sys.platform != "darwin":
# AdvancedSplash is buggy on the Mac as of 2.8.12.1
# and raises annoying (though seemingly harmless) errors everytime
# the GUI is started
splash = SC.AdvancedSplash(
bitmap=introBmp, timeout=2000, parent=None, id=wx.ID_ANY
)
splash.SetText(_("Starting GRASS GUI..."))
splash.SetTextColour(wx.Colour(45, 52, 27))
splash.SetTextFont(
wx.Font(
pointSize=15, family=wx.DEFAULT, style=wx.NORMAL, weight=wx.BOLD
)
)
splash.SetTextPosition((150, 430))
else:
if globalvar.wxPythonPhoenix:
import wx.adv as wxadv

wxadv.SplashScreen(
bitmap=introBmp,
splashStyle=wxadv.SPLASH_CENTRE_ON_SCREEN | wxadv.SPLASH_TIMEOUT,
milliseconds=2000,
parent=None,
id=wx.ID_ANY,
)
else:
wx.SplashScreen(
bitmap=introBmp,
splashStyle=wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
milliseconds=2000,
parent=None,
id=wx.ID_ANY,
)
wx.adv.SplashScreen(
bitmap=introBmp,
splashStyle=wx.adv.SPLASH_CENTRE_ON_SCREEN | wx.adv.SPLASH_TIMEOUT,
milliseconds=3000,
parent=None,
id=wx.ID_ANY,
)

wx.GetApp().Yield()

# create and show main frame
from lmgr.frame import GMFrame

mainframe = GMFrame(parent=None, id=wx.ID_ANY, workspace=self.workspaceFile)
def show_main_gui():
# create and show main frame
from lmgr.frame import GMFrame

# testing purposes
# from main_window.frame import GMFrame
# mainframe = GMFrame(parent=None, id=wx.ID_ANY, workspace=self.workspaceFile)
mainframe = GMFrame(parent=None, id=wx.ID_ANY, workspace=self.workspaceFile)
mainframe.Show()
self.SetTopWindow(mainframe)

mainframe.Show()
self.SetTopWindow(mainframe)
wx.CallAfter(show_main_gui)

return True

Expand Down

0 comments on commit e151423

Please sign in to comment.