shortcuthandling ideas

This commit is contained in:
rimach 2010-11-15 23:54:41 +01:00
commit ad94471014
61 changed files with 315 additions and 81872 deletions

View File

@ -117,6 +117,7 @@ class Manager(object):
settings = QtCore.QSettings() settings = QtCore.QSettings()
settings.beginGroup(plugin_name) settings.beginGroup(plugin_name)
self.db_url = u'' self.db_url = u''
self.is_dirty = False
db_type = unicode( db_type = unicode(
settings.value(u'db type', QtCore.QVariant(u'sqlite')).toString()) settings.value(u'db type', QtCore.QVariant(u'sqlite')).toString())
if db_type == u'sqlite': if db_type == u'sqlite':
@ -150,6 +151,7 @@ class Manager(object):
self.session.add(object_instance) self.session.add(object_instance)
if commit: if commit:
self.session.commit() self.session.commit()
self.is_dirty = True
return True return True
except InvalidRequestError: except InvalidRequestError:
self.session.rollback() self.session.rollback()
@ -220,6 +222,7 @@ class Manager(object):
try: try:
self.session.delete(object_instance) self.session.delete(object_instance)
self.session.commit() self.session.commit()
self.is_dirty = True
return True return True
except InvalidRequestError: except InvalidRequestError:
self.session.rollback() self.session.rollback()
@ -241,6 +244,7 @@ class Manager(object):
query = query.filter(filter_clause) query = query.filter(filter_clause)
query.delete(synchronize_session=False) query.delete(synchronize_session=False)
self.session.commit() self.session.commit()
self.is_dirty = True
return True return True
except InvalidRequestError: except InvalidRequestError:
self.session.rollback() self.session.rollback()
@ -251,5 +255,6 @@ class Manager(object):
""" """
VACUUM the database on exit. VACUUM the database on exit.
""" """
if self.is_dirty:
engine = create_engine(self.db_url) engine = create_engine(self.db_url)
engine.execute("vacuum") engine.execute("vacuum")

View File

@ -541,4 +541,3 @@ class MediaManagerItem(QtGui.QWidget):
individual service items need to be processed by the plugins individual service items need to be processed by the plugins
""" """
pass pass

View File

@ -156,9 +156,11 @@ class PluginManager(object):
if plugin.settings_tab: if plugin.settings_tab:
log.debug(u'Inserting settings tab item from %s' % log.debug(u'Inserting settings tab item from %s' %
visible_title[u'title']) visible_title[u'title'])
settingsform.addTab(visible_title[u'title'], plugin.settings_tab) settingsform.addTab(visible_title[u'title'],
plugin.settings_tab)
else: else:
log.debug(u'No tab settings in %s' % visible_title[u'title']) log.debug(
u'No tab settings in %s' % visible_title[u'title'])
def hook_import_menu(self, import_menu): def hook_import_menu(self, import_menu):
""" """

View File

@ -29,11 +29,10 @@ format it for the output display.
""" """
import logging import logging
from PyQt4 import QtGui, QtCore, QtWebKit from PyQt4 import QtWebKit
from openlp.core.lib import resize_image, expand_tags, \
build_lyrics_format_css, build_lyrics_outline_css, image_to_byte
from openlp.core.lib import expand_tags, build_lyrics_format_css, \
build_lyrics_outline_css
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -116,18 +115,19 @@ class Renderer(object):
html_text = u'' html_text = u''
styled_text = u'' styled_text = u''
for line in text: for line in text:
styled_line = expand_tags(line) styled_line = expand_tags(line) + line_end
if styled_text: styled_text += styled_line
styled_text += line_end + styled_line
html = self.page_shell + styled_text + u'</div></body></html>' html = self.page_shell + styled_text + u'</div></body></html>'
self.web.setHtml(html) self.web.setHtml(html)
# Text too long so go to next page # Text too long so go to next page
if self.web_frame.contentsSize().height() > self.page_height: if self.web_frame.contentsSize().height() > self.page_height:
if html_text.endswith(u'<br>'):
html_text = html_text[:len(html_text)-4]
formatted.append(html_text) formatted.append(html_text)
html_text = u'' html_text = u''
styled_text = styled_line styled_text = styled_line
html_text += line + line_end html_text += line + line_end
if line_break: if html_text.endswith(u'<br>'):
html_text = html_text[:len(html_text)-4] html_text = html_text[:len(html_text)-4]
formatted.append(html_text) formatted.append(html_text)
log.debug(u'format_slide - End') log.debug(u'format_slide - End')

View File

@ -32,9 +32,7 @@ import logging
import os import os
import uuid import uuid
from PyQt4 import QtGui from openlp.core.lib import build_icon, clean_tags, expand_tags
from openlp.core.lib import build_icon, resize_image, clean_tags, expand_tags
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@ -386,10 +386,11 @@ class ThemeXML(object):
for e in element.attrib.iteritems(): for e in element.attrib.iteritems():
if master == u'font_' and e[0] == u'type': if master == u'font_' and e[0] == u'type':
master += e[1] + u'_' master += e[1] + u'_'
elif master == u'display_' and (element.tag == u'shadow' \ elif master == u'display_' and (element.tag == u'shadow'
or element.tag == u'outline'): or element.tag == u'outline'):
self._create_attr(master, element.tag, element.text) self._create_attr(master, element.tag, element.text)
self._create_attr(master, element.tag + u'_'+ e[0], e[1]) self._create_attr(master, element.tag + u'_'+ e[0],
e[1])
else: else:
field = master + e[0] field = master + e[0]
self._create_attr(master, e[0], e[1]) self._create_attr(master, e[0], e[1])
@ -408,6 +409,9 @@ class ThemeXML(object):
elif field in integer_list: elif field in integer_list:
setattr(self, master + field, int(value)) setattr(self, master + field, int(value))
else: else:
# None means an empty string so lets have one.
if value == u'None':
value = u''
setattr(self, master + field, unicode(value)) setattr(self, master + field, unicode(value))
def __str__(self): def __str__(self):

View File

@ -83,7 +83,8 @@ class AdvancedTab(SettingsTab):
self.uiLayout.addWidget(self.doubleClickLiveCheckBox) self.uiLayout.addWidget(self.doubleClickLiveCheckBox)
self.leftLayout.addWidget(self.uiGroupBox) self.leftLayout.addWidget(self.uiGroupBox)
self.expandServiceItemCheckBox = QtGui.QCheckBox(self.uiGroupBox) self.expandServiceItemCheckBox = QtGui.QCheckBox(self.uiGroupBox)
self.expandServiceItemCheckBox.setObjectName(u'expandServiceItemCheckBox') self.expandServiceItemCheckBox.setObjectName(
u'expandServiceItemCheckBox')
self.uiLayout.addWidget(self.expandServiceItemCheckBox) self.uiLayout.addWidget(self.expandServiceItemCheckBox)
# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftWidget) # self.sharedDirGroupBox = QtGui.QGroupBox(self.leftWidget)
# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox') # self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')

View File

@ -34,7 +34,8 @@ class Ui_FileRenameDialog(object):
FileRenameDialog.resize(400, 87) FileRenameDialog.resize(400, 87)
self.buttonBox = QtGui.QDialogButtonBox(FileRenameDialog) self.buttonBox = QtGui.QDialogButtonBox(FileRenameDialog)
self.buttonBox.setGeometry(QtCore.QRect(210, 50, 171, 25)) self.buttonBox.setGeometry(QtCore.QRect(210, 50, 171, 25))
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox") self.buttonBox.setObjectName("buttonBox")
self.widget = QtGui.QWidget(FileRenameDialog) self.widget = QtGui.QWidget(FileRenameDialog)
self.widget.setGeometry(QtCore.QRect(10, 10, 381, 35)) self.widget.setGeometry(QtCore.QRect(10, 10, 381, 35))

View File

