Adjust error messages.

This commit is contained in:
Tomas Groth 2015-02-10 22:25:30 +00:00
parent 2cdc1b2fe4
commit bab5e90e20
5 changed files with 9 additions and 9 deletions

View File

@ -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):

View File

@ -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)

View File

@ -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)

View File

@ -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=''):
"""

View File

@ -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()