openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #01069
[Merge] lp:~trb143/openlp/futures into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/futures into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Add precessing to Thread to stop startup locking for version check
Add code to allow auto preview of next song etc. Media and Presentations excluded.
--
https://code.launchpad.net/~trb143/openlp/futures/+merge/20210
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2010-01-10 11:49:04 +0000
+++ openlp/core/lib/serviceitem.py 2010-02-26 12:21:16 +0000
@@ -72,6 +72,7 @@
self._raw_frames = []
self._display_frames = []
self._uuid = unicode(uuid.uuid1())
+ self.autoPreviewAllowed = False
def addIcon(self, icon):
"""
@@ -200,7 +201,8 @@
u'icon':self.icon,
u'footer':self.raw_footer,
u'type':self.service_item_type,
- u'audit':self.audit
+ u'audit':self.audit,
+ u'preview':self.autoPreviewAllowed
}
service_data = []
if self.service_item_type == ServiceItemType.Text:
@@ -234,6 +236,7 @@
self.addIcon(header[u'icon'])
self.raw_footer = header[u'footer']
self.audit = header[u'audit']
+ self.autoPreviewAllowed = header[u'preview']
if self.service_item_type == ServiceItemType.Text:
for slide in serviceitem[u'serviceitem'][u'data']:
self._raw_frames.append(slide)
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2010-01-16 07:22:50 +0000
+++ openlp/core/ui/generaltab.py 2010-02-26 12:21:16 +0000
@@ -87,6 +87,10 @@
self.SaveCheckServiceCheckBox.setObjectName(u'SaveCheckServiceCheckBox')
self.SettingsLayout.addWidget(self.SaveCheckServiceCheckBox)
self.GeneralLeftLayout.addWidget(self.SettingsGroupBox)
+ self.AutoPreviewCheckBox = QtGui.QCheckBox(self.SettingsGroupBox)
+ self.AutoPreviewCheckBox.setObjectName(u'AutoPreviewCheckBox')
+ self.SettingsLayout.addWidget(self.AutoPreviewCheckBox)
+ self.GeneralLeftLayout.addWidget(self.SettingsGroupBox)
self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40,
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer)
@@ -137,6 +141,8 @@
QtCore.SIGNAL(u'stateChanged(int)'), self.onShowSplashCheckBoxChanged)
QtCore.QObject.connect(self.SaveCheckServiceCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), self.onSaveCheckServiceCheckBox)
+ QtCore.QObject.connect(self.AutoPreviewCheckBox,
+ QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoPreviewCheckBox)
QtCore.QObject.connect(self.NumberEdit,
QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus)
QtCore.QObject.connect(self.UsernameEdit,
@@ -153,6 +159,7 @@
self.ShowSplashCheckBox.setText(self.trUtf8('Show the splash screen'))
self.SettingsGroupBox.setTitle(self.trUtf8('Application Settings'))
self.SaveCheckServiceCheckBox.setText(self.trUtf8('Prompt to save Service before starting New'))
+ self.AutoPreviewCheckBox.setText(self.trUtf8('Preview Next Song from Service Manager'))
self.CCLIGroupBox.setTitle(self.trUtf8('CCLI Details'))
self.NumberLabel.setText(self.trUtf8('CCLI Number:'))
self.UsernameLabel.setText(self.trUtf8('SongSelect Username:'))
@@ -173,6 +180,9 @@
def onSaveCheckServiceCheckBox(self, value):
self.PromptSaveService = (value == QtCore.Qt.Checked)
+ def onAutoPreviewCheckBox(self, value):
+ self.AutoPreview = (value == QtCore.Qt.Checked)
+
def onNumberEditLostFocus(self):
self.CCLINumber = self.NumberEdit.displayText()
@@ -194,6 +204,7 @@
self.AutoOpen = str_to_bool(self.config.get_config(u'auto open', u'False'))
self.ShowSplash = str_to_bool(self.config.get_config(u'show splash', u'True'))
self.PromptSaveService = str_to_bool(self.config.get_config(u'save prompt', u'False'))
+ self.AutoPreview = str_to_bool(self.config.get_config(u'auto preview', u'False'))
self.CCLINumber = unicode(self.config.get_config(u'ccli number', u''))
self.Username = unicode(self.config.get_config(u'songselect username', u''))
self.Password = unicode(self.config.get_config(u'songselect password', u''))
@@ -203,6 +214,7 @@
self.WarningCheckBox.setChecked(self.Warning)
self.AutoOpenCheckBox.setChecked(self.AutoOpen)
self.ShowSplashCheckBox.setChecked(self.ShowSplash)
+ self.AutoPreviewCheckBox.setChecked(self.AutoPreview)
self.NumberEdit.setText(self.CCLINumber)
self.UsernameEdit.setText(self.Username)
self.PasswordEdit.setText(self.Password)
@@ -213,6 +225,7 @@
self.config.set_config(u'auto open', self.AutoOpen)
self.config.set_config(u'show splash', self.ShowSplash)
self.config.set_config(u'save prompt', self.PromptSaveService)
+ self.config.set_config(u'auto preview', self.AutoPreview)
self.config.set_config(u'ccli number', self.CCLINumber)
self.config.set_config(u'songselect username', self.Username)
self.config.set_config(u'songselect password', self.Password)
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2010-02-12 18:42:09 +0000
+++ openlp/core/ui/mainwindow.py 2010-02-26 12:21:16 +0000
@@ -52,12 +52,17 @@
}
"""
class versionThread(QtCore.QThread):
- def __init__(self, parent):
+ def __init__(self, parent, app_version, generalConfig):
QtCore.QThread.__init__(self, parent)
self.parent = parent
+ self.app_version = app_version
+ self.generalConfig = generalConfig
def run (self):
time.sleep(2)
- Receiver.send_message(u'version_check')
+ version = check_latest_version(self.generalConfig, self.app_version)
+ #new version has arrived
+ if version != self.app_version:
+ Receiver.send_message(u'version_check', u'%s' % version)
class Ui_MainWindow(object):
@@ -536,20 +541,18 @@
log.info(u'Load data from Settings')
self.settingsForm.postSetUp()
- def versionCheck(self):
+ def versionCheck(self, version):
"""
Checks the version of the Application called from openlp.pyw
"""
app_version = self.applicationVersion[u'full']
- version = check_latest_version(self.generalConfig, app_version)
- if app_version != version:
- version_text = unicode(self.trUtf8('OpenLP version %s has been updated '
- 'to version %s\n\nYou can obtain the latest version from http://openlp.org'))
- QtGui.QMessageBox.question(self,
- self.trUtf8('OpenLP Version Updated'),
- version_text % (app_version, version),
- QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
- QtGui.QMessageBox.Ok)
+ version_text = unicode(self.trUtf8('OpenLP version %s has been updated '
+ 'to version %s\n\nYou can obtain the latest version from http://openlp.org'))
+ QtGui.QMessageBox.question(self,
+ self.trUtf8('OpenLP Version Updated'),
+ version_text % (app_version, version),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
+ QtGui.QMessageBox.Ok)
def getMonitorNumber(self):
"""
@@ -584,7 +587,8 @@
QtGui.QMessageBox.Ok)
def versionThread(self):
- vT = versionThread(self)
+ app_version = self.applicationVersion[u'full']
+ vT = versionThread(self, app_version, self.generalConfig)
vT.start()
def onHelpAboutItemClicked(self):
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2010-02-23 19:37:07 +0000
+++ openlp/core/ui/servicemanager.py 2010-02-26 12:21:16 +0000
@@ -621,6 +621,7 @@
self.parent.PreviewController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], count)
+
def makeLive(self):
"""
Send the current item to the Live slide controller
@@ -628,6 +629,13 @@
item, count = self.findServiceItem()
self.parent.LiveController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], count)
+ if str_to_bool(PluginConfig(u'General').
+ get_config(u'auto preview', u'False')):
+ item += 1
+ if len(self.serviceItems) > 0 and item < len(self.serviceItems) and \
+ self.serviceItems[item][u'service_item'].autoPreviewAllowed:
+ self.parent.PreviewController.addServiceManagerItem(
+ self.serviceItems[item][u'service_item'], 0)
def remoteEdit(self):
"""
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2010-02-06 16:23:47 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2010-02-26 12:21:16 +0000
@@ -435,6 +435,7 @@
raw_slides = []
raw_footer = []
bible_text = u''
+ self.service_item.autoPreviewAllowed = True
#If we want to use a 2nd translation / version
bible2 = u''
if self.SearchTabWidget.currentIndex() == 0:
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2009-12-31 12:52:01 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2010-02-26 12:21:16 +0000
@@ -144,6 +144,7 @@
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
else:
item_id = self.remoteCustom
+ self.service_item.autoPreviewAllowed = True
customSlide = self.parent.custommanager.get_custom(item_id)
title = customSlide.title
credit = customSlide.credits
@@ -165,4 +166,4 @@
else:
raw_footer.append(u'')
service_item.raw_footer = raw_footer
- return True
\ No newline at end of file
+ return True
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py 2010-02-16 18:51:41 +0000
+++ openlp/plugins/images/lib/mediaitem.py 2010-02-26 12:21:16 +0000
@@ -144,6 +144,7 @@
items = self.ListView.selectedIndexes()
if items:
service_item.title = self.trUtf8('Image(s)')
+ self.service_item.autoPreviewAllowed = True
for item in items:
bitem = self.ListView.item(item.row())
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2010-02-09 16:09:57 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2010-02-26 12:21:16 +0000
@@ -290,6 +290,7 @@
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
else:
item_id = self.remoteSong
+ service_item.autoPreviewAllowed = True
song = self.parent.songmanager.get_song(item_id)
service_item.theme = song.theme_name
service_item.edit_enabled = True
Follow ups