From 26846fd10217a0433181d1692bd3a826d5082645 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 23 Mar 2014 00:53:09 -0400 Subject: [PATCH] Preference UI support for slot divisions --- gui/builtinPreferenceViews/pyfaGeneralPreferences.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gui/builtinPreferenceViews/pyfaGeneralPreferences.py b/gui/builtinPreferenceViews/pyfaGeneralPreferences.py index 81bb81856..130afd0fe 100644 --- a/gui/builtinPreferenceViews/pyfaGeneralPreferences.py +++ b/gui/builtinPreferenceViews/pyfaGeneralPreferences.py @@ -40,6 +40,9 @@ class PFGeneralPref ( PreferenceView): self.cbFitColorSlots = wx.CheckBox( panel, wx.ID_ANY, u"Color fitting view by slot", wx.DefaultPosition, wx.DefaultSize, 0 ) mainSizer.Add( self.cbFitColorSlots, 0, wx.ALL|wx.EXPAND, 5 ) + self.cbDivideSlots = wx.CheckBox( panel, wx.ID_ANY, u"Divide slot groups", wx.DefaultPosition, wx.DefaultSize, 0 ) + mainSizer.Add( self.cbDivideSlots, 0, wx.ALL|wx.EXPAND, 5 ) + # Needs to be implemented - save active fittings and reapply when starting pyfa #self.cbReopenFits = wx.CheckBox( panel, wx.ID_ANY, u"Reopen Fits", wx.DefaultPosition, wx.DefaultSize, 0 ) #mainSizer.Add( self.cbReopenFits, 0, wx.ALL|wx.EXPAND, 5 ) @@ -55,16 +58,25 @@ class PFGeneralPref ( PreferenceView): self.cbGlobalDmgPattern.SetValue(useGlobalDmgPattern) self.cbGlobalForceReload.SetValue(useGlobalForceReload) self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False) + self.cbDivideSlots.SetValue(self.sFit.serviceFittingOptions["divideSlots"] or False) self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange) self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalDmgPatternStateChange) self.cbGlobalForceReload.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalForceReloadStateChange) self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot) + self.cbDivideSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalDivideSlots) panel.SetSizer( mainSizer ) panel.Layout() def onCBGlobalColorBySlot(self, event): + self.sFit.serviceFittingOptions["divideSlots"] = self.cbDivideSlots.GetValue() + fitID = self.mainFrame.getActiveFit() + self.sFit.refreshFit(fitID) + wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID)) + event.Skip() + + def onCBGlobalDivideSlots(self, event): self.sFit.serviceFittingOptions["colorFitBySlot"] = self.cbFitColorSlots.GetValue() fitID = self.mainFrame.getActiveFit() self.sFit.refreshFit(fitID)