chiark / gitweb /
Allow back in the configuration wizard.
authordaid <daid303@gmail.com>
Thu, 13 Feb 2014 07:08:44 +0000 (08:08 +0100)
committerdaid <daid303@gmail.com>
Thu, 13 Feb 2014 07:08:44 +0000 (08:08 +0100)
Cura/gui/configWizard.py

index 94e9ca4b46b0ff86e5289fc880f21ba3b0f680f6..cb3ab43d8e14ae357a91c860f13185eb0fdaeb27 100644 (file)
@@ -210,6 +210,9 @@ class InfoPage(wx.wizard.WizardPageSimple):
        def AllowNext(self):
                return True
 
+       def AllowBack(self):
+               return True
+
        def StoreData(self):
                pass
 
@@ -232,6 +235,9 @@ class FirstInfoPage(InfoPage):
                #self.AddText('* Calibrate your machine')
                #self.AddText('* Do your first print')
 
+       def AllowBack(self):
+               return False
+
 
 class OtherMachineSelectPage(InfoPage):
        def __init__(self, parent):
@@ -860,7 +866,10 @@ class configWizard(wx.wizard.Wizard):
                        self.FindWindowById(wx.ID_FORWARD).Enable()
                else:
                        self.FindWindowById(wx.ID_FORWARD).Disable()
-               self.FindWindowById(wx.ID_BACKWARD).Disable()
+               if e.GetPage().AllowBack():
+                       self.FindWindowById(wx.ID_BACKWARD).Enable()
+               else:
+                       self.FindWindowById(wx.ID_BACKWARD).Disable()
 
 class bedLevelWizardMain(InfoPage):
        def __init__(self, parent):
@@ -1045,6 +1054,9 @@ class headOffsetCalibrationPage(InfoPage):
                self.Bind(wx.EVT_BUTTON, self.OnConnect, self.connectButton)
                self.Bind(wx.EVT_BUTTON, self.OnResume, self.resumeButton)
 
+       def AllowBack(self):
+               return True
+
        def OnConnect(self, e = None):
                if self.comm is not None:
                        self.comm.close()
@@ -1265,7 +1277,10 @@ class bedLevelWizard(wx.wizard.Wizard):
                        self.FindWindowById(wx.ID_FORWARD).Enable()
                else:
                        self.FindWindowById(wx.ID_FORWARD).Disable()
-               self.FindWindowById(wx.ID_BACKWARD).Disable()
+               if e.GetPage().AllowBack():
+                       self.FindWindowById(wx.ID_BACKWARD).Enable()
+               else:
+                       self.FindWindowById(wx.ID_BACKWARD).Disable()
 
 class headOffsetWizard(wx.wizard.Wizard):
        def __init__(self):
@@ -1290,4 +1305,7 @@ class headOffsetWizard(wx.wizard.Wizard):
                        self.FindWindowById(wx.ID_FORWARD).Enable()
                else:
                        self.FindWindowById(wx.ID_FORWARD).Disable()
-               self.FindWindowById(wx.ID_BACKWARD).Disable()
+               if e.GetPage().AllowBack():
+                       self.FindWindowById(wx.ID_BACKWARD).Enable()
+               else:
+                       self.FindWindowById(wx.ID_BACKWARD).Disable()