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')
|
||||
|
||||
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.
|
||||
|
||||
@ -69,12 +69,17 @@ class OpenLPToolbar(QtGui.QToolBar):
|
||||
"""
|
||||
ButtonIcon = buildIcon(icon)
|
||||
if ButtonIcon:
|
||||
if slot:
|
||||
if slot and not checkable:
|
||||
ToolbarButton = self.addAction(ButtonIcon, title, slot)
|
||||
else:
|
||||
ToolbarButton = self.addAction(ButtonIcon, title)
|
||||
if 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.actions[title] = ToolbarButton
|
||||
|
||||
|
@ -159,8 +159,11 @@ class SlideController(QtGui.QWidget):
|
||||
self.trUtf8(u'Move to last'), self.onSlideSelectedLast)
|
||||
if self.isLive:
|
||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.blackPushButton = self.Toolbar.addPushButton(
|
||||
u':/slides/slide_close.png')
|
||||
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(
|
||||
@ -197,7 +200,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.trUtf8(u'Start playing media'), self.onMediaStop)
|
||||
self.volumeSlider = Phonon.VolumeSlider()
|
||||
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||
self.volumeSlider.setObjectName("volumeSlider")
|
||||
self.volumeSlider.setObjectName(u'volumeSlider')
|
||||
self.Mediabar.addToolbarWidget(
|
||||
u'Audio Volume', self.volumeSlider)
|
||||
self.ControllerLayout.addWidget(self.Mediabar)
|
||||
@ -265,8 +268,8 @@ class SlideController(QtGui.QWidget):
|
||||
QtCore.QObject.connect(self.PreviewListWidget,
|
||||
QtCore.SIGNAL(u'activated(QModelIndex)'), self.onSlideSelected)
|
||||
if isLive:
|
||||
QtCore.QObject.connect(self.blackPushButton,
|
||||
QtCore.SIGNAL(u'clicked(bool)'), self.onBlankScreen)
|
||||
#QtCore.QObject.connect(self.blackPushButton,
|
||||
# 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')
|
||||
|
Loading…
Reference in New Issue
Block a user