chiark / gitweb /
Fix a double destruction of firmware install dialog when no default firmware is found
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Tue, 4 Aug 2015 18:46:40 +0000 (14:46 -0400)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Tue, 4 Aug 2015 18:46:40 +0000 (14:46 -0400)
Cura/gui/firmwareInstall.py

index e825568f6b163bc6223b26e3fbdb466d46628580..177fe97c3b4aa1e29fbe1e34860d2461ffe2c50a 100644 (file)
@@ -94,10 +94,6 @@ class InstallFirmwareDialog(wx.Dialog):
                        port = profile.getMachineSetting('serial_port')
                if filename is None:
                        filename = getDefaultFirmware(machineIndex)
-               if filename is None:
-                       wx.MessageBox(_("I am sorry, but Cura does not ship with a default firmware for your machine configuration."), _("Firmware update"), wx.OK | wx.ICON_ERROR)
-                       self.Destroy()
-                       return
                self._machine_type = profile.getMachineSetting('machine_type', machineIndex)
                if self._machine_type == 'reprap':
                        wx.MessageBox(_("Cura only supports firmware updates for ATMega2560 based hardware.\nSo updating your RepRap with Cura might or might not work."), _("Firmware update"), wx.OK | wx.ICON_INFORMATION)
@@ -122,6 +118,9 @@ class InstallFirmwareDialog(wx.Dialog):
                self.success = False
 
        def Run(self):
+               if self.filename is None:
+                       wx.MessageBox(_("I am sorry, but Cura does not ship with a default firmware for your machine configuration."), _("Firmware update"), wx.OK | wx.ICON_ERROR)
+                       return False
                self.success = False
                self.thread = threading.Thread(target=self.OnRun)
                self.thread.daemon = True