From 368b0ce75c4ee54bbfa3db918829329d2baafa50 Mon Sep 17 00:00:00 2001 From: Phill Ridout Date: Sat, 20 Jan 2018 09:30:30 +0000 Subject: [PATCH] Tidy ups --- openlp/core/ui/mainwindow.py | 1 - openlp/core/ui/servicemanager.py | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 958077891..a48fb3dfe 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -1320,7 +1320,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): :param int increment: The value you to increase the progress bar by. """ - # TODO: Test increment default value self.load_progress_bar.setValue(self.load_progress_bar.value() + increment) self.application.process_events() diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 6c3e1ca9b..e4ca1d6fe 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -508,8 +508,9 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi def get_write_file_list(self): """ + Get a list of files used in the service and files that are missing. - :return: + :return: A list of files used in the service that exist, and a list of files that don't. :rtype: (list[openlp.core.common.path.Path], list[openlp.core.common.path.Path]) """ write_list = [] @@ -570,7 +571,6 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi self.service_items.remove(item) continue service_item = item['service_item'].get_service_repr(self._save_lite) - # Add the service item to the service. service.append({'serviceitem': service_item}) self.repaint_service_list(-1, -1) @@ -581,7 +581,6 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi total_size += file_item.stat().st_size self.log_debug('ServiceManager.save_file - ZIP contents size is %i bytes' % total_size) self.main_window.display_progress_bar(total_size) - try: with NamedTemporaryFile() as temp_file, \ zipfile.ZipFile(temp_file, 'w') as zip_file: @@ -602,8 +601,6 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi translate('OpenLP.ServiceManager', 'Error Saving File'), translate('OpenLP.ServiceManager', 'There was an error saving your file.\n\n{error}').format(error=error)) return self.save_file_as() - - self.main_window.finished_progress_bar() self.application.set_normal_cursor() self.main_window.add_recent_file(file_path)