From: daid Date: Tue, 24 Sep 2013 15:20:23 +0000 (+0200) Subject: Update the GUI when changing machine settings. X-Git-Tag: 13.10~54 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9e01631f1f2bfee534a0766c6040aa5f2e85e0a6;p=cura.git Update the GUI when changing machine settings. --- diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index cc53be01..3070ea38 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -355,6 +355,18 @@ class mainWindow(wx.Frame): self.normalSettingsPanel.updateProfileToControls() self.simpleSettingsPanel.updateProfileToControls() + def reloadSettingPanels(self): + self.leftSizer.Detach(self.simpleSettingsPanel) + self.leftSizer.Detach(self.normalSettingsPanel) + self.simpleSettingsPanel.Destroy() + self.normalSettingsPanel.Destroy() + self.simpleSettingsPanel = simpleMode.simpleModePanel(self.leftPane, lambda : self.scene.sceneUpdated()) + self.normalSettingsPanel = normalSettingsPanel(self.leftPane, lambda : self.scene.sceneUpdated()) + self.leftSizer.Add(self.simpleSettingsPanel, 1) + self.leftSizer.Add(self.normalSettingsPanel, 1, wx.EXPAND) + self.updateSliceMode() + self.updateProfileToAllControls() + def OnLoadProfile(self, e): dlg=wx.FileDialog(self, _("Select profile file to load"), os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST) dlg.SetWildcard("ini files (*.ini)|*.ini") @@ -427,7 +439,7 @@ class mainWindow(wx.Frame): self.Hide() configWizard.configWizard() self.Show() - self.updateProfileToAllControls() + self.reloadSettingPanels() def OnAddNewMachine(self, e): self.Hide() @@ -437,7 +449,7 @@ class mainWindow(wx.Frame): profile.setActiveMachine(n) configWizard.configWizard(True) self.Show() - self.updateProfileToAllControls() + self.reloadSettingPanels() def OnBedLevelWizard(self, e): configWizard.bedLevelWizard() @@ -580,8 +592,7 @@ class normalSettingsPanel(configBase.configPanelBase): p = right configBase.TitleRow(p, title) for s in profile.getSettingsForCategory(category, title): - if s.checkConditions(): - configBase.SettingRow(p, s.getName()) + configBase.SettingRow(p, s.getName()) def SizeLabelWidths(self, left, right): leftWidth = self.getLabelColumnWidth(left) diff --git a/Cura/gui/preferencesDialog.py b/Cura/gui/preferencesDialog.py index c70fca07..b650f993 100644 --- a/Cura/gui/preferencesDialog.py +++ b/Cura/gui/preferencesDialog.py @@ -72,7 +72,5 @@ class preferencesDialog(wx.Dialog): self.Fit() def OnClose(self, e): - if self.oldExtruderAmount != int(profile.getMachineSetting('extruder_amount')): - wx.MessageBox(_("After changing the amount of extruders you need to restart Cura for full effect."), _("Extruder amount warning."), wx.OK | wx.ICON_INFORMATION) - self.parent.updateProfileToAllControls() + self.parent.reloadSettingPanels() self.Destroy() diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 89740158..1177bcf3 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -729,6 +729,7 @@ def checkAndUpdateMachineName(): n = 0 while getMachineSetting('machine_name', n) != '': if n == _selectedMachineIndex: + n += 1 continue print name, index, getMachineSetting('machine_name', n) if index is None: