Fix Transitions in Bible display bug 701353

Fix display handling on restart so correct screen mode is set

Fixes: https://launchpad.net/bugs/701353
This commit is contained in:
Tim Bentley 2011-01-14 15:12:28 +00:00
parent 9bf9e46d61
commit b25e128495
3 changed files with 37 additions and 14 deletions

View File

@ -680,7 +680,16 @@ class SlideController(QtGui.QWidget):
Allow the main display to blank the main display at startup time Allow the main display to blank the main display at startup time
""" """
log.debug(u'mainDisplaySetBackground live = %s' % self.isLive) log.debug(u'mainDisplaySetBackground live = %s' % self.isLive)
display_type = QtCore.QSettings().value(
self.parent.generalSettingsSection + u'/screen blank',
QtCore.QVariant(u'')).toString()
if not self.display.primary: if not self.display.primary:
# Order done to handle initial conversion
if display_type == u'themed':
self.onThemeDisplay(True)
elif display_type == u'hidden':
self.onHideDisplay(True)
else:
self.onBlankDisplay(True) self.onBlankDisplay(True)
def onSlideBlank(self): def onSlideBlank(self):
@ -705,13 +714,15 @@ class SlideController(QtGui.QWidget):
self.ThemeScreen.setChecked(False) self.ThemeScreen.setChecked(False)
if self.screens.display_count > 1: if self.screens.display_count > 1:
self.DesktopScreen.setChecked(False) self.DesktopScreen.setChecked(False)
QtCore.QSettings().setValue(
self.parent.generalSettingsSection + u'/screen blank',
QtCore.QVariant(checked))
if checked: if checked:
Receiver.send_message(u'maindisplay_hide', HideMode.Blank) Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
QtCore.QSettings().setValue(
self.parent.generalSettingsSection + u'/screen blank',
QtCore.QVariant(u'blanked'))
else: else:
Receiver.send_message(u'maindisplay_show') Receiver.send_message(u'maindisplay_show')
QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank')
self.blankPlugin(checked) self.blankPlugin(checked)
def onThemeDisplay(self, checked): def onThemeDisplay(self, checked):
@ -722,12 +733,18 @@ class SlideController(QtGui.QWidget):
self.HideMenu.setDefaultAction(self.ThemeScreen) self.HideMenu.setDefaultAction(self.ThemeScreen)
self.BlankScreen.setChecked(False) self.BlankScreen.setChecked(False)
self.ThemeScreen.setChecked(checked) self.ThemeScreen.setChecked(checked)
if self.screens.display_count > 1: if self.screens.display_count > 1:
self.DesktopScreen.setChecked(False) self.DesktopScreen.setChecked(False)
if checked: if checked:
Receiver.send_message(u'maindisplay_hide', HideMode.Theme) Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
QtCore.QSettings().setValue(
self.parent.generalSettingsSection + u'/screen blank',
QtCore.QVariant(u'themed'))
else: else:
Receiver.send_message(u'maindisplay_show') Receiver.send_message(u'maindisplay_show')
QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank')
self.blankPlugin(checked) self.blankPlugin(checked)
def onHideDisplay(self, checked): def onHideDisplay(self, checked):
@ -738,12 +755,19 @@ class SlideController(QtGui.QWidget):
self.HideMenu.setDefaultAction(self.DesktopScreen) self.HideMenu.setDefaultAction(self.DesktopScreen)
self.BlankScreen.setChecked(False) self.BlankScreen.setChecked(False)
self.ThemeScreen.setChecked(False) self.ThemeScreen.setChecked(False)
if self.screens.display_count > 1: # On valid if more than 1 display
if self.screens.display_count <= 1:
return
self.DesktopScreen.setChecked(checked) self.DesktopScreen.setChecked(checked)
if checked: if checked:
Receiver.send_message(u'maindisplay_hide', HideMode.Screen) Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
QtCore.QSettings().setValue(
self.parent.generalSettingsSection + u'/screen blank',
QtCore.QVariant(u'hidden'))
else: else:
Receiver.send_message(u'maindisplay_show') Receiver.send_message(u'maindisplay_show')
QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank')
self.hidePlugin(checked) self.hidePlugin(checked)
def blankPlugin(self, blank): def blankPlugin(self, blank):
@ -1033,9 +1057,8 @@ class SlideController(QtGui.QWidget):
if self.BlankScreen.isChecked: if self.BlankScreen.isChecked:
self.BlankScreen.setChecked(False) self.BlankScreen.setChecked(False)
self.HideMenu.setDefaultAction(self.BlankScreen) self.HideMenu.setDefaultAction(self.BlankScreen)
QtCore.QSettings().setValue( QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank', self.parent.generalSettingsSection + u'/screen blank')
QtCore.QVariant(False))
if self.ThemeScreen.isChecked: if self.ThemeScreen.isChecked:
self.ThemeScreen.setChecked(False) self.ThemeScreen.setChecked(False)
self.HideMenu.setDefaultAction(self.ThemeScreen) self.HideMenu.setDefaultAction(self.ThemeScreen)

View File

@ -745,21 +745,21 @@ class BibleMediaItem(MediaManagerItem):
second_copyright, second_permissions) second_copyright, second_permissions)
if footer not in raw_footer: if footer not in raw_footer:
raw_footer.append(footer) raw_footer.append(footer)
bible_text = u'%s\u00a0%s\n\n%s\u00a0%s' % (verse_text, text, bible_text = u'%s%s\n\n%s%s' % (verse_text, text,
verse_text, second_text) verse_text, second_text)
raw_slides.append(bible_text) raw_slides.append(bible_text)
bible_text = u'' bible_text = u''
# If we are 'Verse Per Slide' then create a new slide. # If we are 'Verse Per Slide' then create a new slide.
elif self.parent.settings_tab.layout_style == 0: elif self.parent.settings_tab.layout_style == 0:
bible_text = u'%s\u00a0%s' % (verse_text, text) bible_text = u'%s%s' % (verse_text, text)
raw_slides.append(bible_text) raw_slides.append(bible_text)
bible_text = u'' bible_text = u''
# If we are 'Verse Per Line' then force a new line. # If we are 'Verse Per Line' then force a new line.
elif self.parent.settings_tab.layout_style == 1: elif self.parent.settings_tab.layout_style == 1:
bible_text = u'%s %s\u00a0%s\n' % (bible_text, verse_text, text) bible_text = u'%s %s%s\n' % (bible_text, verse_text, text)
# We have to be 'Continuous'. # We have to be 'Continuous'.
else: else:
bible_text = u'%s %s\u00a0%s\n' % (bible_text, verse_text, text) bible_text = u'%s %s%s\n' % (bible_text, verse_text, text)
if not old_item: if not old_item:
start_item = item start_item = item
elif self.checkTitle(item, old_item): elif self.checkTitle(item, old_item):