From c63382e41c993a18e6d0b4a3770e38a6b25c3923 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 27 May 2011 12:17:59 +0200 Subject: [PATCH] - hide the theme menu when theme level is not 'Song' - clean ups --- openlp/core/ui/servicemanager.py | 3 ++- openlp/core/ui/thememanager.py | 2 -- openlp/core/ui/themestab.py | 9 +++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index c32567075..349b0a4a3 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -677,7 +677,8 @@ class ServiceManager(QtGui.QWidget): self.timeAction.setVisible(True) self.themeMenu.menuAction().setVisible(False) # Set up the theme menu. - if serviceItem[u'service_item'].is_text(): + if serviceItem[u'service_item'].is_text() and \ + self.mainwindow.renderer.theme_level == ThemeLevel.Song: self.themeMenu.menuAction().setVisible(True) # The service item does not have a theme, check the "Default". if serviceItem[u'service_item'].theme is None: diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 4dabcfdf7..72bdf4558 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -57,8 +57,6 @@ class ThemeManager(QtGui.QWidget): self.settingsSection = u'themes' self.themeForm = ThemeForm(self) self.fileRenameForm = FileRenameForm(self) - self.serviceComboBox = \ - self.mainwindow.serviceManagerContents.themeComboBox # start with the layout self.layout = QtGui.QVBoxLayout(self) self.layout.setSpacing(0) diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 709b3ad80..7e8188f42 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -145,10 +145,8 @@ class ThemesTab(SettingsTab): def save(self): settings = QtCore.QSettings() settings.beginGroup(self.settingsSection) - settings.setValue(u'theme level', - QtCore.QVariant(self.theme_level)) - settings.setValue(u'global theme', - QtCore.QVariant(self.global_theme)) + settings.setValue(u'theme level', QtCore.QVariant(self.theme_level)) + settings.setValue(u'global theme', QtCore.QVariant(self.global_theme)) settings.endGroup() self.mainwindow.renderer.set_global_theme( self.global_theme, self.theme_level) @@ -186,8 +184,7 @@ class ThemesTab(SettingsTab): self.settingsSection + u'/global theme', QtCore.QVariant(u'')).toString()) self.DefaultComboBox.clear() - for theme in theme_list: - self.DefaultComboBox.addItem(theme) + self.DefaultComboBox.addItems(theme_list) find_and_set_in_combo_box(self.DefaultComboBox, self.global_theme) self.mainwindow.renderer.set_global_theme( self.global_theme, self.theme_level)