From 37c555494567badd292d0487f5ec5b512ef072c5 Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Sun, 5 Sep 2010 23:24:43 +0200 Subject: [PATCH] Work on some char stuff, more soon --- controller/character.py | 32 ++++++++++++++++++++++++++++++++ eos | 2 +- gui/characterEditor.py | 8 ++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 controller/character.py diff --git a/controller/character.py b/controller/character.py new file mode 100644 index 000000000..620b1753f --- /dev/null +++ b/controller/character.py @@ -0,0 +1,32 @@ +#=============================================================================== +# Copyright (C) 2010 Diego Duclos +# +# This file is part of pyfa. +# +# pyfa is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# pyfa is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with pyfa. If not, see . +#=============================================================================== + +import eos.db + +class Character(): + instance = None + @classmethod + def getInstance(cls): + if cls.instance is None: + cls.instance = Character() + + return cls.instance + + def getCharacterList(self): + map(lambda c: c.name, eos.db.getCharacterList()) diff --git a/eos b/eos index 7cea84e99..b557bb7ec 160000 --- a/eos +++ b/eos @@ -1 +1 @@ -Subproject commit 7cea84e99b70c08ef61c95d3f6492ec11642bf52 +Subproject commit b557bb7ec51c6e9c214e4fab9e2332afae1bebe9 diff --git a/gui/characterEditor.py b/gui/characterEditor.py index e74d277bd..4d2965223 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -90,6 +90,14 @@ class CharacterEditor (wx.Dialog): self.Centre(wx.BOTH) + self.registerEvents() + + def registerEvents(self): + self.Bind(wx.EVT_CLOSE, self.closeEvent) + + def closeEvent(self, event): + pass + class NewCharacter (wx.Dialog): def __init__(self, parent): wx.Dialog.__init__ (self, parent, id=wx.ID_ANY, title=u"Create new character", pos=wx.DefaultPosition, size=wx.Size(344, 89), style=wx.DEFAULT_DIALOG_STYLE)