Fixed up an issue between the display screen and the blank button

This commit is contained in:
Raoul Snyman 2009-11-13 22:10:35 +02:00
parent 262577bd6e
commit 8c599b6707
3 changed files with 22 additions and 26 deletions

View File

@ -79,9 +79,9 @@ class OpenLPToolbar(QtGui.QToolBar):
ToolbarButton.setCheckable(True)
QtCore.QObject.connect(ToolbarButton,
QtCore.SIGNAL(u'toggled(bool)'), slot)
#log.debug(u'checkable')
self.icons[title] = ButtonIcon
self.actions[title] = ToolbarButton
return ToolbarButton
def addToolbarSeparator(self, handle):
"""

View File

@ -208,7 +208,7 @@ class MainDisplay(DisplayWidget):
# def aa(self):
# self.setWindowOpacity(1)
def blankDisplay(self):
def blankDisplay(self, blanked=True):
if not self.displayBlank:
self.displayBlank = True
self.display.setPixmap(QtGui.QPixmap.fromImage(self.blankFrame))
@ -216,11 +216,9 @@ class MainDisplay(DisplayWidget):
self.displayBlank = False
if self.frame:
self.frameView(self.frame)
if self.parent.LiveController.blackPushButton.isChecked() != \
self.displayBlank:
self.parent.LiveController.blackPushButton.setChecked(
self.displayBlank)
self.parent.generalConfig.set_config(u'Screen Blank',self.displayBlank)
if blanked != self.displayBlank:
self.parent.LiveController.blankButton.setChecked(self.displayBlank)
self.parent.generalConfig.set_config(u'Screen Blank', self.displayBlank)
def displayAlert(self, text=u''):
"""

View File

@ -159,11 +159,9 @@ class SlideController(QtGui.QWidget):
self.trUtf8(u'Move to last'), self.onSlideSelectedLast)
if self.isLive:
self.Toolbar.addToolbarSeparator(u'Close Separator')
self.Toolbar.addToolbarButton(
self.blankButton = self.Toolbar.addToolbarButton(
u'Blank Screen', u':/slides/slide_close.png',
self.trUtf8(u'Blank Screen'), self.onBlankScreen, True)
#self.blackPushButton = self.Toolbar.addPushButton(
# u':/slides/slide_close.png')
if not self.isLive:
self.Toolbar.addToolbarSeparator(u'Close Separator')
self.Toolbar.addToolbarButton(
@ -272,7 +270,7 @@ class SlideController(QtGui.QWidget):
# QtCore.SIGNAL(u'clicked(bool)'), self.onBlankScreen)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay)
Receiver().send_message(u'request_spin_delay')
Receiver.send_message(u'request_spin_delay')
if isLive:
self.Toolbar.makeWidgetsInvisible(self.image_list)
else:
@ -405,7 +403,7 @@ class SlideController(QtGui.QWidget):
self.enableToolBar(item)
if item.isCommand():
if self.isLive:
Receiver().send_message(u'%s_start' % item.name.lower(), \
Receiver.send_message(u'%s_start' % item.name.lower(), \
[item.shortname, item.service_item_path,
item.service_frames[0][u'title'], self.isLive])
else:
@ -438,7 +436,7 @@ class SlideController(QtGui.QWidget):
self.enableToolBar(item)
if item.isCommand():
if self.isLive:
Receiver().send_message(u'%s_start' % item.name.lower(), \
Receiver.send_message(u'%s_start' % item.name.lower(), \
[item.shortname, item.service_item_path,
item.service_frames[0][u'title'], slideno, self.isLive])
else:
@ -491,7 +489,7 @@ class SlideController(QtGui.QWidget):
self.PreviewListWidget.setFocus()
log.log(15, u'Display Rendering took %4s' % (time.time() - before))
if self.serviceitem.audit and self.isLive:
Receiver().send_message(u'songusage_live', self.serviceitem.audit)
Receiver.send_message(u'songusage_live', self.serviceitem.audit)
log.debug(u'displayServiceManagerItems End')
#Screen event methods
@ -500,7 +498,7 @@ class SlideController(QtGui.QWidget):
Go to the first slide.
"""
if self.commandItem and self.commandItem.isCommand():
Receiver().send_message(u'%s_first'% self.commandItem.name.lower())
Receiver.send_message(u'%s_first'% self.commandItem.name.lower())
self.updatePreview()
else:
self.PreviewListWidget.selectRow(0)
@ -512,11 +510,11 @@ class SlideController(QtGui.QWidget):
"""
if self.commandItem and self.commandItem.isCommand():
if blanked:
Receiver().send_message(u'%s_blank'% self.commandItem.name.lower())
Receiver.send_message(u'%s_blank'% self.commandItem.name.lower())
else:
Receiver().send_message(u'%s_unblank'% self.commandItem.name.lower())
Receiver.send_message(u'%s_unblank'% self.commandItem.name.lower())
else:
self.parent.mainDisplay.blankDisplay()
self.parent.mainDisplay.blankDisplay(blanked)
def onSlideSelected(self):
"""
@ -527,7 +525,7 @@ class SlideController(QtGui.QWidget):
self.row = 0
if row > -1 and row < self.PreviewListWidget.rowCount():
if self.commandItem.isCommand():
Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row])
Receiver.send_message(u'%s_slide'% self.commandItem.name.lower(), [row])
if self.isLive:
self.updatePreview()
else:
@ -572,7 +570,7 @@ class SlideController(QtGui.QWidget):
Go to the next slide.
"""
if self.commandItem and self.commandItem.isCommand():
Receiver().send_message(u'%s_next'% self.commandItem.name.lower())
Receiver.send_message(u'%s_next'% self.commandItem.name.lower())
self.updatePreview()
else:
row = self.PreviewListWidget.currentRow() + 1
@ -586,7 +584,7 @@ class SlideController(QtGui.QWidget):
Go to the previous slide.
"""
if self.commandItem and self.commandItem.isCommand():
Receiver().send_message(
Receiver.send_message(
u'%s_previous'% self.commandItem.name.lower())
self.updatePreview()
else:
@ -601,7 +599,7 @@ class SlideController(QtGui.QWidget):
Go to the last slide.
"""
if self.commandItem and self.commandItem.isCommand():
Receiver().send_message(u'%s_last'% self.commandItem.name.lower())
Receiver.send_message(u'%s_last'% self.commandItem.name.lower())
self.updatePreview()
else:
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1)
@ -630,7 +628,7 @@ class SlideController(QtGui.QWidget):
def onEditSong(self):
self.songEdit = True
Receiver().send_message(u'%s_edit' % self.commandItem.name, u'P:%s' %
Receiver.send_message(u'%s_edit' % self.commandItem.name, u'P:%s' %
self.commandItem.editId )
def onGoLive(self):
@ -651,13 +649,13 @@ class SlideController(QtGui.QWidget):
def onMediaPause(self):
if self.isLive:
Receiver().send_message(u'%s_pause'% self.commandItem.name.lower())
Receiver.send_message(u'%s_pause'% self.commandItem.name.lower())
else:
self.mediaObject.pause()
def onMediaPlay(self):
if self.isLive:
Receiver().send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive)
Receiver.send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive)
else:
self.SlidePreview.hide()
self.video.show()
@ -665,7 +663,7 @@ class SlideController(QtGui.QWidget):
def onMediaStop(self):
if self.isLive:
Receiver().send_message(u'%s_stop'% self.commandItem.name.lower())
Receiver.send_message(u'%s_stop'% self.commandItem.name.lower())
else:
self.mediaObject.stop()
self.video.hide()