feat(config): impelemt save and load to GUI
This commit is contained in:
parent
f34d37a9d6
commit
65fe131006
|
@ -317,27 +317,24 @@ class ED_LRR(Ui_ED_LRR):
|
||||||
self.inp_systems_pp.clear()
|
self.inp_systems_pp.clear()
|
||||||
self.inp_systems_dest_dl.clear()
|
self.inp_systems_dest_dl.clear()
|
||||||
for path in cfg["history.systems_path"][:]:
|
for path in cfg["history.systems_path"][:]:
|
||||||
if os.path.isfile(path):
|
|
||||||
self.inp_systems_pp.addItem(path)
|
self.inp_systems_pp.addItem(path)
|
||||||
|
self.inp_systems_pp.setCurrentText(path)
|
||||||
self.inp_systems_dest_dl.addItem(path)
|
self.inp_systems_dest_dl.addItem(path)
|
||||||
else:
|
self.inp_systems_dest_dl.setCurrentText(path)
|
||||||
cfg["history.systems_path"].remove(path)
|
|
||||||
self.inp_bodies_pp.clear()
|
self.inp_bodies_pp.clear()
|
||||||
self.inp_bodies_dest_dl.clear()
|
self.inp_bodies_dest_dl.clear()
|
||||||
for path in cfg["history.bodies_path"][:]:
|
for path in cfg["history.bodies_path"][:]:
|
||||||
if os.path.isfile(path):
|
|
||||||
self.inp_bodies_pp.addItem(path)
|
self.inp_bodies_pp.addItem(path)
|
||||||
|
self.inp_bodies_pp.setCurrentText(path)
|
||||||
self.inp_bodies_dest_dl.addItem(path)
|
self.inp_bodies_dest_dl.addItem(path)
|
||||||
else:
|
self.inp_bodies_dest_dl.setCurrentText(path)
|
||||||
cfg["history.bodies_path"].remove(path)
|
|
||||||
self.inp_sys_lst.clear()
|
self.inp_sys_lst.clear()
|
||||||
self.inp_out_pp.clear()
|
self.inp_out_pp.clear()
|
||||||
for path in cfg["history.stars_csv_path"]:
|
for path in cfg["history.stars_csv_path"]:
|
||||||
if os.path.isfile(path):
|
|
||||||
self.inp_sys_lst.addItem(path)
|
self.inp_sys_lst.addItem(path)
|
||||||
|
self.inp_sys_lst.setCurrentText(path)
|
||||||
self.inp_out_pp.addItem(path)
|
self.inp_out_pp.addItem(path)
|
||||||
else:
|
self.inp_out_pp.setCurrentText(path)
|
||||||
cfg["history.stars_csv_path"].remove(path)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def log(self, *args):
|
def log(self, *args):
|
||||||
|
@ -608,6 +605,14 @@ class ED_LRR(Ui_ED_LRR):
|
||||||
)
|
)
|
||||||
|
|
||||||
def handle_close(self):
|
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()
|
cfg.write()
|
||||||
print("BYEEEEEE!")
|
print("BYEEEEEE!")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue