@@ -95,6 +95,7 @@ def __init__(self, main_app: QWidget):
9595 self .logic_state = LogicState ()
9696
9797 self .main_app = main_app
98+ main_app .wCombo_fw_version .currentIndexChanged .connect (self .fw_version_combo_box_changed )
9899 main_app .wBtn_download_fw .setEnabled (True )
99100 main_app .wBtn_download_fw .clicked .connect (self .spawn_worker_thread (self .download_and_extract_fw ))
100101 main_app .wBtn_select_local_config .clicked .connect (self .open_local_config_file )
@@ -210,6 +211,20 @@ def download_and_extract_fw_result(main_app: 'MainWidget', pio_environments: Lis
210211 main_app .wCombo_pio_env .addItem (pio_env_name .nice_name )
211212 main_app .wCombo_pio_env .setPlaceholderText ('Select Board' )
212213
214+ @Slot ()
215+ def fw_version_combo_box_changed (self , idx : int ):
216+ if idx == self .logic_state .release_idx :
217+ return # Nothing changed, nothing to do
218+ # Clear most state, if FW version is changed we want the user to go through the steps again
219+ # (technically not necessary but can trip some users up)
220+ log .debug ('FW version changed, clearing some state' )
221+ self .logic_state .pio_envs .clear ()
222+ self .logic_state .pio_env = None
223+ self .main_app .wSpn_download .setState (BusyIndicatorState .NONE )
224+ self .main_app .wCombo_pio_env .clear ()
225+ self .main_app .wSpn_build .setState (BusyIndicatorState .NONE )
226+ self .worker_finished ()
227+
213228 @Slot ()
214229 def pio_env_combo_box_changed (self , idx : int ):
215230 if self .logic_state .pio_envs and idx != - 1 :
0 commit comments