@ -30,8 +30,7 @@ import os
from PyQt4 import QtCore, QtGui, QtWebKit from PyQt4 import QtCore, QtGui, QtWebKit
from PyQt4.phonon import Phonon from PyQt4.phonon import Phonon
from openlp.core.lib import Receiver, resize_image, build_html, ServiceItem, \ from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte
image_to_byte
from openlp.core.ui import HideMode from openlp.core.ui import HideMode
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@ -75,6 +75,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,
@ -269,7 +270,8 @@ class Ui_MainWindow(object):
self.SettingsPluginListItem.setIcon( self.SettingsPluginListItem.setIcon(
build_icon(u':/system/settings_plugin_list.png')) build_icon(u':/system/settings_plugin_list.png'))
self.SettingsPluginListItem.setObjectName(u'SettingsPluginListItem') self.SettingsPluginListItem.setObjectName(u'SettingsPluginListItem')
MainWindow.actionList.add_action(self.SettingsPluginListItem, u'Settings') MainWindow.actionList.add_action(self.SettingsPluginListItem,
u'Settings')
#i18n Language Items #i18n Language Items
self.AutoLanguageItem = QtGui.QAction(MainWindow) self.AutoLanguageItem = QtGui.QAction(MainWindow)
self.AutoLanguageItem.setObjectName(u'AutoLanguageItem') self.AutoLanguageItem.setObjectName(u'AutoLanguageItem')
@ -295,7 +297,8 @@ class Ui_MainWindow(object):
self.SettingsConfigureItem.setIcon( self.SettingsConfigureItem.setIcon(
build_icon(u':/system/system_settings.png')) build_icon(u':/system/system_settings.png'))
self.SettingsConfigureItem.setObjectName(u'SettingsConfigureItem') self.SettingsConfigureItem.setObjectName(u'SettingsConfigureItem')
MainWindow.actionList.add_action(self.SettingsShortcutsItem, u'Settings') MainWindow.actionList.add_action(self.SettingsShortcutsItem,
u'Settings')
self.HelpDocumentationItem = QtGui.QAction(MainWindow) self.HelpDocumentationItem = QtGui.QAction(MainWindow)
self.HelpDocumentationItem.setIcon( self.HelpDocumentationItem.setIcon(
build_icon(u':/system/system_help_contents.png')) build_icon(u':/system/system_help_contents.png'))
@ -760,7 +763,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
""" """
Show the shortcuts dialog Show the shortcuts dialog
""" """
self.shortcutForm.exec_(self.actionList) self.shortcutForm.exec_(self)
def onModeDefaultItemClicked(self): def onModeDefaultItemClicked(self):
""" """

View File

@ -107,7 +107,8 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
if self.pluginListWidget.currentItem() is None: if self.pluginListWidget.currentItem() is None:
self._clearDetails() self._clearDetails()
return return
plugin_name_plural = self.pluginListWidget.currentItem().text().split(u' ')[0] plugin_name_plural = \
self.pluginListWidget.currentItem().text().split(u' ')[0]
self.activePlugin = None self.activePlugin = None
for plugin in self.parent.plugin_manager.plugins: for plugin in self.parent.plugin_manager.plugins:
name_string = plugin.getString(StringContent.Name) name_string = plugin.getString(StringContent.Name)

View File

@ -203,13 +203,13 @@ class ServiceManager(QtGui.QWidget):
self.orderToolbar.addSeparator() self.orderToolbar.addSeparator()
self.orderToolbar.addToolbarButton( self.orderToolbar.addToolbarButton(
translate('OpenLP.ServiceManager', '&Expand all'), translate('OpenLP.ServiceManager', '&Expand all'),
u':/services/service_top.png', u':/services/service_expand_all.png',
translate('OpenLP.ServiceManager', translate('OpenLP.ServiceManager',
'Expand all the service items.'), 'Expand all the service items.'),
self.onExpandAll) self.onExpandAll)
self.orderToolbar.addToolbarButton( self.orderToolbar.addToolbarButton(
translate('OpenLP.ServiceManager', '&Collapse all'), translate('OpenLP.ServiceManager', '&Collapse all'),
u':/services/service_bottom.png', u':/services/service_collapse_all.png',
translate('OpenLP.ServiceManager', translate('OpenLP.ServiceManager',
'Collapse all the service items.'), 'Collapse all the service items.'),
self.onCollapseAll) self.onCollapseAll)
@ -441,7 +441,8 @@ class ServiceManager(QtGui.QWidget):
if setSelected: if setSelected:
setSelected = False setSelected = False
serviceIterator.value().setSelected(True) serviceIterator.value().setSelected(True)
elif serviceIterator.value() and serviceIterator.value().isSelected(): elif serviceIterator.value() and \
serviceIterator.value().isSelected():
serviceIterator.value().setSelected(False) serviceIterator.value().setSelected(False)
setSelected = True setSelected = True
serviceIterator += 1 serviceIterator += 1
@ -761,7 +762,8 @@ class ServiceManager(QtGui.QWidget):
serviceitem.set_from_service(item, self.servicePath) serviceitem.set_from_service(item, self.servicePath)
self.validateItem(serviceitem) self.validateItem(serviceitem)
self.addServiceItem(serviceitem) self.addServiceItem(serviceitem)
if serviceitem.is_capable(ItemCapabilities.OnLoadUpdate): if serviceitem.is_capable(
ItemCapabilities.OnLoadUpdate):
Receiver.send_message(u'%s_service_load' % Receiver.send_message(u'%s_service_load' %
serviceitem.name.lower(), serviceitem) serviceitem.name.lower(), serviceitem)
try: try:

View File

@ -42,9 +42,6 @@ class Ui_ShortcutListDialog(object):
self.shortcutListTreeWidget.setColumnCount(2) self.shortcutListTreeWidget.setColumnCount(2)
self.shortcutListTreeWidget.setSelectionBehavior( self.shortcutListTreeWidget.setSelectionBehavior(
QtGui.QAbstractItemView.SelectRows) QtGui.QAbstractItemView.SelectRows)
#self.shortcutListTreeWidget.setHeaderItem(0, QtGui.QTreeWidgetItem())
#self.shortcutListTreeWidget.setHeaderItem(1, QtGui.QTreeWidgetItem())
#self.shortcutListTreeWidget.verticalHeader().setVisible(False)
self.shortcutListLayout.addWidget(self.shortcutListTreeWidget) self.shortcutListLayout.addWidget(self.shortcutListTreeWidget)
self.shortcutLayout = QtGui.QVBoxLayout() self.shortcutLayout = QtGui.QVBoxLayout()
self.shortcutLayout.setSpacing(8) self.shortcutLayout.setSpacing(8)
@ -105,8 +102,8 @@ class Ui_ShortcutListDialog(object):
shortcutListDialog.setWindowTitle( shortcutListDialog.setWindowTitle(
translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts')) translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts'))
self.shortcutListTreeWidget.setHeaderLabels([ self.shortcutListTreeWidget.setHeaderLabels([
translate(u'OpenLP.ShortcutListDialog', 'Action'), translate('OpenLP.ShortcutListDialog', 'Action'),
translate(u'OpenLP.ShortcutListDialog', 'Shortcut') translate('OpenLP.ShortcutListDialog', 'Shortcut')
]) ])
self.defaultRadioButton.setText( self.defaultRadioButton.setText(
translate('OpenLP.ShortcutListDialog', 'Default: %s')) translate('OpenLP.ShortcutListDialog', 'Default: %s'))
@ -114,3 +111,4 @@ class Ui_ShortcutListDialog(object):
translate('OpenLP.ShortcutListDialog', 'Custom:')) translate('OpenLP.ShortcutListDialog', 'Custom:'))
self.shortcutPushButton.setText( self.shortcutPushButton.setText(
translate('OpenLP.ShortcutListDialog', 'None')) translate('OpenLP.ShortcutListDialog', 'None'))

View File

