From b7d3a64963653b79a059d1e1398a58a21a913013 Mon Sep 17 00:00:00 2001 From: James Teh Date: Fri, 12 Aug 2011 03:40:27 +1000 Subject: [PATCH] Rename gui.installer to gui.installerGui so that we can import the non-GUI installer module from this module. gui.installerGui: * IndeterminateProgressDialog: Raise thyself on construction. * createPortableCopy: Display a progress dialog while working. --- source/gui/__init__.py | 4 ++-- source/gui/{installer.py => installerGui.py} | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) rename source/gui/{installer.py => installerGui.py} (93%) diff --git a/source/gui/__init__.py b/source/gui/__init__.py index 47c584f31..9ed441888 100644 --- a/source/gui/__init__.py +++ b/source/gui/__init__.py @@ -229,7 +229,7 @@ class MainFrame(wx.Frame): if isInMessageBox: return self.prePopup() - from gui.installer import createPortableCopy + from gui.installerGui import createPortableCopy createPortableCopy() self.postPopup() @@ -237,7 +237,7 @@ class MainFrame(wx.Frame): if isInMessageBox: return self.prePopup() - from gui.installer import InstallerDialog + from gui.installerGui import InstallerDialog InstallerDialog(self).Show() self.postPopup() diff --git a/source/gui/installer.py b/source/gui/installerGui.py similarity index 93% rename from source/gui/installer.py rename to source/gui/installerGui.py index 660fb5711..3d5937b82 100644 --- a/source/gui/installer.py +++ b/source/gui/installerGui.py @@ -71,7 +71,6 @@ class InstallerDialog(wx.Dialog): def onInstall(self, evt): self.Hide() self.progressDialog = IndeterminateProgressDialog(self, _("Installing NVDA"), _("Please wait while NVDA is being installed.")) - self.progressDialog.Raise() wx.CallLater(5000, self.installDone) def installDone(self): @@ -87,6 +86,7 @@ class IndeterminateProgressDialog(wx.ProgressDialog): super(IndeterminateProgressDialog, self).__init__(title, message, parent=parent) self.timer = wx.PyTimer(self.Pulse) self.timer.Start(1000) + self.Raise() def done(self): self.timer.Stop() @@ -100,10 +100,13 @@ def createPortableCopy(): copyUserConfig=gui.messageBox(_("Would you like to include your current NVDA settings in the portable copy?"), _("Copy User Configuration"), wx.YES_NO|wx.ICON_QUESTION) == wx.YES createAutorun=(ctypes.windll.kernel32.GetDriveTypeW(os.path.splitdrive(path)[0]+u'\\')==2 and gui.messageBox(_("Would you like to create an autorun file for your removable drive to allow NVDA to start automatically?"), _("Removable Drive Detected"), wx.YES_NO|wx.ICON_QUESTION) == wx.YES) + d = IndeterminateProgressDialog(gui.mainFrame, _("Creating Portable Copy"), _("Please wait while a portable copy of NVDA is created.")) import installer try: installer.CreatePortableCopy(path,copyUserConfig=copyUserConfig,createAutorun=createAutorun) except OSError: + d.done() gui.messageBox(_("Failed to create portable copy"),_("Error")) return + d.done() gui.messageBox(_("Successfully created a portable copy of NVDA at %s")%path,_("Success")) -- 2.11.0