forked from openlp/openlp
Cleanups
bzr-revno: 860
This commit is contained in:
commit
685fe0311a
@ -97,11 +97,10 @@ def build_icon(icon):
|
||||
The icon to build. This can be a QIcon, a resource string in the form
|
||||
``:/resource/file.png``, or a file location like ``/path/to/file.png``.
|
||||
"""
|
||||
button_icon = None
|
||||
button_icon = QtGui.QIcon()
|
||||
if isinstance(icon, QtGui.QIcon):
|
||||
button_icon = icon
|
||||
elif isinstance(icon, basestring):
|
||||
button_icon = QtGui.QIcon()
|
||||
if icon.startswith(u':/'):
|
||||
button_icon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,
|
||||
QtGui.QIcon.Off)
|
||||
@ -109,7 +108,6 @@ def build_icon(icon):
|
||||
button_icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
|
||||
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
elif isinstance(icon, QtGui.QImage):
|
||||
button_icon = QtGui.QIcon()
|
||||
button_icon.addPixmap(QtGui.QPixmap.fromImage(icon),
|
||||
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
return button_icon
|
||||
|
@ -72,9 +72,6 @@ class OpenLPToolbar(QtGui.QToolBar):
|
||||
ToolbarButton = None
|
||||
if icon:
|
||||
ButtonIcon = build_icon(icon)
|
||||
else:
|
||||
ButtonIcon = None
|
||||
if ButtonIcon:
|
||||
if slot and not checkable:
|
||||
ToolbarButton = self.addAction(ButtonIcon, title, slot)
|
||||
else:
|
||||
|
@ -29,7 +29,7 @@ import os
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
|
||||
ItemCapabilities, SettingsManager, context_menu_action, Receiver, translate
|
||||
ItemCapabilities, SettingsManager, translate
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user