@ -49,11 +49,14 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
self.setupUi(self) self.setupUi(self)
self.actionList = None self.actionList = None
self.captureShortcut = False self.captureShortcut = False
self.currentItem = None
self.newShortcut = None
QtCore.QObject.connect( QtCore.QObject.connect(
self.shortcutPushButton, self.shortcutPushButton,
QtCore.SIGNAL(u'toggled(bool)'), QtCore.SIGNAL(u'toggled(bool)'),
self.onShortcutPushButtonClicked self.onShortcutPushButtonClicked
) )
self.shortcutListTreeWidget.itemDoubleClicked.connect(self.shortcutEdit)
def keyReleaseEvent(self, event): def keyReleaseEvent(self, event):
Qt = QtCore.Qt Qt = QtCore.Qt
@ -69,7 +72,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
if event.modifiers() & Qt.AltModifier == Qt.AltModifier: if event.modifiers() & Qt.AltModifier == Qt.AltModifier:
key_string = u'Alt+' + key_string key_string = u'Alt+' + key_string
if event.modifiers() & Qt.ShiftModifier == Qt.ShiftModifier: if event.modifiers() & Qt.ShiftModifier == Qt.ShiftModifier:
key_string = u'Shift+' + key_string; key_string = u'Shift+' + key_string
key_sequence = QtGui.QKeySequence(key_string) key_sequence = QtGui.QKeySequence(key_string)
existing_key = QtGui.QKeySequence("Ctrl+Shift+F8") existing_key = QtGui.QKeySequence("Ctrl+Shift+F8")
if key_sequence == existing_key: if key_sequence == existing_key:
@ -83,28 +86,71 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
QtGui.QMessageBox.Ok QtGui.QMessageBox.Ok
) )
else: else:
self.newShortcut = key_sequence.toString()
self.shortcutPushButton.setText(key_sequence.toString()) self.shortcutPushButton.setText(key_sequence.toString())
if self.currentItem:
self.actionList[self.currentItem].setShortcut(QtGui.QKeySequence(self.newShortcut))
self.shortcutListTreeWidget.currentItem().setText(1, self.newShortcut)
self.shortcutPushButton.setChecked(False) self.shortcutPushButton.setChecked(False)
self.captureShortcut = False self.captureShortcut = False
def exec_(self, actionList): def exec_(self, parent):
self.actionList = actionList self.actionList = parent.findChildren(QtGui.QAction)
self.refreshActions() self.refreshActions()
return QtGui.QDialog.exec_(self) return QtGui.QDialog.exec_(self)
def refreshActions(self): def refreshActions(self):
self.shortcutListTreeWidget.clear() self.shortcutListTreeWidget.clear()
for category in self.actionList.categories: catItemDict = dict()
item = QtGui.QTreeWidgetItem([category.name]) for num in range(len(self.actionList)):
for action in category.actions: action = self.actionList[num]
actionText = REMOVE_AMPERSAND.sub('', unicode(action.text())) actionText = action.objectName() or action.parentWidget().objectName()
shortcutText = action.shortcut().toString() shortcutText = action.shortcut().toString()
actionItem = QtGui.QTreeWidgetItem([actionText, shortcutText]) #if not shortcutText:
# continue
categorie = action.data().toString() or 'Sonstige'
if not catItemDict.has_key(categorie):
catItemDict[categorie] = QtGui.QTreeWidgetItem([categorie])
actionItem = QtGui.QTreeWidgetItem([actionText, shortcutText], num)
actionItem.setIcon(0, action.icon()) actionItem.setIcon(0, action.icon())
item.addChild(actionItem) catItemDict[categorie].addChild(actionItem)
item.setExpanded(True) catItemDict[categorie].setExpanded(True)
self.shortcutListTreeWidget.addTopLevelItem(item) for item in catItemDict:
self.shortcutListTreeWidget.addTopLevelItem(catItemDict[item])
self.shortcutListTreeWidget.expandItem(catItemDict[item])
def load_action_list(self, file):
"""
Load an actionList from a xml file
"""
pass
def write_action_list(self, file):
"""
Write the current actionList into a xml file
"""
pass
def read_action_list(self):
"""
disply current actionList
"""
pass
def update_action_list(self):
"""
apply shortcut changes to the related actions
"""
pass
def onShortcutPushButtonClicked(self, toggled): def onShortcutPushButtonClicked(self, toggled):
self.captureShortcut = toggled self.captureShortcut = toggled
def shortcutEdit(self, item, column):
#print "ändern", item.parent().text(0), item.text(0), column, item.type(), item
self.currentItem = item.type()
self.newShortcut = item.text(1)
self.shortcutListTreeWidget.currentItem().setText(column, u'Press new Shortcut')
self.captureShortcut = True

View File

@ -26,7 +26,6 @@
import logging import logging
import os import os
import time
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from PyQt4.phonon import Phonon from PyQt4.phonon import Phonon
@ -434,8 +433,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 +530,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 +614,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 +678,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()
@ -780,8 +793,10 @@ class SlideController(QtGui.QWidget):
row = self.PreviewListWidget.currentRow() row = self.PreviewListWidget.currentRow()
self.selectedRow = 0 self.selectedRow = 0
if row > -1 and row < self.PreviewListWidget.rowCount(): if row > -1 and row < self.PreviewListWidget.rowCount():
if self.serviceItem.is_command() and self.isLive: if self.serviceItem.is_command():
Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(), if self.isLive:
Receiver.send_message(
u'%s_slide' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive, row]) [self.serviceItem, self.isLive, row])
self.updatePreview() self.updatePreview()
else: else:
@ -799,6 +814,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 +862,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 +888,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()

View File

@ -79,7 +79,7 @@ class CategoryActionList(object):
""" """
return self.__next__() return self.__next__()
def has_key(key): def has_key(self, key):
for weight, action in self.actions: for weight, action in self.actions:
if action.text() == key: if action.text() == key:
return True return True
@ -144,7 +144,7 @@ class CategoryList(object):
return True return True
return False return False
def append(self, name, actions=[]): def append(self, name, actions=None):
weight = 0 weight = 0
if len(self.categories) > 0: if len(self.categories) > 0:
weight = self.categories[-1].weight + 1 weight = self.categories[-1].weight + 1
@ -153,7 +153,7 @@ class CategoryList(object):
else: else:
self.add(name, weight) self.add(name, weight)
def add(self, name, weight=0, actions=[]): def add(self, name, weight=0, actions=None):
category = ActionCategory(name, weight) category = ActionCategory(name, weight)
if actions: if actions:
for action in actions: for action in actions:

View File

@ -85,7 +85,11 @@ class AlertsPlugin(Plugin):
self.liveController.alertTab = self.alertsTab self.liveController.alertTab = self.alertsTab
def finalise(self): def finalise(self):
"""
Tidy up on exit
"""
log.info(u'Alerts Finalising') log.info(u'Alerts Finalising')
self.manager.finalise()
Plugin.finalise(self) Plugin.finalise(self)
self.toolsAlertItem.setVisible(False) self.toolsAlertItem.setVisible(False)
@ -117,11 +121,3 @@ class AlertsPlugin(Plugin):
self.textStrings[StringContent.VisibleName] = { self.textStrings[StringContent.VisibleName] = {
u'title': translate('AlertsPlugin', 'Alerts') u'title': translate('AlertsPlugin', 'Alerts')
} }
def finalise(self):
"""
Time to tidy up on exit
"""
log.info(u'Alerts Finalising')
self.manager.finalise()
Plugin.finalise(self)

View File

@ -52,7 +52,11 @@ class BiblePlugin(Plugin):
self.exportBibleItem.setVisible(True) self.exportBibleItem.setVisible(True)
def finalise(self): def finalise(self):
"""
Tidy up on exit
"""
log.info(u'Plugin Finalise') log.info(u'Plugin Finalise')
self.manager.finalise()
Plugin.finalise(self) Plugin.finalise(self)
self.importBibleItem.setVisible(False) self.importBibleItem.setVisible(False)
self.exportBibleItem.setVisible(False) self.exportBibleItem.setVisible(False)
@ -172,11 +176,3 @@ class BiblePlugin(Plugin):
u'tooltip': translate('BiblesPlugin', u'tooltip': translate('BiblesPlugin',
'Add the selected Bible to the service') 'Add the selected Bible to the service')
} }
def finalise(self):
"""
Time to tidy up on exit
"""
log.info(u'Bible Finalising')
self.manager.finalise()
Plugin.finalise(self)

View File

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

View File

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

View File

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

View File

@ -56,7 +56,7 @@ class MediaMediaItem(MediaManagerItem):
u':/media/media_video.png').toImage() u':/media/media_video.png').toImage()
MediaManagerItem.__init__(self, parent, self, icon) MediaManagerItem.__init__(self, parent, self, icon)
self.singleServiceItem = False self.singleServiceItem = False
self.serviceItemIconName = u':/media/media_video.png' self.serviceItemIconName = u':/media/image_clapperboard.png'
def retranslateUi(self): def retranslateUi(self):
self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')

View File

@ -80,5 +80,3 @@ class MediaTab(SettingsTab):
QtCore.QSettings().setValue(self.settingsSection + u'/use phonon', QtCore.QSettings().setValue(self.settingsSection + u'/use phonon',
QtCore.QVariant(self.usePhonon)) QtCore.QVariant(self.usePhonon))
Receiver.send_message(u'config_screen_changed') Receiver.send_message(u'config_screen_changed')

View File

