Home | Trees | Indices | Help |
|
---|
|
1 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Rickard Lindberg, Roger Lindberg 2 # 3 # This file is part of Timeline. 4 # 5 # Timeline is free software: you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by 7 # the Free Software Foundation, either version 3 of the License, or 8 # (at your option) any later version. 9 # 10 # Timeline is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with Timeline. If not, see <http://www.gnu.org/licenses/>. 17 18 19 from timelinelib.wxgui.framework import Controller 20 2123 24 """ 25 This controller is responsible for two things: 26 27 1. Creating a new container 28 2. Updating properties of an existing container 29 30 When creating a new container the result is NOT stored in the database. 31 This happens later when the first event added to the container is saved to 32 the database. 33 34 The reason for this behavior is that we don't want to have empty containers 35 in the database. When updating the properties of an existing container the 36 changes are stored in the timeline database. 37 """ 38 437745 if self._validate(): 46 self._populate_container() 47 if self._is_updating: 48 self._container.save() 49 self.view.EndModalOk()50 5355 if container is None: 56 self._is_updating = False 57 self._container = db.new_container(text="", category=None) 58 else: 59 self._is_updating = True 60 self._container = container6163 self.view.SetName(self._container.get_text()) 64 self.view.SetCategory(self._container.get_category())6567 if self.view.GetName() == "": 68 self.view.DisplayInvalidName( 69 _("Field '%s' can't be empty.") % _("Name") 70 ) 71 return False 72 return True73
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Dec 19 02:55:28 2018 | http://epydoc.sourceforge.net |