forked from openlp/openlp
replaced songusagemanager
This commit is contained in:
parent
b21572782b
commit
d458ac2a98
@ -34,11 +34,11 @@ class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog):
|
|||||||
"""
|
"""
|
||||||
Class documentation goes here.
|
Class documentation goes here.
|
||||||
"""
|
"""
|
||||||
def __init__(self, songusagemanager, parent):
|
def __init__(self, manager, parent):
|
||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
self.songusagemanager = songusagemanager
|
self.manager = manager
|
||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
@ -53,6 +53,6 @@ class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog):
|
|||||||
QtGui.QMessageBox.Cancel)
|
QtGui.QMessageBox.Cancel)
|
||||||
if ret == QtGui.QMessageBox.Ok:
|
if ret == QtGui.QMessageBox.Ok:
|
||||||
deleteDate = self.deleteCalendar.selectedDate().toPyDate()
|
deleteDate = self.deleteCalendar.selectedDate().toPyDate()
|
||||||
self.songusagemanager.delete_all_objects(SongUsageItem,
|
self.manager.delete_all_objects(SongUsageItem,
|
||||||
SongUsageItem.usagedate <= deleteDate)
|
SongUsageItem.usagedate <= deleteDate)
|
||||||
self.close()
|
self.close()
|
||||||
|
@ -76,7 +76,7 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
|
|||||||
filename = u'usage_detail_%s_%s.txt' % (
|
filename = u'usage_detail_%s_%s.txt' % (
|
||||||
self.fromDate.selectedDate().toString(u'ddMMyyyy'),
|
self.fromDate.selectedDate().toString(u'ddMMyyyy'),
|
||||||
self.toDate.selectedDate().toString(u'ddMMyyyy'))
|
self.toDate.selectedDate().toString(u'ddMMyyyy'))
|
||||||
usage = self.plugin.songusagemanager.get_all_objects(
|
usage = self.plugin.manager.get_all_objects(
|
||||||
SongUsageItem, and_(
|
SongUsageItem, and_(
|
||||||
SongUsageItem.usagedate >= self.fromDate.selectedDate().toPyDate(),
|
SongUsageItem.usagedate >= self.fromDate.selectedDate().toPyDate(),
|
||||||
SongUsageItem.usagedate < self.toDate.selectedDate().toPyDate()),
|
SongUsageItem.usagedate < self.toDate.selectedDate().toPyDate()),
|
||||||
|
@ -44,7 +44,7 @@ class SongUsagePlugin(Plugin):
|
|||||||
Plugin.__init__(self, u'SongUsage', u'1.9.3', plugin_helpers)
|
Plugin.__init__(self, u'SongUsage', u'1.9.3', plugin_helpers)
|
||||||
self.weight = -4
|
self.weight = -4
|
||||||
self.icon = build_icon(u':/plugins/plugin_songusage.png')
|
self.icon = build_icon(u':/plugins/plugin_songusage.png')
|
||||||
self.songusagemanager = None
|
self.manager = None
|
||||||
self.songusageActive = False
|
self.songusageActive = False
|
||||||
|
|
||||||
def addToolsMenuItem(self, tools_menu):
|
def addToolsMenuItem(self, tools_menu):
|
||||||
@ -115,9 +115,9 @@ class SongUsagePlugin(Plugin):
|
|||||||
self.settingsSection + u'/active',
|
self.settingsSection + u'/active',
|
||||||
QtCore.QVariant(False)).toBool()
|
QtCore.QVariant(False)).toBool()
|
||||||
self.SongUsageStatus.setChecked(self.SongUsageActive)
|
self.SongUsageStatus.setChecked(self.SongUsageActive)
|
||||||
if self.songusagemanager is None:
|
if self.manager is None:
|
||||||
self.songusagemanager = Manager(u'songusage', init_schema)
|
self.manager = Manager(u'songusage', init_schema)
|
||||||
self.SongUsagedeleteform = SongUsageDeleteForm(self.songusagemanager,
|
self.SongUsagedeleteform = SongUsageDeleteForm(self.manager,
|
||||||
self.formparent)
|
self.formparent)
|
||||||
self.SongUsagedetailform = SongUsageDetailForm(self, self.formparent)
|
self.SongUsagedetailform = SongUsageDetailForm(self, self.formparent)
|
||||||
self.SongUsageMenu.menuAction().setVisible(True)
|
self.SongUsageMenu.menuAction().setVisible(True)
|
||||||
@ -148,7 +148,7 @@ class SongUsagePlugin(Plugin):
|
|||||||
song_usage_item.authors = u''
|
song_usage_item.authors = u''
|
||||||
for author in audit[1]:
|
for author in audit[1]:
|
||||||
song_usage_item.authors += author + u' '
|
song_usage_item.authors += author + u' '
|
||||||
self.songusagemanager.save_object(song_usage_item)
|
self.manager.save_object(song_usage_item)
|
||||||
|
|
||||||
def onSongUsageDelete(self):
|
def onSongUsageDelete(self):
|
||||||
self.SongUsagedeleteform.exec_()
|
self.SongUsagedeleteform.exec_()
|
||||||
|
Loading…
Reference in New Issue
Block a user