Skip to content

Commit

Permalink
Start with splashscreen method updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jczic committed Apr 4, 2023
1 parent 9c081d6 commit d5a07ed
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ def __init__(self) :
resizable = False,
frameless = True,
on_top = True )
self._splashScr.events.closed += self._onSplashScrClosed

self._mainWin = webview.create_window( '%s v%s' % (conf.APPLICATION_TITLE, conf.APPLICATION_STR_VERSION),
url = self._localURL(conf.HTML_APP_MAIN_FILENAME),
width = 1030,
height = 710,
resizable = True,
min_size = (700, 550),
hidden = True )
hidden = not conf.IS_LINUX )
self._mainWin.events.closing += self._onMainWinClosing
self._mainWin.events.closed += self._onMainWinClosed

Expand Down Expand Up @@ -100,6 +101,12 @@ def _fahrenheit2Celsius(f) :

# ------------------------------------------------------------------------

def _onSplashScrClosed(self) :
self._splashScr = None
self._mainWin.show()

# ------------------------------------------------------------------------

def _onMainWinClosing(self) :
if self._canCloseSoftware :
return True
Expand Down Expand Up @@ -282,17 +289,14 @@ def _wsProcessMessage(self, o) :
# ------------------------------------------------------------------------

def _wsAcceptCallback(self, webSocket, httpClient) :
if self._ws :
webSocket.Close()
return
self._ws = webSocket
webSocket.RecvTextCallback = self._wsRecvTextCallback
webSocket.ClosedCallback = self._wsClosedCallback
self._sendAppInfo()
if self._splashScr :
if not self._ws and self._splashScr :
self._ws = webSocket
webSocket.RecvTextCallback = self._wsRecvTextCallback
webSocket.ClosedCallback = self._wsClosedCallback
self._sendAppInfo()
self._splashScr.destroy()
self._splashScr = None
self._mainWin.show()
else :
webSocket.Close()

# ------------------------------------------------------------------------

Expand Down

0 comments on commit d5a07ed

Please sign in to comment.