@@ -127,14 +127,16 @@ def __setup_combo_boxes(self):
127127 for key in PROJECTION .keys () \
128128 if 'vr' not in key .lower () or self .include_vr ])
129129
130- self .ui . trackingMethodComboBox . addItems ( [
130+ self .trackingMethods = [
131131 'Unsupervised one moving person' ,
132132 'Unsupervised two moving persons' ,
133133 'Supervised stopping one moving person' ,
134134 'Supervised stopping two moving persons' ,
135135 'Supervised ignoring one moving person' ,
136136 'Supervised ignoring two moving persons'
137- ]) # set before tracking metric!
137+ ]
138+
139+ self .ui .trackingMethodComboBox .addItems (self .trackingMethods ) # set before tracking metric!
138140
139141 self .ui .trackingMetricComboBox .addItems ([
140142 'y (up-down)' ,
@@ -169,15 +171,18 @@ def __setup_combo_boxes(self):
169171
170172 def __set_tracking_metric (self , value ):
171173 value = value .split ('(' )[0 ].strip ()
172- current_tracking_method_items = [ self .ui .trackingMethodComboBox .itemText ( i ) for i in range ( self . ui . trackingMethodComboBox . count ())]
174+ selection = self .ui .trackingMethodComboBox .currentText ()
173175
176+ self .ui .trackingMethodComboBox .clear ()
174177 if value in ['x' , 'y' , 'x inverted' , 'y inverted' ]:
175- if 'Unsupervised one moving person' not in current_tracking_method_items :
176- self .ui .trackingMethodComboBox .addItems (['Unsupervised one moving person' , 'Supervised stopping one moving person' ])
178+ self .ui .trackingMethodComboBox .addItems (self .trackingMethods )
177179 else :
178- if 'Unsupervised one moving person' in current_tracking_method_items :
179- self .ui .trackingMethodComboBox .clear ()
180- self .ui .trackingMethodComboBox .addItems (['Unsupervised two moving persons' , 'Supervised stopping two moving persons' ])
180+ self .ui .trackingMethodComboBox .addItems (list (filter (lambda x : "one" not in x , self .trackingMethods )))
181+
182+ index = self .ui .trackingMethodComboBox .findText (selection , QtCore .Qt .MatchFixedString )
183+ if index >= 0 :
184+ self .ui .trackingMethodComboBox .setCurrentIndex (index )
185+
181186
182187 self .__set_str_setting ('trackingMetric' , value )
183188
0 commit comments