From bc537365bd513e956226eea64e30796eef9a35ce Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 15 Sep 2010 19:03:54 +0100 Subject: [PATCH 01/13] Speed up render --- openlp/core/lib/renderer.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 0cb92ad39..42420790b 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -90,6 +90,18 @@ class Renderer(object): self._rect = rect_main self._rect_footer = rect_footer + self.web = QtWebKit.QWebView() + self.web.resize(self._rect.width(), self._rect.height()) + self.web.setVisible(False) + self.web_frame = self.web.page().mainFrame() + # Adjust width and height to account for shadow. outline done in css + self.page_width = self._rect.width() - int(self._theme.display_shadow_size) + self.page_height = self._rect.height() - int(self._theme.display_shadow_size) + self.page_shell = u'' \ + u'
' % \ + (build_lyrics_format_css(self._theme, self.page_width, self.page_height), + build_lyrics_outline_css(self._theme)) + def set_frame_dest(self, frame_width, frame_height): """ Set the size of the slide. @@ -139,17 +151,6 @@ class Renderer(object): lines = verse.split(u'\n') for line in lines: text.append(line) - web = QtWebKit.QWebView() - web.resize(self._rect.width(), self._rect.height()) - web.setVisible(False) - frame = web.page().mainFrame() - # Adjust width and height to account for shadow. outline done in css - width = self._rect.width() - int(self._theme.display_shadow_size) - height = self._rect.height() - int(self._theme.display_shadow_size) - shell = u'' \ - u'
' % \ - (build_lyrics_format_css(self._theme, width, height), - build_lyrics_outline_css(self._theme)) formatted = [] html_text = u'' styled_text = u'' @@ -157,11 +158,11 @@ class Renderer(object): for line in text: styled_line = expand_tags(line) + line_end styled_text += styled_line - html = shell + styled_text + u'
' - web.setHtml(html) + html = self.page_shell + styled_text + u'
' + self.web.setHtml(html) # Text too long so go to next page - text_height = int(frame.evaluateJavaScript(js_height).toString()) - if text_height > height: + text_height = int(self.web_frame.evaluateJavaScript(js_height).toString()) + if text_height > self.page_height: formatted.append(html_text) html_text = u'' styled_text = styled_line From b73a921dbc28c996843dae2527ab4474d0001d51 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 20 Sep 2010 05:59:51 +0100 Subject: [PATCH 02/13] Fix bug if no lanuagage files --- openlp/core/utils/languagemanager.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 36e6330a6..3ffbd7cde 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -107,19 +107,20 @@ class LanguageManager(object): ``action`` The language menu option """ - action_name = u'%s' % action.objectName() - qm_list = LanguageManager.get_qm_list() - if LanguageManager.auto_language: - language = u'[%s]' % qm_list[action_name] - else: - language = u'%s' % qm_list[action_name] - QtCore.QSettings().setValue( - u'general/language', QtCore.QVariant(language)) - log.info(u'Language file: \'%s\' written to conf file' % language) - QtGui.QMessageBox.information(None, - translate('OpenLP.LanguageManager', 'Language'), - translate('OpenLP.LanguageManager', - 'Please restart OpenLP to use your new language setting.')) + if action: + action_name = u'%s' % action.objectName() + qm_list = LanguageManager.get_qm_list() + if LanguageManager.auto_language: + language = u'[%s]' % qm_list[action_name] + else: + language = u'%s' % qm_list[action_name] + QtCore.QSettings().setValue( + u'general/language', QtCore.QVariant(language)) + log.info(u'Language file: \'%s\' written to conf file' % language) + QtGui.QMessageBox.information(None, + translate('OpenLP.LanguageManager', 'Language'), + translate('OpenLP.LanguageManager', + 'Please restart OpenLP to use your new language setting.')) @staticmethod def init_qm_list(): From 293443ba61ceaa7c5347bcf58f2cc68399e69d84 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 20 Sep 2010 06:06:18 +0100 Subject: [PATCH 03/13] Fixed but untested Fixes: https://launchpad.net/bugs/642778 --- openlp/core/lib/spelltextedit.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/spelltextedit.py b/openlp/core/lib/spelltextedit.py index 7d227079b..e7f3d7ef0 100644 --- a/openlp/core/lib/spelltextedit.py +++ b/openlp/core/lib/spelltextedit.py @@ -43,9 +43,12 @@ class SpellTextEdit(QtGui.QPlainTextEdit): QtGui.QPlainTextEdit.__init__(self, *args) # Default dictionary based on the current locale. if enchant_available: - self.dict = enchant.Dict() - self.highlighter = Highlighter(self.document()) - self.highlighter.setDict(self.dict) + try: + self.dict = enchant.Dict() + self.highlighter = Highlighter(self.document()) + self.highlighter.setDict(self.dict) + except: + enchant_available = False def mousePressEvent(self, event): if event.button() == QtCore.Qt.RightButton: From fe6a3af42c0a460cb0be41a06edaa3247fd3a76d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 20 Sep 2010 17:33:38 +0100 Subject: [PATCH 04/13] Explicit error type --- openlp/core/lib/spelltextedit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/spelltextedit.py b/openlp/core/lib/spelltextedit.py index e7f3d7ef0..61335002e 100644 --- a/openlp/core/lib/spelltextedit.py +++ b/openlp/core/lib/spelltextedit.py @@ -28,6 +28,7 @@ import re import sys try: import enchant + from enchant import DictNotFoundError enchant_available = True except ImportError: enchant_available = False @@ -47,7 +48,7 @@ class SpellTextEdit(QtGui.QPlainTextEdit): self.dict = enchant.Dict() self.highlighter = Highlighter(self.document()) self.highlighter.setDict(self.dict) - except: + except DictNotFoundError: enchant_available = False def mousePressEvent(self, event): From 5675eba314b5b173b0f96ded4029c2094dd3bbe3 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 20 Sep 2010 17:43:36 +0100 Subject: [PATCH 05/13] Fix local variable issues --- openlp/core/lib/spelltextedit.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/spelltextedit.py b/openlp/core/lib/spelltextedit.py index 61335002e..cec2f9f25 100644 --- a/openlp/core/lib/spelltextedit.py +++ b/openlp/core/lib/spelltextedit.py @@ -43,13 +43,14 @@ class SpellTextEdit(QtGui.QPlainTextEdit): def __init__(self, *args): QtGui.QPlainTextEdit.__init__(self, *args) # Default dictionary based on the current locale. - if enchant_available: + self.enchant_available = enchant_available + if self.enchant_available: try: self.dict = enchant.Dict() self.highlighter = Highlighter(self.document()) self.highlighter.setDict(self.dict) except DictNotFoundError: - enchant_available = False + self.enchant_available = False def mousePressEvent(self, event): if event.button() == QtCore.Qt.RightButton: @@ -70,7 +71,7 @@ class SpellTextEdit(QtGui.QPlainTextEdit): self.setTextCursor(cursor) # Check if the selected word is misspelled and offer spelling # suggestions if it is. - if enchant_available and self.textCursor().hasSelection(): + if self.enchant_available and self.textCursor().hasSelection(): text = unicode(self.textCursor().selectedText()) if not self.dict.check(text): spell_menu = QtGui.QMenu(translate('OpenLP.SpellTextEdit', From 56297a1cceb2a9174b32b78571dead0f7f831d82 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 20 Sep 2010 19:01:32 +0100 Subject: [PATCH 06/13] fixes for 641644 Fixes: https://launchpad.net/bugs/641644 --- openlp/core/ui/maindisplay.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index a2b9dd81a..d48e8166d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -326,8 +326,9 @@ class MainDisplay(DisplayWidget): self.frame.render(painter) painter.end() # Make display show up if in single screen mode - if self.isLive: - self.setVisible(True) + # if was hidden keep it hidden + if self.hide_mode and self.isLive: + self.hideDisplay(self.hide_mode) return preview def buildHtml(self, serviceItem): From d50ffbafa3ea69a3e1f0431330c2be2631c1c0dc Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 21 Sep 2010 18:24:01 +0100 Subject: [PATCH 07/13] Fix review comments --- openlp/core/lib/renderer.py | 12 ------------ openlp/core/ui/maindisplay.py | 8 +++----- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 8cf15c696..f97575c5e 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -105,18 +105,6 @@ class Renderer(object): (build_lyrics_format_css(self._theme, self.page_width, self.page_height), build_lyrics_outline_css(self._theme)) - self.web = QtWebKit.QWebView() - self.web.resize(self._rect.width(), self._rect.height()) - self.web.setVisible(False) - self.web_frame = self.web.page().mainFrame() - # Adjust width and height to account for shadow. outline done in css - self.page_width = self._rect.width() - int(self._theme.display_shadow_size) - self.page_height = self._rect.height() - int(self._theme.display_shadow_size) - self.page_shell = u'' \ - u'
' % \ - (build_lyrics_format_css(self._theme, self.page_width, self.page_height), - build_lyrics_outline_css(self._theme)) - def set_frame_dest(self, frame_width, frame_height): """ Set the size of the slide. diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index e73088410..e36ef7b0d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -326,8 +326,9 @@ class MainDisplay(DisplayWidget): # Important otherwise first preview will miss the background ! while not self.loaded: Receiver.send_message(u'openlp_process_events') - if self.isLive: - self.setVisible(True) + # if was hidden keep it hidden + if self.hide_mode and self.isLive: + self.hideDisplay(self.hide_mode) preview = QtGui.QImage(self.screen[u'size'].width(), self.screen[u'size'].height(), QtGui.QImage.Format_ARGB32_Premultiplied) @@ -335,9 +336,6 @@ class MainDisplay(DisplayWidget): painter.setRenderHint(QtGui.QPainter.Antialiasing) self.frame.render(painter) painter.end() - # if was hidden keep it hidden - if self.hide_mode and self.isLive: - self.hideDisplay(self.hide_mode) return preview def buildHtml(self, serviceItem): From 79881d9023fe30ab474623680b55685909b9c4cb Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 21 Sep 2010 18:30:32 +0100 Subject: [PATCH 08/13] Update plugin version numbers --- openlp/plugins/alerts/alertsplugin.py | 2 +- openlp/plugins/bibles/bibleplugin.py | 2 +- openlp/plugins/bibles/lib/mediaitem.py | 4 +--- openlp/plugins/custom/customplugin.py | 2 +- openlp/plugins/images/imageplugin.py | 2 +- openlp/plugins/media/mediaplugin.py | 2 +- openlp/plugins/presentations/presentationplugin.py | 2 +- openlp/plugins/remotes/remoteplugin.py | 2 +- openlp/plugins/songs/songsplugin.py | 2 +- openlp/plugins/songusage/songusageplugin.py | 2 +- 10 files changed, 10 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 9e1da2267..b8a829b37 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -40,7 +40,7 @@ class AlertsPlugin(Plugin): log.info(u'Alerts Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Alerts', u'1.9.2', plugin_helpers) + Plugin.__init__(self, u'Alerts', u'1.9.3', plugin_helpers) self.weight = -3 self.icon = build_icon(u':/plugins/plugin_alerts.png') self.alertsmanager = AlertsManager(self) diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index da542b23b..7f69c6ff0 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -37,7 +37,7 @@ class BiblePlugin(Plugin): log.info(u'Bible Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Bibles', u'1.9.2', plugin_helpers) + Plugin.__init__(self, u'Bibles', u'1.9.3', plugin_helpers) self.weight = -9 self.icon_path = u':/plugins/plugin_bibles.png' self.icon = build_icon(self.icon_path) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index fa954d2a0..6cceb9c49 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -376,9 +376,6 @@ class BibleMediaItem(MediaManagerItem): def onSearchProgressShow(self): self.SearchProgress.setVisible(True) Receiver.send_message(u'openlp_process_events') - #self.SearchProgress.setMinimum(0) - #self.SearchProgress.setMaximum(2) - #self.SearchProgress.setValue(1) def onSearchProgressHide(self): self.SearchProgress.setVisible(False) @@ -414,6 +411,7 @@ class BibleMediaItem(MediaManagerItem): def onAdvancedToChapter(self): frm = unicode(self.AdvancedFromChapter.currentText()) to = unicode(self.AdvancedToChapter.currentText()) + print frm , to if frm != to: bible = unicode(self.AdvancedVersionComboBox.currentText()) book = unicode(self.AdvancedBookComboBox.currentText()) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 4e3819961..523ccb061 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -47,7 +47,7 @@ class CustomPlugin(Plugin): log.info(u'Custom Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Custom', u'1.9.2', plugin_helpers) + Plugin.__init__(self, u'Custom', u'1.9.3', plugin_helpers) self.weight = -5 self.custommanager = Manager(u'custom', init_schema) self.edit_custom_form = EditCustomForm(self.custommanager) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index d34cd6a3c..7f910f395 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -35,7 +35,7 @@ class ImagePlugin(Plugin): log.info(u'Image Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Images', u'1.9.2', plugin_helpers) + Plugin.__init__(self, u'Images', u'1.9.3', plugin_helpers) self.weight = -7 self.icon_path = u':/plugins/plugin_images.png' self.icon = build_icon(self.icon_path) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index db326f843..e50333eb2 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -37,7 +37,7 @@ class MediaPlugin(Plugin): log.info(u'%s MediaPlugin loaded', __name__) def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Media', u'1.9.2', plugin_helpers) + Plugin.__init__(self, u'Media', u'1.9.3', plugin_helpers) self.weight = -6 self.icon_path = u':/plugins/plugin_media.png' self.icon = build_icon(self.icon_path) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index e63063ffd..ada695625 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -51,7 +51,7 @@ class PresentationPlugin(Plugin): """ log.debug(u'Initialised') self.controllers = {} - Plugin.__init__(self, u'Presentations', u'1.9.2', plugin_helpers) + Plugin.__init__(self, u'Presentations', u'1.9.3', plugin_helpers) self.weight = -8 self.icon_path = u':/plugins/plugin_presentations.png' self.icon = build_icon(self.icon_path) diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 59ad9a99c..927a706a3 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -38,7 +38,7 @@ class RemotesPlugin(Plugin): """ remotes constructor """ - Plugin.__init__(self, u'Remotes', u'1.9.2', plugin_helpers) + Plugin.__init__(self, u'Remotes', u'1.9.3', plugin_helpers) self.icon = build_icon(u':/plugins/plugin_remote.png') self.weight = -1 self.server = None diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 0064be23a..c1fe3a91a 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -50,7 +50,7 @@ class SongsPlugin(Plugin): """ Create and set up the Songs plugin. """ - Plugin.__init__(self, u'Songs', u'1.9.2', plugin_helpers) + Plugin.__init__(self, u'Songs', u'1.9.3', plugin_helpers) self.weight = -10 self.manager = Manager(u'songs', init_schema) self.icon_path = u':/plugins/plugin_songs.png' diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index c8dfd06fc..f0eb1f73d 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -41,7 +41,7 @@ class SongUsagePlugin(Plugin): log.info(u'SongUsage Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'SongUsage', u'1.9.2', plugin_helpers) + Plugin.__init__(self, u'SongUsage', u'1.9.3', plugin_helpers) self.weight = -4 self.icon = build_icon(u':/plugins/plugin_songusage.png') self.songusagemanager = None From 8e94d87e6560f443513db8272fde612db9df6b4e Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 21 Sep 2010 18:35:26 +0100 Subject: [PATCH 09/13] Put the display image back after it was lost --- openlp/core/ui/maindisplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index e36ef7b0d..1a8cdff5e 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -164,7 +164,7 @@ class MainDisplay(DisplayWidget): - splash_image.height()) / 2, splash_image) serviceItem = ServiceItem() - serviceItem.bg_frame = initialFrame + serviceItem.bg_image_bytes = image_to_byte(initialFrame) self.webView.setHtml(build_html(serviceItem, self.screen, self.parent.alertTab, self.isLive)) self.initialFrame = True From 1c58fcda9f2bc040dcb88ecf70df9197a0423b80 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 21 Sep 2010 18:42:16 +0100 Subject: [PATCH 10/13] Remove print statement --- openlp/plugins/bibles/lib/mediaitem.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 6cceb9c49..dcf7589d3 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -411,7 +411,6 @@ class BibleMediaItem(MediaManagerItem): def onAdvancedToChapter(self): frm = unicode(self.AdvancedFromChapter.currentText()) to = unicode(self.AdvancedToChapter.currentText()) - print frm , to if frm != to: bible = unicode(self.AdvancedVersionComboBox.currentText()) book = unicode(self.AdvancedBookComboBox.currentText()) From 3e0a3f799ba151e3b6e877dba7951d68d9822ba9 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 21 Sep 2010 20:05:45 +0100 Subject: [PATCH 11/13] Fix bug 642754 in service manager --- openlp/core/ui/maindisplay.py | 5 ++++- openlp/core/ui/servicemanager.py | 34 +++++++++++++++++--------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 1a8cdff5e..71e7d5a09 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -327,7 +327,10 @@ class MainDisplay(DisplayWidget): while not self.loaded: Receiver.send_message(u'openlp_process_events') # if was hidden keep it hidden - if self.hide_mode and self.isLive: + if self.isLive: +# self.setVisible(True) +# # if was hidden keep it hidden +# if self.hide_mode and self.isLive: self.hideDisplay(self.hide_mode) preview = QtGui.QImage(self.screen[u'size'].width(), self.screen[u'size'].height(), diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 8db14956d..e6e2388df 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -383,20 +383,20 @@ class ServiceManager(QtGui.QWidget): serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList) tempItem = None setLastItem = False - while serviceIterator: - if serviceIterator.isSelected() and tempItem is None: + while serviceIterator.value(): + if serviceIterator.value().isSelected() and tempItem is None: setLastItem = True - serviceIterator.setSelected(False) - if serviceIterator.isSelected(): - #We are on the first record + serviceIterator.value().setSelected(False) + if serviceIterator.value().isSelected(): + # We are on the first record if tempItem: tempItem.setSelected(True) - serviceIterator.setSelected(False) + serviceIterator.value().setSelected(False) else: - tempItem = serviceIterator - lastItem = serviceIterator - ++serviceIterator - #Top Item was selected so set the last one + tempItem = serviceIterator.value() + lastItem = serviceIterator.value() + serviceIterator += 1 + # Top Item was selected so set the last one if setLastItem: lastItem.setSelected(True) @@ -406,16 +406,18 @@ class ServiceManager(QtGui.QWidget): Called by the down arrow """ serviceIterator = QtGui.QTreeWidgetItemIterator(self.serviceManagerList) - firstItem = serviceIterator + firstItem = None setSelected = False - while serviceIterator: + while serviceIterator.value(): + if not firstItem: + firstItem = serviceIterator.value() if setSelected: setSelected = False - serviceIterator.setSelected(True) - elif serviceIterator.isSelected(): - serviceIterator.setSelected(False) + serviceIterator.value().setSelected(True) + elif serviceIterator.value() and serviceIterator.value().isSelected(): + serviceIterator.value().setSelected(False) setSelected = True - ++serviceIterator + serviceIterator += 1 if setSelected: firstItem.setSelected(True) From e790f9aedc7e5d99ad2170f00545f0214030e19a Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 21 Sep 2010 20:08:23 +0100 Subject: [PATCH 12/13] Move display fixes --- openlp/core/ui/maindisplay.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 71e7d5a09..42ddda25d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -328,9 +328,9 @@ class MainDisplay(DisplayWidget): Receiver.send_message(u'openlp_process_events') # if was hidden keep it hidden if self.isLive: -# self.setVisible(True) -# # if was hidden keep it hidden -# if self.hide_mode and self.isLive: + self.setVisible(True) + # if was hidden keep it hidden + if self.hide_mode and self.isLive: self.hideDisplay(self.hide_mode) preview = QtGui.QImage(self.screen[u'size'].width(), self.screen[u'size'].height(), From 47b359a31388f018d1c7b43e72a0021f13a95806 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 22 Sep 2010 06:03:10 +0100 Subject: [PATCH 13/13] Fix issues with other merges --- openlp/core/utils/languagemanager.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 6484cc20a..f118c64b0 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -111,18 +111,18 @@ class LanguageManager(object): action_name = u'en' else: action_name = u'%s' % action.objectName() - qm_list = LanguageManager.get_qm_list() - if LanguageManager.auto_language: - language = u'[%s]' % qm_list[action_name] - else: - language = u'%s' % qm_list[action_name] - QtCore.QSettings().setValue( - u'general/language', QtCore.QVariant(language)) - log.info(u'Language file: \'%s\' written to conf file' % language) - QtGui.QMessageBox.information(None, - translate('OpenLP.LanguageManager', 'Language'), - translate('OpenLP.LanguageManager', - 'Please restart OpenLP to use your new language setting.')) + qm_list = LanguageManager.get_qm_list() + if LanguageManager.auto_language: + language = u'[%s]' % qm_list[action_name] + else: + language = u'%s' % qm_list[action_name] + QtCore.QSettings().setValue( + u'general/language', QtCore.QVariant(language)) + log.info(u'Language file: \'%s\' written to conf file' % language) + QtGui.QMessageBox.information(None, + translate('OpenLP.LanguageManager', 'Language'), + translate('OpenLP.LanguageManager', + 'Please restart OpenLP to use your new language setting.')) @staticmethod def init_qm_list():