summaryrefslogtreecommitdiff
path: root/src/main.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.py16
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