Пример #1
0
def getPixmap(name):
    if name not in _pixmap:
        filename = getImagePath(name)
        if os.path.isfile(filename):
            pixmap = QtGui.QPixmap(filename)
            _pixmap[name] = pixmap
        else:
            raise Error, _("Image '%s' not found") % name
    return _pixmap[name]
Пример #2
0
def getPixbuf(name):
    if name not in _pixbuf:
        filename = getImagePath(name)
        if os.path.isfile(filename):
            pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
            _pixbuf[name] = pixbuf
        else:
            raise Error, _("Image '%s' not found") % name
    return _pixbuf[name]
Пример #3
0
def getPixbuf(name):
    if name not in _pixbuf:
        filename = getImagePath(name)
        if os.path.isfile(filename):
            pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
            _pixbuf[name] = pixbuf
        else:
            raise Error, _("Image '%s' not found") % name
    return _pixbuf[name]
Пример #4
0
def getPixmap(name):
    if name not in _pixmap:
        filename = getImagePath(name)
        if os.path.isfile(filename):
            pixmap = PyQt4.QtGui.QPixmap(filename)
            _pixmap[name] = pixmap
        else:
            raise Error, _("Image '%s' not found") % name
    return _pixmap[name]
Пример #5
0
def getPixbuf(name):
    if name not in _pixbuf:
        filename = getImagePath(name)
        if os.path.isfile(filename):
            icon_size = sysconf.get("gtk-icon-size")
            if icon_size:
                pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename, icon_size, icon_size)
            else:
                pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
            _pixbuf[name] = pixbuf
        else:
            raise Error, _("Image '%s' not found") % name
    return _pixbuf[name]
Пример #6
0
def getPixbuf(name):
    if name not in _pixbuf:
        filename = getImagePath(name)
        if os.path.isfile(filename):
            icon_size = sysconf.get("gtk-icon-size")
            if icon_size:
                pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(
                    filename, icon_size, icon_size)
            else:
                pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
            _pixbuf[name] = pixbuf
        else:
            raise Error, _("Image '%s' not found") % name
    return _pixbuf[name]