From 0bb9f3e06577d19928cd6a45dcd9958725133ec1 Mon Sep 17 00:00:00 2001 From: daid Date: Thu, 13 Feb 2014 08:08:44 +0100 Subject: [PATCH] Allow back in the configuration wizard. --- Cura/gui/configWizard.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Cura/gui/configWizard.py b/Cura/gui/configWizard.py index 94e9ca4b..cb3ab43d 100644 --- a/Cura/gui/configWizard.py +++ b/Cura/gui/configWizard.py @@ -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() -- 2.30.2