Mercurial > getan
changeset 172:b8abca7714fd
Drop AddProjectNameState
This state is not necessary. A project doesn't have a name only key and
description.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Thu, 13 Dec 2012 08:57:05 +0100 |
parents | a34693c5905f |
children | a5319bb1ac13 |
files | getan/states.py |
diffstat | 1 files changed, 6 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/getan/states.py Thu Dec 13 08:25:09 2012 +0100 +++ b/getan/states.py Thu Dec 13 08:57:05 2012 +0100 @@ -85,7 +85,7 @@ return self.select() if keys.get_insert() in key: - return AddProjectNameState(self.controller, self.view) + return AddProjectKeyState(self.controller, self.view) if keys.get_escape() in key: return ExitState(self.controller, self.view) @@ -586,45 +586,24 @@ return PausedProjectsState(self.controller, self.view) -class AddProjectNameState(CreateProjectState): +class AddProjectKeyState(CreateProjectState): + messages = { 'choose_proj': _(' Choose a project.'), - 'proj_name': _('Insert new project name: '), + 'proj_key': _('Insert key for new project: '), } def __init__(self, controller, view): - controller.view.set_footer_text(self.msg('proj_name'), - 'question', 1) - super(AddProjectNameState, self).__init__(controller, view) - self.view.frame.set_focus('footer') - - def enter(self): - project = self.footer.get_edit_text() - if project == '': - return self - return AddProjectKeyState(self.controller, self.view, project) - - -class AddProjectKeyState(CreateProjectState): - - messages = { - 'proj_name': _('Insert new project name: '), - 'proj_key': _('Insert key for new project: '), - } - - def __init__(self, controller, view, project): controller.view.set_footer_text(self.msg('proj_key'), 'question', 1) super(AddProjectKeyState, self).__init__(controller, view) self.view.frame.set_focus('footer') - self.project = project def enter(self): key = self.footer.get_edit_text() if key == '': return self - return AddProjectDescriptionState(self.controller, self.view, - self.project, key) + return AddProjectDescriptionState(self.controller, self.view, key) class AddProjectDescriptionState(CreateProjectState): @@ -633,12 +612,11 @@ 'choose_proj': _(" Choose a project.") } - def __init__(self, controller, view, project, key): + def __init__(self, controller, view, key): controller.view.set_footer_text(self.msg('proj_description'), 'question', 1) super(AddProjectDescriptionState, self).__init__(controller, view) self.view.frame.set_focus('footer') - self.project = project self.key = key def enter(self):