From cb13f805e4b2646911e986954d9721ae3bb29445 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 17 May 2012 22:06:23 +0200 Subject: [PATCH] clean up + fix --- openlp/core/ui/media/mediacontroller.py | 3 +-- openlp/core/ui/servicemanager.py | 17 ++++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 541c61763..b7ad43f0f 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -352,8 +352,7 @@ class MediaController(object): if overriddenPlayer and overriddenPlayer != u'auto': usedPlayers = [overriddenPlayer] if controller.media_info.file_info.isFile(): - suffix = u'*.%s' % \ - controller.media_info.file_info.suffix().toLower() + suffix = u'*.%s' % controller.media_info.file_info.suffix().lower() for title in usedPlayers: player = self.mediaPlayers[title] if suffix in player.video_extensions_list: diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 6cffc3d6e..453ecd00b 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -738,10 +738,10 @@ class ServiceManager(QtGui.QWidget): item = self.serviceManagerList.itemAt(point) if item is None: return - if item.parent() is None: - pos = item.data(0, QtCore.Qt.UserRole).toInt()[0] - else: + if item.parent(): pos = item.parent().data(0, QtCore.Qt.UserRole).toInt()[0] + else: + pos = item.data(0, QtCore.Qt.UserRole).toInt()[0] serviceItem = self.serviceItems[pos - 1] self.editAction.setVisible(False) self.maintainAction.setVisible(False) @@ -750,13 +750,12 @@ class ServiceManager(QtGui.QWidget): if serviceItem[u'service_item'].is_capable(ItemCapabilities.CanEdit)\ and serviceItem[u'service_item'].edit_id: self.editAction.setVisible(True) - if serviceItem[u'service_item']\ - .is_capable(ItemCapabilities.CanMaintain): + if serviceItem[u'service_item'].is_capable( + ItemCapabilities.CanMaintain): self.maintainAction.setVisible(True) - if item.parent() is None: - self.notesAction.setVisible(True) - if serviceItem[u'service_item']\ - .is_capable(ItemCapabilities.HasVariableStartTime): + self.notesAction.setVisible(item.parent() is None) + if serviceItem[u'service_item'].is_capable( + ItemCapabilities.HasVariableStartTime): self.timeAction.setVisible(True) self.themeMenu.menuAction().setVisible(False) # Set up the theme menu.