summaryrefslogtreecommitdiff
path: root/src/main.py
blob: a429916f1d736403a26a5d8433811a4ba50d0148 (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
34
35
36
from common import *

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

		KP.app.settings = QtCore.QSettings('Koopatlas', 'Newer Team')


		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