diff options
author | Treeki <treeki@gmail.com> | 2011-11-22 22:25:00 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-11-22 22:25:00 +0100 |
commit | 3acb4765f5f80f0354213c1e23b9a2565bcdb58c (patch) | |
tree | ce3b2986de80bc670f5fc11de5c7597512f099f2 /src/main.py | |
parent | 7193760f2fbc2c0f4d911709cc942eefdee83e5b (diff) | |
download | koopatlas-3acb4765f5f80f0354213c1e23b9a2565bcdb58c.tar.gz koopatlas-3acb4765f5f80f0354213c1e23b9a2565bcdb58c.zip |
icons!
Diffstat (limited to '')
-rw-r--r-- | src/main.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main.py b/src/main.py index 1d53521..1ef7039 100644 --- a/src/main.py +++ b/src/main.py @@ -18,4 +18,20 @@ class KP: KP.mainWindow.show() KP.app.exec_() + + + @classmethod + def icon(cls, name): + try: + cache = cls.iconCache + except AttributeError: + cache = {} + cls.iconCache = cache + + try: + return cache[name] + except KeyError: + icon = QtGui.QIcon('Resources/%s.png' % name) + cache[name] = icon + return icon |