Skip to content

Commit

Permalink
pupgui2: Don't attempt to map install_directory if `combo_install_l…
Browse files Browse the repository at this point in the history
…ocation_index_map` is empty (#458)
  • Loading branch information
sonic2kk authored Sep 20, 2024
1 parent 1f385df commit d848220
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pupgui2/pupgui2.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,17 @@ def btn_close_clicked(self):
self.cancel_download(cancel_all=True)
self.ui.close()

def combo_install_location_current_index_changed(self):
def combo_install_location_current_index_changed(self) -> None:
if len(self.combo_install_location_index_map) <= 0:
self.update_ui()

return

if not self.updating_combo_install_location:
install_dir = install_directory(self.combo_install_location_index_map[self.ui.comboInstallLocation.currentIndex()])
self.ui.statusBar().showMessage(self.tr('Changed install directory to {install_dir}.').format(install_dir=install_dir), timeout=3000)
self.update_ui()

self.update_ui()

def btn_manage_install_locations_clicked(self):
customid_dialog = PupguiCustomInstallDirectoryDialog(install_directory(), parent=self.ui)
Expand Down

0 comments on commit d848220

Please sign in to comment.