- hide the theme menu when theme level is not 'Song'

- clean ups
This commit is contained in:
Andreas Preikschat 2011-05-27 12:17:59 +02:00
parent 18e3cb0232
commit c63382e41c
3 changed files with 5 additions and 9 deletions

View File

@ -677,7 +677,8 @@ class ServiceManager(QtGui.QWidget):
self.timeAction.setVisible(True) self.timeAction.setVisible(True)
self.themeMenu.menuAction().setVisible(False) self.themeMenu.menuAction().setVisible(False)
# Set up the theme menu. # 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) self.themeMenu.menuAction().setVisible(True)
# The service item does not have a theme, check the "Default". # The service item does not have a theme, check the "Default".
if serviceItem[u'service_item'].theme is None: if serviceItem[u'service_item'].theme is None:

View File

@ -57,8 +57,6 @@ class ThemeManager(QtGui.QWidget):
self.settingsSection = u'themes' self.settingsSection = u'themes'
self.themeForm = ThemeForm(self) self.themeForm = ThemeForm(self)
self.fileRenameForm = FileRenameForm(self) self.fileRenameForm = FileRenameForm(self)
self.serviceComboBox = \
self.mainwindow.serviceManagerContents.themeComboBox
# start with the layout # start with the layout
self.layout = QtGui.QVBoxLayout(self) self.layout = QtGui.QVBoxLayout(self)
self.layout.setSpacing(0) self.layout.setSpacing(0)

View File

@ -145,10 +145,8 @@ class ThemesTab(SettingsTab):
def save(self): def save(self):
settings = QtCore.QSettings() settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection) settings.beginGroup(self.settingsSection)
settings.setValue(u'theme level', settings.setValue(u'theme level', QtCore.QVariant(self.theme_level))
QtCore.QVariant(self.theme_level)) settings.setValue(u'global theme', QtCore.QVariant(self.global_theme))
settings.setValue(u'global theme',
QtCore.QVariant(self.global_theme))
settings.endGroup() settings.endGroup()
self.mainwindow.renderer.set_global_theme( self.mainwindow.renderer.set_global_theme(
self.global_theme, self.theme_level) self.global_theme, self.theme_level)
@ -186,8 +184,7 @@ class ThemesTab(SettingsTab):
self.settingsSection + u'/global theme', self.settingsSection + u'/global theme',
QtCore.QVariant(u'')).toString()) QtCore.QVariant(u'')).toString())
self.DefaultComboBox.clear() self.DefaultComboBox.clear()
for theme in theme_list: self.DefaultComboBox.addItems(theme_list)
self.DefaultComboBox.addItem(theme)
find_and_set_in_combo_box(self.DefaultComboBox, self.global_theme) find_and_set_in_combo_box(self.DefaultComboBox, self.global_theme)
self.mainwindow.renderer.set_global_theme( self.mainwindow.renderer.set_global_theme(
self.global_theme, self.theme_level) self.global_theme, self.theme_level)