openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #05441
[Merge] lp:~m2j/openlp/work into lp:openlp
m2j has proposed merging lp:~m2j/openlp/work into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
#609356 Web bibles don't download all their books on import
https://bugs.launchpad.net/bugs/609356
#661867 Invalid author added in song dialog
https://bugs.launchpad.net/bugs/661867
#686103 Labels in theme wizard out of alignment on Windows
https://bugs.launchpad.net/bugs/686103
#698881 Saving settings tries to use uno when unavailable
https://bugs.launchpad.net/bugs/698881
For more details, see:
https://code.launchpad.net/~m2j/openlp/work/+merge/45628
wrong parentship caused theme and servicemanager to disapear in a floating dock
more intelligent resizing of item list in PluginForm and SongMaintenanceForm
fix in BS web bible parser
--
https://code.launchpad.net/~m2j/openlp/work/+merge/45628
Your team OpenLP Core is requested to review the proposed merge of lp:~m2j/openlp/work into lp:openlp.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2011-01-04 09:19:53 +0000
+++ openlp/core/ui/mainwindow.py 2011-01-09 01:22:01 +0000
@@ -142,7 +142,8 @@
build_icon(u':/system/system_servicemanager.png'))
self.ServiceManagerDock.setMinimumWidth(
self.settingsmanager.mainwindow_right)
- self.ServiceManagerContents = ServiceManager(MainWindow)
+ self.ServiceManagerContents = ServiceManager(MainWindow,
+ self.ServiceManagerDock)
self.ServiceManagerDock.setWidget(self.ServiceManagerContents)
MainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
self.ServiceManagerDock)
@@ -152,7 +153,8 @@
build_icon(u':/system/system_thememanager.png'))
self.ThemeManagerDock.setMinimumWidth(
self.settingsmanager.mainwindow_right)
- self.ThemeManagerContents = ThemeManager(MainWindow)
+ self.ThemeManagerContents = ThemeManager(MainWindow,
+ self.ThemeManagerDock)
self.ThemeManagerContents.setObjectName(u'ThemeManagerContents')
self.ThemeManagerDock.setWidget(self.ThemeManagerContents)
MainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py 2011-01-01 13:22:12 +0000
+++ openlp/core/ui/pluginform.py 2011-01-09 01:22:01 +0000
@@ -61,6 +61,7 @@
self.programaticChange = True
self._clearDetails()
self.programaticChange = True
+ pluginListWidth = 0
for plugin in self.parent.pluginManager.plugins:
item = QtGui.QListWidgetItem(self.pluginListWidget)
# We do this just to make 100% sure the status is an integer as
@@ -83,8 +84,11 @@
if plugin.icon:
item.setIcon(plugin.icon)
self.pluginListWidget.addItem(item)
- self.pluginListWidget.setFixedWidth(
- self.pluginListWidget.sizeHint().width())
+ pluginListWidth = max(pluginListWidth, self.fontMetrics().width(
+ unicode(translate('OpenLP.PluginForm', '%s (Inactive)')) %
+ name_string[u'singular']))
+ self.pluginListWidget.setFixedWidth(pluginListWidth +
+ self.pluginListWidget.iconSize().width() + 48)
def _clearDetails(self):
self.statusComboBox.setCurrentIndex(-1)
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2011-01-08 02:44:12 +0000
+++ openlp/core/ui/servicemanager.py 2011-01-09 01:22:01 +0000
@@ -43,33 +43,33 @@
"""
Set up key bindings and mouse behaviour for the service list
"""
- def __init__(self, parent=None, name=None):
+ def __init__(self, mainwindow, parent=None, name=None):
QtGui.QTreeWidget.__init__(self, parent)
- self.parent = parent
+ self.mainwindow = mainwindow
def keyPressEvent(self, event):
if isinstance(event, QtGui.QKeyEvent):
#here accept the event and do something
if event.key() == QtCore.Qt.Key_Enter:
- self.parent.makeLive()
+ self.mainwindow.makeLive()
event.accept()
elif event.key() == QtCore.Qt.Key_Home:
- self.parent.onServiceTop()
+ self.mainwindow.onServiceTop()
event.accept()
elif event.key() == QtCore.Qt.Key_End:
- self.parent.onServiceEnd()
+ self.mainwindow.onServiceEnd()
event.accept()
elif event.key() == QtCore.Qt.Key_PageUp:
- self.parent.onServiceUp()
+ self.mainwindow.onServiceUp()
event.accept()
elif event.key() == QtCore.Qt.Key_PageDown:
- self.parent.onServiceDown()
+ self.mainwindow.onServiceDown()
event.accept()
elif event.key() == QtCore.Qt.Key_Up:
- self.parent.onMoveSelectionUp()
+ self.mainwindow.onMoveSelectionUp()
event.accept()
elif event.key() == QtCore.Qt.Key_Down:
- self.parent.onMoveSelectionDown()
+ self.mainwindow.onMoveSelectionDown()
event.accept()
event.ignore()
else:
@@ -98,12 +98,12 @@
the resources used into one OSZ file for use on any OpenLP v2 installation.
Also handles the UI tasks of moving things up and down etc.
"""
- def __init__(self, parent):
+ def __init__(self, mainwindow, parent=None):
"""
Sets up the service manager, toolbars, list view, et al.
"""
QtGui.QWidget.__init__(self, parent)
- self.parent = parent
+ self.mainwindow = mainwindow
self.serviceItems = []
self.serviceName = u''
self.suffixes = []
@@ -112,8 +112,8 @@
# is a new service and has not been saved
self._modified = False
self._fileName = u''
- self.serviceNoteForm = ServiceNoteForm(self.parent)
- self.serviceItemEditForm = ServiceItemEditForm(self.parent)
+ self.serviceNoteForm = ServiceNoteForm(self.mainwindow)
+ self.serviceItemEditForm = ServiceItemEditForm(self.mainwindow)
# start with the layout
self.layout = QtGui.QVBoxLayout(self)
self.layout.setSpacing(0)
@@ -247,7 +247,7 @@
QtCore.SIGNAL(u'service_item_update'), self.serviceItemUpdate)
# Last little bits of setting up
self.service_theme = unicode(QtCore.QSettings().value(
- self.parent.serviceSettingsSection + u'/service theme',
+ self.mainwindow.serviceSettingsSection + u'/service theme',
QtCore.QVariant(u'')).toString())
self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
#build the drag and drop context menu
@@ -294,7 +294,7 @@
"""
self._modified = modified
serviceFile = self.shortFileName() or u'Untitled Service'
- self.parent.setServiceModified(modified, serviceFile)
+ self.mainwindow.setServiceModified(modified, serviceFile)
def isModified(self):
"""
@@ -307,7 +307,8 @@
Setter for service file.
"""
self._fileName = unicode(fileName)
- self.parent.setServiceModified(self.isModified(), self.shortFileName())
+ self.mainwindow.setServiceModified(self.isModified(),
+ self.shortFileName())
QtCore.QSettings(). \
setValue(u'service/last file',QtCore.QVariant(fileName))
@@ -341,7 +342,7 @@
Create a new service.
"""
if self.isModified():
- result = QtGui.QMessageBox.question(self.parent,
+ result = QtGui.QMessageBox.question(self.mainwindow,
translate('OpenLP.ServiceManager', 'Save Changes'),
translate('OpenLP.ServiceManager', 'The current service has '
'been modified, would you like to save it?'),
@@ -356,7 +357,7 @@
def onLoadServiceClicked(self):
if self.isModified():
- result = QtGui.QMessageBox.question(self.parent,
+ result = QtGui.QMessageBox.question(self.mainwindow,
translate('OpenLP.ServiceManager', 'Save Changes'),
translate('OpenLP.ServiceManager', 'The current service has '
'been modified, would you like to save it?'),
@@ -366,14 +367,14 @@
return False
elif result == QtGui.QMessageBox.Save:
self.saveFile()
- fileName = unicode(QtGui.QFileDialog.getOpenFileName(self.parent,
+ fileName = unicode(QtGui.QFileDialog.getOpenFileName(self.mainwindow,
translate('OpenLP.ServiceManager', 'Open File'),
- SettingsManager.get_last_dir(self.parent.serviceSettingsSection),
+ SettingsManager.get_last_dir(self.mainwindow.serviceSettingsSection),
translate('OpenLP.ServiceManager',
'OpenLP Service Files (*.osz)')))
if not fileName:
return False
- SettingsManager.set_last_dir(self.parent.serviceSettingsSection,
+ SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection,
split_filename(fileName)[0])
self.loadFile(fileName)
@@ -407,7 +408,7 @@
else:
fileName = self.fileName()
log.debug(u'ServiceManager.saveFile - %s' % fileName)
- SettingsManager.set_last_dir(self.parent.serviceSettingsSection,
+ SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection,
split_filename(fileName)[0])
service = []
serviceFileName = fileName.replace(u'.osz', u'.osd')
@@ -447,7 +448,7 @@
except (IOError, OSError):
# if not present do not worry
pass
- self.parent.addRecentFile(fileName)
+ self.mainwindow.addRecentFile(fileName)
self.setModified(False)
return True
@@ -456,9 +457,9 @@
Get a file name and then call :function:`ServiceManager.saveFile` to
save the file.
"""
- fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.parent,
+ fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow,
translate('OpenLP.ServiceManager', 'Save Service'),
- SettingsManager.get_last_dir(self.parent.serviceSettingsSection),
+ SettingsManager.get_last_dir(self.mainwindow.serviceSettingsSection),
translate('OpenLP.ServiceManager',
'OpenLP Service Files (*.osz)')))
if not fileName:
@@ -508,7 +509,7 @@
self.newFile()
for item in items:
serviceItem = ServiceItem()
- serviceItem.render_manager = self.parent.renderManager
+ serviceItem.render_manager = self.mainwindow.renderManager
serviceItem.set_from_service(item, self.servicePath)
self.validateItem(serviceItem)
self.addServiceItem(serviceItem)
@@ -535,7 +536,7 @@
if zip:
zip.close()
self.setFileName(fileName)
- self.parent.addRecentFile(fileName)
+ self.mainwindow.addRecentFile(fileName)
self.setModified(False)
QtCore.QSettings(). \
setValue(u'service/last file',QtCore.QVariant(fileName))
@@ -886,9 +887,9 @@
"""
log.debug(u'onThemeComboBoxSelected')
self.service_theme = unicode(self.themeComboBox.currentText())
- self.parent.renderManager.set_service_theme(self.service_theme)
+ self.mainwindow.renderManager.set_service_theme(self.service_theme)
QtCore.QSettings().setValue(
- self.parent.serviceSettingsSection + u'/service theme',
+ self.mainwindow.serviceSettingsSection + u'/service theme',
QtCore.QVariant(self.service_theme))
self.regenerateServiceItems()
@@ -898,7 +899,7 @@
sure the theme combo box is in the correct state.
"""
log.debug(u'themeChange')
- if self.parent.renderManager.theme_level == ThemeLevel.Global:
+ if self.mainwindow.renderManager.theme_level == ThemeLevel.Global:
self.toolbar.actions[u'ThemeLabel'].setVisible(False)
self.toolbar.actions[u'ThemeWidget'].setVisible(False)
else:
@@ -913,7 +914,7 @@
Receiver.send_message(u'cursor_busy')
log.debug(u'regenerateServiceItems')
# force reset of renderer as theme data has changed
- self.parent.renderManager.themedata = None
+ self.mainwindow.renderManager.themedata = None
if self.serviceItems:
tempServiceItems = self.serviceItems
self.serviceManagerList.clear()
@@ -948,7 +949,7 @@
newItem.merge(item[u'service_item'])
item[u'service_item'] = newItem
self.repaintServiceList(itemcount + 1, 0)
- self.parent.liveController.replaceServiceManagerItem(newItem)
+ self.mainwindow.liveController.replaceServiceManagerItem(newItem)
self.setModified(True)
def addServiceItem(self, item, rebuild=False, expand=None, replace=False):
@@ -970,7 +971,7 @@
item.merge(self.serviceItems[sitem][u'service_item'])
self.serviceItems[sitem][u'service_item'] = item
self.repaintServiceList(sitem + 1, 0)
- self.parent.liveController.replaceServiceManagerItem(item)
+ self.mainwindow.liveController.replaceServiceManagerItem(item)
else:
# nothing selected for dnd
if self.dropPosition == 0:
@@ -991,7 +992,7 @@
self.repaintServiceList(self.dropPosition, 0)
# if rebuilding list make sure live is fixed.
if rebuild:
- self.parent.liveController.replaceServiceManagerItem(item)
+ self.mainwindow.liveController.replaceServiceManagerItem(item)
self.dropPosition = 0
self.setModified(True)
@@ -1001,7 +1002,7 @@
"""
item, count = self.findServiceItem()
if self.serviceItems[item][u'service_item'].is_valid:
- self.parent.previewController.addServiceManagerItem(
+ self.mainwindow.previewController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], count)
else:
QtGui.QMessageBox.critical(self,
@@ -1025,18 +1026,18 @@
"""
item, count = self.findServiceItem()
if self.serviceItems[item][u'service_item'].is_valid:
- self.parent.liveController.addServiceManagerItem(
+ self.mainwindow.liveController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], count)
if QtCore.QSettings().value(
- self.parent.generalSettingsSection + u'/auto preview',
+ self.mainwindow.generalSettingsSection + u'/auto preview',
QtCore.QVariant(False)).toBool():
item += 1
if self.serviceItems and item < len(self.serviceItems) and \
self.serviceItems[item][u'service_item'].is_capable(
ItemCapabilities.AllowsPreview):
- self.parent.previewController.addServiceManagerItem(
+ self.mainwindow.previewController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], 0)
- self.parent.liveController.PreviewListWidget.setFocus()
+ self.mainwindow.liveController.PreviewListWidget.setFocus()
else:
QtGui.QMessageBox.critical(self,
translate('OpenLP.ServiceManager', 'Missing Display Handler'),
@@ -1156,7 +1157,7 @@
index = 0
self.service_theme = u''
self.themeComboBox.setCurrentIndex(index)
- self.parent.renderManager.set_service_theme(self.service_theme)
+ self.mainwindow.renderManager.set_service_theme(self.service_theme)
self.regenerateServiceItems()
def onThemeChangeAction(self):
=== modified file 'openlp/core/ui/themeform.py'
--- openlp/core/ui/themeform.py 2011-01-05 16:55:54 +0000
+++ openlp/core/ui/themeform.py 2011-01-09 01:22:01 +0000
@@ -212,8 +212,8 @@
"""
Updates the lines on a page on the wizard
"""
- self.mainLineCountLabel.setText(unicode(translate('OpenLP.ThemeForm', \
- '(%d lines per slide)' % int(lines))))
+ self.mainLineCountLabel.setText(unicode(translate('OpenLP.ThemeForm',
+ '(%d lines per slide)')) % int(lines))
def resizeEvent(self, event=None):
"""
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2011-01-02 22:24:14 +0000
+++ openlp/core/ui/thememanager.py 2011-01-09 01:22:01 +0000
@@ -45,13 +45,13 @@
"""
Manages the orders of Theme.
"""
- def __init__(self, parent):
+ def __init__(self, mainwindow, parent=None):
QtGui.QWidget.__init__(self, parent)
- self.parent = parent
+ self.mainwindow = mainwindow
self.settingsSection = u'themes'
self.themeForm = ThemeForm(self)
self.fileRenameForm = FileRenameForm(self)
- self.serviceComboBox = self.parent.ServiceManagerContents.themeComboBox
+ self.serviceComboBox = self.mainwindow.ServiceManagerContents.themeComboBox
# start with the layout
self.layout = QtGui.QVBoxLayout(self)
self.layout.setSpacing(0)
@@ -641,7 +641,7 @@
(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
if self.saveThemeName != u'':
- for plugin in self.parent.pluginManager.plugins:
+ for plugin in self.mainwindow.pluginManager.plugins:
if plugin.usesTheme(self.saveThemeName):
plugin.renameTheme(self.saveThemeName, name)
if unicode(self.serviceComboBox.currentText()) == name:
@@ -727,7 +727,7 @@
Flag to tell message lines per page need to be generated.
"""
log.debug(u'generateImage \n%s ', themeData)
- return self.parent.renderManager.generate_preview(themeData, forcePage)
+ return self.mainwindow.renderManager.generate_preview(themeData, forcePage)
def getPreviewImage(self, theme):
"""
@@ -788,7 +788,7 @@
return False
else:
if testPlugin:
- for plugin in self.parent.pluginManager.plugins:
+ for plugin in self.mainwindow.pluginManager.plugins:
if plugin.usesTheme(theme):
QtGui.QMessageBox.critical(self,
translate('OpenLP.ThemeManager', 'Error'),
=== modified file 'openlp/core/ui/themewizard.py'
--- openlp/core/ui/themewizard.py 2011-01-08 18:26:38 +0000
+++ openlp/core/ui/themewizard.py 2011-01-09 01:22:01 +0000
@@ -476,8 +476,6 @@
self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
- self.mainLineCountLabel.setText(
- translate('OpenLP.ThemeWizard', '(%d lines per slide)'))
self.lineSpacingLabel.setText(
translate('OpenLP.ThemeWizard', 'Line Spacing:'))
self.lineSpacingSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
@@ -569,17 +567,17 @@
self.themeNameLabel.setText(
translate('OpenLP.ThemeWizard', 'Theme name:'))
# Align all QFormLayouts towards each other.
- width = max(self.backgroundLabel.minimumSizeHint().width(),
- self.colorLabel.minimumSizeHint().width())
- width = max(width, self.gradientStartLabel.minimumSizeHint().width())
- width = max(width, self.gradientEndLabel.minimumSizeHint().width())
- width = max(width, self.gradientTypeLabel.minimumSizeHint().width())
- width = max(width, self.imageLabel.minimumSizeHint().width())
- self.backgroundTypeSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
- QtGui.QSizePolicy.Fixed)
- self.colorSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
- QtGui.QSizePolicy.Fixed)
- self.gradientSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
- QtGui.QSizePolicy.Fixed)
- self.imageSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
- QtGui.QSizePolicy.Fixed)
+ labelWidth = max(self.backgroundLabel.minimumSizeHint().width(),
+ self.colorLabel.minimumSizeHint().width(),
+ self.gradientStartLabel.minimumSizeHint().width(),
+ self.gradientEndLabel.minimumSizeHint().width(),
+ self.gradientTypeLabel.minimumSizeHint().width(),
+ self.imageLabel.minimumSizeHint().width())
+ self.backgroundTypeSpacer.changeSize(labelWidth, 0,
+ QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ self.colorSpacer.changeSize(labelWidth, 0,
+ QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ self.gradientSpacer.changeSize(labelWidth, 0,
+ QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ self.imageSpacer.changeSize(labelWidth, 0,
+ QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
=== modified file 'openlp/plugins/alerts/alertsplugin.py'
--- openlp/plugins/alerts/alertsplugin.py 2010-12-31 02:17:41 +0000
+++ openlp/plugins/alerts/alertsplugin.py 2011-01-09 01:22:01 +0000
@@ -73,7 +73,7 @@
self.toolsAlertItem.setStatusTip(
translate('AlertsPlugin', 'Show an alert message.'))
self.toolsAlertItem.setShortcut(u'F7')
- self.serviceManager.parent.ToolsMenu.addAction(self.toolsAlertItem)
+ self.serviceManager.mainwindow.ToolsMenu.addAction(self.toolsAlertItem)
QtCore.QObject.connect(self.toolsAlertItem,
QtCore.SIGNAL(u'triggered()'), self.onAlertsTrigger)
self.toolsAlertItem.setVisible(False)
=== modified file 'openlp/plugins/bibles/forms/bibleimportwizard.py'
--- openlp/plugins/bibles/forms/bibleimportwizard.py 2010-12-27 22:57:35 +0000
+++ openlp/plugins/bibles/forms/bibleimportwizard.py 2011-01-09 01:22:01 +0000
@@ -373,19 +373,19 @@
'you want to use this importer, you will need to install the '
'"python-sqlite" module.'))
# Align all QFormLayouts towards each other.
- width = max(self.formatLabel.minimumSizeHint().width(),
- self.osisFileLabel.minimumSizeHint().width())
- width = max(width, self.csvBooksLabel.minimumSizeHint().width())
- width = max(width, self.csvVersesLabel.minimumSizeHint().width())
- width = max(width, self.openSongFileLabel.minimumSizeHint().width())
- width = max(width, self.openlp1FileLabel.minimumSizeHint().width())
- self.formatSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
- QtGui.QSizePolicy.Fixed)
- self.osisSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
- QtGui.QSizePolicy.Fixed)
- self.csvSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
- QtGui.QSizePolicy.Fixed)
- self.openSongSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
- QtGui.QSizePolicy.Fixed)
- self.openlp1Spacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
- QtGui.QSizePolicy.Fixed)
+ labelWidth = max(self.formatLabel.minimumSizeHint().width(),
+ self.osisFileLabel.minimumSizeHint().width(),
+ self.csvBooksLabel.minimumSizeHint().width(),
+ self.csvVersesLabel.minimumSizeHint().width(),
+ self.openSongFileLabel.minimumSizeHint().width(),
+ self.openlp1FileLabel.minimumSizeHint().width())
+ self.formatSpacer.changeSize(labelWidth, 0,
+ QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ self.osisSpacer.changeSize(labelWidth, 0,
+ QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ self.csvSpacer.changeSize(labelWidth, 0,
+ QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ self.openSongSpacer.changeSize(labelWidth, 0,
+ QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ self.openlp1Spacer.changeSize(labelWidth, 0,
+ QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
=== modified file 'openlp/plugins/bibles/lib/http.py'
--- openlp/plugins/bibles/lib/http.py 2011-01-08 18:50:06 +0000
+++ openlp/plugins/bibles/lib/http.py 2011-01-09 01:22:01 +0000
@@ -309,7 +309,7 @@
finally:
if not content:
return None
- verse_number = re.compile(r'v(\d{2})(\d{3})(\d{3}) verse')
+ verse_number = re.compile(r'v(\d{1,2})(\d{3})(\d{3}) verse')
verses = {}
for verse in content:
Receiver.send_message(u'openlp_process_events')
=== modified file 'openlp/plugins/songs/forms/songmaintenancedialog.py'
--- openlp/plugins/songs/forms/songmaintenancedialog.py 2011-01-04 21:06:50 +0000
+++ openlp/plugins/songs/forms/songmaintenancedialog.py 2011-01-09 01:22:01 +0000
@@ -36,8 +36,6 @@
self.dialogLayout = QtGui.QGridLayout(songMaintenanceDialog)
self.dialogLayout.setObjectName(u'dialogLayout')
self.typeListWidget = QtGui.QListWidget(songMaintenanceDialog)
- # Caution: fixed widget width
- self.typeListWidget.setFixedWidth(172)
self.typeListWidget.setIconSize(QtCore.QSize(32, 32))
self.typeListWidget.setUniformItemSizes(True)
self.typeListWidget.setObjectName(u'typeListWidget')
@@ -147,12 +145,12 @@
def retranslateUi(self, songMaintenanceDialog):
songMaintenanceDialog.setWindowTitle(
translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance'))
- self.listItemAuthors.setText(
- translate('SongsPlugin.SongMaintenanceForm', 'Authors'))
- self.listItemTopics.setText(
- translate('SongsPlugin.SongMaintenanceForm', 'Topics'))
- self.listItemBooks.setText(
- translate('SongsPlugin.SongMaintenanceForm', 'Song Books'))
+ authorsString = translate('SongsPlugin.SongMaintenanceForm', 'Authors')
+ topicsString = translate('SongsPlugin.SongMaintenanceForm', 'Topics')
+ booksString = translate('SongsPlugin.SongMaintenanceForm', 'Song Books')
+ self.listItemAuthors.setText(authorsString)
+ self.listItemTopics.setText(topicsString)
+ self.listItemBooks.setText(booksString)
self.authorsAddButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Add'))
self.authorsEditButton.setText(
@@ -171,3 +169,8 @@
translate('SongsPlugin.SongMaintenanceForm', '&Edit'))
self.booksDeleteButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Delete'))
+ typeListWidth = max(self.fontMetrics().width(authorsString),
+ self.fontMetrics().width(topicsString),
+ self.fontMetrics().width(booksString))
+ self.typeListWidget.setFixedWidth(typeListWidth +
+ self.typeListWidget.iconSize().width() + 32)
Follow ups