@@ -55,7 +55,7 @@ def __init__(self, parent, marketBrowser):
5555 self .Bind (wx .EVT_LIST_BEGIN_DRAG , self .startDrag )
5656
5757 # the "charges for active fitting" needs to listen to fitting changes
58- self .mainFrame .Bind (GE .FIT_CHANGED , self .selectedFittingChanged )
58+ self .mainFrame .Bind (GE .FIT_CHANGED , self .fitChanged )
5959
6060 self .active = []
6161
@@ -121,6 +121,9 @@ def selectionMade(self, context):
121121 # Set toggle buttons / use search mode flag if recently used modules category is selected (in order to have all modules listed and not filtered)
122122 if seldata == RECENTLY_USED_MODULES :
123123 self .marketBrowser .mode = 'recent'
124+
125+ if seldata == CHARGES_FOR_FIT :
126+ self .marketBrowser .mode = 'charges'
124127
125128 self .setToggles ()
126129 if context == 'tree' and self .marketBrowser .settings .get ('marketMGMarketSelectMode' ) == 1 :
@@ -146,11 +149,14 @@ def getChargesForActiveFit(self):
146149 items .add (charge )
147150 return items
148151
149- def selectedFittingChanged (self , event ):
152+ def fitChanged (self , event ):
150153 # skip the event so the other handlers also get called
151154 event .Skip ()
152- activeFitID = self .mainFrame .getActiveFit ()
153155
156+ if self .marketBrowser .mode != 'charges' :
157+ return
158+
159+ activeFitID = self .mainFrame .getActiveFit ()
154160 # if it was not the active fitting that was changed, do not do anything
155161 if activeFitID is not None and activeFitID not in event .fitIDs :
156162 return
0 commit comments