@ -25,6 +25,7 @@
############################################################################### ###############################################################################
import logging import logging
import mimetypes
from PyQt4.phonon import Phonon from PyQt4.phonon import Phonon
@ -45,6 +46,7 @@ class MediaPlugin(Plugin):
self.dnd_id = u'Media' self.dnd_id = u'Media'
self.audio_list = u'' self.audio_list = u''
self.video_list = u'' self.video_list = u''
mimetypes.init()
for mimetype in Phonon.BackendCapabilities.availableMimeTypes(): for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
mimetype = unicode(mimetype) mimetype = unicode(mimetype)
type = mimetype.split(u'audio/x-') type = mimetype.split(u'audio/x-')
@ -60,13 +62,18 @@ class MediaPlugin(Plugin):
self.video_list, mimetype = self._addToList(self.video_list, self.video_list, mimetype = self._addToList(self.video_list,
type, mimetype) type, mimetype)
def _addToList(self, list, value, type): def _addToList(self, list, value, mimetype):
# Is it a media type
if len(value) == 2: if len(value) == 2:
if list.find(value[1]) == -1: extensions = mimetypes.guess_all_extensions(unicode(mimetype))
list += u'*.%s ' % value[1] # we have an extension
self.serviceManager.supportedSuffixes(value[1]) if extensions:
type = u'' for extension in extensions:
return list, type if list.find(extension) == -1:
list += u'*%s ' % extension
self.serviceManager.supportedSuffixes(extension[1:])
mimetype = u''
return list, mimetype
def getSettingsTab(self): def getSettingsTab(self):
return MediaTab(self.name) return MediaTab(self.name)

View File

@ -61,7 +61,8 @@ class PresentationPlugin(Plugin):
Create the settings Tab Create the settings Tab
""" """
visible_name = self.getString(StringContent.VisibleName) visible_name = self.getString(StringContent.VisibleName)
return PresentationTab(self.name, visible_name[u'title'], self.controllers) return PresentationTab(self.name, visible_name[u'title'],
self.controllers)
def initialise(self): def initialise(self):
""" """

View File

