forked from openlp/openlp
Removed an unused parameter from addToolbarButton, and added a "checkable" argument.
This commit is contained in:
parent
29a2138deb
commit
262577bd6e
@ -46,7 +46,7 @@ class OpenLPToolbar(QtGui.QToolBar):
|
|||||||
self.log.debug(u'Init done')
|
self.log.debug(u'Init done')
|
||||||
|
|
||||||
def addToolbarButton(self, title, icon, tooltip=None, slot=None,
|
def addToolbarButton(self, title, icon, tooltip=None, slot=None,
|
||||||
objectname=None):
|
checkable=False):
|
||||||
"""
|
"""
|
||||||
A method to help developers easily add a button to the toolbar.
|
A method to help developers easily add a button to the toolbar.
|
||||||
|
|
||||||
@ -69,12 +69,17 @@ class OpenLPToolbar(QtGui.QToolBar):
|
|||||||
"""
|
"""
|
||||||
ButtonIcon = buildIcon(icon)
|
ButtonIcon = buildIcon(icon)
|
||||||
if ButtonIcon:
|
if ButtonIcon:
|
||||||
if slot:
|
if slot and not checkable:
|
||||||
ToolbarButton = self.addAction(ButtonIcon, title, slot)
|
ToolbarButton = self.addAction(ButtonIcon, title, slot)
|
||||||
else:
|
else:
|
||||||
ToolbarButton = self.addAction(ButtonIcon, title)
|
ToolbarButton = self.addAction(ButtonIcon, title)
|
||||||
if tooltip:
|
if tooltip:
|
||||||
ToolbarButton.setToolTip(tooltip)
|
ToolbarButton.setToolTip(tooltip)
|
||||||
|
if checkable:
|
||||||
|
ToolbarButton.setCheckable(True)
|
||||||
|
QtCore.QObject.connect(ToolbarButton,
|
||||||
|
QtCore.SIGNAL(u'toggled(bool)'), slot)
|
||||||
|
#log.debug(u'checkable')
|
||||||
self.icons[title] = ButtonIcon
|
self.icons[title] = ButtonIcon
|
||||||
self.actions[title] = ToolbarButton
|
self.actions[title] = ToolbarButton
|
||||||
|
|
||||||
|
@ -159,8 +159,11 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.trUtf8(u'Move to last'), self.onSlideSelectedLast)
|
self.trUtf8(u'Move to last'), self.onSlideSelectedLast)
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||||
self.blackPushButton = self.Toolbar.addPushButton(
|
self.Toolbar.addToolbarButton(
|
||||||
u':/slides/slide_close.png')
|
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:
|
if not self.isLive:
|
||||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
@ -197,7 +200,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.trUtf8(u'Start playing media'), self.onMediaStop)
|
self.trUtf8(u'Start playing media'), self.onMediaStop)
|
||||||
self.volumeSlider = Phonon.VolumeSlider()
|
self.volumeSlider = Phonon.VolumeSlider()
|
||||||
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||||
self.volumeSlider.setObjectName("volumeSlider")
|
self.volumeSlider.setObjectName(u'volumeSlider')
|
||||||
self.Mediabar.addToolbarWidget(
|
self.Mediabar.addToolbarWidget(
|
||||||
u'Audio Volume', self.volumeSlider)
|
u'Audio Volume', self.volumeSlider)
|
||||||
self.ControllerLayout.addWidget(self.Mediabar)
|
self.ControllerLayout.addWidget(self.Mediabar)
|
||||||
@ -265,8 +268,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
QtCore.QObject.connect(self.PreviewListWidget,
|
QtCore.QObject.connect(self.PreviewListWidget,
|
||||||
QtCore.SIGNAL(u'activated(QModelIndex)'), self.onSlideSelected)
|
QtCore.SIGNAL(u'activated(QModelIndex)'), self.onSlideSelected)
|
||||||
if isLive:
|
if isLive:
|
||||||
QtCore.QObject.connect(self.blackPushButton,
|
#QtCore.QObject.connect(self.blackPushButton,
|
||||||
QtCore.SIGNAL(u'clicked(bool)'), self.onBlankScreen)
|
# QtCore.SIGNAL(u'clicked(bool)'), self.onBlankScreen)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay)
|
QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay)
|
||||||
Receiver().send_message(u'request_spin_delay')
|
Receiver().send_message(u'request_spin_delay')
|
||||||
|
Loading…
Reference in New Issue
Block a user