feat(config): finish integrating new configuration system
This commit is contained in:
parent
93f655c7ce
commit
a8d6a32799
|
@ -79,7 +79,7 @@ class Job(QObject):
|
||||||
return self.job.start()
|
return self.job.start()
|
||||||
|
|
||||||
def cancel(self):
|
def cancel(self):
|
||||||
self.job.terminate()
|
self.job.terminate()
|
||||||
self.job = None
|
self.job = None
|
||||||
|
|
||||||
def __bool__(self):
|
def __bool__(self):
|
||||||
|
@ -88,7 +88,7 @@ class Job(QObject):
|
||||||
@property
|
@property
|
||||||
def done(self):
|
def done(self):
|
||||||
if self.job:
|
if self.job:
|
||||||
return (self.job.is_alive() == False) and (self.job.queue.empty())
|
return (self.job.is_alive() == False) and (self.job.queue.empty())
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def interval(self):
|
def interval(self):
|
||||||
|
@ -261,24 +261,45 @@ class ED_LRR(Ui_ED_LRR):
|
||||||
return fileName
|
return fileName
|
||||||
|
|
||||||
def set_sys_lst(self, path):
|
def set_sys_lst(self, path):
|
||||||
if path not in cfg["history.out_path"]:
|
if path not in cfg["history.stars_csv_path"]:
|
||||||
cfg["history.out_path"].append(path)
|
cfg["history.stars_csv_path"].append(path)
|
||||||
self.inp_sys_lst.addItem(path)
|
self.update_dropdowns()
|
||||||
self.inp_out_pp.addItem(path)
|
|
||||||
self.inp_sys_lst.setCurrentText(path)
|
|
||||||
self.inp_out_pp.setCurrentText(path)
|
|
||||||
|
|
||||||
def set_bodies_file(self, path):
|
def set_bodies_file(self, path):
|
||||||
if path not in cfg["history.bodies_path"]:
|
if path not in cfg["history.bodies_path"]:
|
||||||
cfg["history.bodies_path"].append(path)
|
cfg["history.bodies_path"].append(path)
|
||||||
self.inp_bodies_pp.addItem(path)
|
self.update_dropdowns()
|
||||||
|
|
||||||
def set_systems_file(self, path):
|
def set_systems_file(self, path):
|
||||||
if path not in cfg["history.systems_path"]:
|
if path not in cfg["history.systems_path"]:
|
||||||
cfg["history.systems_path"].append(path)
|
cfg["history.systems_path"].append(path)
|
||||||
self.inp_systems_pp.addItem(path)
|
self.update_dropdowns()
|
||||||
|
|
||||||
def update_dropdowns(self):
|
def update_dropdowns(self):
|
||||||
|
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_dest_dl.addItem(path)
|
||||||
|
else:
|
||||||
|
cfg["history.systems_path"].remove(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_dest_dl.addItem(path)
|
||||||
|
else:
|
||||||
|
cfg["history.bodies_path"].remove(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_out_pp.addItem(path)
|
||||||
|
else:
|
||||||
|
cfg["history.stars_csv_path"].remove(path)
|
||||||
return
|
return
|
||||||
|
|
||||||
def log(self, *args):
|
def log(self, *args):
|
||||||
|
@ -335,7 +356,7 @@ class ED_LRR(Ui_ED_LRR):
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def error(self, msg):
|
def error(self, msg):
|
||||||
QMessageBox.critical(self.main_window, "ERROR!", msg)
|
QMessageBox.critical(self.main_window, "ED_LRR Error", msg)
|
||||||
|
|
||||||
def get_sys_list(self):
|
def get_sys_list(self):
|
||||||
if not self.inp_sys_lst.currentText():
|
if not self.inp_sys_lst.currentText():
|
||||||
|
@ -518,8 +539,6 @@ class ED_LRR(Ui_ED_LRR):
|
||||||
|
|
||||||
def setup_signals(self):
|
def setup_signals(self):
|
||||||
self.btn_download.clicked.connect(self.run_download)
|
self.btn_download.clicked.connect(self.run_download)
|
||||||
self.inp_systems_dest_dl.setCurrentText(r"D:\devel\rust\ed_lrr_gui\DL\s.json")
|
|
||||||
self.inp_bodies_dest_dl.setCurrentText(r"D:\devel\rust\ed_lrr_gui\DL\b.json")
|
|
||||||
self.set_greedyness(self.sld_greedyness.value())
|
self.set_greedyness(self.sld_greedyness.value())
|
||||||
self.cmb_mode.currentTextChanged.connect(self.set_route_mode)
|
self.cmb_mode.currentTextChanged.connect(self.set_route_mode)
|
||||||
self.rd_comp.toggled.connect(self.set_comp_mode)
|
self.rd_comp.toggled.connect(self.set_comp_mode)
|
||||||
|
@ -529,7 +548,6 @@ class ED_LRR(Ui_ED_LRR):
|
||||||
self.btn_add.clicked.connect(self.add_system)
|
self.btn_add.clicked.connect(self.add_system)
|
||||||
self.btn_rm.clicked.connect(self.remove_system)
|
self.btn_rm.clicked.connect(self.remove_system)
|
||||||
self.chk_permute.stateChanged.connect(self.update_permute_chk)
|
self.chk_permute.stateChanged.connect(self.update_permute_chk)
|
||||||
self.btn_search.clicked.connect(self.resolve_systems)
|
|
||||||
self.btn_out_browse_pp.clicked.connect(
|
self.btn_out_browse_pp.clicked.connect(
|
||||||
lambda: self.get_save_file("CSV File (*.csv)", self.set_sys_lst)
|
lambda: self.get_save_file("CSV File (*.csv)", self.set_sys_lst)
|
||||||
)
|
)
|
||||||
|
@ -551,7 +569,7 @@ class ED_LRR(Ui_ED_LRR):
|
||||||
)
|
)
|
||||||
|
|
||||||
def handle_close(self):
|
def handle_close(self):
|
||||||
cfg.sync()
|
cfg.write()
|
||||||
print("BYEEEEEE!")
|
print("BYEEEEEE!")
|
||||||
|
|
||||||
def setup_styles(self, win, app):
|
def setup_styles(self, win, app):
|
||||||
|
|
Loading…
Reference in New Issue