mirror of
https://github.com/JDM170/SaveWizard
synced 2025-04-20 22:30:42 +07:00
Update
* moved call check_remote_hashes into module_parsing Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
@@ -10,7 +10,7 @@ from PyQt5.QtGui import QRegExpValidator
|
||||
from PyQt5.QtWidgets import QDialog, QFileDialog
|
||||
|
||||
from dataIO import dataIO
|
||||
from module_parsing.script import check_remote_hashes, update_configs
|
||||
from module_parsing.script import update_configs
|
||||
from module_second.script import SecondWindow
|
||||
from statics import update_config_name
|
||||
from util import *
|
||||
@@ -35,9 +35,7 @@ class MainWindow(QDialog, Ui_MainWindow):
|
||||
update_bool = update_cfg.get("update_on_start")
|
||||
if update_bool:
|
||||
self.ui.updates_checkbox.setChecked(update_bool)
|
||||
update_list = check_remote_hashes()
|
||||
if update_list and len(update_list) > 0:
|
||||
update_configs(update_list)
|
||||
update_configs()
|
||||
|
||||
self.file_path = ""
|
||||
self.old_file = ""
|
||||
|
||||
@@ -52,15 +52,15 @@ def check_remote_hashes():
|
||||
return False
|
||||
|
||||
|
||||
def update_configs(cfg_list):
|
||||
"""
|
||||
:param cfg_list: config list to update
|
||||
"""
|
||||
progress = QProgressDialog("Downloading configs...", None, 0, len(cfg_list), flags=Qt.Window | Qt.WindowTitleHint)
|
||||
def update_configs():
|
||||
update_list = check_remote_hashes()
|
||||
if not update_list or len(update_list) == 0:
|
||||
return
|
||||
progress = QProgressDialog("Downloading configs...", None, 0, len(update_list), flags=Qt.Window | Qt.WindowTitleHint)
|
||||
progress.setWindowTitle("Download progress")
|
||||
progress.setWindowModality(Qt.WindowModal)
|
||||
progress.show()
|
||||
for cfg in cfg_list:
|
||||
for cfg in update_list:
|
||||
check_path(cfg)
|
||||
response_status, response = get_response_result(github_link + cfg)
|
||||
if response_status:
|
||||
@@ -69,5 +69,5 @@ def update_configs(cfg_list):
|
||||
dataIO.save_json(cfg, remote_cfg)
|
||||
progress.setValue(progress.value()+1)
|
||||
QApplication.processEvents()
|
||||
progress.setValue(len(cfg_list))
|
||||
progress.setValue(len(update_list))
|
||||
QApplication.processEvents()
|
||||
|
||||
Reference in New Issue
Block a user