chiark / gitweb /
Add a 'Are you sure' dialog to the firmware upgrade skip button
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Fri, 31 Jul 2015 21:02:49 +0000 (17:02 -0400)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Fri, 31 Jul 2015 21:02:49 +0000 (17:02 -0400)
Cura/gui/configWizard.py

index ab1d3846650df47c9d7e599bd0dda161b9a0d828..0377d6d84013887067a9750ece40df758718784c 100644 (file)
@@ -1401,8 +1401,14 @@ class LulzbotFirmwareUpdatePage(InfoPage):
                        self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
 
        def OnSkipClick(self, e):
-               self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
-               self.GetParent().ShowPage(self.GetNext())
+               dlg = wx.MessageDialog(self, _("Are you sure you want to skip the firmware upgrade?\n" +
+                                                                          "It could damage your printer if you changed your toolhead and have not updated thefirmware!"),
+                                                       _('Skip firmware upgrade?'), wx.YES_NO | wx.ICON_EXCLAMATION)
+               skip = dlg.ShowModal() == wx.ID_YES
+               dlg.Destroy()
+               if skip:
+                       self.GetParent().FindWindowById(wx.ID_FORWARD).Enable()
+                       self.GetParent().ShowPage(self.GetNext())
 
 class LulzbotChangeToolheadWizard(wx.wizard.Wizard):
        def __init__(self):