Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGUI/splashscreen: use standard one, try to show it before main app, increase timeout #1718

Merged
merged 2 commits into from Jul 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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