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'))
|
build_icon(u':/system/system_servicemanager.png'))
|
||||||
self.ServiceManagerDock.setMinimumWidth(
|
self.ServiceManagerDock.setMinimumWidth(
|
||||||
self.settingsmanager.mainwindow_right)
|
self.settingsmanager.mainwindow_right)
|
||||||
self.ServiceManagerContents = ServiceManager(MainWindow)
|
self.ServiceManagerContents = ServiceManager(MainWindow,
|
||||||
|
self.ServiceManagerDock)
|
||||||
self.ServiceManagerDock.setWidget(self.ServiceManagerContents)
|
self.ServiceManagerDock.setWidget(self.ServiceManagerContents)
|
||||||
MainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
|
MainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
|
||||||
self.ServiceManagerDock)
|
self.ServiceManagerDock)
|
||||||
@ -152,7 +153,8 @@ class Ui_MainWindow(object):
|
|||||||
build_icon(u':/system/system_thememanager.png'))
|
build_icon(u':/system/system_thememanager.png'))
|
||||||
self.ThemeManagerDock.setMinimumWidth(
|
self.ThemeManagerDock.setMinimumWidth(
|
||||||
self.settingsmanager.mainwindow_right)
|
self.settingsmanager.mainwindow_right)
|
||||||
self.ThemeManagerContents = ThemeManager(MainWindow)
|
self.ThemeManagerContents = ThemeManager(MainWindow,
|
||||||
|
self.ThemeManagerDock)
|
||||||
self.ThemeManagerContents.setObjectName(u'ThemeManagerContents')
|
self.ThemeManagerContents.setObjectName(u'ThemeManagerContents')
|
||||||
self.ThemeManagerDock.setWidget(self.ThemeManagerContents)
|
self.ThemeManagerDock.setWidget(self.ThemeManagerContents)
|
||||||
MainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
|
MainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
|
||||||
|
@ -61,6 +61,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
self.programaticChange = True
|
self.programaticChange = True
|
||||||
self._clearDetails()
|
self._clearDetails()
|
||||||
self.programaticChange = True
|
self.programaticChange = True
|
||||||
|
pluginListWidth = 0
|
||||||
for plugin in self.parent.pluginManager.plugins:
|
for plugin in self.parent.pluginManager.plugins:
|
||||||
item = QtGui.QListWidgetItem(self.pluginListWidget)
|
item = QtGui.QListWidgetItem(self.pluginListWidget)
|
||||||
# We do this just to make 100% sure the status is an integer as
|
# 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:
|
if plugin.icon:
|
||||||
item.setIcon(plugin.icon)
|
item.setIcon(plugin.icon)
|
||||||
self.pluginListWidget.addItem(item)
|
self.pluginListWidget.addItem(item)
|
||||||
self.pluginListWidget.setFixedWidth(
|
pluginListWidth = max(pluginListWidth, self.fontMetrics().width(
|
||||||
self.pluginListWidget.sizeHint().width())
|
unicode(translate('OpenLP.PluginForm', '%s (Inactive)')) %
|
||||||
|
name_string[u'singular']))
|
||||||
|
self.pluginListWidget.setFixedWidth(pluginListWidth +
|
||||||
|
self.pluginListWidget.iconSize().width() + 48)
|
||||||
|
|
||||||
def _clearDetails(self):
|
def _clearDetails(self):
|
||||||
self.statusComboBox.setCurrentIndex(-1)
|
self.statusComboBox.setCurrentIndex(-1)
|
||||||
|
@ -43,33 +43,33 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
|||||||
"""
|
"""
|
||||||
Set up key bindings and mouse behaviour for the service list
|
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)
|
QtGui.QTreeWidget.__init__(self, parent)
|
||||||
self.parent = parent
|
self.mainwindow = mainwindow
|
||||||
|
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
if isinstance(event, QtGui.QKeyEvent):
|
if isinstance(event, QtGui.QKeyEvent):
|
||||||
#here accept the event and do something
|
#here accept the event and do something
|
||||||
if event.key() == QtCore.Qt.Key_Enter:
|
if event.key() == QtCore.Qt.Key_Enter:
|
||||||
self.parent.makeLive()
|
self.mainwindow.makeLive()
|
||||||
event.accept()
|
event.accept()
|
||||||
elif event.key() == QtCore.Qt.Key_Home:
|
elif event.key() == QtCore.Qt.Key_Home:
|
||||||
self.parent.onServiceTop()
|
self.mainwindow.onServiceTop()
|
||||||
event.accept()
|
event.accept()
|
||||||
elif event.key() == QtCore.Qt.Key_End:
|
elif event.key() == QtCore.Qt.Key_End:
|
||||||
self.parent.onServiceEnd()
|
self.mainwindow.onServiceEnd()
|
||||||
event.accept()
|
event.accept()
|
||||||
elif event.key() == QtCore.Qt.Key_PageUp:
|
elif event.key() == QtCore.Qt.Key_PageUp:
|
||||||
self.parent.onServiceUp()
|
self.mainwindow.onServiceUp()
|
||||||
event.accept()
|
event.accept()
|
||||||
elif event.key() == QtCore.Qt.Key_PageDown:
|
elif event.key() == QtCore.Qt.Key_PageDown:
|
||||||
self.parent.onServiceDown()
|
self.mainwindow.onServiceDown()
|
||||||
event.accept()
|
event.accept()
|
||||||
elif event.key() == QtCore.Qt.Key_Up:
|
elif event.key() == QtCore.Qt.Key_Up:
|
||||||
self.parent.onMoveSelectionUp()
|
self.mainwindow.onMoveSelectionUp()
|
||||||
event.accept()
|
event.accept()
|
||||||
elif event.key() == QtCore.Qt.Key_Down:
|
elif event.key() == QtCore.Qt.Key_Down:
|
||||||
self.parent.onMoveSelectionDown()
|
self.mainwindow.onMoveSelectionDown()
|
||||||
event.accept()
|
event.accept()
|
||||||
event.ignore()
|
event.ignore()
|
||||||
else:
|
else:
|
||||||
@ -98,12 +98,12 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
the resources used into one OSZ file for use on any OpenLP v2 installation.
|
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.
|
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.
|
Sets up the service manager, toolbars, list view, et al.
|
||||||
"""
|
"""
|
||||||
QtGui.QWidget.__init__(self, parent)
|
QtGui.QWidget.__init__(self, parent)
|
||||||
self.parent = parent
|
self.mainwindow = mainwindow
|
||||||
self.serviceItems = []
|
self.serviceItems = []
|
||||||
self.serviceName = u''
|
self.serviceName = u''
|
||||||
self.suffixes = []
|
self.suffixes = []
|
||||||
@ -112,8 +112,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
# is a new service and has not been saved
|
# is a new service and has not been saved
|
||||||
self._modified = False
|
self._modified = False
|
||||||
self._fileName = u''
|
self._fileName = u''
|
||||||
self.serviceNoteForm = ServiceNoteForm(self.parent)
|
self.serviceNoteForm = ServiceNoteForm(self.mainwindow)
|
||||||
self.serviceItemEditForm = ServiceItemEditForm(self.parent)
|
self.serviceItemEditForm = ServiceItemEditForm(self.mainwindow)
|
||||||
# start with the layout
|
# start with the layout
|
||||||
self.layout = QtGui.QVBoxLayout(self)
|
self.layout = QtGui.QVBoxLayout(self)
|
||||||
self.layout.setSpacing(0)
|
self.layout.setSpacing(0)
|
||||||
@ -249,7 +249,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
QtCore.SIGNAL(u'service_item_update'), self.serviceItemUpdate)
|
QtCore.SIGNAL(u'service_item_update'), self.serviceItemUpdate)
|
||||||
# Last little bits of setting up
|
# Last little bits of setting up
|
||||||
self.service_theme = unicode(QtCore.QSettings().value(
|
self.service_theme = unicode(QtCore.QSettings().value(
|
||||||
self.parent.serviceSettingsSection + u'/service theme',
|
self.mainwindow.serviceSettingsSection + u'/service theme',
|
||||||
QtCore.QVariant(u'')).toString())
|
QtCore.QVariant(u'')).toString())
|
||||||
self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
|
self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
|
||||||
# build the drag and drop context menu
|
# build the drag and drop context menu
|
||||||
@ -296,7 +296,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
self._modified = modified
|
self._modified = modified
|
||||||
serviceFile = self.shortFileName() or u'Untitled Service'
|
serviceFile = self.shortFileName() or u'Untitled Service'
|
||||||
self.parent.setServiceModified(modified, serviceFile)
|
self.mainwindow.setServiceModified(modified, serviceFile)
|
||||||
|
|
||||||
def isModified(self):
|
def isModified(self):
|
||||||
"""
|
"""
|
||||||
@ -309,7 +309,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Setter for service file.
|
Setter for service file.
|
||||||
"""
|
"""
|
||||||
self._fileName = unicode(fileName)
|
self._fileName = unicode(fileName)
|
||||||
self.parent.setServiceModified(self.isModified(), self.shortFileName())
|
self.mainwindow.setServiceModified(self.isModified(),
|
||||||
|
self.shortFileName())
|
||||||
QtCore.QSettings(). \
|
QtCore.QSettings(). \
|
||||||
setValue(u'service/last file',QtCore.QVariant(fileName))
|
setValue(u'service/last file',QtCore.QVariant(fileName))
|
||||||
|
|
||||||
@ -343,7 +344,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Create a new service.
|
Create a new service.
|
||||||
"""
|
"""
|
||||||
if self.isModified():
|
if self.isModified():
|
||||||
result = QtGui.QMessageBox.question(self.parent,
|
result = QtGui.QMessageBox.question(self.mainwindow,
|
||||||
translate('OpenLP.ServiceManager', 'Save Changes'),
|
translate('OpenLP.ServiceManager', 'Save Changes'),
|
||||||
translate('OpenLP.ServiceManager', 'The current service has '
|
translate('OpenLP.ServiceManager', 'The current service has '
|
||||||
'been modified, would you like to save it?'),
|
'been modified, would you like to save it?'),
|
||||||
@ -358,7 +359,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
|
|
||||||
def onLoadServiceClicked(self):
|
def onLoadServiceClicked(self):
|
||||||
if self.isModified():
|
if self.isModified():
|
||||||
result = QtGui.QMessageBox.question(self.parent,
|
result = QtGui.QMessageBox.question(self.mainwindow,
|
||||||
translate('OpenLP.ServiceManager', 'Save Changes'),
|
translate('OpenLP.ServiceManager', 'Save Changes'),
|
||||||
translate('OpenLP.ServiceManager', 'The current service has '
|
translate('OpenLP.ServiceManager', 'The current service has '
|
||||||
'been modified, would you like to save it?'),
|
'been modified, would you like to save it?'),
|
||||||
@ -368,14 +369,14 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
return False
|
return False
|
||||||
elif result == QtGui.QMessageBox.Save:
|
elif result == QtGui.QMessageBox.Save:
|
||||||
self.saveFile()
|
self.saveFile()
|
||||||
fileName = unicode(QtGui.QFileDialog.getOpenFileName(self.parent,
|
fileName = unicode(QtGui.QFileDialog.getOpenFileName(self.mainwindow,
|
||||||
translate('OpenLP.ServiceManager', 'Open File'),
|
translate('OpenLP.ServiceManager', 'Open File'),
|
||||||
SettingsManager.get_last_dir(self.parent.serviceSettingsSection),
|
SettingsManager.get_last_dir(self.mainwindow.serviceSettingsSection),
|
||||||
translate('OpenLP.ServiceManager',
|
translate('OpenLP.ServiceManager',
|
||||||
'OpenLP Service Files (*.osz)')))
|
'OpenLP Service Files (*.osz)')))
|
||||||
if not fileName:
|
if not fileName:
|
||||||
return False
|
return False
|
||||||
SettingsManager.set_last_dir(self.parent.serviceSettingsSection,
|
SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection,
|
||||||
split_filename(fileName)[0])
|
split_filename(fileName)[0])
|
||||||
self.loadFile(fileName)
|
self.loadFile(fileName)
|
||||||
|
|
||||||
@ -409,7 +410,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
fileName = self.fileName()
|
fileName = self.fileName()
|
||||||
log.debug(u'ServiceManager.saveFile - %s' % 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])
|
split_filename(fileName)[0])
|
||||||
service = []
|
service = []
|
||||||
serviceFileName = fileName.replace(u'.osz', u'.osd')
|
serviceFileName = fileName.replace(u'.osz', u'.osd')
|
||||||
@ -449,7 +450,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
# if not present do not worry
|
# if not present do not worry
|
||||||
pass
|
pass
|
||||||
self.parent.addRecentFile(fileName)
|
self.mainwindow.addRecentFile(fileName)
|
||||||
self.setModified(False)
|
self.setModified(False)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -458,9 +459,9 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Get a file name and then call :function:`ServiceManager.saveFile` to
|
Get a file name and then call :function:`ServiceManager.saveFile` to
|
||||||
save the file.
|
save the file.
|
||||||
"""
|
"""
|
||||||
fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.parent,
|
fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow,
|
||||||
translate('OpenLP.ServiceManager', 'Save Service'),
|
translate('OpenLP.ServiceManager', 'Save Service'),
|
||||||
SettingsManager.get_last_dir(self.parent.serviceSettingsSection),
|
SettingsManager.get_last_dir(self.mainwindow.serviceSettingsSection),
|
||||||
translate('OpenLP.ServiceManager',
|
translate('OpenLP.ServiceManager',
|
||||||
'OpenLP Service Files (*.osz)')))
|
'OpenLP Service Files (*.osz)')))
|
||||||
if not fileName:
|
if not fileName:
|
||||||
@ -510,7 +511,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.newFile()
|
self.newFile()
|
||||||
for item in items:
|
for item in items:
|
||||||
serviceItem = ServiceItem()
|
serviceItem = ServiceItem()
|
||||||
serviceItem.render_manager = self.parent.renderManager
|
serviceItem.render_manager = self.mainwindow.renderManager
|
||||||
serviceItem.set_from_service(item, self.servicePath)
|
serviceItem.set_from_service(item, self.servicePath)
|
||||||
self.validateItem(serviceItem)
|
self.validateItem(serviceItem)
|
||||||
self.addServiceItem(serviceItem)
|
self.addServiceItem(serviceItem)
|
||||||
@ -537,7 +538,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
if zip:
|
if zip:
|
||||||
zip.close()
|
zip.close()
|
||||||
self.setFileName(fileName)
|
self.setFileName(fileName)
|
||||||
self.parent.addRecentFile(fileName)
|
self.mainwindow.addRecentFile(fileName)
|
||||||
self.setModified(False)
|
self.setModified(False)
|
||||||
QtCore.QSettings(). \
|
QtCore.QSettings(). \
|
||||||
setValue(u'service/last file',QtCore.QVariant(fileName))
|
setValue(u'service/last file',QtCore.QVariant(fileName))
|
||||||
@ -888,9 +889,9 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'onThemeComboBoxSelected')
|
log.debug(u'onThemeComboBoxSelected')
|
||||||
self.service_theme = unicode(self.themeComboBox.currentText())
|
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(
|
QtCore.QSettings().setValue(
|
||||||
self.parent.serviceSettingsSection + u'/service theme',
|
self.mainwindow.serviceSettingsSection + u'/service theme',
|
||||||
QtCore.QVariant(self.service_theme))
|
QtCore.QVariant(self.service_theme))
|
||||||
self.regenerateServiceItems()
|
self.regenerateServiceItems()
|
||||||
|
|
||||||
@ -900,7 +901,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
sure the theme combo box is in the correct state.
|
sure the theme combo box is in the correct state.
|
||||||
"""
|
"""
|
||||||
log.debug(u'themeChange')
|
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'ThemeLabel'].setVisible(False)
|
||||||
self.toolbar.actions[u'ThemeWidget'].setVisible(False)
|
self.toolbar.actions[u'ThemeWidget'].setVisible(False)
|
||||||
else:
|
else:
|
||||||
@ -915,7 +916,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Receiver.send_message(u'cursor_busy')
|
Receiver.send_message(u'cursor_busy')
|
||||||
log.debug(u'regenerateServiceItems')
|
log.debug(u'regenerateServiceItems')
|
||||||
# force reset of renderer as theme data has changed
|
# force reset of renderer as theme data has changed
|
||||||
self.parent.renderManager.themedata = None
|
self.mainwindow.renderManager.themedata = None
|
||||||
if self.serviceItems:
|
if self.serviceItems:
|
||||||
tempServiceItems = self.serviceItems
|
tempServiceItems = self.serviceItems
|
||||||
self.serviceManagerList.clear()
|
self.serviceManagerList.clear()
|
||||||
@ -950,7 +951,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
newItem.merge(item[u'service_item'])
|
newItem.merge(item[u'service_item'])
|
||||||
item[u'service_item'] = newItem
|
item[u'service_item'] = newItem
|
||||||
self.repaintServiceList(itemcount + 1, 0)
|
self.repaintServiceList(itemcount + 1, 0)
|
||||||
self.parent.liveController.replaceServiceManagerItem(newItem)
|
self.mainwindow.liveController.replaceServiceManagerItem(newItem)
|
||||||
self.setModified(True)
|
self.setModified(True)
|
||||||
|
|
||||||
def addServiceItem(self, item, rebuild=False, expand=None, replace=False):
|
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'])
|
item.merge(self.serviceItems[sitem][u'service_item'])
|
||||||
self.serviceItems[sitem][u'service_item'] = item
|
self.serviceItems[sitem][u'service_item'] = item
|
||||||
self.repaintServiceList(sitem + 1, 0)
|
self.repaintServiceList(sitem + 1, 0)
|
||||||
self.parent.liveController.replaceServiceManagerItem(item)
|
self.mainwindow.liveController.replaceServiceManagerItem(item)
|
||||||
else:
|
else:
|
||||||
# nothing selected for dnd
|
# nothing selected for dnd
|
||||||
if self.dropPosition == 0:
|
if self.dropPosition == 0:
|
||||||
@ -993,7 +994,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.repaintServiceList(self.dropPosition, 0)
|
self.repaintServiceList(self.dropPosition, 0)
|
||||||
# if rebuilding list make sure live is fixed.
|
# if rebuilding list make sure live is fixed.
|
||||||
if rebuild:
|
if rebuild:
|
||||||
self.parent.liveController.replaceServiceManagerItem(item)
|
self.mainwindow.liveController.replaceServiceManagerItem(item)
|
||||||
self.dropPosition = 0
|
self.dropPosition = 0
|
||||||
self.setModified(True)
|
self.setModified(True)
|
||||||
|
|
||||||
@ -1003,7 +1004,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
item, count = self.findServiceItem()
|
item, count = self.findServiceItem()
|
||||||
if self.serviceItems[item][u'service_item'].is_valid:
|
if self.serviceItems[item][u'service_item'].is_valid:
|
||||||
self.parent.previewController.addServiceManagerItem(
|
self.mainwindow.previewController.addServiceManagerItem(
|
||||||
self.serviceItems[item][u'service_item'], count)
|
self.serviceItems[item][u'service_item'], count)
|
||||||
else:
|
else:
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
@ -1027,18 +1028,18 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
item, count = self.findServiceItem()
|
item, count = self.findServiceItem()
|
||||||
if self.serviceItems[item][u'service_item'].is_valid:
|
if self.serviceItems[item][u'service_item'].is_valid:
|
||||||
self.parent.liveController.addServiceManagerItem(
|
self.mainwindow.liveController.addServiceManagerItem(
|
||||||
self.serviceItems[item][u'service_item'], count)
|
self.serviceItems[item][u'service_item'], count)
|
||||||
if QtCore.QSettings().value(
|
if QtCore.QSettings().value(
|
||||||
self.parent.generalSettingsSection + u'/auto preview',
|
self.mainwindow.generalSettingsSection + u'/auto preview',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
item += 1
|
item += 1
|
||||||
if self.serviceItems and item < len(self.serviceItems) and \
|
if self.serviceItems and item < len(self.serviceItems) and \
|
||||||
self.serviceItems[item][u'service_item'].is_capable(
|
self.serviceItems[item][u'service_item'].is_capable(
|
||||||
ItemCapabilities.AllowsPreview):
|
ItemCapabilities.AllowsPreview):
|
||||||
self.parent.previewController.addServiceManagerItem(
|
self.mainwindow.previewController.addServiceManagerItem(
|
||||||
self.serviceItems[item][u'service_item'], 0)
|
self.serviceItems[item][u'service_item'], 0)
|
||||||
self.parent.liveController.PreviewListWidget.setFocus()
|
self.mainwindow.liveController.PreviewListWidget.setFocus()
|
||||||
else:
|
else:
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('OpenLP.ServiceManager', 'Missing Display Handler'),
|
translate('OpenLP.ServiceManager', 'Missing Display Handler'),
|
||||||
@ -1158,7 +1159,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
index = 0
|
index = 0
|
||||||
self.service_theme = u''
|
self.service_theme = u''
|
||||||
self.themeComboBox.setCurrentIndex(index)
|
self.themeComboBox.setCurrentIndex(index)
|
||||||
self.parent.renderManager.set_service_theme(self.service_theme)
|
self.mainwindow.renderManager.set_service_theme(self.service_theme)
|
||||||
self.regenerateServiceItems()
|
self.regenerateServiceItems()
|
||||||
|
|
||||||
def onThemeChangeAction(self):
|
def onThemeChangeAction(self):
|
||||||
|
@ -212,8 +212,8 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
|||||||
"""
|
"""
|
||||||
Updates the lines on a page on the wizard
|
Updates the lines on a page on the wizard
|
||||||
"""
|
"""
|
||||||
self.mainLineCountLabel.setText(unicode(translate('OpenLP.ThemeForm', \
|
self.mainLineCountLabel.setText(unicode(translate('OpenLP.ThemeForm',
|
||||||
'(%d lines per slide)' % int(lines))))
|
'(%d lines per slide)')) % int(lines))
|
||||||
|
|
||||||
def resizeEvent(self, event=None):
|
def resizeEvent(self, event=None):
|
||||||
"""
|
"""
|
||||||
|
@ -45,13 +45,13 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Manages the orders of Theme.
|
Manages the orders of Theme.
|
||||||
"""
|
"""
|
||||||
def __init__(self, parent):
|
def __init__(self, mainwindow, parent=None):
|
||||||
QtGui.QWidget.__init__(self, parent)
|
QtGui.QWidget.__init__(self, parent)
|
||||||
self.parent = parent
|
self.mainwindow = mainwindow
|
||||||
self.settingsSection = u'themes'
|
self.settingsSection = u'themes'
|
||||||
self.themeForm = ThemeForm(self)
|
self.themeForm = ThemeForm(self)
|
||||||
self.fileRenameForm = FileRenameForm(self)
|
self.fileRenameForm = FileRenameForm(self)
|
||||||
self.serviceComboBox = self.parent.ServiceManagerContents.themeComboBox
|
self.serviceComboBox = self.mainwindow.ServiceManagerContents.themeComboBox
|
||||||
# start with the layout
|
# start with the layout
|
||||||
self.layout = QtGui.QVBoxLayout(self)
|
self.layout = QtGui.QVBoxLayout(self)
|
||||||
self.layout.setSpacing(0)
|
self.layout.setSpacing(0)
|
||||||
@ -252,7 +252,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
oldThemeData = self.getThemeData(oldThemeName)
|
oldThemeData = self.getThemeData(oldThemeName)
|
||||||
self.deleteTheme(oldThemeName)
|
self.deleteTheme(oldThemeName)
|
||||||
self.cloneThemeData(oldThemeData, newThemeName)
|
self.cloneThemeData(oldThemeData, newThemeName)
|
||||||
for plugin in self.parent.pluginManager.plugins:
|
for plugin in self.mainwindow.pluginManager.plugins:
|
||||||
if plugin.usesTheme(oldThemeName):
|
if plugin.usesTheme(oldThemeName):
|
||||||
plugin.renameTheme(oldThemeName, newThemeName)
|
plugin.renameTheme(oldThemeName, newThemeName)
|
||||||
|
|
||||||
@ -637,7 +637,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
Flag to tell message lines per page need to be generated.
|
Flag to tell message lines per page need to be generated.
|
||||||
"""
|
"""
|
||||||
log.debug(u'generateImage \n%s ', themeData)
|
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):
|
def getPreviewImage(self, theme):
|
||||||
"""
|
"""
|
||||||
@ -698,7 +698,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
return False
|
return False
|
||||||
# check for use in the system else where.
|
# check for use in the system else where.
|
||||||
if testPlugin:
|
if testPlugin:
|
||||||
for plugin in self.parent.pluginManager.plugins:
|
for plugin in self.mainwindow.pluginManager.plugins:
|
||||||
if plugin.usesTheme(theme):
|
if plugin.usesTheme(theme):
|
||||||
Receiver.send_message(u'openlp_error_message', {
|
Receiver.send_message(u'openlp_error_message', {
|
||||||
u'title': translate('OpenLP.ThemeManager',
|
u'title': translate('OpenLP.ThemeManager',
|
||||||
@ -765,4 +765,4 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
vAlignCorrection = 2
|
vAlignCorrection = 2
|
||||||
newtheme.display_horizontal_align = theme.HorizontalAlign
|
newtheme.display_horizontal_align = theme.HorizontalAlign
|
||||||
newtheme.display_vertical_align = vAlignCorrection
|
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.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
||||||
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||||
self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
||||||
self.mainLineCountLabel.setText(
|
|
||||||
translate('OpenLP.ThemeWizard', '(%d lines per slide)'))
|
|
||||||
self.lineSpacingLabel.setText(
|
self.lineSpacingLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Line Spacing:'))
|
translate('OpenLP.ThemeWizard', 'Line Spacing:'))
|
||||||
self.lineSpacingSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.lineSpacingSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
||||||
@ -569,17 +567,17 @@ class Ui_ThemeWizard(object):
|
|||||||
self.themeNameLabel.setText(
|
self.themeNameLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Theme name:'))
|
translate('OpenLP.ThemeWizard', 'Theme name:'))
|
||||||
# Align all QFormLayouts towards each other.
|
# Align all QFormLayouts towards each other.
|
||||||
width = max(self.backgroundLabel.minimumSizeHint().width(),
|
labelWidth = max(self.backgroundLabel.minimumSizeHint().width(),
|
||||||
self.colorLabel.minimumSizeHint().width())
|
self.colorLabel.minimumSizeHint().width(),
|
||||||
width = max(width, self.gradientStartLabel.minimumSizeHint().width())
|
self.gradientStartLabel.minimumSizeHint().width(),
|
||||||
width = max(width, self.gradientEndLabel.minimumSizeHint().width())
|
self.gradientEndLabel.minimumSizeHint().width(),
|
||||||
width = max(width, self.gradientTypeLabel.minimumSizeHint().width())
|
self.gradientTypeLabel.minimumSizeHint().width(),
|
||||||
width = max(width, self.imageLabel.minimumSizeHint().width())
|
self.imageLabel.minimumSizeHint().width())
|
||||||
self.backgroundTypeSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
|
self.backgroundTypeSpacer.changeSize(labelWidth, 0,
|
||||||
QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||||
self.colorSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
|
self.colorSpacer.changeSize(labelWidth, 0,
|
||||||
QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||||
self.gradientSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
|
self.gradientSpacer.changeSize(labelWidth, 0,
|
||||||
QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||||
self.imageSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
|
self.imageSpacer.changeSize(labelWidth, 0,
|
||||||
QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||||
|
@ -73,7 +73,7 @@ class AlertsPlugin(Plugin):
|
|||||||
self.toolsAlertItem.setStatusTip(
|
self.toolsAlertItem.setStatusTip(
|
||||||
translate('AlertsPlugin', 'Show an alert message.'))
|
translate('AlertsPlugin', 'Show an alert message.'))
|
||||||
self.toolsAlertItem.setShortcut(u'F7')
|
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.QObject.connect(self.toolsAlertItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onAlertsTrigger)
|
QtCore.SIGNAL(u'triggered()'), self.onAlertsTrigger)
|
||||||
self.toolsAlertItem.setVisible(False)
|
self.toolsAlertItem.setVisible(False)
|
||||||
|
@ -373,19 +373,19 @@ class Ui_BibleImportWizard(object):
|
|||||||
'you want to use this importer, you will need to install the '
|
'you want to use this importer, you will need to install the '
|
||||||
'"python-sqlite" module.'))
|
'"python-sqlite" module.'))
|
||||||
# Align all QFormLayouts towards each other.
|
# Align all QFormLayouts towards each other.
|
||||||
width = max(self.formatLabel.minimumSizeHint().width(),
|
labelWidth = max(self.formatLabel.minimumSizeHint().width(),
|
||||||
self.osisFileLabel.minimumSizeHint().width())
|
self.osisFileLabel.minimumSizeHint().width(),
|
||||||
width = max(width, self.csvBooksLabel.minimumSizeHint().width())
|
self.csvBooksLabel.minimumSizeHint().width(),
|
||||||
width = max(width, self.csvVersesLabel.minimumSizeHint().width())
|
self.csvVersesLabel.minimumSizeHint().width(),
|
||||||
width = max(width, self.openSongFileLabel.minimumSizeHint().width())
|
self.openSongFileLabel.minimumSizeHint().width(),
|
||||||
width = max(width, self.openlp1FileLabel.minimumSizeHint().width())
|
self.openlp1FileLabel.minimumSizeHint().width())
|
||||||
self.formatSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
|
self.formatSpacer.changeSize(labelWidth, 0,
|
||||||
QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||||
self.osisSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
|
self.osisSpacer.changeSize(labelWidth, 0,
|
||||||
QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||||
self.csvSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
|
self.csvSpacer.changeSize(labelWidth, 0,
|
||||||
QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||||
self.openSongSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
|
self.openSongSpacer.changeSize(labelWidth, 0,
|
||||||
QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||||
self.openlp1Spacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
|
self.openlp1Spacer.changeSize(labelWidth, 0,
|
||||||
QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||||
|
@ -309,7 +309,7 @@ class BSExtract(object):
|
|||||||
finally:
|
finally:
|
||||||
if not content:
|
if not content:
|
||||||
return None
|
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 = {}
|
verses = {}
|
||||||
for verse in content:
|
for verse in content:
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
@ -36,8 +36,6 @@ class Ui_SongMaintenanceDialog(object):
|
|||||||
self.dialogLayout = QtGui.QGridLayout(songMaintenanceDialog)
|
self.dialogLayout = QtGui.QGridLayout(songMaintenanceDialog)
|
||||||
self.dialogLayout.setObjectName(u'dialogLayout')
|
self.dialogLayout.setObjectName(u'dialogLayout')
|
||||||
self.typeListWidget = QtGui.QListWidget(songMaintenanceDialog)
|
self.typeListWidget = QtGui.QListWidget(songMaintenanceDialog)
|
||||||
# Caution: fixed widget width
|
|
||||||
self.typeListWidget.setFixedWidth(172)
|
|
||||||
self.typeListWidget.setIconSize(QtCore.QSize(32, 32))
|
self.typeListWidget.setIconSize(QtCore.QSize(32, 32))
|
||||||
self.typeListWidget.setUniformItemSizes(True)
|
self.typeListWidget.setUniformItemSizes(True)
|
||||||
self.typeListWidget.setObjectName(u'typeListWidget')
|
self.typeListWidget.setObjectName(u'typeListWidget')
|
||||||
@ -147,12 +145,12 @@ class Ui_SongMaintenanceDialog(object):
|
|||||||
def retranslateUi(self, songMaintenanceDialog):
|
def retranslateUi(self, songMaintenanceDialog):
|
||||||
songMaintenanceDialog.setWindowTitle(
|
songMaintenanceDialog.setWindowTitle(
|
||||||
translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance'))
|
translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance'))
|
||||||
self.listItemAuthors.setText(
|
authorsString = translate('SongsPlugin.SongMaintenanceForm', 'Authors')
|
||||||
translate('SongsPlugin.SongMaintenanceForm', 'Authors'))
|
topicsString = translate('SongsPlugin.SongMaintenanceForm', 'Topics')
|
||||||
self.listItemTopics.setText(
|
booksString = translate('SongsPlugin.SongMaintenanceForm', 'Song Books')
|
||||||
translate('SongsPlugin.SongMaintenanceForm', 'Topics'))
|
self.listItemAuthors.setText(authorsString)
|
||||||
self.listItemBooks.setText(
|
self.listItemTopics.setText(topicsString)
|
||||||
translate('SongsPlugin.SongMaintenanceForm', 'Song Books'))
|
self.listItemBooks.setText(booksString)
|
||||||
self.authorsAddButton.setText(
|
self.authorsAddButton.setText(
|
||||||
translate('SongsPlugin.SongMaintenanceForm', '&Add'))
|
translate('SongsPlugin.SongMaintenanceForm', '&Add'))
|
||||||
self.authorsEditButton.setText(
|
self.authorsEditButton.setText(
|
||||||
@ -171,3 +169,8 @@ class Ui_SongMaintenanceDialog(object):
|
|||||||
translate('SongsPlugin.SongMaintenanceForm', '&Edit'))
|
translate('SongsPlugin.SongMaintenanceForm', '&Edit'))
|
||||||
self.booksDeleteButton.setText(
|
self.booksDeleteButton.setText(
|
||||||
translate('SongsPlugin.SongMaintenanceForm', '&Delete'))
|
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