diff --git a/openlp/plugins/songusage/forms/songusagedetaildialog.py b/openlp/plugins/songusage/forms/songusagedetaildialog.py index 0cdde6836..47fc9bf27 100644 --- a/openlp/plugins/songusage/forms/songusagedetaildialog.py +++ b/openlp/plugins/songusage/forms/songusagedetaildialog.py @@ -34,30 +34,30 @@ from openlp.core.lib.ui import create_button_box class Ui_SongUsageDetailDialog(object): - def setupUi(self, songUsageDetailDialog): - songUsageDetailDialog.setObjectName(u'songUsageDetailDialog') - songUsageDetailDialog.resize(609, 413) - self.vertical_layout = QtGui.QVBoxLayout(songUsageDetailDialog) + def setupUi(self, song_usage_detail_dialog): + song_usage_detail_dialog.setObjectName(u'song_usage_detail_dialog') + song_usage_detail_dialog.resize(609, 413) + self.vertical_layout = QtGui.QVBoxLayout(song_usage_detail_dialog) self.vertical_layout.setSpacing(8) self.vertical_layout.setContentsMargins(8, 8, 8, 8) self.vertical_layout.setObjectName(u'vertical_layout') - self.date_range_group_box = QtGui.QGroupBox(songUsageDetailDialog) + self.date_range_group_box = QtGui.QGroupBox(song_usage_detail_dialog) self.date_range_group_box.setObjectName(u'date_range_group_box') self.date_horizontal_layout = QtGui.QHBoxLayout(self.date_range_group_box) self.date_horizontal_layout.setSpacing(8) self.date_horizontal_layout.setContentsMargins(8, 8, 8, 8) self.date_horizontal_layout.setObjectName(u'date_horizontal_layout') - self.from_date = QtGui.QCalendarWidget(self.date_range_group_box) - self.from_date.setObjectName(u'from_date') - self.date_horizontal_layout.addWidget(self.from_date) + self.from_date_calendar = QtGui.QCalendarWidget(self.date_range_group_box) + self.from_date_calendar.setObjectName(u'from_date_calendar') + self.date_horizontal_layout.addWidget(self.from_date_calendar) self.to_label = QtGui.QLabel(self.date_range_group_box) self.to_label.setScaledContents(False) self.to_label.setAlignment(QtCore.Qt.AlignCenter) self.to_label.setObjectName(u'to_label') self.date_horizontal_layout.addWidget(self.to_label) - self.to_date = QtGui.QCalendarWidget(self.date_range_group_box) - self.to_date.setObjectName(u'to_date') - self.date_horizontal_layout.addWidget(self.to_date) + self.to_date_calendar = QtGui.QCalendarWidget(self.date_range_group_box) + self.to_date_calendar.setObjectName(u'to_date_calendar') + self.date_horizontal_layout.addWidget(self.to_date_calendar) self.vertical_layout.addWidget(self.date_range_group_box) self.file_group_box = QtGui.QGroupBox(self.date_range_group_box) self.file_group_box.setObjectName(u'file_group_box') @@ -75,13 +75,13 @@ class Ui_SongUsageDetailDialog(object): self.save_file_push_button.setObjectName(u'save_file_push_button') self.file_horizontal_layout.addWidget(self.save_file_push_button) self.vertical_layout.addWidget(self.file_group_box) - self.button_box = create_button_box(songUsageDetailDialog, u'button_box', [u'cancel', u'ok']) + self.button_box = create_button_box(song_usage_detail_dialog, u'button_box', [u'cancel', u'ok']) self.vertical_layout.addWidget(self.button_box) - self.retranslateUi(songUsageDetailDialog) - self.save_file_push_button.clicked.connect(songUsageDetailDialog.define_output_location) + self.retranslateUi(song_usage_detail_dialog) + self.save_file_push_button.clicked.connect(song_usage_detail_dialog.define_output_location) - def retranslateUi(self, songUsageDetailDialog): - songUsageDetailDialog.setWindowTitle(translate('SongUsagePlugin.SongUsageDetailForm', 'Song Usage Extraction')) + def retranslateUi(self, song_usage_detail_dialog): + song_usage_detail_dialog.setWindowTitle(translate('SongUsagePlugin.SongUsageDetailForm', 'Song Usage Extraction')) self.date_range_group_box.setTitle(translate('SongUsagePlugin.SongUsageDetailForm', 'Select Date Range')) self.to_label.setText(translate('SongUsagePlugin.SongUsageDetailForm', 'to')) self.file_group_box.setTitle(translate('SongUsagePlugin.SongUsageDetailForm', 'Report Location')) diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index b660b9715..69611fd69 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -58,10 +58,8 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): """ We need to set up the screen """ - to_date = Settings().value(self.plugin.settingsSection + u'/to date') - from_date = Settings().value(self.plugin.settingsSection + u'/from date') - self.from_date.setSelectedDate(from_date) - self.to_date.setSelectedDate(to_date) + self.from_date_calendar.setSelectedDate(Settings().value(self.plugin.settingsSection + u'/from date')) + self.to_date_calendar.setSelectedDate(Settings().value(self.plugin.settingsSection + u'/to date')) self.file_line_edit.setText(Settings().value(self.plugin.settingsSection + u'/last directory export')) def define_output_location(self): @@ -90,14 +88,14 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): return check_directory_exists(path) file_name = translate('SongUsagePlugin.SongUsageDetailForm', 'usage_detail_%s_%s.txt') % ( - self.from_date.selectedDate().toString(u'ddMMyyyy'), - self.to_date.selectedDate().toString(u'ddMMyyyy')) - Settings().setValue(u'songusage/from date', self.from_date.selectedDate()) - Settings().setValue(u'songusage/to date', self.to_date.selectedDate()) + self.from_date_calendar.selectedDate().toString(u'ddMMyyyy'), + self.to_date_calendar.selectedDate().toString(u'ddMMyyyy')) + Settings().setValue(self.plugin.settingsSection + u'/from date', self.from_date_calendar.selectedDate()) + Settings().setValue(self.plugin.settingsSection + u'/to date', self.to_date_calendar.selectedDate()) usage = self.plugin.manager.get_all_objects( SongUsageItem, and_( - SongUsageItem.usagedate >= self.from_date.selectedDate().toPyDate(), - SongUsageItem.usagedate < self.to_date.selectedDate().toPyDate()), + SongUsageItem.usagedate >= self.from_date_calendar.selectedDate().toPyDate(), + SongUsageItem.usagedate < self.to_date_calendar.selectedDate().toPyDate()), [SongUsageItem.usagedate, SongUsageItem.usagetime]) report_file_name = os.path.join(path, file_name) file_handle = None diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 5b56e2563..19b56a339 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -66,7 +66,7 @@ class SongUsagePlugin(Plugin): self.icon = build_icon(u':/plugins/plugin_songusage.png') self.activeIcon = build_icon(u':/songusage/song_usage_active.png') self.inactiveIcon = build_icon(u':/songusage/song_usage_inactive.png') - self.songUsageActive = False + self.song_usage_active = False def checkPreConditions(self): return self.manager.session is not None @@ -168,7 +168,7 @@ class SongUsagePlugin(Plugin): """ self.song_usage_active_button.blockSignals(True) self.song_usage_status.blockSignals(True) - if self.songUsageActive: + if self.song_usage_active: self.song_usage_active_button.setIcon(self.activeIcon) self.song_usage_status.setChecked(True) self.song_usage_active_button.setChecked(True) @@ -195,7 +195,7 @@ class SongUsagePlugin(Plugin): def _add_song_usage(self, source, item): audit = item[0].audit - if self.songUsageActive and audit: + if self.song_usage_active and audit: song_usage_item = SongUsageItem() song_usage_item.usagedate = datetime.today() song_usage_item.usagetime = datetime.now().time() diff --git a/tests/functional/openlp_core_lib/test_image_manager.py b/tests/functional/openlp_core_lib/test_image_manager.py index d13c82c04..a257fec20 100644 --- a/tests/functional/openlp_core_lib/test_image_manager.py +++ b/tests/functional/openlp_core_lib/test_image_manager.py @@ -28,7 +28,8 @@ class TestImageManager(TestCase): """ Delete all the C++ objects at the end so that we don't have a segfault """ - del self.app + #del self.app + pass def basic_image_manager_test(self): """