bzr-revno: 1207
This commit is contained in:
Jon Tibble 2011-01-11 15:52:20 +00:00
commit 807b1f2be1
4 changed files with 14 additions and 12 deletions

View File

@ -59,7 +59,7 @@ class DisplayTagTab(SettingsTab):
# cPickle only accepts str not unicode strings # cPickle only accepts str not unicode strings
user_expands_string = str(unicode(user_expands).encode(u'utf8')) user_expands_string = str(unicode(user_expands).encode(u'utf8'))
if user_expands_string: if user_expands_string:
user_tags = cPickle.loads(user_expand_string) user_tags = cPickle.loads(user_expands_string)
# If we have some user ones added them as well # If we have some user ones added them as well
for t in user_tags: for t in user_tags:
DisplayTags.add_html_tag(t) DisplayTags.add_html_tag(t)

View File

@ -371,9 +371,9 @@ class ServiceManager(QtGui.QWidget):
self.saveFile() self.saveFile()
fileName = unicode(QtGui.QFileDialog.getOpenFileName(self.mainwindow, fileName = unicode(QtGui.QFileDialog.getOpenFileName(self.mainwindow,
translate('OpenLP.ServiceManager', 'Open File'), translate('OpenLP.ServiceManager', 'Open File'),
SettingsManager.get_last_dir(self.mainwindow.serviceSettingsSection), SettingsManager.get_last_dir(
translate('OpenLP.ServiceManager', self.mainwindow.serviceSettingsSection),
'OpenLP Service Files (*.osz)'))) translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)')))
if not fileName: if not fileName:
return False return False
SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection, SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection,
@ -461,9 +461,9 @@ class ServiceManager(QtGui.QWidget):
""" """
fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow, fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow,
translate('OpenLP.ServiceManager', 'Save Service'), translate('OpenLP.ServiceManager', 'Save Service'),
SettingsManager.get_last_dir(self.mainwindow.serviceSettingsSection), SettingsManager.get_last_dir(
translate('OpenLP.ServiceManager', self.mainwindow.serviceSettingsSection),
'OpenLP Service Files (*.osz)'))) translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)')))
if not fileName: if not fileName:
return False return False
if os.path.splitext(fileName)[1] == u'': if os.path.splitext(fileName)[1] == u'':
@ -482,7 +482,7 @@ class ServiceManager(QtGui.QWidget):
zip = None zip = None
fileTo = None fileTo = None
try: try:
zip = zipfile.ZipFile(unicode(fileName)) zip = zipfile.ZipFile(fileName)
for file in zip.namelist(): for file in zip.namelist():
try: try:
ucsfile = file.decode(u'utf-8') ucsfile = file.decode(u'utf-8')
@ -951,7 +951,8 @@ 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.mainwindow.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):

View File

@ -51,7 +51,8 @@ class ThemeManager(QtGui.QWidget):
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.mainwindow.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)
@ -638,7 +639,8 @@ 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.mainwindow.renderManager.generate_preview(themeData, forcePage) return self.mainwindow.renderManager.generate_preview(
themeData, forcePage)
def getPreviewImage(self, theme): def getPreviewImage(self, theme):
""" """

View File

@ -25,7 +25,6 @@
############################################################################### ###############################################################################
import logging import logging
import time
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui