diff --git a/Modules/download_element.py b/Modules/download_element.py index 6f42034..4d9af65 100644 --- a/Modules/download_element.py +++ b/Modules/download_element.py @@ -45,6 +45,7 @@ def __init__(self, working_dir: str, program_path: str, commands: list, info='', self.potential_error_log = '' # Raw logs from program. TODO: Maybe add some info here when initializing, plus return code perhaps? self.debug_log = [] + self.debug_log.append(' '.join(commands) + '\n') self.done = False self.program_log = deque(maxlen=3) @@ -67,6 +68,7 @@ def program_state_changed(self, new_state): else: self.status = 'Finished' self.progress = '100%' + self.eta = '' self.filesize = '' self.speed = '' diff --git a/core.py b/core.py index 7917fdf..b3550f6 100644 --- a/core.py +++ b/core.py @@ -839,10 +839,7 @@ def queue_download(self): else: if options['state']: - if self.settings.get_active_setting(parameter): - option = self.settings.get_active_setting(parameter) - else: - option = '' + option = self.settings.get_active_setting(parameter) add = format_in_list(options['command'], option) command += add @@ -985,6 +982,10 @@ def do_proper_shutdown(): """Ensures that the settings are saved properly before exiting!""" nonlocal self + for item in self.tab1.process_list.iter_items(): + if item._open_window is not None: + item._open_window.close() + self.hide() self.file_handler.force_save = True self.file_handler.save_settings(self.settings.settings_data) @@ -1041,7 +1042,7 @@ def do_proper_shutdown(): warning = QMessageBox.warning(None, f'Corruption of {file}!', - ''.join([str(e), '\nRestore to defaults?']), + f'{e}\nRestore to defaults?', buttons=QMessageBox.Yes | QMessageBox.No) if warning == QMessageBox.Yes: diff --git a/utils/utilities.py b/utils/utilities.py index 7235c45..4aff092 100644 --- a/utils/utilities.py +++ b/utils/utilities.py @@ -232,6 +232,8 @@ def get_active_setting(self, parameter): if '{}' in param['command']: active = param['active option'] return param['options'][active] + else: + return '' @property def parameters(self) -> dict: