From 5f46426f93f149ff6013513519073d3a76c3c9bf Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 29 Jan 2011 08:26:14 +0000 Subject: [PATCH] More songusage cleanups --- openlp/plugins/songusage/forms/songusagedeleteform.py | 9 +++++++-- openlp/plugins/songusage/forms/songusagedetaildialog.py | 1 + openlp/plugins/songusage/forms/songusagedetailform.py | 9 ++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songusage/forms/songusagedeleteform.py b/openlp/plugins/songusage/forms/songusagedeleteform.py index f83ec8c82..a4cfd84b7 100644 --- a/openlp/plugins/songusage/forms/songusagedeleteform.py +++ b/openlp/plugins/songusage/forms/songusagedeleteform.py @@ -26,7 +26,7 @@ from PyQt4 import QtGui -from openlp.core.lib import translate +from openlp.core.lib import translate, Receiver from openlp.plugins.songusage.lib.db import SongUsageItem from songusagedeletedialog import Ui_SongUsageDeleteDialog @@ -55,4 +55,9 @@ class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog): deleteDate = self.deleteCalendar.selectedDate().toPyDate() self.manager.delete_all_objects(SongUsageItem, SongUsageItem.usagedate <= deleteDate) - self.close() \ No newline at end of file + Receiver.send_message(u'openlp_information_message', { + u'title': translate('SongUsagePlugin.SongUsageDeleteForm', + 'Deletion Sucessful'), + u'message': translate('SongUsagePlugin.SongUsageDeleteForm', + 'All requested data has been deleted sucessfully. ')}) + self.close() diff --git a/openlp/plugins/songusage/forms/songusagedetaildialog.py b/openlp/plugins/songusage/forms/songusagedetaildialog.py index 87d2d5ffe..ec1f69d7e 100644 --- a/openlp/plugins/songusage/forms/songusagedetaildialog.py +++ b/openlp/plugins/songusage/forms/songusagedetaildialog.py @@ -61,6 +61,7 @@ class Ui_SongUsageDetailDialog(object): self.fileLineEdit = QtGui.QLineEdit(self.fileGroupBox) self.fileLineEdit.setObjectName(u'fileLineEdit') self.fileLineEdit.setReadOnly(True) + self.fileLineEdit.setEnabled(False) self.horizontalLayout.addWidget(self.fileLineEdit) self.saveFilePushButton = QtGui.QPushButton(self.fileGroupBox) self.saveFilePushButton.setIcon( diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index 88e3b1450..f02820b0d 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -30,7 +30,8 @@ import os from PyQt4 import QtCore, QtGui from sqlalchemy.sql import and_ -from openlp.core.lib import SettingsManager, translate, check_directory_exists +from openlp.core.lib import SettingsManager, translate, Receiver, \ + check_directory_exists from openlp.plugins.songusage.lib.db import SongUsageItem from songusagedetaildialog import Ui_SongUsageDetailDialog @@ -110,6 +111,12 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): instance.usagedate, instance.usagetime, instance.title, instance.copyright, instance.ccl_number, instance.authors) fileHandle.write(record.encode(u'utf-8')) + Receiver.send_message(u'openlp_information_message', { + u'title': translate('SongUsagePlugin.SongUsageDetailForm', + 'Report Creation'), + u'message': unicode(translate( + 'SongUsagePlugin.SongUsageDetailForm', 'Report \n%s \n' + 'has been sucessfully created. ')) % outname}) except IOError: log.exception(u'Failed to write out song usage records') finally: