forked from openlp/openlp
Head
This commit is contained in:
commit
94a062204b
@ -81,7 +81,8 @@ class ServiceItem(object):
|
|||||||
self.notes = u''
|
self.notes = u''
|
||||||
self.from_plugin = False
|
self.from_plugin = False
|
||||||
self.capabilities = []
|
self.capabilities = []
|
||||||
self.isValid = True
|
self.is_valid = True
|
||||||
|
self.cache = []
|
||||||
|
|
||||||
def add_capability(self, capability):
|
def add_capability(self, capability):
|
||||||
self.capabilities.append(capability)
|
self.capabilities.append(capability)
|
||||||
@ -107,6 +108,7 @@ class ServiceItem(object):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'Render called')
|
log.debug(u'Render called')
|
||||||
self._display_frames = []
|
self._display_frames = []
|
||||||
|
self.cache = []
|
||||||
if self.service_item_type == ServiceItemType.Text:
|
if self.service_item_type == ServiceItemType.Text:
|
||||||
log.debug(u'Formatting slides')
|
log.debug(u'Formatting slides')
|
||||||
if self.theme is None:
|
if self.theme is None:
|
||||||
@ -125,6 +127,7 @@ class ServiceItem(object):
|
|||||||
lines += line + u'\n'
|
lines += line + u'\n'
|
||||||
self._display_frames.append({u'title': title, \
|
self._display_frames.append({u'title': title, \
|
||||||
u'text': lines.rstrip(), u'verseTag': slide[u'verseTag'] })
|
u'text': lines.rstrip(), u'verseTag': slide[u'verseTag'] })
|
||||||
|
self.cache.insert(len(self._display_frames), None)
|
||||||
log.log(15, u'Formatting took %4s' % (time.time() - before))
|
log.log(15, u'Formatting took %4s' % (time.time() - before))
|
||||||
elif self.service_item_type == ServiceItemType.Image:
|
elif self.service_item_type == ServiceItemType.Image:
|
||||||
for slide in self._raw_frames:
|
for slide in self._raw_frames:
|
||||||
@ -149,11 +152,15 @@ class ServiceItem(object):
|
|||||||
self.RenderManager.set_override_theme(self.theme)
|
self.RenderManager.set_override_theme(self.theme)
|
||||||
format = self._display_frames[row][u'text'].split(u'\n')
|
format = self._display_frames[row][u'text'].split(u'\n')
|
||||||
#if screen blank then do not display footer
|
#if screen blank then do not display footer
|
||||||
if format[0]:
|
if self.cache[row] is not None:
|
||||||
frame = self.RenderManager.generate_slide(format,
|
frame = self.cache[row]
|
||||||
self.raw_footer)
|
|
||||||
else:
|
else:
|
||||||
frame = self.RenderManager.generate_slide(format,u'')
|
if format[0]:
|
||||||
|
frame = self.RenderManager.generate_slide(format,
|
||||||
|
self.raw_footer)
|
||||||
|
else:
|
||||||
|
frame = self.RenderManager.generate_slide(format,u'')
|
||||||
|
self.cache[row] = frame
|
||||||
return frame
|
return frame
|
||||||
|
|
||||||
def add_from_image(self, path, title, image):
|
def add_from_image(self, path, title, image):
|
||||||
@ -336,4 +343,3 @@ class ServiceItem(object):
|
|||||||
Returns the title of the raw frame
|
Returns the title of the raw frame
|
||||||
"""
|
"""
|
||||||
return self._raw_frames[row][u'path']
|
return self._raw_frames[row][u'path']
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class SettingsManager(object):
|
|||||||
self.slidecontroller_image = self.slidecontroller - 50
|
self.slidecontroller_image = self.slidecontroller - 50
|
||||||
|
|
||||||
self.showPreviewPanel = QtCore.QSettings().value(
|
self.showPreviewPanel = QtCore.QSettings().value(
|
||||||
u'user interface/preview panel', True).toBool()
|
u'user interface/preview panel', QtCore.QVariant(True)).toBool()
|
||||||
|
|
||||||
def togglePreviewPanel(self, isVisible):
|
def togglePreviewPanel(self, isVisible):
|
||||||
QtCore.QSettings().setValue(u'user interface/preview panel',
|
QtCore.QSettings().setValue(u'user interface/preview panel',
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from aboutdialog import Ui_AboutDialog
|
from aboutdialog import Ui_AboutDialog
|
||||||
from openlp.core.lib import translate
|
|
||||||
|
|
||||||
class AboutForm(QtGui.QDialog, Ui_AboutDialog):
|
class AboutForm(QtGui.QDialog, Ui_AboutDialog):
|
||||||
"""
|
"""
|
||||||
|
@ -118,7 +118,11 @@ class MainDisplay(DisplayWidget):
|
|||||||
DisplayWidget.__init__(self, parent)
|
DisplayWidget.__init__(self, parent)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.setWindowTitle(u'OpenLP Display')
|
self.setWindowTitle(u'OpenLP Display')
|
||||||
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
|
# WA_TranslucentBackground is not available in QT4.4
|
||||||
|
try:
|
||||||
|
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
self.screens = screens
|
self.screens = screens
|
||||||
self.display_image = QtGui.QLabel(self)
|
self.display_image = QtGui.QLabel(self)
|
||||||
self.display_image.setScaledContents(True)
|
self.display_image.setScaledContents(True)
|
||||||
@ -340,8 +344,14 @@ class VideoDisplay(Phonon.VideoWidget):
|
|||||||
self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)
|
self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)
|
||||||
Phonon.createPath(self.mediaObject, self)
|
Phonon.createPath(self.mediaObject, self)
|
||||||
Phonon.createPath(self.mediaObject, self.audioObject)
|
Phonon.createPath(self.mediaObject, self.audioObject)
|
||||||
self.setWindowFlags(QtCore.Qt.WindowStaysOnBottomHint |
|
flags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Dialog
|
||||||
QtCore.Qt.FramelessWindowHint | QtCore.Qt.Dialog)
|
# WindowsStaysOnBottomHint is not available in QT4.4
|
||||||
|
try:
|
||||||
|
flags = flags | QtCore.Qt.WindowStaysOnBottomHint
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
self.setWindowFlags(flags)
|
||||||
|
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'maindisplay_hide'), self.mediaHide)
|
QtCore.SIGNAL(u'maindisplay_hide'), self.mediaHide)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
@ -260,15 +260,14 @@ class Ui_MainWindow(object):
|
|||||||
qmList = LanguageManager.get_qm_list()
|
qmList = LanguageManager.get_qm_list()
|
||||||
savedLanguage = LanguageManager.get_language()
|
savedLanguage = LanguageManager.get_language()
|
||||||
self.AutoLanguageItem.setChecked(LanguageManager.AutoLanguage)
|
self.AutoLanguageItem.setChecked(LanguageManager.AutoLanguage)
|
||||||
self.LanguageItem = {}
|
for key in sorted(qmList.keys()):
|
||||||
for key in qmList.keys():
|
languageItem = QtGui.QAction(MainWindow)
|
||||||
self.LanguageItem[key] = QtGui.QAction(MainWindow)
|
languageItem.setObjectName(key)
|
||||||
self.LanguageItem[key].setObjectName(key)
|
languageItem.setCheckable(True)
|
||||||
self.LanguageItem[key].setCheckable(True)
|
|
||||||
self.LanguageItem[key].setDisabled(LanguageManager.AutoLanguage)
|
|
||||||
if qmList[key] == savedLanguage:
|
if qmList[key] == savedLanguage:
|
||||||
self.LanguageItem[key].setChecked(True)
|
languageItem.setChecked(True)
|
||||||
add_actions(self.LanguageGroup, [self.LanguageItem[key]])
|
add_actions(self.LanguageGroup, [languageItem])
|
||||||
|
self.LanguageGroup.setDisabled(LanguageManager.AutoLanguage)
|
||||||
self.ToolsAddToolItem = QtGui.QAction(MainWindow)
|
self.ToolsAddToolItem = QtGui.QAction(MainWindow)
|
||||||
AddToolIcon = build_icon(u':/tools/tools_add.png')
|
AddToolIcon = build_icon(u':/tools/tools_add.png')
|
||||||
self.ToolsAddToolItem.setIcon(AddToolIcon)
|
self.ToolsAddToolItem.setIcon(AddToolIcon)
|
||||||
@ -296,8 +295,7 @@ class Ui_MainWindow(object):
|
|||||||
self.ViewThemeManagerItem, None, self.action_Preview_Panel))
|
self.ViewThemeManagerItem, None, self.action_Preview_Panel))
|
||||||
#i18n add Language Actions
|
#i18n add Language Actions
|
||||||
add_actions(self.OptionsLanguageMenu, (self.AutoLanguageItem, None))
|
add_actions(self.OptionsLanguageMenu, (self.AutoLanguageItem, None))
|
||||||
for item in sorted(self.LanguageItem):
|
add_actions(self.OptionsLanguageMenu, self.LanguageGroup.actions())
|
||||||
add_actions(self.OptionsLanguageMenu, [self.LanguageItem[item]])
|
|
||||||
add_actions(self.OptionsMenu, (self.OptionsLanguageMenu.menuAction(),
|
add_actions(self.OptionsMenu, (self.OptionsLanguageMenu.menuAction(),
|
||||||
self.OptionsViewMenu.menuAction(), None, self.OptionsSettingsItem))
|
self.OptionsViewMenu.menuAction(), None, self.OptionsSettingsItem))
|
||||||
add_actions(self.ToolsMenu,
|
add_actions(self.ToolsMenu,
|
||||||
@ -417,10 +415,10 @@ class Ui_MainWindow(object):
|
|||||||
self.AutoLanguageItem.setText(translate('MainWindow', '&Auto Detect'))
|
self.AutoLanguageItem.setText(translate('MainWindow', '&Auto Detect'))
|
||||||
self.AutoLanguageItem.setStatusTip(
|
self.AutoLanguageItem.setStatusTip(
|
||||||
translate('MainWindow', 'Choose System language, if available'))
|
translate('MainWindow', 'Choose System language, if available'))
|
||||||
for item in self.LanguageItem:
|
for item in self.LanguageGroup.actions():
|
||||||
self.LanguageItem[item].setText(self.LanguageItem[item].objectName())
|
item.setText(item.objectName())
|
||||||
self.LanguageItem[item].setStatusTip(
|
item.setStatusTip(
|
||||||
translate('MainWindow', 'Set the interface language to %1').arg(self.LanguageItem[item].objectName()))
|
translate('MainWindow', 'Set the interface language to %1').arg(item.objectName()))
|
||||||
self.ToolsAddToolItem.setText(translate('MainWindow', 'Add &Tool...'))
|
self.ToolsAddToolItem.setText(translate('MainWindow', 'Add &Tool...'))
|
||||||
self.ToolsAddToolItem.setStatusTip(
|
self.ToolsAddToolItem.setStatusTip(
|
||||||
translate('MainWindow', 'Add an application to the list of tools'))
|
translate('MainWindow', 'Add an application to the list of tools'))
|
||||||
@ -575,8 +573,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
#i18n
|
#i18n
|
||||||
def setAutoLanguage(self, value):
|
def setAutoLanguage(self, value):
|
||||||
for action in self.LanguageGroup.actions():
|
self.LanguageGroup.setDisabled(value)
|
||||||
action.setDisabled(value)
|
|
||||||
LanguageManager.AutoLanguage = value
|
LanguageManager.AutoLanguage = value
|
||||||
LanguageManager.set_language(self.LanguageGroup.checkedAction())
|
LanguageManager.set_language(self.LanguageGroup.checkedAction())
|
||||||
|
|
||||||
|
@ -61,9 +61,10 @@ class ScreenList(object):
|
|||||||
"""
|
"""
|
||||||
Set up the current screen dimensions
|
Set up the current screen dimensions
|
||||||
"""
|
"""
|
||||||
log.debug(u'set_override_display %s', number, )
|
log.debug(u'set_current_display %s', number, )
|
||||||
if number + 1 > self.display_count:
|
if number + 1 > self.display_count:
|
||||||
self.current = self.screen_list[0]
|
self.current = self.screen_list[0]
|
||||||
|
self.override = copy.deepcopy(self.current)
|
||||||
self.current_display = 0
|
self.current_display = 0
|
||||||
else:
|
else:
|
||||||
self.current = self.screen_list[number]
|
self.current = self.screen_list[number]
|
||||||
|
@ -499,7 +499,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
for itemcount, item in enumerate(self.serviceItems):
|
for itemcount, item in enumerate(self.serviceItems):
|
||||||
serviceitem = item[u'service_item']
|
serviceitem = item[u'service_item']
|
||||||
treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList)
|
treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList)
|
||||||
if serviceitem.isValid:
|
if serviceitem.is_valid:
|
||||||
if serviceitem.notes:
|
if serviceitem.notes:
|
||||||
icon = QtGui.QImage(serviceitem.icon)
|
icon = QtGui.QImage(serviceitem.icon)
|
||||||
icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio,
|
icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio,
|
||||||
@ -685,7 +685,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
if serviceItem.is_command():
|
if serviceItem.is_command():
|
||||||
type = serviceItem._raw_frames[0][u'title'].split(u'.')[1]
|
type = serviceItem._raw_frames[0][u'title'].split(u'.')[1]
|
||||||
if type not in self.suffixes:
|
if type not in self.suffixes:
|
||||||
serviceItem.isValid = False
|
serviceItem.is_valid = False
|
||||||
|
|
||||||
def cleanUp(self):
|
def cleanUp(self):
|
||||||
"""
|
"""
|
||||||
@ -769,7 +769,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Send the current item to the Preview slide controller
|
Send the current item to the Preview slide controller
|
||||||
"""
|
"""
|
||||||
item, count = self.findServiceItem()
|
item, count = self.findServiceItem()
|
||||||
if self.serviceItems[item][u'service_item'].isValid:
|
if self.serviceItems[item][u'service_item'].is_valid:
|
||||||
self.parent.PreviewController.addServiceManagerItem(
|
self.parent.PreviewController.addServiceManagerItem(
|
||||||
self.serviceItems[item][u'service_item'], count)
|
self.serviceItems[item][u'service_item'], count)
|
||||||
else:
|
else:
|
||||||
@ -796,7 +796,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Send the current item to the Live slide controller
|
Send the current item to the Live slide controller
|
||||||
"""
|
"""
|
||||||
item, count = self.findServiceItem()
|
item, count = self.findServiceItem()
|
||||||
if self.serviceItems[item][u'service_item'].isValid:
|
if self.serviceItems[item][u'service_item'].is_valid:
|
||||||
self.parent.LiveController.addServiceManagerItem(
|
self.parent.LiveController.addServiceManagerItem(
|
||||||
self.serviceItems[item][u'service_item'], count)
|
self.serviceItems[item][u'service_item'], count)
|
||||||
if QtCore.QSettings().value(
|
if QtCore.QSettings().value(
|
||||||
@ -963,4 +963,4 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
data_item[u'notes'] = unicode(service_item.notes)
|
data_item[u'notes'] = unicode(service_item.notes)
|
||||||
data_item[u'selected'] = (item == curitem)
|
data_item[u'selected'] = (item == curitem)
|
||||||
data.append(data_item)
|
data.append(data_item)
|
||||||
Receiver.send_message(u'servicemanager_list_response', data)
|
Receiver.send_message(u'servicemanager_list_response', data)
|
@ -36,6 +36,24 @@ ItemCapabilities
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class SlideThread(QtCore.QThread):
|
||||||
|
"""
|
||||||
|
A special Qt thread class to speed up the display of text based frames.
|
||||||
|
This is threaded so it loads the frames in background
|
||||||
|
"""
|
||||||
|
def __init__(self, parent, prefix, count):
|
||||||
|
QtCore.QThread.__init__(self, parent)
|
||||||
|
self.prefix = prefix
|
||||||
|
self.count = count
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
"""
|
||||||
|
Run the thread.
|
||||||
|
"""
|
||||||
|
time.sleep(1)
|
||||||
|
for i in range(0, self.count):
|
||||||
|
Receiver.send_message(u'%s_slide_cache' % self.prefix, i)
|
||||||
|
|
||||||
class SlideList(QtGui.QTableWidget):
|
class SlideList(QtGui.QTableWidget):
|
||||||
"""
|
"""
|
||||||
Customised version of QTableWidget which can respond to keyboard
|
Customised version of QTableWidget which can respond to keyboard
|
||||||
@ -44,7 +62,7 @@ class SlideList(QtGui.QTableWidget):
|
|||||||
def __init__(self, parent=None, name=None):
|
def __init__(self, parent=None, name=None):
|
||||||
QtGui.QTableWidget.__init__(self, parent.Controller)
|
QtGui.QTableWidget.__init__(self, parent.Controller)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.hotkey_map = {
|
self.hotkeyMap = {
|
||||||
QtCore.Qt.Key_Return: 'servicemanager_next_item',
|
QtCore.Qt.Key_Return: 'servicemanager_next_item',
|
||||||
QtCore.Qt.Key_Space: 'slidecontroller_live_next_noloop',
|
QtCore.Qt.Key_Space: 'slidecontroller_live_next_noloop',
|
||||||
QtCore.Qt.Key_Enter: 'slidecontroller_live_next_noloop',
|
QtCore.Qt.Key_Enter: 'slidecontroller_live_next_noloop',
|
||||||
@ -66,8 +84,8 @@ class SlideList(QtGui.QTableWidget):
|
|||||||
elif event.key() == QtCore.Qt.Key_PageDown:
|
elif event.key() == QtCore.Qt.Key_PageDown:
|
||||||
self.parent.onSlideSelectedLast()
|
self.parent.onSlideSelectedLast()
|
||||||
event.accept()
|
event.accept()
|
||||||
elif event.key() in self.hotkey_map and self.parent.isLive:
|
elif event.key() in self.hotkeyMap and self.parent.isLive:
|
||||||
Receiver.send_message(self.hotkey_map[event.key()])
|
Receiver.send_message(self.hotkeyMap[event.key()])
|
||||||
event.accept()
|
event.accept()
|
||||||
event.ignore()
|
event.ignore()
|
||||||
else:
|
else:
|
||||||
@ -87,13 +105,13 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.isLive = isLive
|
self.isLive = isLive
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.mainDisplay = self.parent.displayManager.mainDisplay
|
self.mainDisplay = self.parent.displayManager.mainDisplay
|
||||||
self.loop_list = [
|
self.loopList = [
|
||||||
u'Start Loop',
|
u'Start Loop',
|
||||||
u'Stop Loop',
|
u'Stop Loop',
|
||||||
u'Loop Separator',
|
u'Loop Separator',
|
||||||
u'Image SpinBox'
|
u'Image SpinBox'
|
||||||
]
|
]
|
||||||
self.song_edit_list = [
|
self.songEditList = [
|
||||||
u'Edit Song',
|
u'Edit Song',
|
||||||
]
|
]
|
||||||
if isLive:
|
if isLive:
|
||||||
@ -115,11 +133,11 @@ class SlideController(QtGui.QWidget):
|
|||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.TypeLabel.setText(self.trUtf8('Live'))
|
self.TypeLabel.setText(self.trUtf8('Live'))
|
||||||
self.split = 1
|
self.split = 1
|
||||||
self.type_prefix = u'live'
|
self.typePrefix = u'live'
|
||||||
else:
|
else:
|
||||||
self.TypeLabel.setText(self.trUtf8('Preview'))
|
self.TypeLabel.setText(self.trUtf8('Preview'))
|
||||||
self.split = 0
|
self.split = 0
|
||||||
self.type_prefix = u'preview'
|
self.typePrefix = u'preview'
|
||||||
self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
|
self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
|
||||||
self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter)
|
self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
self.PanelLayout.addWidget(self.TypeLabel)
|
self.PanelLayout.addWidget(self.TypeLabel)
|
||||||
@ -309,51 +327,53 @@ class SlideController(QtGui.QWidget):
|
|||||||
QtCore.SIGNAL(u'slidecontroller_live_spin_delay'),
|
QtCore.SIGNAL(u'slidecontroller_live_spin_delay'),
|
||||||
self.receiveSpinDelay)
|
self.receiveSpinDelay)
|
||||||
if isLive:
|
if isLive:
|
||||||
self.Toolbar.makeWidgetsInvisible(self.loop_list)
|
self.Toolbar.makeWidgetsInvisible(self.loopList)
|
||||||
else:
|
else:
|
||||||
self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
|
self.Toolbar.makeWidgetsInvisible(self.songEditList)
|
||||||
self.Mediabar.setVisible(False)
|
self.Mediabar.setVisible(False)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_stop_loop' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_stop_loop' % self.typePrefix),
|
||||||
self.onStopLoop)
|
self.onStopLoop)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_first' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_first' % self.typePrefix),
|
||||||
self.onSlideSelectedFirst)
|
self.onSlideSelectedFirst)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_next' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_next' % self.typePrefix),
|
||||||
self.onSlideSelectedNext)
|
self.onSlideSelectedNext)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_previous' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_previous' % self.typePrefix),
|
||||||
self.onSlideSelectedPrevious)
|
self.onSlideSelectedPrevious)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_next_noloop' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_next_noloop' % self.typePrefix),
|
||||||
self.onSlideSelectedNextNoloop)
|
self.onSlideSelectedNextNoloop)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_previous_noloop' %
|
QtCore.SIGNAL(u'slidecontroller_%s_previous_noloop' %
|
||||||
self.type_prefix),
|
self.typePrefix),
|
||||||
self.onSlideSelectedPreviousNoloop)
|
self.onSlideSelectedPreviousNoloop)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_last' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_last' % self.typePrefix),
|
||||||
self.onSlideSelectedLast)
|
self.onSlideSelectedLast)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_change' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_change' % self.typePrefix),
|
||||||
self.onSlideChange)
|
self.onSlideChange)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_set' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_set' % self.typePrefix),
|
||||||
self.onSlideSelectedIndex)
|
self.onSlideSelectedIndex)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_blank' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_blank' % self.typePrefix),
|
||||||
self.onSlideBlank)
|
self.onSlideBlank)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_unblank' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_unblank' % self.typePrefix),
|
||||||
self.onSlideUnblank)
|
self.onSlideUnblank)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_text_request' % self.type_prefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_text_request' % self.typePrefix),
|
||||||
self.onTextRequest)
|
self.onTextRequest)
|
||||||
QtCore.QObject.connect(self.Splitter,
|
QtCore.QObject.connect(self.Splitter,
|
||||||
QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter)
|
QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'config_updated'), self.refreshServiceItem)
|
QtCore.SIGNAL(u'config_updated'), self.refreshServiceItem)
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'%s_slide_cache' % self.typePrefix), self.slideCache)
|
||||||
|
|
||||||
def widthChanged(self):
|
def widthChanged(self):
|
||||||
"""
|
"""
|
||||||
@ -404,16 +424,16 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.Toolbar.setVisible(True)
|
self.Toolbar.setVisible(True)
|
||||||
self.Mediabar.setVisible(False)
|
self.Mediabar.setVisible(False)
|
||||||
self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
|
self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
|
||||||
self.Toolbar.makeWidgetsInvisible(self.loop_list)
|
self.Toolbar.makeWidgetsInvisible(self.loopList)
|
||||||
if item.is_text():
|
if item.is_text():
|
||||||
self.Toolbar.makeWidgetsInvisible(self.loop_list)
|
self.Toolbar.makeWidgetsInvisible(self.loopList)
|
||||||
if QtCore.QSettings().value(
|
if QtCore.QSettings().value(
|
||||||
self.parent.songsSettingsSection + u'/show songbar',
|
self.parent.songsSettingsSection + u'/show songbar',
|
||||||
QtCore.QVariant(True)).toBool() and len(self.slideList) > 0:
|
QtCore.QVariant(True)).toBool() and len(self.slideList) > 0:
|
||||||
self.Toolbar.makeWidgetsVisible([u'Song Menu'])
|
self.Toolbar.makeWidgetsVisible([u'Song Menu'])
|
||||||
if item.is_capable(ItemCapabilities.AllowsLoop) and \
|
if item.is_capable(ItemCapabilities.AllowsLoop) and \
|
||||||
len(item.get_frames()) > 1:
|
len(item.get_frames()) > 1:
|
||||||
self.Toolbar.makeWidgetsVisible(self.loop_list)
|
self.Toolbar.makeWidgetsVisible(self.loopList)
|
||||||
if item.is_media():
|
if item.is_media():
|
||||||
self.Toolbar.setVisible(False)
|
self.Toolbar.setVisible(False)
|
||||||
self.Mediabar.setVisible(True)
|
self.Mediabar.setVisible(True)
|
||||||
@ -425,9 +445,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
self.Toolbar.setVisible(True)
|
self.Toolbar.setVisible(True)
|
||||||
self.Mediabar.setVisible(False)
|
self.Mediabar.setVisible(False)
|
||||||
self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
|
self.Toolbar.makeWidgetsInvisible(self.songEditList)
|
||||||
if item.is_capable(ItemCapabilities.AllowsEdit) and item.from_plugin:
|
if item.is_capable(ItemCapabilities.AllowsEdit) and item.from_plugin:
|
||||||
self.Toolbar.makeWidgetsVisible(self.song_edit_list)
|
self.Toolbar.makeWidgetsVisible(self.songEditList)
|
||||||
elif item.is_media():
|
elif item.is_media():
|
||||||
self.Toolbar.setVisible(False)
|
self.Toolbar.setVisible(False)
|
||||||
self.Mediabar.setVisible(True)
|
self.Mediabar.setVisible(True)
|
||||||
@ -569,8 +589,12 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.enableToolBar(serviceItem)
|
self.enableToolBar(serviceItem)
|
||||||
self.onSlideSelected()
|
self.onSlideSelected()
|
||||||
self.PreviewListWidget.setFocus()
|
self.PreviewListWidget.setFocus()
|
||||||
Receiver.send_message(u'slidecontroller_%s_started' % self.type_prefix,
|
Receiver.send_message(u'slidecontroller_%s_started' % self.typePrefix,
|
||||||
[serviceItem])
|
[serviceItem])
|
||||||
|
if self.serviceItem.is_text():
|
||||||
|
st = SlideThread(
|
||||||
|
self, self.typePrefix, len(self.serviceItem.get_frames()))
|
||||||
|
st.start()
|
||||||
log.log(15, u'Display Rendering took %4s' % (time.time() - before))
|
log.log(15, u'Display Rendering took %4s' % (time.time() - before))
|
||||||
|
|
||||||
def onTextRequest(self):
|
def onTextRequest(self):
|
||||||
@ -591,7 +615,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
(self.PreviewListWidget.currentRow() == framenumber)
|
(self.PreviewListWidget.currentRow() == framenumber)
|
||||||
data.append(data_item)
|
data.append(data_item)
|
||||||
Receiver.send_message(u'slidecontroller_%s_text_response'
|
Receiver.send_message(u'slidecontroller_%s_text_response'
|
||||||
% self.type_prefix, data)
|
% self.typePrefix, data)
|
||||||
|
|
||||||
#Screen event methods
|
#Screen event methods
|
||||||
def onSlideSelectedFirst(self):
|
def onSlideSelectedFirst(self):
|
||||||
@ -708,6 +732,13 @@ class SlideController(QtGui.QWidget):
|
|||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
|
|
||||||
|
def slideCache(self, slide):
|
||||||
|
"""
|
||||||
|
Generate a slide cache item rendered and ready for use
|
||||||
|
in the background.
|
||||||
|
"""
|
||||||
|
self.serviceItem.get_rendered_frame(int(slide))
|
||||||
|
|
||||||
def onSlideSelected(self):
|
def onSlideSelected(self):
|
||||||
"""
|
"""
|
||||||
Generate the preview when you click on a slide.
|
Generate the preview when you click on a slide.
|
||||||
@ -737,7 +768,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.mainDisplay.frameView(frame, True)
|
self.mainDisplay.frameView(frame, True)
|
||||||
self.selectedRow = row
|
self.selectedRow = row
|
||||||
Receiver.send_message(u'slidecontroller_%s_changed' % self.type_prefix,
|
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
||||||
row)
|
row)
|
||||||
|
|
||||||
def onSlideChange(self, row):
|
def onSlideChange(self, row):
|
||||||
@ -746,7 +777,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
self.PreviewListWidget.selectRow(row)
|
self.PreviewListWidget.selectRow(row)
|
||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
Receiver.send_message(u'slidecontroller_%s_changed' % self.type_prefix,
|
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
||||||
row)
|
row)
|
||||||
|
|
||||||
def updatePreview(self):
|
def updatePreview(self):
|
||||||
|
@ -24,10 +24,9 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from logging import FileHandler
|
|
||||||
from PyQt4 import QtCore, QtGui
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from PyQt4 import QtCore, QtGui
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import translate
|
||||||
|
|
||||||
@ -68,7 +67,8 @@ class LanguageManager(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_language():
|
def get_language():
|
||||||
language = unicode(QtCore.QSettings().value(
|
settings = QtCore.QSettings(u'OpenLP', u'OpenLP')
|
||||||
|
language = unicode(settings.value(
|
||||||
u'general/language', QtCore.QVariant(u'[en]')).toString())
|
u'general/language', QtCore.QVariant(u'[en]')).toString())
|
||||||
log.info(u'Language file: \'%s\' Loaded from conf file' % language)
|
log.info(u'Language file: \'%s\' Loaded from conf file' % language)
|
||||||
regEx = QtCore.QRegExp("^\[(.*)\]")
|
regEx = QtCore.QRegExp("^\[(.*)\]")
|
||||||
|
@ -337,13 +337,14 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
# load bibles into the combo boxes
|
# load bibles into the combo boxes
|
||||||
first = True
|
first = True
|
||||||
for bible in bibles:
|
for bible in bibles:
|
||||||
self.QuickVersionComboBox.addItem(bible)
|
if bible:
|
||||||
self.QuickSecondBibleComboBox.addItem(bible)
|
self.QuickVersionComboBox.addItem(bible)
|
||||||
self.AdvancedVersionComboBox.addItem(bible)
|
self.QuickSecondBibleComboBox.addItem(bible)
|
||||||
self.AdvancedSecondBibleComboBox.addItem(bible)
|
self.AdvancedVersionComboBox.addItem(bible)
|
||||||
if first:
|
self.AdvancedSecondBibleComboBox.addItem(bible)
|
||||||
first = False
|
if first:
|
||||||
self.initialiseBible(bible)
|
first = False
|
||||||
|
self.initialiseBible(bible)
|
||||||
|
|
||||||
def onListViewResize(self, width, height):
|
def onListViewResize(self, width, height):
|
||||||
self.SearchProgress.setGeometry(self.ListView.geometry().x(),
|
self.SearchProgress.setGeometry(self.ListView.geometry().x(),
|
||||||
@ -518,7 +519,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
else:
|
else:
|
||||||
service_item.theme = self.parent.settings_tab.bible_theme
|
service_item.theme = self.parent.settings_tab.bible_theme
|
||||||
#if we are verse per slide we have already been added
|
#if we are verse per slide we have already been added
|
||||||
if self.parent.settings_tab.layout_style != 0:
|
if self.parent.settings_tab.layout_style != 0 and not bible2:
|
||||||
raw_slides.append(bible_text)
|
raw_slides.append(bible_text)
|
||||||
for slide in raw_slides:
|
for slide in raw_slides:
|
||||||
service_item.add_from_text(slide[:30], slide)
|
service_item.add_from_text(slide[:30], slide)
|
||||||
|
@ -105,7 +105,7 @@ class PresentationController(object):
|
|||||||
if self.available:
|
if self.available:
|
||||||
self.enabled = QtCore.QSettings().value(
|
self.enabled = QtCore.QSettings().value(
|
||||||
self.settingsSection + u'/' + name,
|
self.settingsSection + u'/' + name,
|
||||||
QtCore.Qt.Unchecked).toInt()[0] == QtCore.Qt.Checked
|
QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0] == QtCore.Qt.Checked
|
||||||
else:
|
else:
|
||||||
self.enabled = False
|
self.enabled = False
|
||||||
self.thumbnailroot = os.path.join(
|
self.thumbnailroot = os.path.join(
|
||||||
|
@ -50,7 +50,7 @@ class SongManager():
|
|||||||
settings.beginGroup(u'songs')
|
settings.beginGroup(u'songs')
|
||||||
self.db_url = u''
|
self.db_url = u''
|
||||||
db_type = unicode(
|
db_type = unicode(
|
||||||
settings.value(u'songs/db type', u'sqlite').toString())
|
settings.value(u'songs/db type', QtCore.QVariant(u'sqlite')).toString())
|
||||||
if db_type == u'sqlite':
|
if db_type == u'sqlite':
|
||||||
self.db_url = u'sqlite:///%s/songs.sqlite' % \
|
self.db_url = u'sqlite:///%s/songs.sqlite' % \
|
||||||
AppLocation.get_section_data_path(u'songs')
|
AppLocation.get_section_data_path(u'songs')
|
||||||
|
Binary file not shown.
Binary file not shown.
BIN
resources/i18n/openlp_en.qm
Normal file
BIN
resources/i18n/openlp_en.qm
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -38,7 +38,8 @@ from PyQt4 import QtCore
|
|||||||
ignore_pathes = [u"./scripts", u"./openlp/core/test"]
|
ignore_pathes = [u"./scripts", u"./openlp/core/test"]
|
||||||
ignore_files = [u"setup.py"]
|
ignore_files = [u"setup.py"]
|
||||||
translation_path = u"http://pootle.projecthq.biz/export/openlp/"
|
translation_path = u"http://pootle.projecthq.biz/export/openlp/"
|
||||||
translations = [ u"af"
|
translations = [ u"en"
|
||||||
|
, u"af"
|
||||||
, u"en_ZA"
|
, u"en_ZA"
|
||||||
, u"en_GB"
|
, u"en_GB"
|
||||||
, u"de"
|
, u"de"
|
||||||
|
Loading…
Reference in New Issue
Block a user