Skip to content

Commit bd474b6

Browse files
authored
Merge d7aea3b into fc6b73f
2 parents fc6b73f + d7aea3b commit bd474b6

6 files changed

Lines changed: 24 additions & 15 deletions

File tree

appveyor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ before_test:
146146
Add-AppveyorMessage "Unable to install NVDA prior to tests."
147147
}
148148
Push-AppveyorArtifact $installerLogFilePath
149+
$crashDump = "$outputDir\nvda_crash.dmp"
150+
if (Test-Path -Path $crashDump){
151+
Push-AppveyorArtifact $crashDump -FileName "nvda_install_crash.dmp"
152+
Add-AppveyorMessage "Install process crashed"
153+
$errorCode=1
154+
}
149155
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }
150156
151157
test_script:

source/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ def onResult(ID):
111111
def restart(disableAddons=False, debugLogging=False):
112112
"""Restarts NVDA by starting a new copy."""
113113
if globalVars.appArgs.launcher:
114-
import wx
114+
import gui
115115
globalVars.exitCode=3
116-
wx.GetApp().ExitMainLoop()
116+
wx.CallAfter(gui.mainFrame.Destroy)
117117
return
118118
import subprocess
119119
import winUser

source/gui/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(self):
7777

7878
def Destroy(self):
7979
self.sysTrayIcon.Destroy()
80-
super(MainFrame, self).Destroy()
80+
super().Destroy()
8181

8282
def prePopup(self):
8383
"""Prepare for a popup.
@@ -199,7 +199,7 @@ def onExitCommand(self, evt):
199199
d.Show()
200200
self.postPopup()
201201
else:
202-
wx.GetApp().ExitMainLoop()
202+
wx.CallAfter(self.Destroy)
203203

204204
def onNVDASettingsCommand(self,evt):
205205
self._popupSettingsDialog(NVDASettingsDialog)
@@ -359,6 +359,7 @@ def onConfigProfilesCommand(self, evt):
359359
ProfilesDialog(gui.mainFrame).Show()
360360
self.postPopup()
361361

362+
362363
class SysTrayIcon(wx.adv.TaskBarIcon):
363364

364365
def __init__(self, frame):
@@ -712,7 +713,7 @@ def onOk(self, evt):
712713
if action >= 2 and config.isAppX:
713714
action += 1
714715
if action == 0:
715-
wx.GetApp().ExitMainLoop()
716+
wx.CallAfter(mainFrame.Destroy)
716717
elif action == 1:
717718
queueHandler.queueFunction(queueHandler.eventQueue,core.restart)
718719
elif action == 2:

source/gui/guiHelper.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# -*- coding: UTF-8 -*-
2-
#guiHelper.py
3-
#A part of NonVisual Desktop Access (NVDA)
4-
#Copyright (C) 2016 NV Access Limited
5-
#This file is covered by the GNU General Public License.
6-
#See the file COPYING for more details.
1+
# A part of NonVisual Desktop Access (NVDA)
2+
# Copyright (C) 2016-2021 NV Access Limited
3+
# This file is covered by the GNU General Public License.
4+
# See the file COPYING for more details.
75

86

97
""" Utilities to simplify the creation of wx GUIs, including automatic management of spacing.
@@ -369,6 +367,9 @@ def addDialogDismissButtons(self, buttons, separated=False):
369367
self.dialogDismissButtonsAdded = True
370368
return buttons
371369

370+
371+
372+
372373
class SIPABCMeta(wx.siplib.wrappertype, ABCMeta):
373374
"""Meta class to be used for wx subclasses with abstract methods."""
374375
pass

source/gui/installerGui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def doInstall(
102102
winUser.SW_SHOWNORMAL
103103
)
104104
else:
105-
wx.GetApp().ExitMainLoop()
105+
wx.CallAfter(gui.mainFrame.Destroy)
106106

107107

108108
def doSilentInstall(
@@ -450,7 +450,7 @@ def doCreatePortable(portableDirectory,copyUserConfig=False,silent=False,startAf
450450
return
451451
d.done()
452452
if silent:
453-
wx.GetApp().ExitMainLoop()
453+
wx.CallAfter(gui.mainFrame.Destroy)
454454
else:
455455
# Translators: The message displayed when a portable copy of NVDA has been successfully created.
456456
# %s will be replaced with the destination directory.

source/gui/startupDialogs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ def run(cls):
117117
gui.mainFrame.prePopup()
118118
d = cls(gui.mainFrame)
119119
d.ShowModal()
120-
d.Destroy()
120+
if d and not d.IsBeingDeleted():
121+
wx.CallAfter(d.Destroy)
121122
gui.mainFrame.postPopup()
122123

123124

@@ -193,7 +194,7 @@ def onContinueRunning(self, evt):
193194
core.doStartupDialogs()
194195

195196
def onExit(self, evt):
196-
wx.GetApp().ExitMainLoop()
197+
wx.CallAfter(gui.mainFrame.Destroy)
197198

198199
@classmethod
199200
def run(cls):

0 commit comments

Comments
 (0)