Head r727 and C style fix

This commit is contained in:
Jon Tibble 2010-03-08 19:43:37 +00:00
commit 54c4bc9c19
7 changed files with 28 additions and 14 deletions

View File

@ -41,7 +41,6 @@ class ServiceManagerList(QtGui.QTreeWidget):
def __init__(self, parent=None, name=None):
QtGui.QTreeWidget.__init__(self,parent)
self.parent = parent
self.setExpandsOnDoubleClick(False)
def keyPressEvent(self, event):
if type(event) == QtGui.QKeyEvent:
@ -249,6 +248,7 @@ class ServiceManager(QtGui.QWidget):
if self.serviceItemNoteForm.exec_():
self.serviceItems[item][u'service_item'].notes = \
self.serviceItemNoteForm.textEdit.toPlainText()
self.repaintServiceList(item, 0)
def nextItem(self):
"""
@ -428,15 +428,29 @@ class ServiceManager(QtGui.QWidget):
for itemcount, item in enumerate(self.serviceItems):
serviceitem = item[u'service_item']
treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList)
treewidgetitem.setText(0,serviceitem.title)
treewidgetitem.setIcon(0,serviceitem.iconic_representation)
if len(serviceitem.notes) > 0:
icon = QtGui.QImage(serviceitem.icon)
icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio,
QtCore.Qt.SmoothTransformation)
overlay = QtGui.QImage(':/services/service_item_notes.png')
overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio,
QtCore.Qt.SmoothTransformation)
painter = QtGui.QPainter(icon)
painter.drawImage(0, 0, overlay)
painter.end()
treewidgetitem.setIcon(0, build_icon(icon))
else:
treewidgetitem.setIcon(0, serviceitem.iconic_representation)
treewidgetitem.setText(0, serviceitem.title)
treewidgetitem.setToolTip(0, serviceitem.notes)
treewidgetitem.setData(0, QtCore.Qt.UserRole,
QtCore.QVariant(item[u'order']))
treewidgetitem.setExpanded(item[u'expanded'])
for count, frame in enumerate(serviceitem.get_frames()):
treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem)
text = frame[u'title']
treewidgetitem1.setText(0,text[:40])
treewidgetitem1.setText(0, text[:40])
treewidgetitem1.setData(0, QtCore.Qt.UserRole,
QtCore.QVariant(count))
if serviceItem == itemcount and serviceItemCount == count:
@ -593,12 +607,12 @@ class ServiceManager(QtGui.QWidget):
self.serviceItems = []
self.isNew = True
for item in tempServiceItems:
self.addServiceItem(item[u'service_item'], True)
self.addServiceItem(item[u'service_item'], False, item[u'expanded'])
#Set to False as items may have changed rendering
#does not impact the saved song so True may aslo be valid
self.parent.serviceChanged(False, self.serviceName)
def addServiceItem(self, item, rebuild=False):
def addServiceItem(self, item, rebuild=False, expand=True):
"""
Add a Service item to the list
@ -618,12 +632,12 @@ class ServiceManager(QtGui.QWidget):
if sitem == -1:
self.serviceItems.append({u'service_item': item,
u'order': len(self.serviceItems) + 1,
u'expanded':True})
u'expanded':expand})
self.repaintServiceList(len(self.serviceItems) + 1, 0)
else:
self.serviceItems.insert(sitem + 1, {u'service_item': item,
u'order': len(self.serviceItems)+1,
u'expanded':True})
u'expanded':expand})
self.repaintServiceList(sitem + 1, 0)
#if rebuilding list make sure live is fixed.
if rebuild:

View File

@ -33,13 +33,12 @@ log = logging.getLogger(__name__)
def check_latest_version(config, current_version):
version_string = current_version
#set to prod in the distribution confif file.
environment = config.get_config(u'run environment', u'dev')
last_test = config.get_config(u'last version test', datetime.now().date())
this_test = unicode(datetime.now().date())
config.set_config(u'last version test', this_test)
if last_test != this_test:
version_string = u''
req = urllib2.Request(u'http://www.openlp.org/files/%s_version.txt' % environment)
req = urllib2.Request(u'http://www.openlp.org/files/version.txt')
req.add_header(u'User-Agent', u'OpenLP/%s' % current_version)
try:
handle = urllib2.urlopen(req, None)

View File

@ -61,7 +61,7 @@ class ImageMediaItem(MediaManagerItem):
def retranslateUi(self):
self.OnNewPrompt = self.trUtf8('Select Image(s)')
self.OnNewFileMasks = \
self.trUtf8('Images (*.jpg *jpeg *.gif *.png *.bmp)')
self.trUtf8('Images (*.jpg *jpeg *.gif *.png *.bmp);; All files (*)')
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)

View File

@ -30,7 +30,7 @@ if os.name == u'nt':
from ctypes import *
from ctypes.wintypes import RECT
from presentationcontroller import PresentationController, PresentationDocument
from presentationcontroller import PresentationController, PresentationDocument
log = logging.getLogger(__name__)
@ -122,7 +122,7 @@ class PptviewDocument(PresentationDocument):
rendermanager = self.controller.plugin.render_manager
rect = rendermanager.screens.current[u'size']
rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom())
filepath = str(self.filepath.replace(u'/', u'\\'));
filepath = str(self.filepath.replace(u'/', u'\\'))
try:
self.pptid = self.controller.process.OpenPPT(filepath, None, rect,
str(os.path.join(self.thumbnailpath, self.controller.thumbnailprefix)))

View File

@ -78,6 +78,7 @@
<qresource prefix="services">
<file>service_edit.png</file>
<file>service_notes.png</file>
<file>service_item_notes.png</file>
<file>service_bottom.png</file>
<file>service_down.png</file>
<file>service_top.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 B

View File

@ -1 +1 @@
1.9.0-723
1.9.0-725