summaryrefslogtreecommitdiff
path: root/src/main.py
blob: e6b72d2a9b912ec4f7c765e93ebd3d4ee26f8cf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from common import *

class KP:
	@staticmethod
	def run():
		KP.app = QtGui.QApplication(sys.argv)

		from mapdata import KPMap
		KP.map = KPMap()

		from ui import KPMainWindow
		
		KP.mainWindow = KPMainWindow()
		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