forked from openlp/openlp
Fix bugs in theme and slidecontroller
bzr-revno: 664
This commit is contained in:
commit
00ed999964
@ -26,11 +26,13 @@
|
|||||||
The :mod:`lib` module contains most of the components and libraries that make
|
The :mod:`lib` module contains most of the components and libraries that make
|
||||||
OpenLP work.
|
OpenLP work.
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
import types
|
import types
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
def translate(context, text):
|
def translate(context, text):
|
||||||
"""
|
"""
|
||||||
A special shortcut method to wrap around the Qt4 translation functions.
|
A special shortcut method to wrap around the Qt4 translation functions.
|
||||||
@ -60,7 +62,9 @@ def file_to_xml(xmlfile):
|
|||||||
file = open(xmlfile, u'r')
|
file = open(xmlfile, u'r')
|
||||||
xml = file.read()
|
xml = file.read()
|
||||||
except IOError:
|
except IOError:
|
||||||
log.exception(u'Failed to open XML file')
|
#This may not be an error as this is also used to check
|
||||||
|
#that a file exist
|
||||||
|
log.error(u'Failed to open XML file %s' % xmlfile)
|
||||||
finally:
|
finally:
|
||||||
if file:
|
if file:
|
||||||
file.close()
|
file.close()
|
||||||
|
@ -253,7 +253,7 @@ class RenderManager(object):
|
|||||||
newImage = QtGui.QImage(w, h, QtGui.QImage.Format_ARGB32_Premultiplied)
|
newImage = QtGui.QImage(w, h, QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||||
newImage.fill(QtCore.Qt.black)
|
newImage.fill(QtCore.Qt.black)
|
||||||
painter = QtGui.QPainter(newImage)
|
painter = QtGui.QPainter(newImage)
|
||||||
painter.drawImage((w-realw) / 2, (h-realh) / 2, preview)
|
painter.drawImage((w - realw) / 2, (h - realh) / 2, preview)
|
||||||
return newImage
|
return newImage
|
||||||
|
|
||||||
def calculate_default(self, screen):
|
def calculate_default(self, screen):
|
||||||
|
@ -300,8 +300,14 @@ class Ui_MainWindow(object):
|
|||||||
# Connect up some signals and slots
|
# Connect up some signals and slots
|
||||||
QtCore.QObject.connect(self.FileExitItem,
|
QtCore.QObject.connect(self.FileExitItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), MainWindow.close)
|
QtCore.SIGNAL(u'triggered()'), MainWindow.close)
|
||||||
|
QtCore.QObject.connect(self.ControlSplitter,
|
||||||
|
QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter)
|
||||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||||
|
|
||||||
|
def trackSplitter(self, tab, pos):
|
||||||
|
#print tab, pos
|
||||||
|
pass
|
||||||
|
|
||||||
def retranslateUi(self, MainWindow):
|
def retranslateUi(self, MainWindow):
|
||||||
"""
|
"""
|
||||||
Set up the translation system
|
Set up the translation system
|
||||||
|
@ -219,7 +219,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.PreviewFrame = QtGui.QFrame(self.Splitter)
|
self.PreviewFrame = QtGui.QFrame(self.Splitter)
|
||||||
self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225))
|
self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225))
|
||||||
self.PreviewFrame.setSizePolicy(QtGui.QSizePolicy(
|
self.PreviewFrame.setSizePolicy(QtGui.QSizePolicy(
|
||||||
QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum))
|
QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Label))
|
||||||
self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel)
|
self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel)
|
||||||
self.PreviewFrame.setFrameShadow(QtGui.QFrame.Sunken)
|
self.PreviewFrame.setFrameShadow(QtGui.QFrame.Sunken)
|
||||||
self.PreviewFrame.setObjectName(u'PreviewFrame')
|
self.PreviewFrame.setObjectName(u'PreviewFrame')
|
||||||
@ -319,7 +319,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
if item.verse_order:
|
if item.verse_order:
|
||||||
verses = item.verse_order.split(u' ')
|
verses = item.verse_order.split(u' ')
|
||||||
for verse in verses:
|
for verse in verses:
|
||||||
if int(verse) > 12:
|
if not verse or int(verse) > 12:
|
||||||
break
|
break
|
||||||
try:
|
try:
|
||||||
self.Songbar.actions[verse].setVisible(True)
|
self.Songbar.actions[verse].setVisible(True)
|
||||||
|
@ -271,7 +271,6 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
return self.themelist
|
return self.themelist
|
||||||
|
|
||||||
def getThemeData(self, themename):
|
def getThemeData(self, themename):
|
||||||
assert(themename)
|
|
||||||
log.debug(u'getthemedata for theme %s', themename)
|
log.debug(u'getthemedata for theme %s', themename)
|
||||||
xml_file = os.path.join(self.path, unicode(themename),
|
xml_file = os.path.join(self.path, unicode(themename),
|
||||||
unicode(themename) + u'.xml')
|
unicode(themename) + u'.xml')
|
||||||
|
@ -1 +1 @@
|
|||||||
1.9.0-663
|
1.9.0-664
|
||||||
|
Loading…
Reference in New Issue
Block a user