forked from openlp/openlp
Merge from head.
This commit is contained in:
commit
663792b762
@ -144,8 +144,9 @@ def resize_image(image, width, height):
|
|||||||
The image to resize.
|
The image to resize.
|
||||||
"""
|
"""
|
||||||
preview = QtGui.QImage(image)
|
preview = QtGui.QImage(image)
|
||||||
preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio,
|
if not preview.isNull():
|
||||||
QtCore.Qt.SmoothTransformation)
|
preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio,
|
||||||
|
QtCore.Qt.SmoothTransformation)
|
||||||
realw = preview.width()
|
realw = preview.width()
|
||||||
realh = preview.height()
|
realh = preview.height()
|
||||||
# and move it to the centre of the preview space
|
# and move it to the centre of the preview space
|
||||||
|
@ -131,6 +131,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
It provides a default set and the plugin is able to override
|
It provides a default set and the plugin is able to override
|
||||||
the if required.
|
the if required.
|
||||||
"""
|
"""
|
||||||
|
self.hasImportIcon = False
|
||||||
self.hasNewIcon = True
|
self.hasNewIcon = True
|
||||||
self.hasEditIcon = True
|
self.hasEditIcon = True
|
||||||
self.hasFileIcon = False
|
self.hasFileIcon = False
|
||||||
@ -207,48 +208,54 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
|
|
||||||
def addMiddleHeaderBar(self):
|
def addMiddleHeaderBar(self):
|
||||||
# Create buttons for the toolbar
|
# Create buttons for the toolbar
|
||||||
|
## Import Button ##
|
||||||
|
if self.hasImportIcon:
|
||||||
|
self.addToolbarButton(
|
||||||
|
u'Import %s' % self.PluginNameShort,
|
||||||
|
u'%s %s' % (self.trUtf8('Import a'), self.PluginNameVisible),
|
||||||
|
u':/general/general_import.png', self.onImportClick)
|
||||||
## File Button ##
|
## File Button ##
|
||||||
if self.hasFileIcon:
|
if self.hasFileIcon:
|
||||||
self.addToolbarButton(
|
self.addToolbarButton(
|
||||||
u'Load %s' % self.PluginNameShort,
|
u'Load %s' % self.PluginNameShort,
|
||||||
u'%s %s' % (self.trUtf8('Load a new'), self.PluginNameVisible),
|
u'%s %s' % (self.trUtf8('Load a new'), self.PluginNameVisible),
|
||||||
u':/%s_load.png' % self.IconPath, self.onFileClick)
|
u':/general/general_open.png', self.onFileClick)
|
||||||
## New Button ##
|
## New Button ##
|
||||||
if self.hasNewIcon:
|
if self.hasNewIcon:
|
||||||
self.addToolbarButton(
|
self.addToolbarButton(
|
||||||
u'New %s' % self.PluginNameShort,
|
u'New %s' % self.PluginNameShort,
|
||||||
u'%s %s' % (self.trUtf8('Add a new'), self.PluginNameVisible),
|
u'%s %s' % (self.trUtf8('Add a new'), self.PluginNameVisible),
|
||||||
u':/%s_new.png' % self.IconPath, self.onNewClick)
|
u':/general/general_new.png', self.onNewClick)
|
||||||
## Edit Button ##
|
## Edit Button ##
|
||||||
if self.hasEditIcon:
|
if self.hasEditIcon:
|
||||||
self.addToolbarButton(
|
self.addToolbarButton(
|
||||||
u'Edit %s' % self.PluginNameShort,
|
u'Edit %s' % self.PluginNameShort,
|
||||||
u'%s %s' % (self.trUtf8('Edit the selected'),
|
u'%s %s' % (self.trUtf8('Edit the selected'),
|
||||||
self.PluginNameVisible),
|
self.PluginNameVisible),
|
||||||
u':/%s_edit.png' % self.IconPath, self.onEditClick)
|
u':/general/general_edit.png', self.onEditClick)
|
||||||
## Delete Button ##
|
## Delete Button ##
|
||||||
if self.hasDeleteIcon:
|
if self.hasDeleteIcon:
|
||||||
self.addToolbarButton(
|
self.addToolbarButton(
|
||||||
u'Delete %s' % self.PluginNameShort,
|
u'Delete %s' % self.PluginNameShort,
|
||||||
self.trUtf8('Delete the selected item'),
|
self.trUtf8('Delete the selected item'),
|
||||||
u':/%s_delete.png' % self.IconPath, self.onDeleteClick)
|
u':/general/general_delete.png', self.onDeleteClick)
|
||||||
## Separator Line ##
|
## Separator Line ##
|
||||||
self.addToolbarSeparator()
|
self.addToolbarSeparator()
|
||||||
## Preview ##
|
## Preview ##
|
||||||
self.addToolbarButton(
|
self.addToolbarButton(
|
||||||
u'Preview %s' % self.PluginNameShort,
|
u'Preview %s' % self.PluginNameShort,
|
||||||
self.trUtf8('Preview the selected item'),
|
self.trUtf8('Preview the selected item'),
|
||||||
u':/system/system_preview.png', self.onPreviewClick)
|
u':/general/general_preview.png', self.onPreviewClick)
|
||||||
## Live Button ##
|
## Live Button ##
|
||||||
self.addToolbarButton(
|
self.addToolbarButton(
|
||||||
u'Go Live',
|
u'Go Live',
|
||||||
self.trUtf8('Send the selected item live'),
|
self.trUtf8('Send the selected item live'),
|
||||||
u':/system/system_live.png', self.onLiveClick)
|
u':/general/general_live.png', self.onLiveClick)
|
||||||
## Add to service Button ##
|
## Add to service Button ##
|
||||||
self.addToolbarButton(
|
self.addToolbarButton(
|
||||||
u'Add %s to Service' % self.PluginNameShort,
|
u'Add %s to Service' % self.PluginNameShort,
|
||||||
self.trUtf8('Add the selected item(s) to the service'),
|
self.trUtf8('Add the selected item(s) to the service'),
|
||||||
u':/system/system_add.png', self.onAddClick)
|
u':/general/general_add.png', self.onAddClick)
|
||||||
|
|
||||||
def addListViewToToolBar(self):
|
def addListViewToToolBar(self):
|
||||||
#Add the List widget
|
#Add the List widget
|
||||||
@ -268,22 +275,22 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
if self.hasEditIcon:
|
if self.hasEditIcon:
|
||||||
self.ListView.addAction(
|
self.ListView.addAction(
|
||||||
contextMenuAction(
|
contextMenuAction(
|
||||||
self.ListView, u':/%s_new.png' % self.IconPath,
|
self.ListView, u':/general/general_edit.png',
|
||||||
u'%s %s' % (self.trUtf8('&Edit'), self.PluginNameVisible),
|
u'%s %s' % (self.trUtf8('&Edit'), self.PluginNameVisible),
|
||||||
self.onEditClick))
|
self.onEditClick))
|
||||||
self.ListView.addAction(contextMenuSeparator(self.ListView))
|
self.ListView.addAction(contextMenuSeparator(self.ListView))
|
||||||
self.ListView.addAction(
|
self.ListView.addAction(
|
||||||
contextMenuAction(
|
contextMenuAction(
|
||||||
self.ListView, u':/system/system_preview.png',
|
self.ListView, u':/general/general_preview.png',
|
||||||
u'%s %s' % (self.trUtf8('&Preview'), self.PluginNameVisible),
|
u'%s %s' % (self.trUtf8('&Preview'), self.PluginNameVisible),
|
||||||
self.onPreviewClick))
|
self.onPreviewClick))
|
||||||
self.ListView.addAction(
|
self.ListView.addAction(
|
||||||
contextMenuAction(
|
contextMenuAction(
|
||||||
self.ListView, u':/system/system_live.png',
|
self.ListView, u':/general/general_live.png',
|
||||||
self.trUtf8('&Show Live'), self.onLiveClick))
|
self.trUtf8('&Show Live'), self.onLiveClick))
|
||||||
self.ListView.addAction(
|
self.ListView.addAction(
|
||||||
contextMenuAction(
|
contextMenuAction(
|
||||||
self.ListView, u':/system/system_add.png',
|
self.ListView, u':/general/general_add.png',
|
||||||
self.trUtf8('&Add to Service'), self.onAddClick))
|
self.trUtf8('&Add to Service'), self.onAddClick))
|
||||||
QtCore.QObject.connect(
|
QtCore.QObject.connect(
|
||||||
self.ListView, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
self.ListView, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
||||||
@ -313,7 +320,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
files = QtGui.QFileDialog.getOpenFileNames(
|
files = QtGui.QFileDialog.getOpenFileNames(
|
||||||
self, self.OnNewPrompt,
|
self, self.OnNewPrompt,
|
||||||
self.parent.config.get_last_dir(), self.OnNewFileMasks)
|
self.parent.config.get_last_dir(), self.OnNewFileMasks)
|
||||||
log.info(u'New files(s)%s', unicode(files))
|
log.info(u'New files(s) %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
self.loadList(files)
|
self.loadList(files)
|
||||||
dir, filename = os.path.split(unicode(files[0]))
|
dir, filename = os.path.split(unicode(files[0]))
|
||||||
@ -353,8 +360,8 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
def onPreviewClick(self):
|
def onPreviewClick(self):
|
||||||
if not self.ListView.selectedIndexes() and not self.remoteTriggered:
|
if not self.ListView.selectedIndexes() and not self.remoteTriggered:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self,
|
||||||
self.trUtf8('No items selected...'),
|
self.trUtf8('No Items Selected'),
|
||||||
self.trUtf8('You must select one or more items'))
|
self.trUtf8('You must select one or more items.'))
|
||||||
else:
|
else:
|
||||||
log.debug(self.PluginNameShort + u' Preview requested')
|
log.debug(self.PluginNameShort + u' Preview requested')
|
||||||
service_item = self.buildServiceItem()
|
service_item = self.buildServiceItem()
|
||||||
@ -365,8 +372,8 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
def onLiveClick(self):
|
def onLiveClick(self):
|
||||||
if not self.ListView.selectedIndexes():
|
if not self.ListView.selectedIndexes():
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self,
|
||||||
self.trUtf8('No items selected...'),
|
self.trUtf8('No Items Selected'),
|
||||||
self.trUtf8('You must select one or more items'))
|
self.trUtf8('You must select one or more items.'))
|
||||||
else:
|
else:
|
||||||
log.debug(self.PluginNameShort + u' Live requested')
|
log.debug(self.PluginNameShort + u' Live requested')
|
||||||
service_item = self.buildServiceItem()
|
service_item = self.buildServiceItem()
|
||||||
@ -377,8 +384,8 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
def onAddClick(self):
|
def onAddClick(self):
|
||||||
if not self.ListView.selectedIndexes() and not self.remoteTriggered:
|
if not self.ListView.selectedIndexes() and not self.remoteTriggered:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self,
|
||||||
self.trUtf8('No items selected...'),
|
self.trUtf8('No Items Selected'),
|
||||||
self.trUtf8('You must select one or more items'))
|
self.trUtf8('You must select one or more items.'))
|
||||||
else:
|
else:
|
||||||
log.debug(self.PluginNameShort + u' Add requested')
|
log.debug(self.PluginNameShort + u' Add requested')
|
||||||
service_item = self.buildServiceItem()
|
service_item = self.buildServiceItem()
|
||||||
|
@ -116,7 +116,7 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.ImageLineEdit.setObjectName(u'ImageLineEdit')
|
self.ImageLineEdit.setObjectName(u'ImageLineEdit')
|
||||||
self.horizontalLayout_2.addWidget(self.ImageLineEdit)
|
self.horizontalLayout_2.addWidget(self.ImageLineEdit)
|
||||||
self.ImageToolButton = QtGui.QToolButton(self.ImageFilenameWidget)
|
self.ImageToolButton = QtGui.QToolButton(self.ImageFilenameWidget)
|
||||||
icon1 = build_icon(u':/images/image_load.png')
|
icon1 = build_icon(u':/general/general_open.png')
|
||||||
self.ImageToolButton.setIcon(icon1)
|
self.ImageToolButton.setIcon(icon1)
|
||||||
self.ImageToolButton.setObjectName(u'ImageToolButton')
|
self.ImageToolButton.setObjectName(u'ImageToolButton')
|
||||||
self.horizontalLayout_2.addWidget(self.ImageToolButton)
|
self.horizontalLayout_2.addWidget(self.ImageToolButton)
|
||||||
|
@ -114,13 +114,13 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
# Create the top toolbar
|
# Create the top toolbar
|
||||||
self.Toolbar = OpenLPToolbar(self)
|
self.Toolbar = OpenLPToolbar(self)
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
self.trUtf8('New Service'), u':/services/service_new.png',
|
self.trUtf8('New Service'), u':/general/general_new.png',
|
||||||
self.trUtf8('Create a new service'), self.onNewService)
|
self.trUtf8('Create a new service'), self.onNewService)
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
self.trUtf8('Open Service'), u':/services/service_open.png',
|
self.trUtf8('Open Service'), u':/general/general_open.png',
|
||||||
self.trUtf8('Load an existing service'), self.onLoadService)
|
self.trUtf8('Load an existing service'), self.onLoadService)
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
self.trUtf8('Save Service'), u':/services/service_save.png',
|
self.trUtf8('Save Service'), u':/general/general_save.png',
|
||||||
self.trUtf8('Save this service'), self.onSaveService)
|
self.trUtf8('Save this service'), self.onSaveService)
|
||||||
self.Toolbar.addSeparator()
|
self.Toolbar.addSeparator()
|
||||||
self.ThemeLabel = QtGui.QLabel(self.trUtf8('Theme:'),
|
self.ThemeLabel = QtGui.QLabel(self.trUtf8('Theme:'),
|
||||||
@ -148,7 +148,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.ServiceManagerList.setHeaderHidden(True)
|
self.ServiceManagerList.setHeaderHidden(True)
|
||||||
self.ServiceManagerList.setExpandsOnDoubleClick(False)
|
self.ServiceManagerList.setExpandsOnDoubleClick(False)
|
||||||
self.ServiceManagerList.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
self.ServiceManagerList.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
||||||
self.ServiceManagerList.customContextMenuRequested.connect(self.contextMenu)
|
QtCore.QObject.connect(self.ServiceManagerList,
|
||||||
|
QtCore.SIGNAL('customContextMenuRequested(QPoint)'), self.contextMenu)
|
||||||
self.ServiceManagerList.setObjectName(u'ServiceManagerList')
|
self.ServiceManagerList.setObjectName(u'ServiceManagerList')
|
||||||
# enable drop
|
# enable drop
|
||||||
self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
|
self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
|
||||||
@ -171,7 +172,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.trUtf8('Move to end'), self.onServiceEnd)
|
self.trUtf8('Move to end'), self.onServiceEnd)
|
||||||
self.OrderToolbar.addSeparator()
|
self.OrderToolbar.addSeparator()
|
||||||
self.OrderToolbar.addToolbarButton(
|
self.OrderToolbar.addToolbarButton(
|
||||||
self.trUtf8('&Delete From Service'), u':/services/service_delete.png',
|
self.trUtf8('&Delete From Service'), u':/general/general_delete.png',
|
||||||
self.trUtf8('Delete From Service'), self.onDeleteFromService)
|
self.trUtf8('Delete From Service'), self.onDeleteFromService)
|
||||||
self.Layout.addWidget(self.OrderToolbar)
|
self.Layout.addWidget(self.OrderToolbar)
|
||||||
# Connect up our signals and slots
|
# Connect up our signals and slots
|
||||||
@ -201,17 +202,17 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
#build the context menu
|
#build the context menu
|
||||||
self.menu = QtGui.QMenu()
|
self.menu = QtGui.QMenu()
|
||||||
self.editAction = self.menu.addAction(self.trUtf8('&Edit Item'))
|
self.editAction = self.menu.addAction(self.trUtf8('&Edit Item'))
|
||||||
self.editAction.setIcon(build_icon(u':/services/service_edit.png'))
|
self.editAction.setIcon(build_icon(u':/general/general_edit.png'))
|
||||||
self.notesAction = self.menu.addAction(self.trUtf8('&Notes'))
|
self.notesAction = self.menu.addAction(self.trUtf8('&Notes'))
|
||||||
self.notesAction.setIcon(build_icon(u':/services/service_notes.png'))
|
self.notesAction.setIcon(build_icon(u':/services/service_notes.png'))
|
||||||
self.deleteAction = self.menu.addAction(self.trUtf8('&Delete From Service'))
|
self.deleteAction = self.menu.addAction(self.trUtf8('&Delete From Service'))
|
||||||
self.deleteAction.setIcon(build_icon(u':/services/service_delete.png'))
|
self.deleteAction.setIcon(build_icon(u':/general/general_delete.png'))
|
||||||
self.sep1 = self.menu.addAction(u'')
|
self.sep1 = self.menu.addAction(u'')
|
||||||
self.sep1.setSeparator(True)
|
self.sep1.setSeparator(True)
|
||||||
self.previewAction = self.menu.addAction(self.trUtf8('&Preview Verse'))
|
self.previewAction = self.menu.addAction(self.trUtf8('&Preview Verse'))
|
||||||
self.previewAction.setIcon(build_icon(u':/system/system_preview.png'))
|
self.previewAction.setIcon(build_icon(u':/general/general_preview.png'))
|
||||||
self.liveAction = self.menu.addAction(self.trUtf8('&Live Verse'))
|
self.liveAction = self.menu.addAction(self.trUtf8('&Live Verse'))
|
||||||
self.liveAction.setIcon(build_icon(u':/system/system_live.png'))
|
self.liveAction.setIcon(build_icon(u':/general/general_live.png'))
|
||||||
self.sep2 = self.menu.addAction(u'')
|
self.sep2 = self.menu.addAction(u'')
|
||||||
self.sep2.setSeparator(True)
|
self.sep2.setSeparator(True)
|
||||||
self.themeMenu = QtGui.QMenu(self.trUtf8(u'&Change Item Theme'))
|
self.themeMenu = QtGui.QMenu(self.trUtf8(u'&Change Item Theme'))
|
||||||
|
@ -177,11 +177,11 @@ class SlideController(QtGui.QWidget):
|
|||||||
if not self.isLive:
|
if not self.isLive:
|
||||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
u'Go Live', u':/system/system_live.png',
|
u'Go Live', u':/general/general_live.png',
|
||||||
self.trUtf8('Move to live'), self.onGoLive)
|
self.trUtf8('Move to live'), self.onGoLive)
|
||||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
u'Edit Song', u':/services/service_edit.png',
|
u'Edit Song', u':/general/general_edit.png',
|
||||||
self.trUtf8('Edit and re-preview Song'), self.onEditSong)
|
self.trUtf8('Edit and re-preview Song'), self.onEditSong)
|
||||||
if isLive:
|
if isLive:
|
||||||
self.Toolbar.addToolbarSeparator(u'Loop Separator')
|
self.Toolbar.addToolbarSeparator(u'Loop Separator')
|
||||||
|
@ -59,14 +59,14 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.trUtf8('Edit Theme'), u':/themes/theme_edit.png',
|
self.trUtf8('Edit Theme'), u':/themes/theme_edit.png',
|
||||||
self.trUtf8('Edit a theme'), self.onEditTheme)
|
self.trUtf8('Edit a theme'), self.onEditTheme)
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
self.trUtf8('Delete Theme'), u':/themes/theme_delete.png',
|
self.trUtf8('Delete Theme'), u':/general/general_delete.png',
|
||||||
self.trUtf8('Delete a theme'), self.onDeleteTheme)
|
self.trUtf8('Delete a theme'), self.onDeleteTheme)
|
||||||
self.Toolbar.addSeparator()
|
self.Toolbar.addSeparator()
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
self.trUtf8('Import Theme'), u':/themes/theme_import.png',
|
self.trUtf8('Import Theme'), u':/general/general_import.png',
|
||||||
self.trUtf8('Import a theme'), self.onImportTheme)
|
self.trUtf8('Import a theme'), self.onImportTheme)
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
self.trUtf8('Export Theme'), u':/themes/theme_export.png',
|
self.trUtf8('Export Theme'), u':/general/general_export.png',
|
||||||
self.trUtf8('Export a theme'), self.onExportTheme)
|
self.trUtf8('Export a theme'), self.onExportTheme)
|
||||||
self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
|
self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
|
||||||
self.Layout.addWidget(self.Toolbar)
|
self.Layout.addWidget(self.Toolbar)
|
||||||
@ -82,17 +82,17 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
contextMenuSeparator(self.ThemeListWidget))
|
contextMenuSeparator(self.ThemeListWidget))
|
||||||
self.ThemeListWidget.addAction(
|
self.ThemeListWidget.addAction(
|
||||||
contextMenuAction(self.ThemeListWidget,
|
contextMenuAction(self.ThemeListWidget,
|
||||||
u':/themes/theme_delete.png',
|
u':/general/general_delete.png',
|
||||||
self.trUtf8('Delete theme'),
|
self.trUtf8('Delete theme'),
|
||||||
self.onDeleteTheme))
|
self.onDeleteTheme))
|
||||||
self.ThemeListWidget.addAction(
|
self.ThemeListWidget.addAction(
|
||||||
contextMenuAction(self.ThemeListWidget,
|
contextMenuAction(self.ThemeListWidget,
|
||||||
u':/themes/theme_export.png',
|
u':/general/general_export.png',
|
||||||
self.trUtf8('Make Global'),
|
self.trUtf8('Make Global'),
|
||||||
self.changeGlobalFromScreen))
|
self.changeGlobalFromScreen))
|
||||||
self.ThemeListWidget.addAction(
|
self.ThemeListWidget.addAction(
|
||||||
contextMenuAction(self.ThemeListWidget,
|
contextMenuAction(self.ThemeListWidget,
|
||||||
u':/themes/theme_export.png',
|
u':/general/general_export.png',
|
||||||
self.trUtf8('Export theme'),
|
self.trUtf8('Export theme'),
|
||||||
self.onExportTheme))
|
self.onExportTheme))
|
||||||
self.ThemeListWidget.addAction(
|
self.ThemeListWidget.addAction(
|
||||||
|
@ -159,9 +159,10 @@ class ThemesTab(SettingsTab):
|
|||||||
image = self.parent.ThemeManagerContents.getPreviewImage(
|
image = self.parent.ThemeManagerContents.getPreviewImage(
|
||||||
self.global_theme)
|
self.global_theme)
|
||||||
preview = QtGui.QPixmap(unicode(image))
|
preview = QtGui.QPixmap(unicode(image))
|
||||||
display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
if not preview.isNull():
|
||||||
QtCore.Qt.SmoothTransformation)
|
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
||||||
self.DefaultListView.setPixmap(display)
|
QtCore.Qt.SmoothTransformation)
|
||||||
|
self.DefaultListView.setPixmap(preview)
|
||||||
|
|
||||||
def updateThemeList(self, theme_list):
|
def updateThemeList(self, theme_list):
|
||||||
"""
|
"""
|
||||||
@ -184,6 +185,7 @@ class ThemesTab(SettingsTab):
|
|||||||
image = self.parent.ThemeManagerContents.getPreviewImage(
|
image = self.parent.ThemeManagerContents.getPreviewImage(
|
||||||
self.global_theme)
|
self.global_theme)
|
||||||
preview = QtGui.QPixmap(unicode(image))
|
preview = QtGui.QPixmap(unicode(image))
|
||||||
display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
if not preview.isNull():
|
||||||
QtCore.Qt.SmoothTransformation)
|
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
||||||
self.DefaultListView.setPixmap(display)
|
QtCore.Qt.SmoothTransformation)
|
||||||
|
self.DefaultListView.setPixmap(preview)
|
||||||
|
@ -44,6 +44,12 @@ class AppLocation(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_directory(dir_type):
|
def get_directory(dir_type):
|
||||||
|
"""
|
||||||
|
Return the appropriate directory according to the directory type.
|
||||||
|
|
||||||
|
``dir_type``
|
||||||
|
The directory type you want, for instance the data directory.
|
||||||
|
"""
|
||||||
if dir_type == AppLocation.AppDir:
|
if dir_type == AppLocation.AppDir:
|
||||||
return os.path.abspath(os.path.split(sys.argv[0])[0])
|
return os.path.abspath(os.path.split(sys.argv[0])[0])
|
||||||
elif dir_type == AppLocation.ConfigDir:
|
elif dir_type == AppLocation.ConfigDir:
|
||||||
@ -89,6 +95,16 @@ class AppLocation(object):
|
|||||||
|
|
||||||
|
|
||||||
def check_latest_version(config, current_version):
|
def check_latest_version(config, current_version):
|
||||||
|
"""
|
||||||
|
Check the latest version of OpenLP against the version file on the OpenLP
|
||||||
|
site.
|
||||||
|
|
||||||
|
``config``
|
||||||
|
The OpenLP config object.
|
||||||
|
|
||||||
|
``current_version``
|
||||||
|
The current version of OpenLP.
|
||||||
|
"""
|
||||||
version_string = current_version
|
version_string = current_version
|
||||||
#set to prod in the distribution confif file.
|
#set to prod in the distribution confif file.
|
||||||
last_test = config.get_config(u'last version test', datetime.now().date())
|
last_test = config.get_config(u'last version test', datetime.now().date())
|
||||||
@ -107,6 +123,18 @@ def check_latest_version(config, current_version):
|
|||||||
log.exception(u'Reason for failure: %s', e.reason)
|
log.exception(u'Reason for failure: %s', e.reason)
|
||||||
return version_string
|
return version_string
|
||||||
|
|
||||||
|
def variant_to_unicode(variant):
|
||||||
|
"""
|
||||||
|
Converts a QVariant to a unicode string.
|
||||||
|
|
||||||
|
``variant``
|
||||||
|
The QVariant instance to convert to unicode.
|
||||||
|
"""
|
||||||
|
string = variant.toString()
|
||||||
|
if not isinstance(string, unicode):
|
||||||
|
string = unicode(string, u'utf8')
|
||||||
|
return string
|
||||||
|
|
||||||
from registry import Registry
|
from registry import Registry
|
||||||
from confighelper import ConfigHelper
|
from confighelper import ConfigHelper
|
||||||
|
|
||||||
|
@ -23,10 +23,203 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import sqlite3
|
||||||
|
|
||||||
|
from sqlalchemy import *
|
||||||
|
from sqlalchemy import create_engine
|
||||||
|
from sqlalchemy.orm import scoped_session, sessionmaker, mapper
|
||||||
|
|
||||||
|
from openlp.core.lib import PluginConfig
|
||||||
|
from openlp.plugins.bibles.lib.models import *
|
||||||
|
|
||||||
|
class BaseModel(object):
|
||||||
|
"""
|
||||||
|
BaseModel provides a base object with a set of generic functions
|
||||||
|
"""
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def populate(cls, **kwargs):
|
||||||
|
"""
|
||||||
|
Creates an instance of a class and populates it, returning the instance
|
||||||
|
"""
|
||||||
|
me = cls()
|
||||||
|
keys = kwargs.keys()
|
||||||
|
for key in keys:
|
||||||
|
me.__setattr__(key, kwargs[key])
|
||||||
|
return me
|
||||||
|
|
||||||
|
class TBibleMeta(BaseModel):
|
||||||
|
"""
|
||||||
|
Bible Meta Data
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
class TTestament(BaseModel):
|
||||||
|
"""
|
||||||
|
Bible Testaments
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
class TBook(BaseModel):
|
||||||
|
"""
|
||||||
|
Song model
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
class TVerse(BaseModel):
|
||||||
|
"""
|
||||||
|
Topic model
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
temp_meta_table = Table(u'metadata_temp', metadata,
|
||||||
|
Column(u'key', types.Unicode(255), primary_key=True),
|
||||||
|
Column(u'value', types.Unicode(255)),
|
||||||
|
)
|
||||||
|
temp_testament_table = Table(u'testament_temp', metadata,
|
||||||
|
Column(u'id', types.Integer, primary_key=True),
|
||||||
|
Column(u'name', types.Unicode(30)),
|
||||||
|
)
|
||||||
|
temp_book_table = Table(u'book_temp', metadata,
|
||||||
|
Column(u'id', types.Integer, primary_key=True),
|
||||||
|
Column(u'testament_id', types.Integer),
|
||||||
|
Column(u'name', types.Unicode(30)),
|
||||||
|
Column(u'abbreviation', types.Unicode(5)),
|
||||||
|
)
|
||||||
|
temp_verse_table = Table(u'verse_temp', metadata,
|
||||||
|
Column(u'id', types.Integer, primary_key=True),
|
||||||
|
Column(u'book_id', types.Integer),
|
||||||
|
Column(u'chapter', types.Integer),
|
||||||
|
Column(u'verse', types.Integer),
|
||||||
|
Column(u'text', types.UnicodeText),
|
||||||
|
)
|
||||||
|
|
||||||
|
mapper(TBibleMeta, temp_meta_table)
|
||||||
|
mapper(TTestament, temp_testament_table)
|
||||||
|
mapper(TBook, temp_book_table)
|
||||||
|
mapper(TVerse, temp_verse_table)
|
||||||
|
|
||||||
|
def init_models(url):
|
||||||
|
engine = create_engine(url)
|
||||||
|
metadata.bind = engine
|
||||||
|
session = scoped_session(sessionmaker(autoflush=False,
|
||||||
|
autocommit=False, bind=engine))
|
||||||
|
return session
|
||||||
|
|
||||||
class MigrateBibles():
|
class MigrateBibles():
|
||||||
def __init__(self, display):
|
def __init__(self, display):
|
||||||
self.display = display
|
self.display = display
|
||||||
|
self.config = PluginConfig(u'Bibles')
|
||||||
|
self.data_path = self.config.get_data_path()
|
||||||
|
self.database_files = self.config.get_files(u'sqlite')
|
||||||
|
print self.database_files
|
||||||
|
|
||||||
|
def progress(self, text):
|
||||||
|
print text
|
||||||
|
self.display.output(text)
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
self.display.output(u'Bible process started')
|
self.progress(u'Bibles processing started')
|
||||||
self.display.output(u'Bible process finished')
|
for f in self.database_files:
|
||||||
|
self.v_1_9_0(f)
|
||||||
|
self.progress(u'Bibles processing finished')
|
||||||
|
|
||||||
|
def v_1_9_0(self, database):
|
||||||
|
self.progress(u'Migration 1.9.0 Started for ' + database)
|
||||||
|
self._v1_9_0_old(database)
|
||||||
|
self._v1_9_0_new(database)
|
||||||
|
self._v1_9_0_cleanup(database)
|
||||||
|
self.progress(u'Migration 1.9.0 Finished for ' + database)
|
||||||
|
|
||||||
|
def _v1_9_0_old(self, database):
|
||||||
|
self.progress(u'Rename Tables ' + database)
|
||||||
|
conn = sqlite3.connect(os.path.join(self.data_path, database))
|
||||||
|
conn.execute(u'alter table book rename to book_temp;')
|
||||||
|
conn.commit()
|
||||||
|
conn.execute(u'alter table testament rename to testament_temp;')
|
||||||
|
conn.commit()
|
||||||
|
conn.execute(u'alter table verse rename to verse_temp;')
|
||||||
|
conn.commit()
|
||||||
|
conn.execute(u'alter table metadata rename to metadata_temp;')
|
||||||
|
conn.commit()
|
||||||
|
|
||||||
|
def _v1_9_0_new(self, database):
|
||||||
|
self.progress(u'Create new Tables ' + database)
|
||||||
|
self.db_url = u'sqlite:///' + self.data_path + u'/' + database
|
||||||
|
print self.db_url
|
||||||
|
self.session = init_models(self.db_url)
|
||||||
|
metadata.create_all(checkfirst=True)
|
||||||
|
self.progress(u'Create testament table')
|
||||||
|
results = self.session.query(TTestament).order_by(TTestament.id).all()
|
||||||
|
for testament_temp in results:
|
||||||
|
testament = Testament()
|
||||||
|
testament.id = testament_temp.id
|
||||||
|
testament.name = testament_temp.name
|
||||||
|
try:
|
||||||
|
self.session.add(testament)
|
||||||
|
self.session.commit()
|
||||||
|
except:
|
||||||
|
self.session.rollback()
|
||||||
|
print u'Error thrown = ', sys.exc_info()[1]
|
||||||
|
self.progress(u'Create book table')
|
||||||
|
results = self.session.query(TBook).order_by(TBook.id).all()
|
||||||
|
for book_temp in results:
|
||||||
|
book = Book()
|
||||||
|
book.id = book_temp.id
|
||||||
|
book.testament_id = book_temp.testament_id
|
||||||
|
book.name = book_temp.name
|
||||||
|
book.abbreviation = book_temp.abbreviation
|
||||||
|
try:
|
||||||
|
self.session.add(book)
|
||||||
|
self.session.commit()
|
||||||
|
except:
|
||||||
|
self.session.rollback()
|
||||||
|
print u'Error thrown = ', sys.exc_info()[1]
|
||||||
|
self.progress(u'Create verse table')
|
||||||
|
results = self.session.query(TVerse).order_by(TVerse.id).all()
|
||||||
|
for verse_temp in results:
|
||||||
|
verse = Verse()
|
||||||
|
verse.id = verse_temp.id
|
||||||
|
verse.book_id = verse_temp.book_id
|
||||||
|
verse.chapter = verse_temp.chapter
|
||||||
|
verse.verse = verse_temp.verse
|
||||||
|
verse.text = verse_temp.text
|
||||||
|
try:
|
||||||
|
self.session.add(verse)
|
||||||
|
except:
|
||||||
|
self.session.rollback()
|
||||||
|
print u'Error thrown = ', sys.exc_info()[1]
|
||||||
|
try:
|
||||||
|
self.session.commit()
|
||||||
|
except:
|
||||||
|
self.session.rollback()
|
||||||
|
print u'Error thrown = ', sys.exc_info()[1]
|
||||||
|
self.progress(u'Create metadata table')
|
||||||
|
results = self.session.query(TBibleMeta).order_by(TBibleMeta.key).all()
|
||||||
|
for biblemeta_temp in results:
|
||||||
|
biblemeta = BibleMeta()
|
||||||
|
biblemeta.key = biblemeta_temp.key
|
||||||
|
biblemeta.value = biblemeta_temp.value
|
||||||
|
try:
|
||||||
|
self.session.add(biblemeta)
|
||||||
|
self.session.commit()
|
||||||
|
except:
|
||||||
|
self.session.rollback()
|
||||||
|
print u'Error thrown = ', sys.exc_info()[1]
|
||||||
|
|
||||||
|
def _v1_9_0_cleanup(self, database):
|
||||||
|
self.progress(u'Update Internal Data ' + database)
|
||||||
|
conn = sqlite3.connect(os.path.join(self.data_path, database))
|
||||||
|
conn.commit()
|
||||||
|
conn.execute(u'drop table book_temp;')
|
||||||
|
conn.commit()
|
||||||
|
conn.execute(u'drop table testament_temp;')
|
||||||
|
conn.commit()
|
||||||
|
conn.execute(u'drop table verse_temp;')
|
||||||
|
conn.commit()
|
||||||
|
conn.execute(u'drop table metadata_temp;')
|
||||||
|
conn.commit()
|
||||||
|
conn.execute(u'vacuum;')
|
||||||
|
conn.commit()
|
||||||
|
@ -104,7 +104,7 @@ class Ui_BibleImportWizard(object):
|
|||||||
self.OsisFileButton = QtGui.QToolButton(self.OsisPage)
|
self.OsisFileButton = QtGui.QToolButton(self.OsisPage)
|
||||||
self.OsisFileButton.setMaximumSize(QtCore.QSize(32, 16777215))
|
self.OsisFileButton.setMaximumSize(QtCore.QSize(32, 16777215))
|
||||||
icon = QtGui.QIcon()
|
icon = QtGui.QIcon()
|
||||||
icon.addPixmap(QtGui.QPixmap(u':/imports/import_load.png'),
|
icon.addPixmap(QtGui.QPixmap(u':/general/general_open.png'),
|
||||||
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
self.OsisFileButton.setIcon(icon)
|
self.OsisFileButton.setIcon(icon)
|
||||||
self.OsisFileButton.setObjectName(u'OsisFileButton')
|
self.OsisFileButton.setObjectName(u'OsisFileButton')
|
||||||
|
@ -32,12 +32,12 @@ from PyQt4 import QtCore, QtGui
|
|||||||
|
|
||||||
from bibleimportwizard import Ui_BibleImportWizard
|
from bibleimportwizard import Ui_BibleImportWizard
|
||||||
from openlp.core.lib import Receiver
|
from openlp.core.lib import Receiver
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation, variant_to_unicode
|
||||||
from openlp.plugins.bibles.lib.manager import BibleFormat
|
from openlp.plugins.bibles.lib.manager import BibleFormat
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class DownloadLocation(object):
|
class WebDownload(object):
|
||||||
Unknown = -1
|
Unknown = -1
|
||||||
Crosswalk = 0
|
Crosswalk = 0
|
||||||
BibleGateway = 1
|
BibleGateway = 1
|
||||||
@ -60,9 +60,21 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
log.info(u'BibleImportForm loaded')
|
log.info(u'BibleImportForm loaded')
|
||||||
|
|
||||||
def __init__(self, parent, config, manager, bibleplugin):
|
def __init__(self, parent, config, manager, bibleplugin):
|
||||||
'''
|
"""
|
||||||
Constructor
|
Instantiate the wizard, and run any extra setup we need to.
|
||||||
'''
|
|
||||||
|
``parent``
|
||||||
|
The QWidget-derived parent of the wizard.
|
||||||
|
|
||||||
|
``config``
|
||||||
|
The configuration object for storing and retrieving settings.
|
||||||
|
|
||||||
|
``manager``
|
||||||
|
The Bible manager.
|
||||||
|
|
||||||
|
``bibleplugin``
|
||||||
|
The Bible plugin.
|
||||||
|
"""
|
||||||
QtGui.QWizard.__init__(self, parent)
|
QtGui.QWizard.__init__(self, parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.registerFields()
|
self.registerFields()
|
||||||
@ -97,10 +109,16 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
self.onCurrentIdChanged)
|
self.onCurrentIdChanged)
|
||||||
|
|
||||||
def exec_(self):
|
def exec_(self):
|
||||||
|
"""
|
||||||
|
Run the wizard.
|
||||||
|
"""
|
||||||
self.setDefaults()
|
self.setDefaults()
|
||||||
return QtGui.QWizard.exec_(self)
|
return QtGui.QWizard.exec_(self)
|
||||||
|
|
||||||
def validateCurrentPage(self):
|
def validateCurrentPage(self):
|
||||||
|
"""
|
||||||
|
Validate the current page before moving on to the next page.
|
||||||
|
"""
|
||||||
if self.currentId() == 0:
|
if self.currentId() == 0:
|
||||||
# Welcome page
|
# Welcome page
|
||||||
return True
|
return True
|
||||||
@ -144,7 +162,9 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
return True
|
return True
|
||||||
elif self.currentId() == 2:
|
elif self.currentId() == 2:
|
||||||
# License details
|
# License details
|
||||||
if self.field(u'license_version').toString() == u'':
|
license_version = variant_to_unicode(self.field(u'license_version'))
|
||||||
|
license_copyright = variant_to_unicode(self.field(u'license_copyright'))
|
||||||
|
if license_version == u'':
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
self.trUtf8('Empty Version Name'),
|
self.trUtf8('Empty Version Name'),
|
||||||
self.trUtf8('You need to specify a version name for your '
|
self.trUtf8('You need to specify a version name for your '
|
||||||
@ -152,7 +172,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||||
self.VersionNameEdit.setFocus()
|
self.VersionNameEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif self.field(u'license_copyright').toString() == u'':
|
elif license_copyright == u'':
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
self.trUtf8('Empty Copyright'),
|
self.trUtf8('Empty Copyright'),
|
||||||
self.trUtf8('You need to set a copyright for your Bible! '
|
self.trUtf8('You need to set a copyright for your Bible! '
|
||||||
@ -161,8 +181,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||||
self.CopyrightEdit.setFocus()
|
self.CopyrightEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif self.manager.exists(
|
elif self.manager.exists(license_version):
|
||||||
self.field(u'license_version').toString()):
|
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
self.trUtf8('Bible Exists'),
|
self.trUtf8('Bible Exists'),
|
||||||
self.trUtf8('This Bible already exists! Please import '
|
self.trUtf8('This Bible already exists! Please import '
|
||||||
@ -176,27 +195,49 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def onLocationComboBoxChanged(self, index):
|
def onLocationComboBoxChanged(self, index):
|
||||||
|
"""
|
||||||
|
Setup the list of Bibles when you select a different source on the web
|
||||||
|
download page.
|
||||||
|
|
||||||
|
``index``
|
||||||
|
The index of the combo box.
|
||||||
|
"""
|
||||||
self.BibleComboBox.clear()
|
self.BibleComboBox.clear()
|
||||||
for bible, abbreviation in self.web_bible_list[index].iteritems():
|
for bible in self.web_bible_list[index].keys():
|
||||||
self.BibleComboBox.addItem(unicode(self.trUtf8(bible)))
|
self.BibleComboBox.addItem(unicode(self.trUtf8(bible)))
|
||||||
|
|
||||||
def onOsisFileButtonClicked(self):
|
def onOsisFileButtonClicked(self):
|
||||||
self.getFileName(self.trUtf8('Open OSIS file'),
|
"""
|
||||||
|
Show the file open dialog for the OSIS file.
|
||||||
|
"""
|
||||||
|
self.getFileName(self.trUtf8('Open OSIS File'),
|
||||||
self.OSISLocationEdit)
|
self.OSISLocationEdit)
|
||||||
|
|
||||||
def onBooksFileButtonClicked(self):
|
def onBooksFileButtonClicked(self):
|
||||||
self.getFileName(self.trUtf8('Open Books CSV file'),
|
"""
|
||||||
|
Show the file open dialog for the books CSV file.
|
||||||
|
"""
|
||||||
|
self.getFileName(self.trUtf8('Open Books CSV File'),
|
||||||
self.BooksLocationEdit)
|
self.BooksLocationEdit)
|
||||||
|
|
||||||
def onCsvVersesFileButtonClicked(self):
|
def onCsvVersesFileButtonClicked(self):
|
||||||
self.getFileName(self.trUtf8('Open Verses CSV file'),
|
"""
|
||||||
|
Show the file open dialog for the verses CSV file.
|
||||||
|
"""
|
||||||
|
self.getFileName(self.trUtf8('Open Verses CSV File'),
|
||||||
self.CsvVerseLocationEdit)
|
self.CsvVerseLocationEdit)
|
||||||
|
|
||||||
def onOpenSongBrowseButtonClicked(self):
|
def onOpenSongBrowseButtonClicked(self):
|
||||||
|
"""
|
||||||
|
Show the file open dialog for the OpenSong file.
|
||||||
|
"""
|
||||||
self.getFileName(self.trUtf8('Open OpenSong Bible'),
|
self.getFileName(self.trUtf8('Open OpenSong Bible'),
|
||||||
self.OpenSongFileEdit)
|
self.OpenSongFileEdit)
|
||||||
|
|
||||||
def onCancelButtonClicked(self, checked):
|
def onCancelButtonClicked(self, checked):
|
||||||
|
"""
|
||||||
|
Stop the import on pressing the cancel button.
|
||||||
|
"""
|
||||||
log.debug('Cancel button pressed!')
|
log.debug('Cancel button pressed!')
|
||||||
if self.currentId() == 3:
|
if self.currentId() == 3:
|
||||||
Receiver.send_message(u'openlpstopimport')
|
Receiver.send_message(u'openlpstopimport')
|
||||||
@ -241,7 +282,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
self.setField(u'csv_booksfile', QtCore.QVariant(''))
|
self.setField(u'csv_booksfile', QtCore.QVariant(''))
|
||||||
self.setField(u'csv_versefile', QtCore.QVariant(''))
|
self.setField(u'csv_versefile', QtCore.QVariant(''))
|
||||||
self.setField(u'opensong_file', QtCore.QVariant(''))
|
self.setField(u'opensong_file', QtCore.QVariant(''))
|
||||||
self.setField(u'web_location', QtCore.QVariant(DownloadLocation.Crosswalk))
|
self.setField(u'web_location', QtCore.QVariant(WebDownload.Crosswalk))
|
||||||
self.setField(u'web_biblename', QtCore.QVariant(self.BibleComboBox))
|
self.setField(u'web_biblename', QtCore.QVariant(self.BibleComboBox))
|
||||||
self.setField(u'proxy_server',
|
self.setField(u'proxy_server',
|
||||||
QtCore.QVariant(self.config.get_config(u'proxy address', '')))
|
QtCore.QVariant(self.config.get_config(u'proxy address', '')))
|
||||||
@ -252,7 +293,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
self.setField(u'license_version', QtCore.QVariant(self.VersionNameEdit))
|
self.setField(u'license_version', QtCore.QVariant(self.VersionNameEdit))
|
||||||
self.setField(u'license_copyright', QtCore.QVariant(self.CopyrightEdit))
|
self.setField(u'license_copyright', QtCore.QVariant(self.CopyrightEdit))
|
||||||
self.setField(u'license_permission', QtCore.QVariant(self.PermissionEdit))
|
self.setField(u'license_permission', QtCore.QVariant(self.PermissionEdit))
|
||||||
self.onLocationComboBoxChanged(DownloadLocation.Crosswalk)
|
self.onLocationComboBoxChanged(WebDownload.Crosswalk)
|
||||||
|
|
||||||
def loadWebBibles(self):
|
def loadWebBibles(self):
|
||||||
"""
|
"""
|
||||||
@ -263,14 +304,19 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
filepath = os.path.join(filepath, u'bibles', u'resources')
|
filepath = os.path.join(filepath, u'bibles', u'resources')
|
||||||
fbibles = None
|
fbibles = None
|
||||||
try:
|
try:
|
||||||
self.web_bible_list[DownloadLocation.Crosswalk] = {}
|
self.web_bible_list[WebDownload.Crosswalk] = {}
|
||||||
books_file = open(os.path.join(filepath, u'crosswalkbooks.csv'), 'r')
|
books_file = open(os.path.join(filepath, u'crosswalkbooks.csv'), 'r')
|
||||||
dialect = csv.Sniffer().sniff(books_file.read(1024))
|
dialect = csv.Sniffer().sniff(books_file.read(1024))
|
||||||
books_file.seek(0)
|
books_file.seek(0)
|
||||||
books_reader = csv.reader(books_file, dialect)
|
books_reader = csv.reader(books_file, dialect)
|
||||||
for line in books_reader:
|
for line in books_reader:
|
||||||
self.web_bible_list[DownloadLocation.Crosswalk][line[0]] = \
|
ver = line[0]
|
||||||
unicode(line[1], u'utf-8').strip()
|
name = line[1]
|
||||||
|
if not isinstance(ver, unicode):
|
||||||
|
ver = unicode(ver, u'utf8')
|
||||||
|
if not isinstance(name, unicode):
|
||||||
|
name = unicode(name, u'utf8')
|
||||||
|
self.web_bible_list[WebDownload.Crosswalk][ver] = name.strip()
|
||||||
except:
|
except:
|
||||||
log.exception(u'Crosswalk resources missing')
|
log.exception(u'Crosswalk resources missing')
|
||||||
finally:
|
finally:
|
||||||
@ -278,14 +324,19 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
books_file.close()
|
books_file.close()
|
||||||
#Load and store BibleGateway Bibles
|
#Load and store BibleGateway Bibles
|
||||||
try:
|
try:
|
||||||
self.web_bible_list[DownloadLocation.BibleGateway] = {}
|
self.web_bible_list[WebDownload.BibleGateway] = {}
|
||||||
books_file = open(os.path.join(filepath, u'biblegateway.csv'), 'r')
|
books_file = open(os.path.join(filepath, u'biblegateway.csv'), 'r')
|
||||||
dialect = csv.Sniffer().sniff(books_file.read(1024))
|
dialect = csv.Sniffer().sniff(books_file.read(1024))
|
||||||
books_file.seek(0)
|
books_file.seek(0)
|
||||||
books_reader = csv.reader(books_file, dialect)
|
books_reader = csv.reader(books_file, dialect)
|
||||||
for line in books_reader:
|
for line in books_reader:
|
||||||
self.web_bible_list[DownloadLocation.BibleGateway][line[0]] = \
|
ver = line[0]
|
||||||
unicode(line[1], u'utf-8').strip()
|
name = line[1]
|
||||||
|
if not isinstance(ver, unicode):
|
||||||
|
ver = unicode(ver, u'utf8')
|
||||||
|
if not isinstance(name, unicode):
|
||||||
|
name = unicode(name, u'utf8')
|
||||||
|
self.web_bible_list[WebDownload.BibleGateway][ver] = name.strip()
|
||||||
except:
|
except:
|
||||||
log.exception(u'Biblegateway resources missing')
|
log.exception(u'Biblegateway resources missing')
|
||||||
finally:
|
finally:
|
||||||
@ -315,52 +366,53 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
|
|
||||||
def performImport(self):
|
def performImport(self):
|
||||||
bible_type = self.field(u'source_format').toInt()[0]
|
bible_type = self.field(u'source_format').toInt()[0]
|
||||||
|
license_version = variant_to_unicode(self.field(u'license_version'))
|
||||||
|
license_copyright = variant_to_unicode(self.field(u'license_copyright'))
|
||||||
|
license_permission = variant_to_unicode(self.field(u'license_permission'))
|
||||||
importer = None
|
importer = None
|
||||||
if bible_type == BibleFormat.OSIS:
|
if bible_type == BibleFormat.OSIS:
|
||||||
# Import an OSIS bible
|
# Import an OSIS bible
|
||||||
importer = self.manager.import_bible(BibleFormat.OSIS,
|
importer = self.manager.import_bible(BibleFormat.OSIS,
|
||||||
name=unicode(self.field(u'license_version').toString()),
|
name=license_version,
|
||||||
filename=unicode(self.field(u'osis_location').toString())
|
filename=variant_to_unicode(self.field(u'osis_location'))
|
||||||
)
|
)
|
||||||
elif bible_type == BibleFormat.CSV:
|
elif bible_type == BibleFormat.CSV:
|
||||||
# Import a CSV bible
|
# Import a CSV bible
|
||||||
importer = self.manager.import_bible(BibleFormat.CSV,
|
importer = self.manager.import_bible(BibleFormat.CSV,
|
||||||
name=unicode(self.field(u'license_version').toString()),
|
name=license_version,
|
||||||
booksfile=self.field(u'csv_booksfile').toString(),
|
booksfile=variant_to_unicode(self.field(u'csv_booksfile')),
|
||||||
versefile=self.field(u'csv_versefile').toString()
|
versefile=variant_to_unicode(self.field(u'csv_versefile'))
|
||||||
)
|
)
|
||||||
elif bible_type == BibleFormat.OpenSong:
|
elif bible_type == BibleFormat.OpenSong:
|
||||||
# Import an OpenSong bible
|
# Import an OpenSong bible
|
||||||
importer = self.manager.import_bible(BibleFormat.OpenSong,
|
importer = self.manager.import_bible(BibleFormat.OpenSong,
|
||||||
name=unicode(self.field(u'license_version').toString()),
|
name=license_version,
|
||||||
filename=self.field(u'opensong_file').toString()
|
filename=variant_to_unicode(self.field(u'opensong_file'))
|
||||||
)
|
)
|
||||||
elif bible_type == BibleFormat.WebDownload:
|
elif bible_type == BibleFormat.WebDownload:
|
||||||
# Import a bible from the web
|
# Import a bible from the web
|
||||||
self.ImportProgressBar.setMaximum(1)
|
self.ImportProgressBar.setMaximum(1)
|
||||||
download_location = self.field(u'web_location').toInt()[0]
|
download_location = self.field(u'web_location').toInt()[0]
|
||||||
if download_location == DownloadLocation.Crosswalk:
|
bible_version = self.BibleComboBox.currentText()
|
||||||
bible = self.web_bible_list[DownloadLocation.Crosswalk][
|
if not isinstance(bible_version, unicode):
|
||||||
unicode(self.BibleComboBox.currentText(), u'utf8')]
|
bible_version = unicode(bible_version, u'utf8')
|
||||||
elif download_location == DownloadLocation.BibleGateway:
|
if download_location == WebDownload.Crosswalk:
|
||||||
bible = self.web_bible_list[DownloadLocation.BibleGateway][
|
bible = self.web_bible_list[WebDownload.Crosswalk][bible_version]
|
||||||
self.BibleComboBox.currentText()]
|
elif download_location == WebDownload.BibleGateway:
|
||||||
importer = self.manager.import_bible(BibleFormat.WebDownload,
|
bible = self.web_bible_list[WebDownload.BibleGateway][bible_version]
|
||||||
name=unicode(self.field(u'license_version').toString(), u'utf8'),
|
importer = self.manager.import_bible(
|
||||||
download_source=DownloadLocation.get_name(download_location),
|
BibleFormat.WebDownload,
|
||||||
|
name=license_version,
|
||||||
|
download_source=WebDownload.get_name(download_location),
|
||||||
download_name=bible,
|
download_name=bible,
|
||||||
proxy_server=unicode(self.field(u'proxy_server').toString(), u'utf8'),
|
proxy_server=variant_to_unicode(self.field(u'proxy_server')),
|
||||||
proxy_username=unicode(self.field(u'proxy_username').toString(), u'utf8'),
|
proxy_username=variant_to_unicode(self.field(u'proxy_username')),
|
||||||
proxy_password=unicode(self.field(u'proxy_password').toString(), u'utf8')
|
proxy_password=variant_to_unicode(self.field(u'proxy_password'))
|
||||||
)
|
)
|
||||||
success = importer.do_import()
|
success = importer.do_import()
|
||||||
if success:
|
if success:
|
||||||
self.manager.save_meta_data(
|
self.manager.save_meta_data(license_version, license_version,
|
||||||
unicode(self.field(u'license_version').toString()),
|
license_copyright, license_permission)
|
||||||
unicode(self.field(u'license_version').toString()),
|
|
||||||
unicode(self.field(u'license_copyright').toString()),
|
|
||||||
unicode(self.field(u'license_permission').toString())
|
|
||||||
)
|
|
||||||
self.manager.reload_bibles()
|
self.manager.reload_bibles()
|
||||||
self.ImportProgressLabel.setText(self.trUtf8('Finished import.'))
|
self.ImportProgressLabel.setText(self.trUtf8('Finished import.'))
|
||||||
else:
|
else:
|
||||||
|
@ -39,10 +39,19 @@ from openlp.plugins.bibles.lib.models import Book
|
|||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class HTTPBooks(object):
|
class HTTPBooks(object):
|
||||||
|
"""
|
||||||
|
A wrapper class around a small SQLite database which contains the books,
|
||||||
|
chapter counts and verse counts for the web download Bibles. This class
|
||||||
|
contains a singleton "cursor" so that only one connection to the SQLite
|
||||||
|
database is ever used.
|
||||||
|
"""
|
||||||
cursor = None
|
cursor = None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_cursor():
|
def get_cursor():
|
||||||
|
"""
|
||||||
|
Return the cursor object. Instantiate one if it doesn't exist yet.
|
||||||
|
"""
|
||||||
if HTTPBooks.cursor is None:
|
if HTTPBooks.cursor is None:
|
||||||
filepath = os.path.join(
|
filepath = os.path.join(
|
||||||
AppLocation.get_directory(AppLocation.PluginsDir), u'bibles',
|
AppLocation.get_directory(AppLocation.PluginsDir), u'bibles',
|
||||||
@ -53,12 +62,24 @@ class HTTPBooks(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def run_sql(query, parameters=()):
|
def run_sql(query, parameters=()):
|
||||||
|
"""
|
||||||
|
Run an SQL query on the database, returning the results.
|
||||||
|
|
||||||
|
``query``
|
||||||
|
The actual SQL query to run.
|
||||||
|
|
||||||
|
``parameters``
|
||||||
|
Any variable parameters to add to the query.
|
||||||
|
"""
|
||||||
cursor = HTTPBooks.get_cursor()
|
cursor = HTTPBooks.get_cursor()
|
||||||
cursor.execute(query, parameters)
|
cursor.execute(query, parameters)
|
||||||
return cursor.fetchall()
|
return cursor.fetchall()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_books():
|
def get_books():
|
||||||
|
"""
|
||||||
|
Return a list of all the books of the Bible.
|
||||||
|
"""
|
||||||
books = HTTPBooks.run_sql(u'SELECT id, testament_id, name, '
|
books = HTTPBooks.run_sql(u'SELECT id, testament_id, name, '
|
||||||
u'abbreviation, chapters FROM books ORDER BY id')
|
u'abbreviation, chapters FROM books ORDER BY id')
|
||||||
book_list = []
|
book_list = []
|
||||||
@ -74,6 +95,12 @@ class HTTPBooks(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_book(name):
|
def get_book(name):
|
||||||
|
"""
|
||||||
|
Return a book by name or abbreviation.
|
||||||
|
|
||||||
|
``name``
|
||||||
|
The name or abbreviation of the book.
|
||||||
|
"""
|
||||||
if not isinstance(name, unicode):
|
if not isinstance(name, unicode):
|
||||||
name = unicode(name)
|
name = unicode(name)
|
||||||
books = HTTPBooks.run_sql(u'SELECT id, testament_id, name, '
|
books = HTTPBooks.run_sql(u'SELECT id, testament_id, name, '
|
||||||
@ -92,6 +119,15 @@ class HTTPBooks(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_chapter(name, chapter):
|
def get_chapter(name, chapter):
|
||||||
|
"""
|
||||||
|
Return the chapter details for a specific chapter of a book.
|
||||||
|
|
||||||
|
``name``
|
||||||
|
The name or abbreviation of a book.
|
||||||
|
|
||||||
|
``chapter``
|
||||||
|
The chapter number.
|
||||||
|
"""
|
||||||
if not isinstance(name, int):
|
if not isinstance(name, int):
|
||||||
chapter = int(chapter)
|
chapter = int(chapter)
|
||||||
book = HTTPBooks.get_book(name)
|
book = HTTPBooks.get_book(name)
|
||||||
@ -109,6 +145,12 @@ class HTTPBooks(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_chapter_count(book):
|
def get_chapter_count(book):
|
||||||
|
"""
|
||||||
|
Return the number of chapters in a book.
|
||||||
|
|
||||||
|
``book``
|
||||||
|
The name or abbreviation of the book.
|
||||||
|
"""
|
||||||
details = HTTPBooks.get_book(book)
|
details = HTTPBooks.get_book(book)
|
||||||
if details:
|
if details:
|
||||||
return details[u'chapters']
|
return details[u'chapters']
|
||||||
@ -116,6 +158,15 @@ class HTTPBooks(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_verse_count(book, chapter):
|
def get_verse_count(book, chapter):
|
||||||
|
"""
|
||||||
|
Return the number of verses in a chapter.
|
||||||
|
|
||||||
|
``book``
|
||||||
|
The name or abbreviation of the book.
|
||||||
|
|
||||||
|
``chapter``
|
||||||
|
The number of the chapter.
|
||||||
|
"""
|
||||||
details = HTTPBooks.get_chapter(book, chapter)
|
details = HTTPBooks.get_chapter(book, chapter)
|
||||||
if details:
|
if details:
|
||||||
return details[u'verses']
|
return details[u'verses']
|
||||||
@ -123,7 +174,9 @@ class HTTPBooks(object):
|
|||||||
|
|
||||||
|
|
||||||
class BGExtract(BibleCommon):
|
class BGExtract(BibleCommon):
|
||||||
log.info(u'%s BGExtract loaded', __name__)
|
"""
|
||||||
|
Extract verses from BibleGateway
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, proxyurl=None):
|
def __init__(self, proxyurl=None):
|
||||||
log.debug(u'init %s', proxyurl)
|
log.debug(u'init %s', proxyurl)
|
||||||
@ -133,7 +186,7 @@ class BGExtract(BibleCommon):
|
|||||||
"""
|
"""
|
||||||
Access and decode bibles via the BibleGateway website
|
Access and decode bibles via the BibleGateway website
|
||||||
|
|
||||||
``Version``
|
``version``
|
||||||
The version of the bible like 31 for New International version
|
The version of the bible like 31 for New International version
|
||||||
|
|
||||||
``bookname``
|
``bookname``
|
||||||
@ -196,8 +249,10 @@ class BGExtract(BibleCommon):
|
|||||||
verse_list[verse_number] = u''
|
verse_list[verse_number] = u''
|
||||||
continue
|
continue
|
||||||
if isinstance(verse, NavigableString):
|
if isinstance(verse, NavigableString):
|
||||||
|
if not isinstance(verse, unicode):
|
||||||
|
verse = unicode(verse, u'utf8')
|
||||||
verse_list[verse_number] = verse_list[verse_number] + \
|
verse_list[verse_number] = verse_list[verse_number] + \
|
||||||
unescape(unicode(verse, u'utf-8').replace(u' ', u' '))
|
unescape(verse.replace(u' ', u' '))
|
||||||
# Delete the "0" element, since we don't need it, it's just there for
|
# Delete the "0" element, since we don't need it, it's just there for
|
||||||
# some stupid initial whitespace, courtesy of Bible Gateway.
|
# some stupid initial whitespace, courtesy of Bible Gateway.
|
||||||
del verse_list[0]
|
del verse_list[0]
|
||||||
@ -205,14 +260,15 @@ class BGExtract(BibleCommon):
|
|||||||
return SearchResults(bookname, chapter, verse_list)
|
return SearchResults(bookname, chapter, verse_list)
|
||||||
|
|
||||||
class CWExtract(BibleCommon):
|
class CWExtract(BibleCommon):
|
||||||
log.info(u'%s CWExtract loaded', __name__)
|
"""
|
||||||
|
Extract verses from CrossWalk/BibleStudyTools
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, proxyurl=None):
|
def __init__(self, proxyurl=None):
|
||||||
log.debug(u'init %s', proxyurl)
|
log.debug(u'init %s', proxyurl)
|
||||||
self.proxyurl = proxyurl
|
self.proxyurl = proxyurl
|
||||||
|
|
||||||
def get_bible_chapter(self, version, bookname, chapter):
|
def get_bible_chapter(self, version, bookname, chapter):
|
||||||
log.debug(u'%s %s, %s, %s', __name__, version, bookname, chapter)
|
|
||||||
"""
|
"""
|
||||||
Access and decode bibles via the Crosswalk website
|
Access and decode bibles via the Crosswalk website
|
||||||
|
|
||||||
@ -227,9 +283,9 @@ class CWExtract(BibleCommon):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'get_bible_chapter %s,%s,%s',
|
log.debug(u'get_bible_chapter %s,%s,%s',
|
||||||
version, bookname, chapter)
|
version, bookname, chapter)
|
||||||
bookname = bookname.replace(u' ', u'')
|
urlbookname = bookname.replace(u' ', u'-')
|
||||||
chapter_url = u'http://www.biblestudytools.com/%s/%s/%s.html' % \
|
chapter_url = u'http://www.biblestudytools.com/%s/%s/%s.html' % \
|
||||||
(version, bookname.lower(), chapter)
|
(version, urlbookname.lower(), chapter)
|
||||||
log.debug(u'URL: %s', chapter_url)
|
log.debug(u'URL: %s', chapter_url)
|
||||||
page = urllib2.urlopen(chapter_url)
|
page = urllib2.urlopen(chapter_url)
|
||||||
if not page:
|
if not page:
|
||||||
@ -287,6 +343,10 @@ class HTTPBible(BibleDB):
|
|||||||
self.proxy_password = None
|
self.proxy_password = None
|
||||||
|
|
||||||
def do_import(self):
|
def do_import(self):
|
||||||
|
"""
|
||||||
|
Run the import. This method overrides the parent class method. Returns
|
||||||
|
``True`` on success, ``False`` on failure.
|
||||||
|
"""
|
||||||
self.wizard.ImportProgressBar.setMaximum(2)
|
self.wizard.ImportProgressBar.setMaximum(2)
|
||||||
self.wizard.incrementProgressBar('Registering bible...')
|
self.wizard.incrementProgressBar('Registering bible...')
|
||||||
self.create_meta(u'download source', self.download_source)
|
self.create_meta(u'download source', self.download_source)
|
||||||
@ -370,17 +430,43 @@ class HTTPBible(BibleDB):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def get_books(self):
|
def get_books(self):
|
||||||
|
"""
|
||||||
|
Return the list of books.
|
||||||
|
"""
|
||||||
return [Book.populate(name=book['name']) for book in HTTPBooks.get_books()]
|
return [Book.populate(name=book['name']) for book in HTTPBooks.get_books()]
|
||||||
|
|
||||||
def lookup_book(self, book):
|
def lookup_book(self, book):
|
||||||
|
"""
|
||||||
|
Look up the name of a book.
|
||||||
|
"""
|
||||||
return HTTPBooks.get_book(book)
|
return HTTPBooks.get_book(book)
|
||||||
|
|
||||||
def get_chapter_count(self, book):
|
def get_chapter_count(self, book):
|
||||||
|
"""
|
||||||
|
Return the number of chapters in a particular book.
|
||||||
|
"""
|
||||||
return HTTPBooks.get_chapter_count(book)
|
return HTTPBooks.get_chapter_count(book)
|
||||||
|
|
||||||
def get_verse_count(self, book, chapter):
|
def get_verse_count(self, book, chapter):
|
||||||
|
"""
|
||||||
|
Return the number of verses for the specified chapter and book.
|
||||||
|
|
||||||
|
``book``
|
||||||
|
The name of the book.
|
||||||
|
|
||||||
|
``chapter``
|
||||||
|
The chapter whose verses are being counted.
|
||||||
|
"""
|
||||||
return HTTPBooks.get_verse_count(book, chapter)
|
return HTTPBooks.get_verse_count(book, chapter)
|
||||||
|
|
||||||
def set_proxy_server(self, server):
|
def set_proxy_server(self, server):
|
||||||
|
"""
|
||||||
|
Sets the proxy server.
|
||||||
|
|
||||||
|
**Note: This is not actually used.**
|
||||||
|
|
||||||
|
``server``
|
||||||
|
The hostname or IP address of the proxy server.
|
||||||
|
"""
|
||||||
self.proxy_server = server
|
self.proxy_server = server
|
||||||
|
|
||||||
|
@ -60,6 +60,9 @@ class BibleFormat(object):
|
|||||||
def get_class(id):
|
def get_class(id):
|
||||||
"""
|
"""
|
||||||
Return the appropriate imeplementation class.
|
Return the appropriate imeplementation class.
|
||||||
|
|
||||||
|
``id``
|
||||||
|
The Bible format.
|
||||||
"""
|
"""
|
||||||
if id == BibleFormat.OSIS:
|
if id == BibleFormat.OSIS:
|
||||||
return OSISBible
|
return OSISBible
|
||||||
@ -74,6 +77,9 @@ class BibleFormat(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def list():
|
def list():
|
||||||
|
"""
|
||||||
|
Return a list of the supported Bible formats.
|
||||||
|
"""
|
||||||
return [
|
return [
|
||||||
BibleFormat.OSIS,
|
BibleFormat.OSIS,
|
||||||
BibleFormat.CSV,
|
BibleFormat.CSV,
|
||||||
@ -247,7 +253,7 @@ class BibleManager(object):
|
|||||||
"""
|
"""
|
||||||
if not isinstance(name, unicode):
|
if not isinstance(name, unicode):
|
||||||
name = unicode(name)
|
name = unicode(name)
|
||||||
for bible, db_object in self.db_cache.iteritems():
|
for bible in self.db_cache.keys():
|
||||||
log.debug(u'Bible from cache in is_new_bible %s', bible)
|
log.debug(u'Bible from cache in is_new_bible %s', bible)
|
||||||
if not isinstance(bible, unicode):
|
if not isinstance(bible, unicode):
|
||||||
bible = unicode(bible)
|
bible = unicode(bible)
|
||||||
|
@ -76,6 +76,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def requiredIcons(self):
|
def requiredIcons(self):
|
||||||
MediaManagerItem.requiredIcons(self)
|
MediaManagerItem.requiredIcons(self)
|
||||||
|
self.hasImportIcon = True
|
||||||
|
self.hasNewIcon = False
|
||||||
self.hasEditIcon = False
|
self.hasEditIcon = False
|
||||||
self.hasDeleteIcon = False
|
self.hasDeleteIcon = False
|
||||||
|
|
||||||
@ -251,6 +253,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'config_updated'), self.configUpdated)
|
QtCore.SIGNAL(u'config_updated'), self.configUpdated)
|
||||||
# Other stuff
|
# Other stuff
|
||||||
|
QtCore.QObject.connect(self.QuickSearchEdit,
|
||||||
|
QtCore.SIGNAL(u'returnPressed()'), self.onQuickSearchButton)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'bible_showprogress'), self.onSearchProgressShow)
|
QtCore.SIGNAL(u'bible_showprogress'), self.onSearchProgressShow)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
@ -373,7 +377,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
unicode(self.AdvancedBookComboBox.currentText()),
|
unicode(self.AdvancedBookComboBox.currentText()),
|
||||||
self.AdvancedBookComboBox.itemData(item).toInt()[0])
|
self.AdvancedBookComboBox.itemData(item).toInt()[0])
|
||||||
|
|
||||||
def onNewClick(self):
|
def onImportClick(self):
|
||||||
self.bibleimportform = ImportWizardForm(self, self.parent.config,
|
self.bibleimportform = ImportWizardForm(self, self.parent.config,
|
||||||
self.parent.manager, self.parent)
|
self.parent.manager, self.parent)
|
||||||
self.bibleimportform.exec_()
|
self.bibleimportform.exec_()
|
||||||
|
@ -63,7 +63,8 @@ class OpenSongBible(BibleDB):
|
|||||||
Loads a Bible from file.
|
Loads a Bible from file.
|
||||||
"""
|
"""
|
||||||
log.debug(u'Starting OpenSong import from "%s"' % self.filename)
|
log.debug(u'Starting OpenSong import from "%s"' % self.filename)
|
||||||
self.filename = unicode(self.filename, u'utf-8')
|
if not isinstance(self.filename, unicode):
|
||||||
|
self.filename = unicode(self.filename, u'utf8')
|
||||||
self.wizard.incrementProgressBar(u'Preparing for import...')
|
self.wizard.incrementProgressBar(u'Preparing for import...')
|
||||||
file = None
|
file = None
|
||||||
success = True
|
success = True
|
||||||
|
@ -65,6 +65,7 @@ class OSISBible(BibleDB):
|
|||||||
self.l_regex = re.compile(r'<l (.*?)>')
|
self.l_regex = re.compile(r'<l (.*?)>')
|
||||||
self.w_regex = re.compile(r'<w (.*?)>')
|
self.w_regex = re.compile(r'<w (.*?)>')
|
||||||
self.q_regex = re.compile(r'<q (.*?)>')
|
self.q_regex = re.compile(r'<q (.*?)>')
|
||||||
|
self.trans_regex = re.compile(r'<transChange(.*?)>(.*?)</transChange>')
|
||||||
self.spaces_regex = re.compile(r'([ ]{2,})')
|
self.spaces_regex = re.compile(r'([ ]{2,})')
|
||||||
self.books = {}
|
self.books = {}
|
||||||
filepath = os.path.join(
|
filepath = os.path.join(
|
||||||
@ -159,10 +160,11 @@ class OSISBible(BibleDB):
|
|||||||
verse_text = self.l_regex.sub(u'', verse_text)
|
verse_text = self.l_regex.sub(u'', verse_text)
|
||||||
verse_text = self.w_regex.sub(u'', verse_text)
|
verse_text = self.w_regex.sub(u'', verse_text)
|
||||||
verse_text = self.q_regex.sub(u'', verse_text)
|
verse_text = self.q_regex.sub(u'', verse_text)
|
||||||
|
verse_text = self.trans_regex.sub(u'', verse_text)
|
||||||
verse_text = verse_text.replace(u'</lb>', u'')\
|
verse_text = verse_text.replace(u'</lb>', u'')\
|
||||||
.replace(u'</l>', u'').replace(u'<lg>', u'')\
|
.replace(u'</l>', u'').replace(u'<lg>', u'')\
|
||||||
.replace(u'</lg>', u'').replace(u'</q>', u'')\
|
.replace(u'</lg>', u'').replace(u'</q>', u'')\
|
||||||
.replace(u'</div>', u'')
|
.replace(u'</div>', u'').replace(u'</w>', u'')
|
||||||
verse_text = self.spaces_regex.sub(u' ', verse_text)
|
verse_text = self.spaces_regex.sub(u' ', verse_text)
|
||||||
self.create_verse(db_book.id, chapter, verse, verse_text)
|
self.create_verse(db_book.id, chapter, verse, verse_text)
|
||||||
Receiver.send_message(u'process_events')
|
Receiver.send_message(u'process_events')
|
||||||
|
@ -147,8 +147,8 @@ class ImpressController(PresentationController):
|
|||||||
Called at system exit to clean up any running presentations
|
Called at system exit to clean up any running presentations
|
||||||
"""
|
"""
|
||||||
log.debug(u'Kill OpenOffice')
|
log.debug(u'Kill OpenOffice')
|
||||||
for doc in self.docs:
|
while self.docs:
|
||||||
doc.close_presentation()
|
self.docs[0].close_presentation()
|
||||||
if os.name != u'nt':
|
if os.name != u'nt':
|
||||||
desktop = self.get_uno_desktop()
|
desktop = self.get_uno_desktop()
|
||||||
else:
|
else:
|
||||||
|
@ -143,7 +143,7 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
for cidx in self.controllers:
|
for cidx in self.controllers:
|
||||||
doc = self.controllers[cidx].add_doc(filepath)
|
doc = self.controllers[cidx].add_doc(filepath)
|
||||||
doc.presentation_deleted()
|
doc.presentation_deleted()
|
||||||
self.controllers[cidx].remove_doc(doc)
|
doc.close_presentation()
|
||||||
|
|
||||||
def generateSlideData(self, service_item):
|
def generateSlideData(self, service_item):
|
||||||
items = self.ListView.selectedIndexes()
|
items = self.ListView.selectedIndexes()
|
||||||
@ -171,7 +171,7 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
service_item.add_from_command(path, name, img)
|
service_item.add_from_command(path, name, img)
|
||||||
i = i + 1
|
i = i + 1
|
||||||
img = doc.get_slide_preview_file(i)
|
img = doc.get_slide_preview_file(i)
|
||||||
controller.remove_doc(doc)
|
doc.close_presentation()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def findControllerByType(self, filename):
|
def findControllerByType(self, filename):
|
||||||
|
@ -81,8 +81,9 @@ class PowerpointController(PresentationController):
|
|||||||
"""
|
"""
|
||||||
Called at system exit to clean up any running presentations
|
Called at system exit to clean up any running presentations
|
||||||
"""
|
"""
|
||||||
for doc in self.docs:
|
log.debug(u'Kill powerpoint')
|
||||||
doc.close_presentation()
|
while self.docs:
|
||||||
|
self.docs[0].close_presentation()
|
||||||
if self.process is None:
|
if self.process is None:
|
||||||
return
|
return
|
||||||
if self.process.Presentations.Count > 0:
|
if self.process.Presentations.Count > 0:
|
||||||
@ -149,12 +150,12 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
Triggerent by new object being added to SlideController orOpenLP
|
Triggerent by new object being added to SlideController orOpenLP
|
||||||
being shut down
|
being shut down
|
||||||
"""
|
"""
|
||||||
if self.presentation is None:
|
log.debug(u'ClosePresentation')
|
||||||
return
|
if self.presentation:
|
||||||
try:
|
try:
|
||||||
self.presentation.Close()
|
self.presentation.Close()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
self.presentation = None
|
self.presentation = None
|
||||||
self.controller.remove_doc(self)
|
self.controller.remove_doc(self)
|
||||||
|
|
||||||
|
@ -88,9 +88,9 @@ class PptviewController(PresentationController):
|
|||||||
"""
|
"""
|
||||||
Called at system exit to clean up any running presentations
|
Called at system exit to clean up any running presentations
|
||||||
"""
|
"""
|
||||||
log.debug(u'Kill')
|
log.debug(u'Kill pptviewer')
|
||||||
for doc in self.docs:
|
while self.docs:
|
||||||
doc.close_presentation()
|
self.docs[0].close_presentation()
|
||||||
|
|
||||||
def add_doc(self, name):
|
def add_doc(self, name):
|
||||||
log.debug(u'Add Doc PPTView')
|
log.debug(u'Add Doc PPTView')
|
||||||
@ -137,6 +137,7 @@ class PptviewDocument(PresentationDocument):
|
|||||||
Triggerent by new object being added to SlideController orOpenLP
|
Triggerent by new object being added to SlideController orOpenLP
|
||||||
being shut down
|
being shut down
|
||||||
"""
|
"""
|
||||||
|
log.debug(u'ClosePresentation')
|
||||||
self.controller.process.ClosePPT(self.pptid)
|
self.controller.process.ClosePPT(self.pptid)
|
||||||
self.pptid = -1
|
self.pptid = -1
|
||||||
self.controller.remove_doc(self)
|
self.controller.remove_doc(self)
|
||||||
|
@ -57,6 +57,8 @@ class PresentationPlugin(Plugin):
|
|||||||
for controller in self.controllers:
|
for controller in self.controllers:
|
||||||
if self.controllers[controller].enabled:
|
if self.controllers[controller].enabled:
|
||||||
presentation_types.append({u'%s' % controller : self.controllers[controller].supports})
|
presentation_types.append({u'%s' % controller : self.controllers[controller].supports})
|
||||||
|
self.controllers[controller].start_process()
|
||||||
|
|
||||||
Receiver.send_message(
|
Receiver.send_message(
|
||||||
u'presentation types', presentation_types)
|
u'presentation types', presentation_types)
|
||||||
|
|
||||||
@ -104,8 +106,6 @@ class PresentationPlugin(Plugin):
|
|||||||
for controller_class in controller_classes:
|
for controller_class in controller_classes:
|
||||||
controller = controller_class(self)
|
controller = controller_class(self)
|
||||||
self.registerControllers(controller)
|
self.registerControllers(controller)
|
||||||
if controller.enabled:
|
|
||||||
controller.start_process()
|
|
||||||
if self.controllers:
|
if self.controllers:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
@ -498,7 +498,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
sxml = SongXMLBuilder()
|
sxml = SongXMLBuilder()
|
||||||
sxml.new_document()
|
sxml.new_document()
|
||||||
sxml.add_lyrics_to_song()
|
sxml.add_lyrics_to_song()
|
||||||
count = 1
|
|
||||||
text = u' '
|
text = u' '
|
||||||
for i in range (0, self.VerseListWidget.count()):
|
for i in range (0, self.VerseListWidget.count()):
|
||||||
item = self.VerseListWidget.item(i)
|
item = self.VerseListWidget.item(i)
|
||||||
@ -506,7 +505,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
bits = verseId.split(u':')
|
bits = verseId.split(u':')
|
||||||
sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text()))
|
sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text()))
|
||||||
text = text + unicode(self.VerseListWidget.item(i).text()) + u' '
|
text = text + unicode(self.VerseListWidget.item(i).text()) + u' '
|
||||||
count += 1
|
|
||||||
text = text.replace(u'\'', u'')
|
text = text.replace(u'\'', u'')
|
||||||
text = text.replace(u',', u'')
|
text = text.replace(u',', u'')
|
||||||
text = text.replace(u';', u'')
|
text = text.replace(u';', u'')
|
||||||
|
@ -54,7 +54,7 @@ class Ui_OpenLPExportDialog(object):
|
|||||||
self.horizontalLayout.addWidget(self.ExportFileLineEdit)
|
self.horizontalLayout.addWidget(self.ExportFileLineEdit)
|
||||||
self.ExportFileSelectPushButton = QtGui.QPushButton(self.ExportFileWidget)
|
self.ExportFileSelectPushButton = QtGui.QPushButton(self.ExportFileWidget)
|
||||||
icon1 = QtGui.QIcon()
|
icon1 = QtGui.QIcon()
|
||||||
icon1.addPixmap(QtGui.QPixmap(u':/exports/export_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon1.addPixmap(QtGui.QPixmap(u':/general/general_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
self.ExportFileSelectPushButton.setIcon(icon1)
|
self.ExportFileSelectPushButton.setIcon(icon1)
|
||||||
self.ExportFileSelectPushButton.setObjectName(u'ExportFileSelectPushButton')
|
self.ExportFileSelectPushButton.setObjectName(u'ExportFileSelectPushButton')
|
||||||
self.horizontalLayout.addWidget(self.ExportFileSelectPushButton)
|
self.horizontalLayout.addWidget(self.ExportFileSelectPushButton)
|
||||||
|
@ -282,7 +282,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
raw_footer = []
|
raw_footer = []
|
||||||
author_list = u''
|
author_list = u''
|
||||||
author_audit = []
|
author_audit = []
|
||||||
ccl = u''
|
ccli = u''
|
||||||
if self.remoteTriggered is None:
|
if self.remoteTriggered is None:
|
||||||
item = self.ListView.currentItem()
|
item = self.ListView.currentItem()
|
||||||
if item is None:
|
if item is None:
|
||||||
|
@ -60,7 +60,8 @@ class Ui_SongUsageDetailDialog(object):
|
|||||||
self.horizontalLayout.addWidget(self.FileLineEdit)
|
self.horizontalLayout.addWidget(self.FileLineEdit)
|
||||||
self.SaveFilePushButton = QtGui.QPushButton(self.FileGroupBox)
|
self.SaveFilePushButton = QtGui.QPushButton(self.FileGroupBox)
|
||||||
icon = QtGui.QIcon()
|
icon = QtGui.QIcon()
|
||||||
icon.addPixmap(QtGui.QPixmap(u':/exports/export_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon.addPixmap(QtGui.QPixmap(u':/general/general_load.png'),
|
||||||
|
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
self.SaveFilePushButton.setIcon(icon)
|
self.SaveFilePushButton.setIcon(icon)
|
||||||
self.SaveFilePushButton.setObjectName(u'SaveFilePushButton')
|
self.SaveFilePushButton.setObjectName(u'SaveFilePushButton')
|
||||||
self.horizontalLayout.addWidget(self.SaveFilePushButton)
|
self.horizontalLayout.addWidget(self.SaveFilePushButton)
|
||||||
|
@ -70,7 +70,7 @@ class Migration(object):
|
|||||||
"""
|
"""
|
||||||
#MigrateFiles(self.display).process()
|
#MigrateFiles(self.display).process()
|
||||||
MigrateSongs(self.display).process()
|
MigrateSongs(self.display).process()
|
||||||
#MigrateBibles(self.display).process()
|
MigrateBibles(self.display).process()
|
||||||
|
|
||||||
def move_log_file(self):
|
def move_log_file(self):
|
||||||
"""
|
"""
|
||||||
@ -101,6 +101,7 @@ class Migration(object):
|
|||||||
writefile.close()
|
writefile.close()
|
||||||
|
|
||||||
def convert_sqlite2_to_3(self, olddb, newdb):
|
def convert_sqlite2_to_3(self, olddb, newdb):
|
||||||
|
print u'Converting sqlite2 ' + olddb + ' to sqlite3 ' + newdb
|
||||||
if os.name == u'nt':
|
if os.name == u'nt':
|
||||||
# we can't make this a raw unicode string as the \U within it causes much confusion
|
# we can't make this a raw unicode string as the \U within it causes much confusion
|
||||||
hKey = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, u'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\SQLite ODBC Driver')
|
hKey = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, u'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\SQLite ODBC Driver')
|
||||||
@ -132,19 +133,30 @@ class Migration(object):
|
|||||||
|
|
||||||
if __name__ == u'__main__':
|
if __name__ == u'__main__':
|
||||||
mig = Migration()
|
mig = Migration()
|
||||||
config = PluginConfig(u'Songs')
|
songconfig = PluginConfig(u'Songs')
|
||||||
newpath = config.get_data_path()
|
newsongpath = songconfig.get_data_path()
|
||||||
|
bibleconfig = PluginConfig(u'Bibles')
|
||||||
|
newbiblepath = bibleconfig.get_data_path()
|
||||||
if os.name == u'nt':
|
if os.name == u'nt':
|
||||||
if not os.path.isdir(newpath):
|
if not os.path.isdir(newsongpath):
|
||||||
os.makedirs(newpath)
|
os.makedirs(newsongpath)
|
||||||
|
if not os.path.isdir(newbiblepath):
|
||||||
|
os.makedirs(newbiblepath)
|
||||||
ALL_USERS_APPLICATION_DATA = 35
|
ALL_USERS_APPLICATION_DATA = 35
|
||||||
shell = Dispatch(u'Shell.Application')
|
shell = Dispatch(u'Shell.Application')
|
||||||
folder = shell.Namespace(ALL_USERS_APPLICATION_DATA)
|
folder = shell.Namespace(ALL_USERS_APPLICATION_DATA)
|
||||||
folderitem = folder.Self
|
folderitem = folder.Self
|
||||||
olddb = os.path.join(folderitem.path, u'openlp.org', u'Data', u'songs.olp')
|
oldsongdb = os.path.join(folderitem.path, u'openlp.org', u'Data', u'songs.olp')
|
||||||
|
oldbiblepath = os.path.join(folderitem.path, u'openlp.org', u'Data', u'Bibles')
|
||||||
else:
|
else:
|
||||||
olddb = os.path.join(newpath, u'songs.olp')
|
oldsongdb = os.path.join(newsongpath, u'songs.olp')
|
||||||
newdb = os.path.join(newpath, u'songs.sqlite')
|
newsongdb = os.path.join(newsongpath, u'songs.sqlite')
|
||||||
mig.convert_sqlite2_to_3(olddb, newdb)
|
mig.convert_sqlite2_to_3(oldsongdb, newsongdb)
|
||||||
|
files = os.listdir(oldbiblepath)
|
||||||
|
for file in files:
|
||||||
|
f = os.path.splitext(os.path.basename(file))[0]
|
||||||
|
if f != 'kjv': #kjv bible has an autoincrement key not supported in sqlite3
|
||||||
|
mig.convert_sqlite2_to_3(os.path.join(oldbiblepath, file),
|
||||||
|
os.path.join(newbiblepath, f + u'.sqlite'))
|
||||||
mig.process()
|
mig.process()
|
||||||
#mig.move_log_file()
|
#mig.move_log_file()
|
||||||
|
@ -13,14 +13,22 @@
|
|||||||
<file>book_maintenance.png</file>
|
<file>book_maintenance.png</file>
|
||||||
<file>author_maintenance.png</file>
|
<file>author_maintenance.png</file>
|
||||||
<file>topic_maintenance.png</file>
|
<file>topic_maintenance.png</file>
|
||||||
<file>song_delete.png</file>
|
|
||||||
<file>song_edit.png</file>
|
|
||||||
<file>song_export.png</file>
|
|
||||||
<file>song_new.png</file>
|
|
||||||
<file>song_author_edit.png</file>
|
<file>song_author_edit.png</file>
|
||||||
<file>song_topic_edit.png</file>
|
<file>song_topic_edit.png</file>
|
||||||
<file>song_book_edit.png</file>
|
<file>song_book_edit.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
<qresource prefix="general" >
|
||||||
|
<file>general_preview.png</file>
|
||||||
|
<file>general_live.png</file>
|
||||||
|
<file>general_add.png</file>
|
||||||
|
<file>general_delete.png</file>
|
||||||
|
<file>general_edit.png</file>
|
||||||
|
<file>general_export.png</file>
|
||||||
|
<file>general_import.png</file>
|
||||||
|
<file>general_new.png</file>
|
||||||
|
<file>general_open.png</file>
|
||||||
|
<file>general_save.png</file>
|
||||||
|
</qresource>
|
||||||
<qresource prefix="slides" >
|
<qresource prefix="slides" >
|
||||||
<file>slide_close.png</file>
|
<file>slide_close.png</file>
|
||||||
<file>slide_first.png</file>
|
<file>slide_first.png</file>
|
||||||
@ -58,46 +66,21 @@
|
|||||||
<file>export_load.png</file>
|
<file>export_load.png</file>
|
||||||
<file>export_move_to_list.png</file>
|
<file>export_move_to_list.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="custom" >
|
|
||||||
<file>custom_new.png</file>
|
|
||||||
<file>custom_edit.png</file>
|
|
||||||
<file>custom_delete.png</file>
|
|
||||||
</qresource>
|
|
||||||
<qresource prefix="wizards" >
|
<qresource prefix="wizards" >
|
||||||
<file>wizard_importbible.bmp</file>
|
<file>wizard_importbible.bmp</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="presentations" >
|
|
||||||
<file>presentation_delete.png</file>
|
|
||||||
<file>presentation_load.png</file>
|
|
||||||
</qresource>
|
|
||||||
<qresource prefix="videos" >
|
|
||||||
<file>video_delete.png</file>
|
|
||||||
<file>video_load.png</file>
|
|
||||||
</qresource>
|
|
||||||
<qresource prefix="images" >
|
|
||||||
<file>image_delete.png</file>
|
|
||||||
<file>image_load.png</file>
|
|
||||||
</qresource>
|
|
||||||
<qresource prefix="services" >
|
<qresource prefix="services" >
|
||||||
<file>service_edit.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>
|
||||||
<file>service_down.png</file>
|
<file>service_down.png</file>
|
||||||
<file>service_top.png</file>
|
<file>service_top.png</file>
|
||||||
<file>service_up.png</file>
|
<file>service_up.png</file>
|
||||||
<file>service_delete.png</file>
|
|
||||||
<file>service_new.png</file>
|
|
||||||
<file>service_open.png</file>
|
|
||||||
<file>service_save.png</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="system" >
|
<qresource prefix="system" >
|
||||||
<file>system_close.png</file>
|
<file>system_close.png</file>
|
||||||
<file>system_about.png</file>
|
<file>system_about.png</file>
|
||||||
<file>system_help_contents.png</file>
|
<file>system_help_contents.png</file>
|
||||||
<file>system_add.png</file>
|
|
||||||
<file>system_live.png</file>
|
|
||||||
<file>system_preview.png</file>
|
|
||||||
<file>system_mediamanager.png</file>
|
<file>system_mediamanager.png</file>
|
||||||
<file>system_contribute.png</file>
|
<file>system_contribute.png</file>
|
||||||
<file>system_servicemanager.png</file>
|
<file>system_servicemanager.png</file>
|
||||||
@ -129,7 +112,5 @@
|
|||||||
<file>theme_delete.png</file>
|
<file>theme_delete.png</file>
|
||||||
<file>theme_new.png</file>
|
<file>theme_new.png</file>
|
||||||
<file>theme_edit.png</file>
|
<file>theme_edit.png</file>
|
||||||
<file>theme_export.png</file>
|
|
||||||
<file>theme_import.png</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 688 B After Width: | Height: | Size: 720 B |
Binary file not shown.
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 815 B |
@ -206,7 +206,6 @@ def import_bible():
|
|||||||
rows = old_cursor.fetchall()
|
rows = old_cursor.fetchall()
|
||||||
if debug or verbose:
|
if debug or verbose:
|
||||||
print 'done.'
|
print 'done.'
|
||||||
song_map = {}
|
|
||||||
for row in rows:
|
for row in rows:
|
||||||
book_id = int(row[1])
|
book_id = int(row[1])
|
||||||
chapter = int(row[2])
|
chapter = int(row[2])
|
||||||
|
Loading…
Reference in New Issue
Block a user