forked from openlp/openlp
PPT's are getting there. Going from blank ppt to song broken now
This commit is contained in:
parent
1ce94d1c20
commit
5f93ff657e
@ -460,7 +460,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
request = unicode(self.sender().text())
|
request = unicode(self.sender().text())
|
||||||
slideno = self.slideList[request]
|
slideno = self.slideList[request]
|
||||||
self.__updatePreviewSelection(slideno)
|
self.__updatePreviewSelection(slideno)
|
||||||
self.onSlideSelected()
|
self.slideSelected()
|
||||||
|
|
||||||
def receiveSpinDelay(self, value):
|
def receiveSpinDelay(self, value):
|
||||||
"""
|
"""
|
||||||
@ -556,7 +556,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
# If service item is the same as the current on only change slide
|
# If service item is the same as the current on only change slide
|
||||||
if item.__eq__(self.serviceItem):
|
if item.__eq__(self.serviceItem):
|
||||||
self.__checkUpdateSelectedSlide(slideno)
|
self.__checkUpdateSelectedSlide(slideno)
|
||||||
self.onSlideSelected()
|
self.slideSelected()
|
||||||
return
|
return
|
||||||
self._processItem(item, slideno)
|
self._processItem(item, slideno)
|
||||||
|
|
||||||
@ -641,7 +641,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.display.buildHtml(self.serviceItem)
|
self.display.buildHtml(self.serviceItem)
|
||||||
if serviceItem.is_media():
|
if serviceItem.is_media():
|
||||||
self.onMediaStart(serviceItem)
|
self.onMediaStart(serviceItem)
|
||||||
self.onSlideSelected(True)
|
self.slideSelected(True)
|
||||||
self.previewListWidget.setFocus()
|
self.previewListWidget.setFocus()
|
||||||
if old_item:
|
if old_item:
|
||||||
# Close the old item after the new one is opened
|
# Close the old item after the new one is opened
|
||||||
@ -699,7 +699,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
else:
|
else:
|
||||||
self.previewListWidget.selectRow(0)
|
self.previewListWidget.selectRow(0)
|
||||||
self.onSlideSelected()
|
self.slideSelected()
|
||||||
|
|
||||||
def onSlideSelectedIndex(self, message):
|
def onSlideSelectedIndex(self, message):
|
||||||
"""
|
"""
|
||||||
@ -714,7 +714,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
else:
|
else:
|
||||||
self.__checkUpdateSelectedSlide(index)
|
self.__checkUpdateSelectedSlide(index)
|
||||||
self.onSlideSelected()
|
self.slideSelected()
|
||||||
|
|
||||||
def mainDisplaySetBackground(self):
|
def mainDisplaySetBackground(self):
|
||||||
"""
|
"""
|
||||||
@ -755,15 +755,13 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.themeScreen.setChecked(False)
|
self.themeScreen.setChecked(False)
|
||||||
self.desktopScreen.setChecked(False)
|
self.desktopScreen.setChecked(False)
|
||||||
if checked:
|
if checked:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
|
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.parent.generalSettingsSection + u'/screen blank',
|
self.parent.generalSettingsSection + u'/screen blank',
|
||||||
QtCore.QVariant(u'blanked'))
|
QtCore.QVariant(u'blanked'))
|
||||||
else:
|
else:
|
||||||
Receiver.send_message(u'maindisplay_show')
|
|
||||||
QtCore.QSettings().remove(
|
QtCore.QSettings().remove(
|
||||||
self.parent.generalSettingsSection + u'/screen blank')
|
self.parent.generalSettingsSection + u'/screen blank')
|
||||||
self.blankPlugin(checked)
|
self.blankPlugin()
|
||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
|
|
||||||
def onThemeDisplay(self, checked):
|
def onThemeDisplay(self, checked):
|
||||||
@ -776,15 +774,13 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.themeScreen.setChecked(checked)
|
self.themeScreen.setChecked(checked)
|
||||||
self.desktopScreen.setChecked(False)
|
self.desktopScreen.setChecked(False)
|
||||||
if checked:
|
if checked:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
|
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.parent.generalSettingsSection + u'/screen blank',
|
self.parent.generalSettingsSection + u'/screen blank',
|
||||||
QtCore.QVariant(u'themed'))
|
QtCore.QVariant(u'themed'))
|
||||||
else:
|
else:
|
||||||
Receiver.send_message(u'maindisplay_show')
|
|
||||||
QtCore.QSettings().remove(
|
QtCore.QSettings().remove(
|
||||||
self.parent.generalSettingsSection + u'/screen blank')
|
self.parent.generalSettingsSection + u'/screen blank')
|
||||||
self.blankPlugin(checked)
|
self.blankPlugin()
|
||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
|
|
||||||
def onHideDisplay(self, checked):
|
def onHideDisplay(self, checked):
|
||||||
@ -797,28 +793,31 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.themeScreen.setChecked(False)
|
self.themeScreen.setChecked(False)
|
||||||
self.desktopScreen.setChecked(checked)
|
self.desktopScreen.setChecked(checked)
|
||||||
if checked:
|
if checked:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.parent.generalSettingsSection + u'/screen blank',
|
self.parent.generalSettingsSection + u'/screen blank',
|
||||||
QtCore.QVariant(u'hidden'))
|
QtCore.QVariant(u'hidden'))
|
||||||
else:
|
else:
|
||||||
Receiver.send_message(u'maindisplay_show')
|
|
||||||
QtCore.QSettings().remove(
|
QtCore.QSettings().remove(
|
||||||
self.parent.generalSettingsSection + u'/screen blank')
|
self.parent.generalSettingsSection + u'/screen blank')
|
||||||
self.hidePlugin(checked)
|
self.hidePlugin(checked)
|
||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
|
|
||||||
def blankPlugin(self, blank):
|
def blankPlugin(self):
|
||||||
"""
|
"""
|
||||||
Blank the display screen within a plugin if required.
|
Blank/Hide the display screen within a plugin if required.
|
||||||
"""
|
"""
|
||||||
log.debug(u'blankPlugin %s ', blank)
|
hide_mode = self.hideMode()
|
||||||
|
log.debug(u'blankPlugin %s ', hide_mode)
|
||||||
if self.serviceItem is not None:
|
if self.serviceItem is not None:
|
||||||
if blank:
|
if hide_mode:
|
||||||
|
if not self.serviceItem.is_command():
|
||||||
|
Receiver.send_message(u'maindisplay_hide', hide_mode)
|
||||||
Receiver.send_message(u'%s_blank'
|
Receiver.send_message(u'%s_blank'
|
||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive, hide_mode])
|
||||||
else:
|
else:
|
||||||
|
if not self.serviceItem.is_command():
|
||||||
|
Receiver.send_message(u'maindisplay_show')
|
||||||
Receiver.send_message(u'%s_unblank'
|
Receiver.send_message(u'%s_unblank'
|
||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
@ -830,15 +829,24 @@ class SlideController(QtGui.QWidget):
|
|||||||
log.debug(u'hidePlugin %s ', hide)
|
log.debug(u'hidePlugin %s ', hide)
|
||||||
if self.serviceItem is not None:
|
if self.serviceItem is not None:
|
||||||
if hide:
|
if hide:
|
||||||
|
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
||||||
Receiver.send_message(u'%s_hide'
|
Receiver.send_message(u'%s_hide'
|
||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
else:
|
else:
|
||||||
|
if not self.serviceItem.is_command():
|
||||||
|
Receiver.send_message(u'maindisplay_show')
|
||||||
Receiver.send_message(u'%s_unblank'
|
Receiver.send_message(u'%s_unblank'
|
||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
|
|
||||||
def onSlideSelected(self, start=False):
|
def onSlideSelected(self, start=False):
|
||||||
|
"""
|
||||||
|
Slide selected in controller
|
||||||
|
"""
|
||||||
|
self.slideSelected()
|
||||||
|
|
||||||
|
def slideSelected(self, start=False):
|
||||||
"""
|
"""
|
||||||
Generate the preview when you click on a slide.
|
Generate the preview when you click on a slide.
|
||||||
if this is the Live Controller also display on the screen
|
if this is the Live Controller also display on the screen
|
||||||
@ -927,7 +935,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
Receiver.send_message('servicemanager_next_item')
|
Receiver.send_message('servicemanager_next_item')
|
||||||
return
|
return
|
||||||
self.__checkUpdateSelectedSlide(row)
|
self.__checkUpdateSelectedSlide(row)
|
||||||
self.onSlideSelected()
|
self.slideSelected()
|
||||||
|
|
||||||
def onSlideSelectedPreviousNoloop(self):
|
def onSlideSelectedPreviousNoloop(self):
|
||||||
self.onSlideSelectedPrevious(False)
|
self.onSlideSelectedPrevious(False)
|
||||||
@ -950,7 +958,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
row = 0
|
row = 0
|
||||||
self.__checkUpdateSelectedSlide(row)
|
self.__checkUpdateSelectedSlide(row)
|
||||||
self.onSlideSelected()
|
self.slideSelected()
|
||||||
|
|
||||||
def __checkUpdateSelectedSlide(self, row):
|
def __checkUpdateSelectedSlide(self, row):
|
||||||
if row + 1 < self.previewListWidget.rowCount():
|
if row + 1 < self.previewListWidget.rowCount():
|
||||||
@ -971,7 +979,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
self.previewListWidget.selectRow(
|
self.previewListWidget.selectRow(
|
||||||
self.previewListWidget.rowCount() - 1)
|
self.previewListWidget.rowCount() - 1)
|
||||||
self.onSlideSelected()
|
self.slideSelected()
|
||||||
|
|
||||||
def onStartLoop(self):
|
def onStartLoop(self):
|
||||||
"""
|
"""
|
||||||
|
@ -70,11 +70,9 @@ class Controller(object):
|
|||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
||||||
self.stop()
|
self.stop()
|
||||||
elif hide_mode == HideMode.Theme:
|
elif hide_mode == HideMode.Theme:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
|
self.blank(hide_mode)
|
||||||
self.blank()
|
|
||||||
elif hide_mode == HideMode.Blank:
|
elif hide_mode == HideMode.Blank:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
|
self.blank(hide_mode)
|
||||||
self.blank()
|
|
||||||
else:
|
else:
|
||||||
self.doc.start_presentation()
|
self.doc.start_presentation()
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
||||||
@ -182,7 +180,7 @@ class Controller(object):
|
|||||||
#self.doc.slidenumber = 0
|
#self.doc.slidenumber = 0
|
||||||
#self.timer.stop()
|
#self.timer.stop()
|
||||||
|
|
||||||
def blank(self):
|
def blank(self, hide_mode):
|
||||||
"""
|
"""
|
||||||
Instruct the controller to blank the presentation
|
Instruct the controller to blank the presentation
|
||||||
"""
|
"""
|
||||||
@ -193,6 +191,8 @@ class Controller(object):
|
|||||||
return
|
return
|
||||||
if not self.doc.is_active():
|
if not self.doc.is_active():
|
||||||
return
|
return
|
||||||
|
if hide_mode == HideMode.Theme:
|
||||||
|
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
|
||||||
self.doc.blank_screen()
|
self.doc.blank_screen()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
@ -363,8 +363,9 @@ class MessageListener(object):
|
|||||||
React to the message to blank the display
|
React to the message to blank the display
|
||||||
"""
|
"""
|
||||||
is_live = message[1]
|
is_live = message[1]
|
||||||
|
hide_mode = message[2]
|
||||||
if is_live:
|
if is_live:
|
||||||
self.live_handler.blank()
|
self.live_handler.blank(hide_mode)
|
||||||
|
|
||||||
def unblank(self, message):
|
def unblank(self, message):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user