forked from openlp/openlp
Head1106
This commit is contained in:
commit
bfac70d1b0
@ -73,6 +73,7 @@ class Ui_MainWindow(object):
|
|||||||
MainWindow.setSizePolicy(sizePolicy)
|
MainWindow.setSizePolicy(sizePolicy)
|
||||||
MainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
|
MainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
|
||||||
MainWindow.setWindowIcon(MainIcon)
|
MainWindow.setWindowIcon(MainIcon)
|
||||||
|
self.setDockNestingEnabled(True)
|
||||||
# Set up the main container, which contains all the other form widgets
|
# Set up the main container, which contains all the other form widgets
|
||||||
self.MainContent = QtGui.QWidget(MainWindow)
|
self.MainContent = QtGui.QWidget(MainWindow)
|
||||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
|
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
|
||||||
|
@ -434,8 +434,12 @@ class SlideController(QtGui.QWidget):
|
|||||||
request = unicode(self.sender().text())
|
request = unicode(self.sender().text())
|
||||||
slideno = self.slideList[request]
|
slideno = self.slideList[request]
|
||||||
if slideno > self.PreviewListWidget.rowCount():
|
if slideno > self.PreviewListWidget.rowCount():
|
||||||
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount())
|
self.PreviewListWidget.selectRow(
|
||||||
|
self.PreviewListWidget.rowCount() - 1)
|
||||||
else:
|
else:
|
||||||
|
if slideno + 1 < self.PreviewListWidget.rowCount():
|
||||||
|
self.PreviewListWidget.scrollToItem(
|
||||||
|
self.PreviewListWidget.item(slideno + 1, 0))
|
||||||
self.PreviewListWidget.selectRow(slideno)
|
self.PreviewListWidget.selectRow(slideno)
|
||||||
self.onSlideSelected()
|
self.onSlideSelected()
|
||||||
|
|
||||||
@ -527,6 +531,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
log.debug(u'addServiceManagerItem live = %s' % self.isLive)
|
log.debug(u'addServiceManagerItem live = %s' % self.isLive)
|
||||||
# If service item is the same as the current on only change slide
|
# If service item is the same as the current on only change slide
|
||||||
if item.__eq__(self.serviceItem):
|
if item.__eq__(self.serviceItem):
|
||||||
|
if slideno + 1 < self.PreviewListWidget.rowCount():
|
||||||
|
self.PreviewListWidget.scrollToItem(
|
||||||
|
self.PreviewListWidget.item(slideno + 1, 0))
|
||||||
self.PreviewListWidget.selectRow(slideno)
|
self.PreviewListWidget.selectRow(slideno)
|
||||||
self.onSlideSelected()
|
self.onSlideSelected()
|
||||||
return
|
return
|
||||||
@ -608,8 +615,12 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.PreviewListWidget.setColumnWidth(0,
|
self.PreviewListWidget.setColumnWidth(0,
|
||||||
self.PreviewListWidget.viewport().size().width())
|
self.PreviewListWidget.viewport().size().width())
|
||||||
if slideno > self.PreviewListWidget.rowCount():
|
if slideno > self.PreviewListWidget.rowCount():
|
||||||
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount())
|
self.PreviewListWidget.selectRow(
|
||||||
|
self.PreviewListWidget.rowCount() - 1)
|
||||||
else:
|
else:
|
||||||
|
if slideno + 1 < self.PreviewListWidget.rowCount():
|
||||||
|
self.PreviewListWidget.scrollToItem(
|
||||||
|
self.PreviewListWidget.item(slideno + 1, 0))
|
||||||
self.PreviewListWidget.selectRow(slideno)
|
self.PreviewListWidget.selectRow(slideno)
|
||||||
self.enableToolBar(serviceItem)
|
self.enableToolBar(serviceItem)
|
||||||
# Pass to display for viewing
|
# Pass to display for viewing
|
||||||
@ -668,6 +679,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
[self.serviceItem, self.isLive, index])
|
[self.serviceItem, self.isLive, index])
|
||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
else:
|
else:
|
||||||
|
if index + 1 < self.PreviewListWidget.rowCount():
|
||||||
|
self.PreviewListWidget.scrollToItem(
|
||||||
|
self.PreviewListWidget.item(index + 1, 0))
|
||||||
self.PreviewListWidget.selectRow(index)
|
self.PreviewListWidget.selectRow(index)
|
||||||
self.onSlideSelected()
|
self.onSlideSelected()
|
||||||
|
|
||||||
@ -799,6 +813,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
The slide has been changed. Update the slidecontroller accordingly
|
The slide has been changed. Update the slidecontroller accordingly
|
||||||
"""
|
"""
|
||||||
|
if row + 1 < self.PreviewListWidget.rowCount():
|
||||||
|
self.PreviewListWidget.scrollToItem(
|
||||||
|
self.PreviewListWidget.item(row + 1, 0))
|
||||||
self.PreviewListWidget.selectRow(row)
|
self.PreviewListWidget.selectRow(row)
|
||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
||||||
@ -844,6 +861,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
Receiver.send_message('servicemanager_next_item')
|
Receiver.send_message('servicemanager_next_item')
|
||||||
return
|
return
|
||||||
|
if row + 1 < self.PreviewListWidget.rowCount():
|
||||||
|
self.PreviewListWidget.scrollToItem(
|
||||||
|
self.PreviewListWidget.item(row + 1, 0))
|
||||||
self.PreviewListWidget.selectRow(row)
|
self.PreviewListWidget.selectRow(row)
|
||||||
self.onSlideSelected()
|
self.onSlideSelected()
|
||||||
|
|
||||||
@ -867,6 +887,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
row = self.PreviewListWidget.rowCount() - 1
|
row = self.PreviewListWidget.rowCount() - 1
|
||||||
else:
|
else:
|
||||||
row = 0
|
row = 0
|
||||||
|
if row + 1 < self.PreviewListWidget.rowCount():
|
||||||
|
self.PreviewListWidget.scrollToItem(
|
||||||
|
self.PreviewListWidget.item(row + 1, 0))
|
||||||
self.PreviewListWidget.selectRow(row)
|
self.PreviewListWidget.selectRow(row)
|
||||||
self.onSlideSelected()
|
self.onSlideSelected()
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ class CustomPlugin(Plugin):
|
|||||||
return CustomTab(self.name, visible_name[u'title'])
|
return CustomTab(self.name, visible_name[u'title'])
|
||||||
|
|
||||||
def getMediaManagerItem(self):
|
def getMediaManagerItem(self):
|
||||||
# Create the CustomManagerItem object
|
# Create the ManagerItem object
|
||||||
return CustomMediaItem(self, self, self.icon)
|
return CustomMediaItem(self, self, self.icon)
|
||||||
|
|
||||||
def about(self):
|
def about(self):
|
||||||
@ -76,7 +76,7 @@ class CustomPlugin(Plugin):
|
|||||||
|
|
||||||
Returns True if the theme is being used, otherwise returns False.
|
Returns True if the theme is being used, otherwise returns False.
|
||||||
"""
|
"""
|
||||||
if self.custommanager.get_all_objects(CustomSlide,
|
if self.manager.get_all_objects(CustomSlide,
|
||||||
CustomSlide.theme_name == theme):
|
CustomSlide.theme_name == theme):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@ -92,11 +92,11 @@ class CustomPlugin(Plugin):
|
|||||||
``newTheme``
|
``newTheme``
|
||||||
The new name the plugin should now use.
|
The new name the plugin should now use.
|
||||||
"""
|
"""
|
||||||
customsUsingTheme = self.custommanager.get_all_objects(CustomSlide,
|
customsUsingTheme = self.manager.get_all_objects(CustomSlide,
|
||||||
CustomSlide.theme_name == oldTheme)
|
CustomSlide.theme_name == oldTheme)
|
||||||
for custom in customsUsingTheme:
|
for custom in customsUsingTheme:
|
||||||
custom.theme_name = newTheme
|
custom.theme_name = newTheme
|
||||||
self.custommanager.save_object(custom)
|
self.manager.save_object(custom)
|
||||||
|
|
||||||
def setPluginTextStrings(self):
|
def setPluginTextStrings(self):
|
||||||
"""
|
"""
|
||||||
|
@ -162,12 +162,10 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
|
|||||||
sxml.add_verse_to_lyrics(u'custom', unicode(count),
|
sxml.add_verse_to_lyrics(u'custom', unicode(count),
|
||||||
unicode(self.slideListView.item(i).text()))
|
unicode(self.slideListView.item(i).text()))
|
||||||
count += 1
|
count += 1
|
||||||
self.customSlide.title = unicode(self.titleEdit.displayText(), u'utf-8')
|
self.customSlide.title = unicode(self.titleEdit.text())
|
||||||
self.customSlide.text = unicode(sxml.extract_xml(), u'utf-8')
|
self.customSlide.text = unicode(sxml.extract_xml(), u'utf-8')
|
||||||
self.customSlide.credits = unicode(self.creditEdit.displayText(),
|
self.customSlide.credits = unicode(self.creditEdit.text())
|
||||||
u'utf-8')
|
self.customSlide.theme_name = unicode(self.themeComboBox.currentText())
|
||||||
self.customSlide.theme_name = unicode(self.themeComboBox.currentText(),
|
|
||||||
u'utf-8')
|
|
||||||
return self.manager.save_object(self.customSlide)
|
return self.manager.save_object(self.customSlide)
|
||||||
|
|
||||||
def onUpButtonPressed(self):
|
def onUpButtonPressed(self):
|
||||||
|
@ -140,7 +140,7 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
id_list = [(item.data(QtCore.Qt.UserRole)).toInt()[0]
|
id_list = [(item.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||||
for item in self.listView.selectedIndexes()]
|
for item in self.listView.selectedIndexes()]
|
||||||
for id in id_list:
|
for id in id_list:
|
||||||
self.parent.custommanager.delete_object(CustomSlide, id)
|
self.parent.manager.delete_object(CustomSlide, id)
|
||||||
for row in row_list:
|
for row in row_list:
|
||||||
self.listView.takeItem(row)
|
self.listView.takeItem(row)
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
service_item.add_capability(ItemCapabilities.AllowsEdit)
|
service_item.add_capability(ItemCapabilities.AllowsEdit)
|
||||||
service_item.add_capability(ItemCapabilities.AllowsPreview)
|
service_item.add_capability(ItemCapabilities.AllowsPreview)
|
||||||
service_item.add_capability(ItemCapabilities.AllowsLoop)
|
service_item.add_capability(ItemCapabilities.AllowsLoop)
|
||||||
customSlide = self.parent.custommanager.get_object(CustomSlide, item_id)
|
customSlide = self.parent.manager.get_object(CustomSlide, item_id)
|
||||||
title = customSlide.title
|
title = customSlide.title
|
||||||
credit = customSlide.credits
|
credit = customSlide.credits
|
||||||
service_item.editId = item_id
|
service_item.editId = item_id
|
||||||
|
@ -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