This commit is contained in:
Jon Tibble 2010-06-19 14:18:38 +01:00
parent 14cafa91c2
commit 0235f251bf
3 changed files with 2 additions and 7 deletions

View File

@ -95,11 +95,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)
@ -107,7 +106,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

View File

@ -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:

View File

@ -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__)