openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #04068
[Merge] lp:~trb143/openlp/bugfixes1 into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/bugfixes1 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
#637547 Editing a song in a loaded service file crashes
https://bugs.launchpad.net/bugs/637547
#637886 Replacing live video background with nothing live causes crash
https://bugs.launchpad.net/bugs/637886
#642778 enchant.DictNotFoundError: Dictionary for language 'ja_JP' could not be found
https://bugs.launchpad.net/bugs/642778
Add config item for auto expanding Service Items (default False)
Add expand All and collapse All Buttons (New icons to be provided by Raoul)
--
https://code.launchpad.net/~trb143/openlp/bugfixes1/+merge/38012
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bugfixes1 into lp:openlp.
=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py 2010-09-14 18:18:47 +0000
+++ openlp/core/ui/advancedtab.py 2010-10-08 19:37:48 +0000
@@ -82,6 +82,9 @@
self.doubleClickLiveCheckBox.setObjectName(u'doubleClickLiveCheckBox')
self.uiLayout.addWidget(self.doubleClickLiveCheckBox)
self.leftLayout.addWidget(self.uiGroupBox)
+ self.expandServiceItemCheckBox = QtGui.QCheckBox(self.uiGroupBox)
+ self.expandServiceItemCheckBox.setObjectName(u'expandServiceItemCheckBox')
+ self.uiLayout.addWidget(self.expandServiceItemCheckBox)
# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftWidget)
# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')
# self.sharedDirGroupBox.setGeometry(QtCore.QRect(0, 65, 500, 85))
@@ -140,6 +143,8 @@
'Remember active media manager tab on startup'))
self.doubleClickLiveCheckBox.setText(translate('OpenLP.AdvancedTab',
'Double-click to send items straight to live (requires restart)'))
+ self.expandServiceItemCheckBox.setText(translate('OpenLP.AdvancedTab',
+ 'Expand new service items on creation'))
# self.sharedDirGroupBox.setTitle(
# translate('AdvancedTab', 'Central Data Store'))
# self.sharedCheckBox.setText(
@@ -167,6 +172,9 @@
self.doubleClickLiveCheckBox.setChecked(
settings.value(u'double click live',
QtCore.QVariant(False)).toBool())
+ self.expandServiceItemCheckBox.setChecked(
+ settings.value(u'expand service item',
+ QtCore.QVariant(False)).toBool())
settings.endGroup()
def save(self):
@@ -181,6 +189,8 @@
QtCore.QVariant(self.mediaPluginCheckBox.isChecked()))
settings.setValue(u'double click live',
QtCore.QVariant(self.doubleClickLiveCheckBox.isChecked()))
+ settings.setValue(u'expand service item',
+ QtCore.QVariant(self.expandServiceItemCheckBox.isChecked()))
settings.endGroup()
def onSharedCheckBoxChanged(self, checked):
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2010-10-07 17:52:40 +0000
+++ openlp/core/ui/servicemanager.py 2010-10-08 19:37:48 +0000
@@ -107,6 +107,7 @@
self.serviceName = u''
self.suffixes = []
self.droppos = 0
+ self.expandTabs = False
#is a new service and has not been saved
self.isNew = True
self.serviceNoteForm = ServiceNoteForm(self.parent)
@@ -199,6 +200,19 @@
translate('OpenLP.ServiceManager',
'Delete the selected item from the service.'),
self.onDeleteFromService)
+ self.orderToolbar.addSeparator()
+ self.orderToolbar.addToolbarButton(
+ translate('OpenLP.ServiceManager', '&Expand all'),
+ u':/services/service_top.png',
+ translate('OpenLP.ServiceManager',
+ 'Expand all the service items.'),
+ self.onExpandAll)
+ self.orderToolbar.addToolbarButton(
+ translate('OpenLP.ServiceManager', '&Collapse all'),
+ u':/services/service_bottom.png',
+ translate('OpenLP.ServiceManager',
+ 'Collapse all the service items.'),
+ self.onCollapseAll)
self.layout.addWidget(self.orderToolbar)
# Connect up our signals and slots
QtCore.QObject.connect(self.themeComboBox,
@@ -220,7 +234,7 @@
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'servicemanager_list_request'), self.listRequest)
QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'config_updated'), self.regenerateServiceItems)
+ QtCore.SIGNAL(u'config_updated'), self.configUpdated)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'theme_update_global'), self.themeChange)
QtCore.QObject.connect(Receiver.get_receiver(),
@@ -265,6 +279,17 @@
self.themeMenu = QtGui.QMenu(
translate('OpenLP.ServiceManager', '&Change Item Theme'))
self.menu.addMenu(self.themeMenu)
+ self.configUpdated(True)
+
+ def configUpdated(self, firstTime=False):
+ """
+ Triggered when Config dialog is updated.
+ """
+ self.expandTabs = QtCore.QSettings().value(
+ u'advanced/expand service item',
+ QtCore.QVariant(u'False')).toBool()
+ if not firstTime:
+ self.regenerateServiceItems()
def supportedSuffixes(self, suffix):
self.suffixes.append(suffix)
@@ -321,7 +346,7 @@
self.serviceItems[item][u'service_item'])
if self.serviceItemEditForm.exec_():
self.addServiceItem(self.serviceItemEditForm.getServiceItem(),
- replace=True)
+ replace=True, expand=self.serviceItems[item][u'expand'])
def nextItem(self):
"""
@@ -423,6 +448,14 @@
if setSelected:
firstItem.setSelected(True)
+ def onCollapseAll(self):
+ """
+ Collapse all the service items
+ """
+ for item in self.serviceItems:
+ item[u'expanded'] = False
+ self.regenerateServiceItems()
+
def collapsed(self, item):
"""
Record if an item is collapsed
@@ -431,6 +464,14 @@
pos = item.data(0, QtCore.Qt.UserRole).toInt()[0]
self.serviceItems[pos -1 ][u'expanded'] = False
+ def onExpandAll(self):
+ """
+ Collapse all the service items
+ """
+ for item in self.serviceItems:
+ item[u'expanded'] = True
+ self.regenerateServiceItems()
+
def expanded(self, item):
"""
Record if an item is collapsed
@@ -528,12 +569,12 @@
Used when moving items as the move takes place in supporting array,
and when regenerating all the items due to theme changes
"""
- #Correct order of items in array
+ # Correct order of items in array
count = 1
for item in self.serviceItems:
item[u'order'] = count
count += 1
- #Repaint the screen
+ # Repaint the screen
self.serviceManagerList.clear()
for itemcount, item in enumerate(self.serviceItems):
serviceitem = item[u'service_item']
@@ -805,7 +846,7 @@
self.isNew = True
for item in tempServiceItems:
self.addServiceItem(
- item[u'service_item'], False, item[u'expanded'])
+ item[u'service_item'], False, expand=item[u'expanded'])
# Set to False as items may have changed rendering
# does not impact the saved song so True may also be valid
self.parent.serviceChanged(False, self.serviceName)
@@ -834,14 +875,19 @@
self.parent.LiveController.replaceServiceManagerItem(newItem)
self.parent.serviceChanged(False, self.serviceName)
- def addServiceItem(self, item, rebuild=False, expand=False, replace=False):
+ def addServiceItem(self, item, rebuild=False, expand=None, replace=False):
"""
Add a Service item to the list
``item``
Service Item to be added
+
+ ``expand``
+ Override the default expand settings. (Tristate)
"""
log.debug(u'addServiceItem')
+ if expand == None:
+ expand = self.expandTabs
sitem = self.findServiceItem()[0]
item.render()
if replace:
Follow ups