openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #01175
[Merge] lp:~trb143/openlp/futures into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/futures into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Fixes to rendering
Fix to drop and drag
--
https://code.launchpad.net/~trb143/openlp/futures/+merge/21323
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py 2010-03-11 08:11:36 +0000
+++ openlp/core/lib/renderer.py 2010-03-14 07:59:14 +0000
@@ -43,7 +43,6 @@
"""
self._rect = None
self._debug = False
- self._right_margin = 64 # the amount of right indent
self._display_shadow_size_footer = 0
self._display_outline_size_footer = 0
self.theme_name = None
@@ -149,7 +148,7 @@
def pre_render_text(self, text):
metrics = QtGui.QFontMetrics(self.mainFont)
#work out line width
- line_width = self._rect.width() - self._right_margin
+ line_width = self._rect.width()
#number of lines on a page - adjust for rounding up.
line_height = metrics.height()
if self._theme.display_shadow:
@@ -224,6 +223,7 @@
``rect_footer``
The footer text block.
"""
+ log.debug(u'set_text_rectangle %s , %s' %(rect_main, rect_footer) )
self._rect = rect_main
self._rect_footer = rect_footer
@@ -447,8 +447,7 @@
rightextent = x + w
# shift right from last line's rh edge
if self._theme.display_wrapStyle == 1 and linenum != 0:
- rightextent = self._first_line_right_extent + \
- self._right_margin
+ rightextent = self._first_line_right_extent
if rightextent > maxx:
rightextent = maxx
x = rightextent - w
=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py 2010-02-27 15:31:23 +0000
+++ openlp/core/lib/rendermanager.py 2010-03-14 07:59:14 +0000
@@ -146,13 +146,13 @@
footer_rect = None
if not theme.font_main_override:
main_rect = QtCore.QRect(10, 0,
- self.width - 1, self.footer_start)
+ self.width - 20, self.footer_start)
else:
main_rect = QtCore.QRect(theme.font_main_x, theme.font_main_y,
theme.font_main_width - 1, theme.font_main_height - 1)
if not theme.font_footer_override:
footer_rect = QtCore.QRect(10, self.footer_start,
- self.width - 1, self.height - self.footer_start)
+ self.width - 20, self.height - self.footer_start)
else:
footer_rect = QtCore.QRect(theme.font_footer_x,
theme.font_footer_y, theme.font_footer_width - 1,
=== modified file 'openlp/core/lib/themexmlhandler.py'
--- openlp/core/lib/themexmlhandler.py 2010-03-09 19:43:11 +0000
+++ openlp/core/lib/themexmlhandler.py 2010-03-14 07:59:14 +0000
@@ -53,7 +53,7 @@
<weight>Normal</weight>
<italics>False</italics>
<indentation>0</indentation>
- <location override="False" x="10" y="10" width="1024" height="730"/>
+ <location override="False" x="10" y="10" width="1004" height="730"/>
</font>
<font type="footer">
<name>Arial</name>
@@ -62,7 +62,7 @@
<weight>Normal</weight>
<italics>False</italics>
<indentation>0</indentation>
- <location override="False" x="10" y="730" width="1024" height="38"/>
+ <location override="False" x="10" y="730" width="1004" height="38"/>
</font>
<display>
<shadow color="#000000" size="5">True</shadow>
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2010-03-09 20:29:45 +0000
+++ openlp/core/ui/mainwindow.py 2010-03-14 07:59:14 +0000
@@ -621,6 +621,8 @@
self.screens.set_current_display(updated_display)
self.RenderManager.update_display(updated_display)
self.mainDisplay.setup(updated_display)
+ #Trigger after changes have been made
+ Receiver.send_message(u'config_updated')
self.activateWindow()
def closeEvent(self, event):
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2010-03-12 19:39:15 +0000
+++ openlp/core/ui/servicemanager.py 2010-03-14 07:59:14 +0000
@@ -100,6 +100,7 @@
self.parent = parent
self.serviceItems = []
self.serviceName = u''
+ self.droppos = 0
#is a new service and has not been saved
self.isNew = True
#Indicates if remoteTriggering is active. If it is the next addServiceItem call
@@ -190,6 +191,8 @@
QtCore.SIGNAL(u'presentation types'), self.onPresentationTypes)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'servicemanager_next_item'), self.nextItem)
+ QtCore.QObject.connect(Receiver.get_receiver(),
+ QtCore.SIGNAL(u'config_updated'), self.regenerateServiceItems)
# Last little bits of setting up
self.config = PluginConfig(u'ServiceManager')
self.servicePath = self.config.get_data_path()
@@ -617,7 +620,7 @@
for item in tempServiceItems:
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
+ #does not impact the saved song so True may also be valid
self.parent.serviceChanged(False, self.serviceName)
def addServiceItem(self, item, rebuild=False, expand=True):
@@ -637,19 +640,21 @@
self.repaintServiceList(sitem + 1, 0)
self.parent.LiveController.replaceServiceManagerItem(item)
else:
- if sitem == -1:
+ #nothing selected or dnd
+ if self.droppos == 0:
self.serviceItems.append({u'service_item': item,
u'order': len(self.serviceItems) + 1,
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,
+ self.serviceItems.insert(self.droppos, {u'service_item': item,
+ u'order': self.droppos,
u'expanded':expand})
- self.repaintServiceList(sitem + 1, 0)
+ self.repaintServiceList(self.droppos, 0)
#if rebuilding list make sure live is fixed.
if rebuild:
self.parent.LiveController.replaceServiceManagerItem(item)
+ self.droppos = 0
self.parent.serviceChanged(False, self.serviceName)
def makePreview(self):
@@ -730,9 +735,9 @@
link = event.mimeData()
if link.hasText():
plugin = event.mimeData().text()
+ item = self.ServiceManagerList.itemAt(event.pos())
if plugin == u'ServiceManager':
startpos, startCount = self.findServiceItem()
- item = self.ServiceManagerList.itemAt(event.pos())
if item is None:
endpos = len(self.serviceItems)
else:
@@ -751,6 +756,14 @@
self.serviceItems.insert(newpos, serviceItem)
self.repaintServiceList(endpos, startCount)
else:
+ if item == None:
+ self.droppos = len(self.serviceItems)
+ else:
+ parentitem = item.parent()
+ if parentitem is None:
+ self.droppos = item.data(0, QtCore.Qt.UserRole).toInt()[0]
+ else:
+ self.droppos = parentitem.data(0, QtCore.Qt.UserRole).toInt()[0]
Receiver.send_message(u'%s_add_service_item' % plugin)
def updateThemeList(self, theme_list):
=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py 2010-03-04 22:09:03 +0000
+++ openlp/core/ui/settingsform.py 2010-03-14 07:59:14 +0000
@@ -65,7 +65,6 @@
def accept(self):
for tab_index in range(0, self.SettingsTabWidget.count()):
self.SettingsTabWidget.widget(tab_index).save()
- Receiver.send_message(u'config_updated')
return QtGui.QDialog.accept(self)
def postSetUp(self):
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2010-03-12 15:38:56 +0000
+++ openlp/core/ui/slidecontroller.py 2010-03-14 07:59:14 +0000
@@ -299,6 +299,8 @@
QtCore.SIGNAL(u'%s_change' % prefix), self.onSlideChange)
QtCore.QObject.connect(self.Splitter,
QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter)
+ QtCore.QObject.connect(Receiver.get_receiver(),
+ QtCore.SIGNAL(u'config_updated'), self.refreshServiceItem)
def widthChanged(self):
"""
@@ -377,6 +379,17 @@
self.Mediabar.setVisible(True)
self.volumeSlider.setAudioOutput(self.audio)
+ def refreshServiceItem(self):
+ """
+ Method to update the service item if the screen has changed
+ """
+ log.debug(u'refreshServiceItem')
+ if self.serviceItem:
+ if self.serviceItem.is_text() or self.serviceItem.is_image():
+ item = self.serviceItem
+ item.render()
+ self.addServiceManagerItem(item, self.selectedRow)
+
def addServiceItem(self, item):
"""
Method to install the service item into the controller
Follow ups