diff --git a/ed_lrr_gui/gui/main.py b/ed_lrr_gui/gui/main.py index c68173e..667b59f 100644 --- a/ed_lrr_gui/gui/main.py +++ b/ed_lrr_gui/gui/main.py @@ -317,27 +317,24 @@ class ED_LRR(Ui_ED_LRR): self.inp_systems_pp.clear() self.inp_systems_dest_dl.clear() for path in cfg["history.systems_path"][:]: - if os.path.isfile(path): self.inp_systems_pp.addItem(path) + self.inp_systems_pp.setCurrentText(path) self.inp_systems_dest_dl.addItem(path) - else: - cfg["history.systems_path"].remove(path) + self.inp_systems_dest_dl.setCurrentText(path) self.inp_bodies_pp.clear() self.inp_bodies_dest_dl.clear() for path in cfg["history.bodies_path"][:]: - if os.path.isfile(path): self.inp_bodies_pp.addItem(path) + self.inp_bodies_pp.setCurrentText(path) self.inp_bodies_dest_dl.addItem(path) - else: - cfg["history.bodies_path"].remove(path) + self.inp_bodies_dest_dl.setCurrentText(path) self.inp_sys_lst.clear() self.inp_out_pp.clear() for path in cfg["history.stars_csv_path"]: - if os.path.isfile(path): self.inp_sys_lst.addItem(path) + self.inp_sys_lst.setCurrentText(path) self.inp_out_pp.addItem(path) - else: - cfg["history.stars_csv_path"].remove(path) + self.inp_out_pp.setCurrentText(path) return def log(self, *args): @@ -608,6 +605,14 @@ class ED_LRR(Ui_ED_LRR): ) def handle_close(self): + for key in [ + "history.stars_csv_path", + "history.bodies_path", + "history.systems_path", + ]: + for path in cfg[key][:]: + if not os.path.isfile(path): + cfg[key].remove(path) cfg.write() print("BYEEEEEE!")