From bab5e90e205c9e0dc702a05719057f9573bc2cb4 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 10 Feb 2015 22:25:30 +0000 Subject: [PATCH] Adjust error messages. --- openlp/core/ui/mainwindow.py | 4 ++-- openlp/core/ui/servicemanager.py | 4 ++-- openlp/core/ui/thememanager.py | 4 ++-- openlp/plugins/songs/forms/songexportform.py | 4 ++-- openlp/plugins/songusage/forms/songusagedetailform.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index b4413552e..0e919871a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -1001,8 +1001,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow, RegistryProperties): os.remove(temp_file) except OSError as ose: QtGui.QMessageBox.critical(self, translate('OpenLP.MainWindow', 'Export setting error'), - translate('OpenLP.MainWindow', 'While writing the export file this error ' - 'occurred:\n%s') % str(ose), + translate('OpenLP.MainWindow', 'An error occurred while exporting the ' + 'settings: %s') % ose.strerror, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) def on_mode_default_item_clicked(self): diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 61299d548..0213fb02f 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -603,8 +603,8 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ServiceManage return self.save_file_as() except OSError as ose: QtGui.QMessageBox.critical(self, translate('OpenLP.ServiceManager', 'Error Saving File'), - translate('OpenLP.ServiceManager', 'While writing the service file this ' - 'error occurred:\n%s') % str(ose), + translate('OpenLP.ServiceManager', 'An error occurred while writing the ' + 'service file: %s') % ose.strerror, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) success = False self.main_window.add_recent_file(path_file_name) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index e3df2f4fe..030516821 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -403,8 +403,8 @@ class ThemeManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ThemeManager, R except OSError as ose: self.log_exception('Export Theme Failed') critical_error_message_box(translate('OpenLP.ThemeManager', 'Theme Export Failed'), - translate('OpenLP.ThemeManager', - 'Your theme could not be exported due to this error:\n%s' % str(ose))) + translate('OpenLP.ThemeManager', 'The theme export failed because this error ' + 'occurred: %s') % ose.strerror) if theme_zip: theme_zip.close() shutil.rmtree(theme_path, True) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index a136ccee1..f96c46638 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -252,8 +252,8 @@ class SongExportForm(OpenLPWizard): else: self.progress_label.setText(translate('SongsPlugin.SongExportForm', 'Your song export failed.')) except OSError as ose: - self.progress_label.setText(translate('SongsPlugin.SongExportForm', 'Your song export failed due to this ' - 'error:\n%s') % str(ose)) + self.progress_label.setText(translate('SongsPlugin.SongExportForm', 'Your song export failed because this ' + 'error occurred: %s') % ose.strerror) def _find_list_widget_items(self, list_widget, text=''): """ diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index 19da1f731..a4136e88b 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -109,7 +109,7 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog, RegistryPrope log.exception('Failed to write out song usage records') critical_error_message_box(translate('SongUsagePlugin.SongUsageDetailForm', 'Report Creation Failed'), translate('SongUsagePlugin.SongUsageDetailForm', - 'The report could not be created due to this error:\n%s' % str(ose))) + 'An error occurred while creating the report: %s') % ose.strerror) finally: if file_handle: file_handle.close()