Skip to content

Commit

Permalink
Add-on updates dialog: display add-on update results dialog on startu…
Browse files Browse the repository at this point in the history
…p if told to do so via a callback. Re nvaccess#3208.

Possibly due to threading issue: GUI works correctly if queued from the main thread. One way to do this is via a callback that is claled by wx.CallAfter. Thus use an internal callback when NVDA needs to display add-on update results dialog at startup.
  • Loading branch information
josephsl committed Nov 16, 2018
1 parent 02ad573 commit f6a7abe
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions source/addonHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,19 @@ def autoAddonUpdateCheck():
t.start()

def _showAddonUpdateUI():
def _showAddonUpdateUICallback(info):
# The only purpose of this callback is to force add-on updates window to show up at startup.
import gui
from gui.addonGui import AddonUpdatesDialog
gui.mainFrame.prePopup()
AddonUpdatesDialog(gui.mainFrame, info).Show()
gui.mainFrame.postPopup()
try:
info = checkForAddonUpdates()
except:
info = None
if info is not None:
import gui
from gui.addonGui import AddonUpdatesDialog
wx.CallAfter(AddonUpdatesDialog, gui.mainFrame, info)
wx.CallAfter(_showAddonUpdateUICallback, info)

def initialize():
""" Initializes the add-ons subsystem. """
Expand Down

0 comments on commit f6a7abe

Please sign in to comment.