OSDN Git Service

Rename gui.installer to gui.installerGui so that we can import the non-GUI installer...
authorJames Teh <jamie@jantrid.net>
Thu, 11 Aug 2011 17:40:27 +0000 (03:40 +1000)
committerJames Teh <jamie@jantrid.net>
Thu, 11 Aug 2011 17:40:27 +0000 (03:40 +1000)
gui.installerGui:
* IndeterminateProgressDialog: Raise thyself on construction.
* createPortableCopy: Display a progress dialog while working.

source/gui/__init__.py
source/gui/installerGui.py [moved from source/gui/installer.py with 93% similarity]

index 47c584f..9ed4418 100644 (file)
@@ -229,7 +229,7 @@ class MainFrame(wx.Frame):
                if isInMessageBox:\r
                        return\r
                self.prePopup()\r
-               from gui.installer import createPortableCopy\r
+               from gui.installerGui import createPortableCopy\r
                createPortableCopy()\r
                self.postPopup()\r
 \r
@@ -237,7 +237,7 @@ class MainFrame(wx.Frame):
                if isInMessageBox:\r
                        return\r
                self.prePopup()\r
-               from gui.installer import InstallerDialog\r
+               from gui.installerGui import InstallerDialog\r
                InstallerDialog(self).Show()\r
                self.postPopup()\r
 \r
similarity index 93%
rename from source/gui/installer.py
rename to source/gui/installerGui.py
index 660fb57..3d5937b 100644 (file)
@@ -71,7 +71,6 @@ class InstallerDialog(wx.Dialog):
        def onInstall(self, evt):\r
                self.Hide()\r
                self.progressDialog = IndeterminateProgressDialog(self, _("Installing NVDA"), _("Please wait while NVDA is being installed."))\r
-               self.progressDialog.Raise()\r
                wx.CallLater(5000, self.installDone)\r
 \r
        def installDone(self):\r
@@ -87,6 +86,7 @@ class IndeterminateProgressDialog(wx.ProgressDialog):
                super(IndeterminateProgressDialog, self).__init__(title, message, parent=parent)\r
                self.timer = wx.PyTimer(self.Pulse)\r
                self.timer.Start(1000)\r
+               self.Raise()\r
 \r
        def done(self):\r
                self.timer.Stop()\r
@@ -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\r
                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)\r
 \r
+               d = IndeterminateProgressDialog(gui.mainFrame, _("Creating Portable Copy"), _("Please wait while a portable copy of NVDA is created."))\r
                import installer\r
                try:\r
                        installer.CreatePortableCopy(path,copyUserConfig=copyUserConfig,createAutorun=createAutorun)\r
                except OSError:\r
+                       d.done()\r
                        gui.messageBox(_("Failed to create portable copy"),_("Error"))\r
                        return\r
+               d.done()\r
                gui.messageBox(_("Successfully created a portable copy of NVDA at %s")%path,_("Success"))\r