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 21237925 self._db = db 26 self._create_category(category) 27 self.view.PopulateCategories(exclude=category) 28 self._populate_view()2931 if self._validate(): 32 self._populate_category() 33 self._category.save() 34 self.view.EndModalOk()35 3840 if category is None: 41 self._category = self._db.new_category() 42 else: 43 self._category = category4446 self.view.SetName(self._category.name) 47 self.view.SetColor(self._category.color) 48 self.view.SetProgressColor(self._category.progress_color) 49 self.view.SetDoneColor(self._category.done_color) 50 self.view.SetFontColor(self._category.font_color) 51 self.view.SetParent(self._category.parent)5254 new_name = self.view.GetName() 55 if not self._is_name_valid(new_name): 56 self.view.HandleInvalidName(new_name) 57 return False 58 if self._is_name_in_use(new_name): 59 self.view.HandleUsedName(new_name) 60 return False 61 return True6264 return len(name) > 06567 for cat in self._db.get_categories(): 68 if cat != self._category and cat.get_name() == name: 69 return True 70 return False7173 self._category.name = self.view.GetName() 74 self._category.color = self.view.GetColor() 75 self._category.progress_color = self.view.GetProgressColor() 76 self._category.done_color = self.view.GetDoneColor() 77 self._category.font_color = self.view.GetFontColor() 78 self._category.parent = self.view.GetParent()
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Dec 19 02:55:28 2018 | http://epydoc.sourceforge.net |