@ -43,7 +43,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
""" """
log.info(u'%s EditSongForm loaded', __name__) log.info(u'%s EditSongForm loaded', __name__)
def __init__(self, parent, songmanager): def __init__(self, parent, manager):
""" """
Constructor Constructor
""" """
@ -100,7 +100,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtCore.QObject.connect(self.ButtonBox, QtCore.QObject.connect(self.ButtonBox,
QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview) QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview)
# Create other objects and forms # Create other objects and forms
self.songmanager = songmanager self.manager = manager
self.verse_form = EditVerseForm(self) self.verse_form = EditVerseForm(self)
self.initialise() self.initialise()
self.AuthorsListView.setSortingEnabled(False) self.AuthorsListView.setSortingEnabled(False)
@ -116,7 +116,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.TopicRemoveButton.setEnabled(False) self.TopicRemoveButton.setEnabled(False)
def loadAuthors(self): def loadAuthors(self):
authors = self.songmanager.get_all_objects(Author, authors = self.manager.get_all_objects(Author,
order_by_ref=Author.display_name) order_by_ref=Author.display_name)
self.AuthorsSelectionComboItem.clear() self.AuthorsSelectionComboItem.clear()
self.AuthorsSelectionComboItem.addItem(u'') self.AuthorsSelectionComboItem.addItem(u'')
@ -127,8 +127,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
row, QtCore.QVariant(author.id)) row, QtCore.QVariant(author.id))
def loadTopics(self): def loadTopics(self):
topics = self.songmanager.get_all_objects(Topic, topics = self.manager.get_all_objects(Topic, order_by_ref=Topic.name)
order_by_ref=Topic.name)
self.SongTopicCombo.clear() self.SongTopicCombo.clear()
self.SongTopicCombo.addItem(u'') self.SongTopicCombo.addItem(u'')
for topic in topics: for topic in topics:
@ -137,7 +136,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.SongTopicCombo.setItemData(row, QtCore.QVariant(topic.id)) self.SongTopicCombo.setItemData(row, QtCore.QVariant(topic.id))
def loadBooks(self): def loadBooks(self):
books = self.songmanager.get_all_objects(Book, order_by_ref=Book.name) books = self.manager.get_all_objects(Book, order_by_ref=Book.name)
self.SongbookCombo.clear() self.SongbookCombo.clear()
self.SongbookCombo.addItem(u'') self.SongbookCombo.addItem(u'')
for book in books: for book in books:
@ -177,15 +176,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.loadAuthors() self.loadAuthors()
self.loadTopics() self.loadTopics()
self.loadBooks() self.loadBooks()
self.song = self.songmanager.get_object(Song, id) self.song = self.manager.get_object(Song, id)
self.TitleEditItem.setText(self.song.title) self.TitleEditItem.setText(self.song.title)
if self.song.alternate_title: if self.song.alternate_title:
self.AlternativeEdit.setText(self.song.alternate_title) self.AlternativeEdit.setText(self.song.alternate_title)
else: else:
self.AlternativeEdit.setText(u'') self.AlternativeEdit.setText(u'')
if self.song.song_book_id != 0: if self.song.song_book_id != 0:
book_name = self.songmanager.get_object(Book, book_name = self.manager.get_object(Book, self.song.song_book_id)
self.song.song_book_id)
id = self.SongbookCombo.findText( id = self.SongbookCombo.findText(
unicode(book_name.name), QtCore.Qt.MatchExactly) unicode(book_name.name), QtCore.Qt.MatchExactly)
if id == -1: if id == -1:
@ -299,7 +297,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
else: else:
author = Author.populate(first_name=text.rsplit(u' ', 1)[0], author = Author.populate(first_name=text.rsplit(u' ', 1)[0],
last_name=text.rsplit(u' ', 1)[1], display_name=text) last_name=text.rsplit(u' ', 1)[1], display_name=text)
self.songmanager.save_object(author) self.manager.save_object(author)
author_item = QtGui.QListWidgetItem( author_item = QtGui.QListWidgetItem(
unicode(author.display_name)) unicode(author.display_name))
author_item.setData(QtCore.Qt.UserRole, author_item.setData(QtCore.Qt.UserRole,
@ -311,7 +309,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
return return
elif item > 0: elif item > 0:
item_id = (self.AuthorsSelectionComboItem.itemData(item)).toInt()[0] item_id = (self.AuthorsSelectionComboItem.itemData(item)).toInt()[0]
author = self.songmanager.get_object(Author, item_id) author = self.manager.get_object(Author, item_id)
if self.AuthorsListView.findItems(unicode(author.display_name), if self.AuthorsListView.findItems(unicode(author.display_name),
QtCore.Qt.MatchExactly): QtCore.Qt.MatchExactly):
QtGui.QMessageBox.warning(self, QtGui.QMessageBox.warning(self,
@ -354,7 +352,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
topic = Topic.populate(name=text) topic = Topic.populate(name=text)
self.songmanager.save_object(topic) self.manager.save_object(topic)
topic_item = QtGui.QListWidgetItem(unicode(topic.name)) topic_item = QtGui.QListWidgetItem(unicode(topic.name))
topic_item.setData(QtCore.Qt.UserRole, topic_item.setData(QtCore.Qt.UserRole,
QtCore.QVariant(topic.id)) QtCore.QVariant(topic.id))
@ -365,7 +363,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
return return
elif item > 0: elif item > 0:
item_id = (self.SongTopicCombo.itemData(item)).toInt()[0] item_id = (self.SongTopicCombo.itemData(item)).toInt()[0]
topic = self.songmanager.get_object(Topic, item_id) topic = self.manager.get_object(Topic, item_id)
if self.TopicsListView.findItems(unicode(topic.name), if self.TopicsListView.findItems(unicode(topic.name),
QtCore.Qt.MatchExactly): QtCore.Qt.MatchExactly):
QtGui.QMessageBox.warning(self, QtGui.QMessageBox.warning(self,
@ -598,7 +596,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
The Song is valid so as the plugin to add it to preview to see. The Song is valid so as the plugin to add it to preview to see.
""" """
log.debug(u'onPreview') log.debug(u'onPreview')
if unicode(button.objectName()) == u'previewButton' and self.saveSong(): if unicode(button.objectName()) == u'previewButton' and \
self.saveSong(True):
Receiver.send_message(u'songs_preview') Receiver.send_message(u'songs_preview')
def closePressed(self): def closePressed(self):
@ -619,17 +618,20 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
book = Book.populate(name=text, publisher=u'') book = Book.populate(name=text, publisher=u'')
self.songmanager.save_object(book) self.manager.save_object(book)
else: else:
return return
if self.saveSong(): if self.saveSong():
Receiver.send_message(u'songs_load_list') Receiver.send_message(u'songs_load_list')
self.close() self.close()
def saveSong(self): def saveSong(self, preview=False):
""" """
Get all the data from the widgets on the form, and then save it to the Get all the data from the widgets on the form, and then save it to the
database. database.
``preview``
Should be True if song is also previewed.
""" """
self.song.title = unicode(self.TitleEditItem.text()) self.song.title = unicode(self.TitleEditItem.text())
self.song.alternate_title = unicode(self.AlternativeEdit.text()) self.song.alternate_title = unicode(self.AlternativeEdit.text())
@ -642,7 +644,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.song.song_number = unicode(self.songBookNumberEdit.text()) self.song.song_number = unicode(self.songBookNumberEdit.text())
book_name = unicode(self.SongbookCombo.currentText()) book_name = unicode(self.SongbookCombo.currentText())
if book_name: if book_name:
self.song.book = self.songmanager.get_object_filtered(Book, self.song.book = self.manager.get_object_filtered(Book,
Book.name == book_name) Book.name == book_name)
else: else:
self.song.book = None self.song.book = None
@ -653,15 +655,15 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
for row in range(self.AuthorsListView.count()): for row in range(self.AuthorsListView.count()):
item = self.AuthorsListView.item(row) item = self.AuthorsListView.item(row)
authorId = (item.data(QtCore.Qt.UserRole)).toInt()[0] authorId = (item.data(QtCore.Qt.UserRole)).toInt()[0]
self.song.authors.append(self.songmanager.get_object(Author, self.song.authors.append(self.manager.get_object(Author,
authorId)) authorId))
self.song.topics = [] self.song.topics = []
for row in range(self.TopicsListView.count()): for row in range(self.TopicsListView.count()):
item = self.TopicsListView.item(row) item = self.TopicsListView.item(row)
topicId = (item.data(QtCore.Qt.UserRole)).toInt()[0] topicId = (item.data(QtCore.Qt.UserRole)).toInt()[0]
self.song.topics.append(self.songmanager.get_object(Topic, self.song.topics.append(self.manager.get_object(Topic, topicId))
topicId)) self.manager.save_object(self.song)
self.songmanager.save_object(self.song) if not preview:
self.song = None self.song = None
return True return True
return False return False

View File

@ -36,13 +36,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
""" """
Class documentation goes here. Class documentation goes here.
""" """
def __init__(self, songmanager, parent=None): def __init__(self, manager, parent=None):
""" """
Constructor Constructor
""" """
QtGui.QDialog.__init__(self, parent) QtGui.QDialog.__init__(self, parent)
self.setupUi(self) self.setupUi(self)
self.songmanager = songmanager self.manager = manager
self.authorform = AuthorsForm(self) self.authorform = AuthorsForm(self)
self.topicform = TopicsForm(self) self.topicform = TopicsForm(self)
self.bookform = SongBookForm(self) self.bookform = SongBookForm(self)
@ -85,12 +85,12 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
del_text, err_text, sel_text): del_text, err_text, sel_text):
item_id = self._getCurrentItemId(list_widget) item_id = self._getCurrentItemId(list_widget)
if item_id != -1: if item_id != -1:
item = self.songmanager.get_object(item_class, item_id) item = self.manager.get_object(item_class, item_id)
if item and len(item.songs) == 0: if item and len(item.songs) == 0:
if QtGui.QMessageBox.warning(self, dlg_title, del_text, if QtGui.QMessageBox.warning(self, dlg_title, del_text,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.Yes: QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.Yes:
self.songmanager.delete_object(item_class, item.id) self.manager.delete_object(item_class, item.id)
reset_func() reset_func()
else: else:
QtGui.QMessageBox.critical(self, dlg_title, err_text) QtGui.QMessageBox.critical(self, dlg_title, err_text)
@ -102,7 +102,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
Reloads the Authors list. Reloads the Authors list.
""" """
self.AuthorsListWidget.clear() self.AuthorsListWidget.clear()
authors = self.songmanager.get_all_objects(Author, authors = self.manager.get_all_objects(Author,
order_by_ref=Author.display_name) order_by_ref=Author.display_name)
for author in authors: for author in authors:
if author.display_name: if author.display_name:
@ -124,8 +124,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
Reloads the Topics list. Reloads the Topics list.
""" """
self.TopicsListWidget.clear() self.TopicsListWidget.clear()
topics = self.songmanager.get_all_objects(Topic, topics = self.manager.get_all_objects(Topic, order_by_ref=Topic.name)
order_by_ref=Topic.name)
for topic in topics: for topic in topics:
topic_name = QtGui.QListWidgetItem(topic.name) topic_name = QtGui.QListWidgetItem(topic.name)
topic_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(topic.id)) topic_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(topic.id))
@ -142,7 +141,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
Reloads the Books list. Reloads the Books list.
""" """
self.BooksListWidget.clear() self.BooksListWidget.clear()
books = self.songmanager.get_all_objects(Book, order_by_ref=Book.name) books = self.manager.get_all_objects(Book, order_by_ref=Book.name)
for book in books: for book in books:
book_name = QtGui.QListWidgetItem(u'%s (%s)' % (book.name, book_name = QtGui.QListWidgetItem(u'%s (%s)' % (book.name,
book.publisher)) book.publisher))
@ -160,7 +159,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
Returns False if the given Author is already in the list otherwise Returns False if the given Author is already in the list otherwise
True. True.
""" """
authors = self.songmanager.get_all_objects(Author, authors = self.manager.get_all_objects(Author,
and_(Author.first_name == new_author.first_name, and_(Author.first_name == new_author.first_name,
Author.last_name == new_author.last_name, Author.last_name == new_author.last_name,
Author.display_name == new_author.display_name)) Author.display_name == new_author.display_name))
@ -182,7 +181,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
""" """
Returns False if the given Topic is already in the list otherwise True. Returns False if the given Topic is already in the list otherwise True.
""" """
topics = self.songmanager.get_all_objects(Topic, topics = self.manager.get_all_objects(Topic,
Topic.name == new_topic.name) Topic.name == new_topic.name)
if len(topics) > 0: if len(topics) > 0:
# If we edit an existing Topic, we need to make sure that we do # If we edit an existing Topic, we need to make sure that we do
@ -202,7 +201,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
""" """
Returns False if the given Book is already in the list otherwise True. Returns False if the given Book is already in the list otherwise True.
""" """
books = self.songmanager.get_all_objects(Book, books = self.manager.get_all_objects(Book,
and_(Book.name == new_book.name, and_(Book.name == new_book.name,
Book.publisher == new_book.publisher)) Book.publisher == new_book.publisher))
if len(books) > 0: if len(books) > 0:
@ -227,7 +226,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
last_name=unicode(self.authorform.LastNameEdit.text()), last_name=unicode(self.authorform.LastNameEdit.text()),
display_name=unicode(self.authorform.DisplayEdit.text())) display_name=unicode(self.authorform.DisplayEdit.text()))
if self.checkAuthor(author): if self.checkAuthor(author):
if self.songmanager.save_object(author): if self.manager.save_object(author):
self.resetAuthors() self.resetAuthors()
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
@ -244,7 +243,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
if self.topicform.exec_(): if self.topicform.exec_():
topic = Topic.populate(name=unicode(self.topicform.NameEdit.text())) topic = Topic.populate(name=unicode(self.topicform.NameEdit.text()))
if self.checkTopic(topic): if self.checkTopic(topic):
if self.songmanager.save_object(topic): if self.manager.save_object(topic):
self.resetTopics() self.resetTopics()
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
@ -262,7 +261,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
book = Book.populate(name=unicode(self.bookform.NameEdit.text()), book = Book.populate(name=unicode(self.bookform.NameEdit.text()),
publisher=unicode(self.bookform.PublisherEdit.text())) publisher=unicode(self.bookform.PublisherEdit.text()))
if self.checkBook(book): if self.checkBook(book):
if self.songmanager.save_object(book): if self.manager.save_object(book):
self.resetBooks() self.resetBooks()
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
@ -278,7 +277,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
def onAuthorEditButtonClick(self): def onAuthorEditButtonClick(self):
author_id = self._getCurrentItemId(self.AuthorsListWidget) author_id = self._getCurrentItemId(self.AuthorsListWidget)
if author_id != -1: if author_id != -1:
author = self.songmanager.get_object(Author, author_id) author = self.manager.get_object(Author, author_id)
self.authorform.setAutoDisplayName(False) self.authorform.setAutoDisplayName(False)
self.authorform.FirstNameEdit.setText(author.first_name) self.authorform.FirstNameEdit.setText(author.first_name)
self.authorform.LastNameEdit.setText(author.last_name) self.authorform.LastNameEdit.setText(author.last_name)
@ -295,7 +294,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
author.display_name = unicode( author.display_name = unicode(
self.authorform.DisplayEdit.text()) self.authorform.DisplayEdit.text())
if self.checkAuthor(author, True): if self.checkAuthor(author, True):
if self.songmanager.save_object(author): if self.manager.save_object(author):
self.resetAuthors() self.resetAuthors()
Receiver.send_message(u'songs_load_list') Receiver.send_message(u'songs_load_list')
else: else:
@ -330,14 +329,14 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
def onTopicEditButtonClick(self): def onTopicEditButtonClick(self):
topic_id = self._getCurrentItemId(self.TopicsListWidget) topic_id = self._getCurrentItemId(self.TopicsListWidget)
if topic_id != -1: if topic_id != -1:
topic = self.songmanager.get_object(Topic, topic_id) topic = self.manager.get_object(Topic, topic_id)
self.topicform.NameEdit.setText(topic.name) self.topicform.NameEdit.setText(topic.name)
# Save the topic's name for the case that he has to be restored. # Save the topic's name for the case that he has to be restored.
temp_name = topic.name temp_name = topic.name
if self.topicform.exec_(False): if self.topicform.exec_(False):
topic.name = unicode(self.topicform.NameEdit.text()) topic.name = unicode(self.topicform.NameEdit.text())
if self.checkTopic(topic, True): if self.checkTopic(topic, True):
if self.songmanager.save_object(topic): if self.manager.save_object(topic):
self.resetTopics() self.resetTopics()
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
@ -367,7 +366,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
def onBookEditButtonClick(self): def onBookEditButtonClick(self):
book_id = self._getCurrentItemId(self.BooksListWidget) book_id = self._getCurrentItemId(self.BooksListWidget)
if book_id != -1: if book_id != -1:
book = self.songmanager.get_object(Book, book_id) book = self.manager.get_object(Book, book_id)
if book.publisher is None: if book.publisher is None:
book.publisher = u'' book.publisher = u''
self.bookform.NameEdit.setText(book.name) self.bookform.NameEdit.setText(book.name)
@ -380,7 +379,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
book.name = unicode(self.bookform.NameEdit.text()) book.name = unicode(self.bookform.NameEdit.text())
book.publisher = unicode(self.bookform.PublisherEdit.text()) book.publisher = unicode(self.bookform.PublisherEdit.text())
if self.checkBook(book, True): if self.checkBook(book, True):
if self.songmanager.save_object(book): if self.manager.save_object(book):
self.resetBooks() self.resetBooks()
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
@ -410,11 +409,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
``old_author`` ``old_author``
The author which will be deleted afterwards. The author which will be deleted afterwards.
""" """
existing_author = self.songmanager.get_object_filtered(Author, existing_author = self.manager.get_object_filtered(Author,
and_(Author.first_name == old_author.first_name, and_(Author.first_name == old_author.first_name,
Author.last_name == old_author.last_name, Author.last_name == old_author.last_name,
Author.display_name == old_author.display_name)) Author.display_name == old_author.display_name))
songs = self.songmanager.get_all_objects(Song, songs = self.manager.get_all_objects(Song,
Song.authors.contains(old_author)) Song.authors.contains(old_author))
for song in songs: for song in songs:
# We check if the song has already existing_author as author. If # We check if the song has already existing_author as author. If
@ -422,8 +421,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
if existing_author not in song.authors: if existing_author not in song.authors:
song.authors.append(existing_author) song.authors.append(existing_author)
song.authors.remove(old_author) song.authors.remove(old_author)
self.songmanager.save_object(song) self.manager.save_object(song)
self.songmanager.delete_object(Author, old_author.id) self.manager.delete_object(Author, old_author.id)
def mergeTopics(self, old_topic): def mergeTopics(self, old_topic):
""" """
@ -432,9 +431,9 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
``old_topic`` ``old_topic``
The topic which will be deleted afterwards. The topic which will be deleted afterwards.
""" """
existing_topic = self.songmanager.get_object_filtered(Topic, existing_topic = self.manager.get_object_filtered(Topic,
Topic.name == old_topic.name) Topic.name == old_topic.name)
songs = self.songmanager.get_all_objects(Song, songs = self.manager.get_all_objects(Song,
Song.topics.contains(old_topic)) Song.topics.contains(old_topic))
for song in songs: for song in songs:
# We check if the song has already existing_topic as topic. If that # We check if the song has already existing_topic as topic. If that
@ -442,8 +441,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
if existing_topic not in song.topics: if existing_topic not in song.topics:
song.topics.append(existing_topic) song.topics.append(existing_topic)
song.topics.remove(old_topic) song.topics.remove(old_topic)
self.songmanager.save_object(song) self.manager.save_object(song)
self.songmanager.delete_object(Topic, old_topic.id) self.manager.delete_object(Topic, old_topic.id)
def mergeBooks(self, old_book): def mergeBooks(self, old_book):
""" """
@ -452,15 +451,15 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
``old_book`` ``old_book``
The book which will be deleted afterwards. The book which will be deleted afterwards.
""" """
existing_book = self.songmanager.get_object_filtered(Book, existing_book = self.manager.get_object_filtered(Book,
and_(Book.name == old_book.name, and_(Book.name == old_book.name,
Book.publisher == old_book.publisher)) Book.publisher == old_book.publisher))
songs = self.songmanager.get_all_objects(Song, songs = self.manager.get_all_objects(Song,
Song.song_book_id == old_book.id) Song.song_book_id == old_book.id)
for song in songs: for song in songs:
song.song_book_id = existing_book.id song.song_book_id = existing_book.id
self.songmanager.save_object(song) self.manager.save_object(song)
self.songmanager.delete_object(Book, old_book.id) self.manager.delete_object(Book, old_book.id)
def onAuthorDeleteButtonClick(self): def onAuthorDeleteButtonClick(self):
""" """

View File

@ -213,12 +213,16 @@ class CCLIFileImport(SongImport):
Verse lyrics Verse lyrics
<Empty line> <Empty line>
<Empty line> <Empty line>
Song CCLI number # e.g. CCLI Number (e.g.CCLI-Liednummer: 2672885) Song CCLI number
Song copyright # e.g. © 1999 Integrity's Hosanna! Music | LenSongs Publishing # e.g. CCLI Number (e.g.CCLI-Liednummer: 2672885)
Song copyright
# e.g. © 1999 Integrity's Hosanna! Music | LenSongs Publishing
Song authors # e.g. Lenny LeBlanc | Paul Baloche Song authors # e.g. Lenny LeBlanc | Paul Baloche
Licencing info # e.g. For use solely with the SongSelect Terms of Use. Licencing info
# e.g. For use solely with the SongSelect Terms of Use.
All rights Reserved. www.ccli.com All rights Reserved. www.ccli.com
CCLI Licence number of user # e.g. CCL-Liedlizenznummer: 14 / CCLI License No. 14 CCLI Licence number of user
# e.g. CCL-Liedlizenznummer: 14 / CCLI License No. 14
""" """
log.debug(u'TXT file text: %s', textList) log.debug(u'TXT file text: %s', textList)

View File

@ -389,7 +389,8 @@ class SongMediaItem(MediaManagerItem):
service_item.audit = [ service_item.audit = [
song.title, author_audit, song.copyright, unicode(song.ccli_number) song.title, author_audit, song.copyright, unicode(song.ccli_number)
] ]
service_item.data_string = {u'title':song.search_title, u'authors':author_list} service_item.data_string = {u'title':song.search_title,
u'authors':author_list}
return True return True
def serviceLoad(self, item): def serviceLoad(self, item):

View File

@ -74,7 +74,8 @@ class OpenLP1SongImport(SongImport):
decoded = unicode(raw, codec) decoded = unicode(raw, codec)
self.last_encoding = codec self.last_encoding = codec
except UnicodeDecodeError: except UnicodeDecodeError:
log.exception(u'Error in detecting openlp.org 1.x database encoding.') log.exception(
u'Error in detecting openlp.org 1.x database encoding.')
try: try:
decoded = unicode(raw, self.last_encoding) decoded = unicode(raw, self.last_encoding)
except UnicodeDecodeError: except UnicodeDecodeError:
@ -152,7 +153,8 @@ class OpenLP1SongImport(SongImport):
break break
for track in tracks: for track in tracks:
if track[0] == track_id[0]: if track[0] == track_id[0]:
self.add_media_file(self.decode_string(track[1], guess)) self.add_media_file(self.decode_string(track[1],
guess))
break break
if self.stop_import_flag: if self.stop_import_flag:
success = False success = False

View File

@ -229,14 +229,16 @@ class OpenSongImport(SongImport):
# drop the square brackets # drop the square brackets
right_bracket = thisline.find(u']') right_bracket = thisline.find(u']')
content = thisline[1:right_bracket].upper() content = thisline[1:right_bracket].upper()
# have we got any digits? If so, versenumber is everything from the digits # have we got any digits?
# If so, versenumber is everything from the digits
# to the end (even if there are some alpha chars on the end) # to the end (even if there are some alpha chars on the end)
match = re.match(u'(.*)(\d+.*)', content) match = re.match(u'(.*)(\d+.*)', content)
if match is not None: if match is not None:
versetype = match.group(1) versetype = match.group(1)
versenum = match.group(2) versenum = match.group(2)
else: else:
# otherwise we assume number 1 and take the whole prefix as versetype # otherwise we assume number 1 and take the whole prefix as
# the versetype
versetype = content versetype = content
versenum = u'1' versenum = u'1'
continue continue
@ -301,6 +303,7 @@ class OpenSongImport(SongImport):
# Assume it's no.1 if there's no digits # Assume it's no.1 if there's no digits
tag = tag + u'1' tag = tag + u'1'
if not versetags.has_key(tag): if not versetags.has_key(tag):
log.info(u'Got order %s but not in versetags, dropping this item from presentation order', tag) log.info(u'Got order %s but not in versetags, dropping this'
u'item from presentation order', tag)
else: else:
self.verse_order_list.append(tag) self.verse_order_list.append(tag)

View File

@ -47,8 +47,9 @@ class SongImport(QtCore.QObject):
""" """
Initialise and create defaults for properties Initialise and create defaults for properties
song_manager is an instance of a SongManager, through which all ``manager``
database access is performed An instance of a SongManager, through which all database access is
performed.
""" """
self.manager = manager self.manager = manager
self.stop_import_flag = False self.stop_import_flag = False
@ -296,7 +297,8 @@ class SongImport(QtCore.QObject):
song.lyrics = unicode(sxml.extract_xml(), u'utf-8') song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
for i, current_verse_tag in enumerate(self.verse_order_list): for i, current_verse_tag in enumerate(self.verse_order_list):
if verses_changed_to_other.has_key(current_verse_tag): if verses_changed_to_other.has_key(current_verse_tag):
self.verse_order_list[i] = verses_changed_to_other[current_verse_tag] self.verse_order_list[i] = \
verses_changed_to_other[current_verse_tag]
song.verse_order = u' '.join(self.verse_order_list) song.verse_order = u' '.join(self.verse_order_list)
song.copyright = self.copyright song.copyright = self.copyright
song.comments = self.comments song.comments = self.comments

View File

@ -56,8 +56,10 @@ class SongsTab(SettingsTab):
self.SongUpdateOnEditCheckBox = QtGui.QCheckBox(self.SongsModeGroupBox) self.SongUpdateOnEditCheckBox = QtGui.QCheckBox(self.SongsModeGroupBox)
self.SongUpdateOnEditCheckBox.setObjectName(u'SongUpdateOnEditCheckBox') self.SongUpdateOnEditCheckBox.setObjectName(u'SongUpdateOnEditCheckBox')
self.SongsModeLayout.addWidget(self.SongUpdateOnEditCheckBox) self.SongsModeLayout.addWidget(self.SongUpdateOnEditCheckBox)
self.SongAddFromServiceCheckBox = QtGui.QCheckBox(self.SongsModeGroupBox) self.SongAddFromServiceCheckBox = QtGui.QCheckBox(
self.SongAddFromServiceCheckBox.setObjectName(u'SongAddFromServiceCheckBox') self.SongsModeGroupBox)
self.SongAddFromServiceCheckBox.setObjectName(
u'SongAddFromServiceCheckBox')
self.SongsModeLayout.addWidget(self.SongAddFromServiceCheckBox) self.SongsModeLayout.addWidget(self.SongAddFromServiceCheckBox)
self.SongsLayout.setWidget( self.SongsLayout.setWidget(
0, QtGui.QFormLayout.LabelRole, self.SongsModeGroupBox) 0, QtGui.QFormLayout.LabelRole, self.SongsModeGroupBox)
@ -83,7 +85,8 @@ class SongsTab(SettingsTab):
'Display verses on live tool bar')) 'Display verses on live tool bar'))
self.SongUpdateOnEditCheckBox.setText( self.SongUpdateOnEditCheckBox.setText(
translate('SongsPlugin.SongsTab', 'Update service from song edit')) translate('SongsPlugin.SongsTab', 'Update service from song edit'))
self.SongAddFromServiceCheckBox.setText(translate('SongsPlugin.SongsTab', self.SongAddFromServiceCheckBox.setText(
translate('SongsPlugin.SongsTab',
'Add missing songs when opening service')) 'Add missing songs when opening service'))
def onSearchAsTypeCheckBoxChanged(self, check_state): def onSearchAsTypeCheckBoxChanged(self, check_state):
@ -132,6 +135,8 @@ class SongsTab(SettingsTab):
settings.beginGroup(self.settingsSection) settings.beginGroup(self.settingsSection)
settings.setValue(u'search as type', QtCore.QVariant(self.song_search)) settings.setValue(u'search as type', QtCore.QVariant(self.song_search))
settings.setValue(u'display songbar', QtCore.QVariant(self.song_bar)) settings.setValue(u'display songbar', QtCore.QVariant(self.song_bar))
settings.setValue(u'update service on edit', QtCore.QVariant(self.update_edit)) settings.setValue(u'update service on edit',
settings.setValue(u'add song from service', QtCore.QVariant(self.update_load)) QtCore.QVariant(self.update_edit))
settings.setValue(u'add song from service',
QtCore.QVariant(self.update_load))
settings.endGroup() settings.endGroup()

View File

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

View File

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

View File

@ -29,7 +29,8 @@ from datetime import datetime
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringContent, Receiver, build_icon, translate from openlp.core.lib import Plugin, StringContent, Receiver, build_icon, \
translate
from openlp.core.lib.db import Manager from openlp.core.lib.db import Manager
from openlp.plugins.songusage.forms import SongUsageDetailForm, \ from openlp.plugins.songusage.forms import SongUsageDetailForm, \
SongUsageDeleteForm SongUsageDeleteForm
@ -44,7 +45,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,15 +116,20 @@ 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)
def finalise(self): def finalise(self):
"""
Tidy up on exit
"""
log.info(u'Plugin Finalise') log.info(u'Plugin Finalise')
self.manager.finalise()
Plugin.finalise(self)
self.SongUsageMenu.menuAction().setVisible(False) self.SongUsageMenu.menuAction().setVisible(False)
#stop any events being processed #stop any events being processed
self.SongUsageActive = False self.SongUsageActive = False
@ -148,7 +154,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_()
@ -176,11 +182,3 @@ class SongUsagePlugin(Plugin):
self.textStrings[StringContent.VisibleName] = { self.textStrings[StringContent.VisibleName] = {
u'title': translate('SongUsagePlugin', 'SongUsage') u'title': translate('SongUsagePlugin', 'SongUsage')
} }
def finalise(self):
"""
Time to tidy up on exit
"""
log.info(u'SongUsage Finalising')
self.manager.finalise()
Plugin.finalise(self)

