forked from openlp/openlp
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 bzr-revno: 1202
This commit is contained in:
commit
1c1a4d51c2
@ -142,7 +142,8 @@ class Ui_MainWindow(object):
|
||||
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 @@ class Ui_MainWindow(object):
|
||||
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,
|
||||
|
@ -61,6 +61,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
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 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
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)
|
||||
|
@ -43,33 +43,33 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
||||
"""
|
||||
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 @@ class ServiceManager(QtGui.QWidget):
|
||||
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 @@ class ServiceManager(QtGui.QWidget):
|
||||
# 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)
|
||||
@ -249,7 +249,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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
|
||||
@ -296,7 +296,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
"""
|
||||
self._modified = modified
|
||||
serviceFile = self.shortFileName() or u'Untitled Service'
|
||||
self.parent.setServiceModified(modified, serviceFile)
|
||||
self.mainwindow.setServiceModified(modified, serviceFile)
|
||||
|
||||
def isModified(self):
|
||||
"""
|
||||
@ -309,7 +309,8 @@ class ServiceManager(QtGui.QWidget):
|
||||
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))
|
||||
|
||||
@ -343,7 +344,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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?'),
|
||||
@ -358,7 +359,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
|
||||
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?'),
|
||||
@ -368,14 +369,14 @@ class ServiceManager(QtGui.QWidget):
|
||||
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)
|
||||
|
||||
@ -409,7 +410,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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')
|
||||
@ -449,7 +450,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
except (IOError, OSError):
|
||||
# if not present do not worry
|
||||
pass
|
||||
self.parent.addRecentFile(fileName)
|
||||
self.mainwindow.addRecentFile(fileName)
|
||||
self.setModified(False)
|
||||
return True
|
||||
|
||||
@ -458,9 +459,9 @@ class ServiceManager(QtGui.QWidget):
|
||||
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:
|
||||
@ -510,7 +511,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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)
|
||||
@ -537,7 +538,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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))
|
||||
@ -888,9 +889,9 @@ class ServiceManager(QtGui.QWidget):
|
||||
"""
|
||||
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()
|
||||
|
||||
@ -900,7 +901,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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:
|
||||
@ -915,7 +916,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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()
|
||||
@ -950,7 +951,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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):
|
||||
@ -972,7 +973,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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:
|
||||
@ -993,7 +994,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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)
|
||||
|
||||
@ -1003,7 +1004,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
"""
|
||||
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,
|
||||
@ -1027,18 +1028,18 @@ class ServiceManager(QtGui.QWidget):
|
||||
"""
|
||||
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'),
|
||||
@ -1158,7 +1159,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
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):
|
||||
|
@ -212,8 +212,8 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
"""
|
||||
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):
|
||||
"""
|
||||
|
@ -45,13 +45,13 @@ class ThemeManager(QtGui.QWidget):
|
||||
"""
|
||||
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)
|
||||
@ -252,7 +252,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
oldThemeData = self.getThemeData(oldThemeName)
|
||||
self.deleteTheme(oldThemeName)
|
||||
self.cloneThemeData(oldThemeData, newThemeName)
|
||||
for plugin in self.parent.pluginManager.plugins:
|
||||
for plugin in self.mainwindow.pluginManager.plugins:
|
||||
if plugin.usesTheme(oldThemeName):
|
||||
plugin.renameTheme(oldThemeName, newThemeName)
|
||||
|
||||
@ -637,7 +637,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
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):
|
||||
"""
|
||||
@ -698,7 +698,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
return False
|
||||
# check for use in the system else where.
|
||||
if testPlugin:
|
||||
for plugin in self.parent.pluginManager.plugins:
|
||||
for plugin in self.mainwindow.pluginManager.plugins:
|
||||
if plugin.usesTheme(theme):
|
||||
Receiver.send_message(u'openlp_error_message', {
|
||||
u'title': translate('OpenLP.ThemeManager',
|
||||
@ -765,4 +765,4 @@ class ThemeManager(QtGui.QWidget):
|
||||
vAlignCorrection = 2
|
||||
newtheme.display_horizontal_align = theme.HorizontalAlign
|
||||
newtheme.display_vertical_align = vAlignCorrection
|
||||
return newtheme.extract_xml()
|
||||
return newtheme.extract_xml()
|
||||
|
@ -476,8 +476,6 @@ class Ui_ThemeWizard(object):
|
||||
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 @@ class Ui_ThemeWizard(object):
|
||||
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)
|
||||
|
@ -73,7 +73,7 @@ class AlertsPlugin(Plugin):
|
||||
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)
|
||||
|
@ -373,19 +373,19 @@ class Ui_BibleImportWizard(object):
|
||||
'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)
|
||||
|
@ -309,7 +309,7 @@ class BSExtract(object):
|
||||
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')
|
||||
|
@ -36,8 +36,6 @@ class Ui_SongMaintenanceDialog(object):
|
||||
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 @@ class Ui_SongMaintenanceDialog(object):
|
||||
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 @@ class Ui_SongMaintenanceDialog(object):
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user