openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #07040
[Merge] lp:~j-corwin/openlp/general into lp:openlp
Jonathan Corwin has proposed merging lp:~j-corwin/openlp/general into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #634771 in OpenLP: "OpenLP 1.9.2+bzr1016-0ubuntu1~lucid1 does not start"
https://bugs.launchpad.net/openlp/+bug/634771
Bug #646718 in OpenLP: "Songbook, Number will not loaded, Title will not be saved"
https://bugs.launchpad.net/openlp/+bug/646718
Bug #696013 in OpenLP: "song import from powerpoint crashes every second time"
https://bugs.launchpad.net/openlp/+bug/696013
Bug #696637 in OpenLP: "Alert not positioned correctly in single screen"
https://bugs.launchpad.net/openlp/+bug/696637
Bug #735039 in OpenLP: "Cannot import PowerPoint Presentations with PowerPoint 2010"
https://bugs.launchpad.net/openlp/+bug/735039
For more details, see:
https://code.launchpad.net/~j-corwin/openlp/general/+merge/53379
Fix alert position if display screen not visible - Bug 696637
Impress - No longer make invisible on Linux as causes problems starting it separately. Just keep it minimised.
Fix issues with generic import - Bug 696013
Fix Visible issue with ppt 2010 - Bug 735039
Fix strange bug on Windows where python itself crashes during maindisplay setup with a QPaint error
Fix case insensitive song ordering in media manager
--
https://code.launchpad.net/~j-corwin/openlp/general/+merge/53379
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/general into lp:openlp.
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2011-03-14 10:10:10 +0000
+++ openlp/core/ui/maindisplay.py 2011-03-15 07:50:59 +0000
@@ -150,24 +150,23 @@
if not background_color.isValid():
background_color = QtCore.Qt.white
splash_image = QtGui.QImage(image_file)
- initialFrame = QtGui.QImage(
+ self.initialFrame = QtGui.QImage(
self.screens.current[u'size'].width(),
self.screens.current[u'size'].height(),
- QtGui.QImage.Format_ARGB32_Premultiplied)
+ QtGui.QImage.Format_ARGB32_Premultiplied)
painter_image = QtGui.QPainter()
- painter_image.begin(initialFrame)
- painter_image.fillRect(initialFrame.rect(), background_color)
+ painter_image.begin(self.initialFrame)
+ painter_image.fillRect(self.initialFrame.rect(), background_color)
painter_image.drawImage(
(self.screens.current[u'size'].width() -
splash_image.width()) / 2,
(self.screens.current[u'size'].height()
- splash_image.height()) / 2, splash_image)
serviceItem = ServiceItem()
- serviceItem.bg_image_bytes = image_to_byte(initialFrame)
+ serviceItem.bg_image_bytes = image_to_byte(self.initialFrame)
self.webView.setHtml(build_html(serviceItem, self.screen,
self.alertTab, self.isLive, None))
- self.initialFrame = True
- self.__hideMouse()
+ self.__hideMouse()
# To display or not to display?
if not self.screen[u'primary']:
self.show()
@@ -188,6 +187,7 @@
# Wait for the webview to update before displaying text.
while not self.webLoaded:
Receiver.send_message(u'openlp_process_events')
+ self.setGeometry(self.screen[u'size'])
self.frame.evaluateJavaScript(u'show_text("%s")' % \
slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
return self.preview()
@@ -199,7 +199,7 @@
`slide`
The slide text to be displayed
"""
- log.debug(u'alert to display')
+ log.debug(u'alert to display')
if self.height() != self.screen[u'size'].height() \
or not self.isVisible() or self.videoWidget.isVisible():
shrink = True
@@ -215,12 +215,18 @@
else:
shrinkItem = self
if text:
- shrinkItem.resize(self.width(), int(height.toString()))
+ alert_height = int(height.toString())
+ shrinkItem.resize(self.width(), alert_height)
shrinkItem.setVisible(True)
+ if self.alertTab.location == 1:
+ shrinkItem.move(self.screen[u'size'].left(),
+ (self.screen[u'size'].height() - alert_height) / 2)
+ elif self.alertTab.location == 2:
+ shrinkItem.move(self.screen[u'size'].left(),
+ self.screen[u'size'].height() - alert_height)
else:
shrinkItem.setVisible(False)
- shrinkItem.resize(self.screen[u'size'].width(),
- self.screen[u'size'].height())
+ self.setGeometry(self.screen[u'size'])
def directImage(self, name, path):
"""
@@ -250,6 +256,7 @@
"""
Display an image, as is.
"""
+ self.setGeometry(self.screen[u'size'])
if image:
js = u'show_image("data:image/png;base64,%s");' % image
else:
@@ -344,6 +351,7 @@
"""
log.debug(u'video')
self.webLoaded = True
+ self.setGeometry(self.screen[u'size'])
# We are running a background theme
self.override[u'theme'] = u''
self.override[u'video'] = True
@@ -443,7 +451,7 @@
"""
log.debug(u'buildHtml')
self.webLoaded = False
- self.initialFrame = False
+ self.initialFrame = None
self.serviceItem = serviceItem
background = None
# We have an image override so keep the image till the theme changes
=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py 2011-03-11 23:41:44 +0000
+++ openlp/core/utils/__init__.py 2011-03-15 07:50:59 +0000
@@ -391,7 +391,7 @@
Returns the UNO command to launch an openoffice.org instance.
"""
COMMAND = u'soffice'
- OPTIONS = u'-nologo -norestore -minimized -invisible -nofirststartwizard'
+ OPTIONS = u'-nologo -norestore -minimized -nodefault -nofirststartwizard'
if UNO_CONNECTION_TYPE == u'pipe':
CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"'
else:
=== modified file 'openlp/plugins/presentations/lib/messagelistener.py'
--- openlp/plugins/presentations/lib/messagelistener.py 2011-02-25 17:27:06 +0000
+++ openlp/plugins/presentations/lib/messagelistener.py 2011-03-15 07:50:59 +0000
@@ -80,7 +80,8 @@
if self.doc.is_active():
return
if not self.doc.is_loaded():
- self.doc.load_presentation()
+ if not self.doc.load_presentation():
+ return
if self.is_live:
self.doc.start_presentation()
if self.doc.slidenumber > 1:
=== modified file 'openlp/plugins/presentations/lib/powerpointcontroller.py'
--- openlp/plugins/presentations/lib/powerpointcontroller.py 2011-02-24 05:47:38 +0000
+++ openlp/plugins/presentations/lib/powerpointcontroller.py 2011-03-15 07:50:59 +0000
@@ -77,8 +77,11 @@
"""
Loads PowerPoint process
"""
- self.process = Dispatch(u'PowerPoint.Application')
- self.process.Visible = True
+ log.debug(u'start_process')
+ if not self.process:
+ self.process = Dispatch(u'PowerPoint.Application')
+ if float(self.process.Version) < 13:
+ self.process.Visible = True
self.process.WindowState = 2
def kill(self):
@@ -120,13 +123,14 @@
``presentation``
The file name of the presentations to run.
"""
- log.debug(u'LoadPresentation')
+ log.debug(u'load_presentation')
if not self.controller.process or not self.controller.process.Visible:
self.controller.start_process()
try:
self.controller.process.Presentations.Open(self.filepath, False,
False, True)
except pywintypes.com_error:
+ log.debug(u'PPT open failed')
return False
self.presentation = self.controller.process.Presentations(
self.controller.process.Presentations.Count)
@@ -145,6 +149,7 @@
However, for the moment, we want a physical file since it makes life
easier elsewhere.
"""
+ log.debug(u'create_thumbnails')
if self.check_thumbnails():
return
for num in range(0, self.presentation.Slides.Count):
@@ -170,6 +175,7 @@
"""
Returns ``True`` if a presentation is loaded.
"""
+ log.debug(u'is_loaded')
try:
if not self.controller.process.Visible:
return False
@@ -186,6 +192,7 @@
"""
Returns ``True`` if a presentation is currently active.
"""
+ log.debug(u'is_active')
if not self.is_loaded():
return False
try:
@@ -201,6 +208,7 @@
"""
Unblanks (restores) the presentation.
"""
+ log.debug(u'unblank_screen')
self.presentation.SlideShowSettings.Run()
self.presentation.SlideShowWindow.View.State = 1
self.presentation.SlideShowWindow.Activate()
@@ -209,12 +217,14 @@
"""
Blanks the screen.
"""
+ log.debug(u'blank_screen')
self.presentation.SlideShowWindow.View.State = 3
def is_blank(self):
"""
Returns ``True`` if screen is blank.
"""
+ log.debug(u'is_blank')
if self.is_active():
return self.presentation.SlideShowWindow.View.State == 3
else:
@@ -224,6 +234,7 @@
"""
Stops the current presentation and hides the output.
"""
+ log.debug(u'stop_presentation')
self.presentation.SlideShowWindow.View.Exit()
if os.name == u'nt':
@@ -231,6 +242,7 @@
"""
Starts a presentation from the beginning.
"""
+ log.debug(u'start_presentation')
#SlideShowWindow measures its size/position by points, not pixels
try:
dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88)
@@ -253,30 +265,35 @@
"""
Returns the current slide number.
"""
+ log.debug(u'get_slide_number')
return self.presentation.SlideShowWindow.View.CurrentShowPosition
def get_slide_count(self):
"""
Returns total number of slides.
"""
+ log.debug(u'get_slide_count')
return self.presentation.Slides.Count
def goto_slide(self, slideno):
"""
Moves to a specific slide in the presentation.
"""
+ log.debug(u'goto_slide')
self.presentation.SlideShowWindow.View.GotoSlide(slideno)
def next_step(self):
"""
Triggers the next effect of slide on the running presentation.
"""
+ log.debug(u'next_step')
self.presentation.SlideShowWindow.View.Next()
def previous_step(self):
"""
Triggers the previous slide on the running presentation.
"""
+ log.debug(u'previous_step')
self.presentation.SlideShowWindow.View.Previous()
def get_slide_text(self, slide_no):
=== modified file 'openlp/plugins/presentations/lib/pptviewcontroller.py'
--- openlp/plugins/presentations/lib/pptviewcontroller.py 2011-02-24 05:47:38 +0000
+++ openlp/plugins/presentations/lib/pptviewcontroller.py 2011-03-15 07:50:59 +0000
@@ -84,7 +84,8 @@
dllpath = os.path.join(self.plugin.pluginManager.basepath,
u'presentations', u'lib', u'pptviewlib', u'pptviewlib.dll')
self.process = cdll.LoadLibrary(dllpath)
- #self.process.SetDebug(1)
+ if log.isEnabledFor(logging.DEBUG):
+ self.process.SetDebug(1)
def kill(self):
"""
@@ -140,8 +141,10 @@
PPTviewLib creates large BMP's, but we want small PNG's for consistency.
Convert them here.
"""
+ log.debug(u'create_thumbnails')
if self.check_thumbnails():
return
+ log.debug(u'create_thumbnails proceeding')
for idx in range(self.get_slide_count()):
path = u'%s\\slide%s.bmp' % (self.get_temp_folder(),
unicode(idx + 1))
=== modified file 'openlp/plugins/presentations/lib/pptviewlib/ppttest.py'
--- openlp/plugins/presentations/lib/pptviewlib/ppttest.py 2011-02-24 05:47:38 +0000
+++ openlp/plugins/presentations/lib/pptviewlib/ppttest.py 2011-03-15 07:50:59 +0000
@@ -133,7 +133,7 @@
def OpenClick(self):
oldid = self.pptid;
rect = RECT(100,100,900,700)
- filename = unicode(self.PPTEdit.text())
+ filename = str(self.PPTEdit.text().replace(u'/', u'\\'))
print filename
self.pptid = pptdll.OpenPPT(filename, None, rect, 'c:\\temp\\slide')
print "id: " + unicode(self.pptid)
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2011-03-11 19:38:57 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2011-03-15 07:50:59 +0000
@@ -166,20 +166,18 @@
or_(Song.search_title.like(u'%' + self.whitespace.sub(u' ',
search_keywords.lower()) + u'%'),
Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'),
- Song.comments.like(u'%' + search_keywords.lower() + u'%')),
- Song.search_title.asc())
+ Song.comments.like(u'%' + search_keywords.lower() + u'%')))
self.displayResultsSong(search_results)
elif search_type == SongSearch.Titles:
log.debug(u'Titles Search')
search_results = self.parent.manager.get_all_objects(Song,
Song.search_title.like(u'%' + self.whitespace.sub(u' ',
- search_keywords.lower()) + u'%'), Song.search_title.asc())
+ search_keywords.lower()) + u'%'))
self.displayResultsSong(search_results)
elif search_type == SongSearch.Lyrics:
log.debug(u'Lyrics Search')
search_results = self.parent.manager.get_all_objects(Song,
- Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'),
- Song.search_lyrics.asc())
+ Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'))
self.displayResultsSong(search_results)
elif search_type == SongSearch.Authors:
log.debug(u'Authors Search')
@@ -190,7 +188,7 @@
elif search_type == SongSearch.Themes:
log.debug(u'Theme Search')
search_results = self.parent.manager.get_all_objects(Song,
- Song.theme_name == search_keywords, Song.search_lyrics.asc())
+ Song.theme_name == search_keywords)
self.displayResultsSong(search_results)
def onSongListLoad(self):
@@ -461,4 +459,5 @@
"""
Locale aware collation of song titles
"""
- return locale.strcoll(unicode(song_1.title), unicode(song_2.title))
+ return locale.strcoll(unicode(song_1.title.lower()),
+ unicode(song_2.title.lower()))
Follow ups