View File

@ -1,73 +0,0 @@
[bibles]
display new chapter = False
display brackets = 0
dual bibles = False
db type = sqlite
bible theme =
verse layout style = 1
status = 1
data path = bibles
[media]
status = 1
[alerts]
font color = #ffffff
background color = #660000
font face = Sans Serif
timeout = 5
[remotes]
remote port = 4316
[presentations]
status = 1
impress = 0
data path = presentations
powerpoint = 0
powerpoint viewer = 0
[custom]
status = 1
display footer = True
data path = custom
db type = sqlite
[themes]
global theme =
data path = themes
theme level = 1
[images]
status = 1
data path = images
loop delay = 5
[user interface]
theme manager = True
media manager = True
preview panel = True
service manager = True
[servicemanager]
data path = servicemanager
[general]
monitor = 0
run environment = dev
ccli number =
blank warning = False
show splash = True
last version test = 2010-02-05
songselect username =
save prompt = False
songselect password =
auto open = False
[songs]
status = 1
search as type = False
display songbar = True
data path = songs
db type = sqlite

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 KiB

View File

@ -1,2 +0,0 @@
<?xml version="1.0" ?>
<theme version="1.0"><name>Bible Readings</name><background mode="opaque" type="image"><filename>open6_2.jpg</filename></background><font type="main"><name>Arial</name><color>#ffffff</color><proportion>40</proportion><proportion>40</proportion><location override="False"/></font><font type="footer"><name>Arial</name><color>#ffffff</color><proportion>12</proportion><proportion>12</proportion><location override="False"/></font><display><shadow color="#000000">False</shadow><outline color="#000000">False</outline><horizontalAlign>2</horizontalAlign><verticalAlign>1</verticalAlign><wrapStyle>0</wrapStyle></display></theme>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

View File

@ -1,64 +0,0 @@
<?xml version="1.0" ?>
<theme version="1.0">
<name>
Blue
</name>
<background mode="opaque" type="solid">
<color>
#0000ff
</color>
</background>
<font type="main">
<name>
DejaVu Sans Mono
</name>
<color>
#ffff00
</color>
<proportion>
45
</proportion>
<weight>
Normal
</weight>
<italics>
False
</italics>
<location override="False"/>
</font>
<font type="footer">
<name>
DejaVu Sans Mono
</name>
<color>
#ffff00
</color>
<proportion>
12
</proportion>
<weight>
Normal
</weight>
<italics>
False
</italics>
<location override="False"/>
</font>
<display>
<shadow color="#000000">
False
</shadow>
<outline color="#000000">
False
</outline>
<horizontalAlign>
0
</horizontalAlign>
<verticalAlign>
1
</verticalAlign>
<wrapStyle>
0
</wrapStyle>
</display>
</theme>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

View File

@ -1,64 +0,0 @@
<?xml version="1.0" ?>
<theme version="1.0">
<name>
theme1
</name>
<background mode="opaque" type="solid">
<color>
#400080
</color>
</background>
<font type="main">
<name>
Tahoma
</name>
<color>
#0080ff
</color>
<proportion>
45
</proportion>
<weight>
Normal
</weight>
<italics>
False
</italics>
<location override="False"/>
</font>
<font type="footer">
<name>
Tahoma
</name>
<color>
#0080ff
</color>
<proportion>
12
</proportion>
<weight>
Normal
</weight>
<italics>
False
</italics>
<location override="False"/>
</font>
<display>
<shadow color="#000000">
False
</shadow>
<outline color="#000000">
False
</outline>
<horizontalAlign>
0
</horizontalAlign>
<verticalAlign>
0
</verticalAlign>
<wrapStyle>
0
</wrapStyle>
</display>
</theme>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

View File

@ -1,70 +0,0 @@
<?xml version="1.0" ?>
<theme version="1.0">
<name>
theme2
</name>
<background mode="opaque" type="gradient">
<startColor>
#ff8000
</startColor>
<endColor>
#0000ff
</endColor>
<direction>
vertical
</direction>
</background>
<font type="main">
<name>
Tahoma
</name>
<color>
#ffffff
</color>
<proportion>
45
</proportion>
<weight>
Normal
</weight>
<italics>
False
</italics>
<location override="False"/>
</font>
<font type="footer">
<name>
Tahoma
</name>
<color>
#ffffff
</color>
<proportion>
12
</proportion>
<weight>
Normal
</weight>
<italics>
False
</italics>
<location override="False"/>
</font>
<display>
<shadow color="#000000">
True
</shadow>
<outline color="#000000">
True
</outline>
<horizontalAlign>
0
</horizontalAlign>
<verticalAlign>
0
</verticalAlign>
<wrapStyle>
0
</wrapStyle>
</display>
</theme>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

View File

@ -1,2 +0,0 @@
<?xml version="1.0" ?>
<theme version="1.0"><name>theme3</name><background mode="opaque" type="image"><filename>sunset2.jpg</filename></background><font type="main"><name>DejaVu Sans Mono</name><color>#ffff00</color><proportion>32</proportion><weight>Normal</weight><italics>False</italics><location override="False"/></font><font type="footer"><name>DejaVu Sans Mono</name><color>#ffff00</color><proportion>12</proportion><weight>Normal</weight><italics>False</italics><location override="False"/></font><display><shadow color="#000000">False</shadow><outline color="#000000">False</outline><horizontalAlign>1</horizontalAlign><verticalAlign>2</verticalAlign><wrapStyle>0</wrapStyle></display></theme>

View File

@ -1,23 +0,0 @@
[custom]
db type = sqlite
[bibles]
db type = sqlite
[main]
themes path = themes
data path = /home/raoul/.openlp/data
[songs]
db type = sqlite
file name = songs.sqlite
data path = songs
[presentations]
suffix name = ppt,pps,odi
[images]
suffix name = jpg,gif,png,bmp
[videos]
suffix name = avi,mpeg

View File

@ -1,24 +0,0 @@
[custom]
db type = sqlite
[bibles]
db type = sqlite
[main]
themes path = themes
data path = /home/<username>/.openlp/data
[songs]
file name = songs.sqlite
data path = songs
db type = sqlite
[presentations]
suffix name = ppt,pps,odi
[images]
suffix name = jpg,gif,png,bmp
[videos]
suffix name = avi,mpeg

View File

@ -1,23 +0,0 @@
[custom]
db type = sqlite
[bibles]
db type = sqlite
[main]
themes path = themes
data path = c:\\Documents and Settings\\<username>\\Application Data\\.openlp\\data
[songs]
file name = songs.sqlite
data path = songs
db type = sqlite
[presentations]
suffix name = ppt,pps,odi
[images]
suffix name = jpg,gif,png,bmp
[videos]
suffix name = avi,mpeg

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,66 +0,0 @@
Gen,Genesis,Gen
Exod,Exodus,Exod
Lev,Leviticus,Lev
Num,Numbers,Num
Deut,Deuteronomy,Deut
Josh,Joshua,Josh
Judg,Judges,Judg
Ruth,Ruth,Ruth
1Sam,1 Samuel,1Sam
2Sam,2 Samuel,2Sam
1Kgs,1 Kings,1Kgs
2Kgs,2 Kings,2Kgs
1Chr,1 Chronicles,1Chr
2Chr,2 Chronicles,2Chr
Ezra,Ezra,Ezra
Neh,Nehemiah,Neh
Esth,Esther,Esth
Job,Job,Job
Ps,Psalms,Ps
Prov,Proverbs,Prov
Eccl,Ecclesiastes,Eccl
Song,Song of Songs,Song
Isa,Isaiah,Isa
Jer,Jeremiah,Jer
Lam,Lamentations,Lam
Ezek,Ezekiel,Ezek
Dan,Daniel,Dan
Hos,Hosea,Hos
Joel,Joel,Joel
Amos,Amos,Amos
Obad,Obad,Obad
Jonah,Jonah,Jonah
Mic,Micah,Mic
Nah,Naham,Nah
Hab,Habakkuk,Hab
Zeph,Zephaniah,Zeph
Hag,Haggai,Hag
Zech,Zechariah,Zech
Mal,Malachi,Mal
Matt,Matthew,Matt
Mark,Mark,Mark
Luke,Luke,Luke
John,John,John
Acts,Acts,Acts
Rom,Romans,Rom
1Cor,1 Corinthans,1Cor
2Cor,2 Corinthans,2Cor
Gal,Galatians,Gal
Eph,Ephesians,Eph
Phil,Philippians,Phil
Col,Colossians,Col
1Thess,1 Thessalonians,1Thess
2Thess,2 Thessalonians,2Thess
1Tim,1 Timothy,1Tim
2Tim,2 Timothy,2Tim
Titus,Titus,Titus
Phlm,Philemon,Phlm
Heb,Hebrews,Heb
Jas,James,Jas
1Pet,1 Peter,1Pet
2Pet,2 Peter,2Pet
1John,1 John,1John
2John,2 John,2John
3John,3 John,3John
Jude,Jude,Jude
Rev,Revelation,Rev

View File

@ -83,6 +83,8 @@
<file>wizard_importbible.bmp</file> <file>wizard_importbible.bmp</file>
</qresource> </qresource>
<qresource prefix="services"> <qresource prefix="services">
<file>service_collapse_all.png</file>
<file>service_expand_all.png</file>
<file>service_notes.png</file> <file>service_notes.png</file>
<file>service_item_notes.png</file> <file>service_item_notes.png</file>
<file>service_bottom.png</file> <file>service_bottom.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.