| 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.dialogs.fieldselection.controller import FIELDS
20 from timelinelib.wxgui.framework import Controller
21
22
23 CSV_FILE = _("CSV File")
24 TARGET_TYPES = (CSV_FILE,)
25 TEXT_ENCODINGS = ("utf-8", "cp1252", "cp850")
26
27
29
31 self.event_fields = FIELDS["Event"]
32 self.category_fields = FIELDS["Category"]
33 self.view.SetTargetTypes(TARGET_TYPES)
34 self.view.SetTextEncodings(TEXT_ENCODINGS)
35 self.view.SetEvents(True)
36 self.view.SetCategories(False)
37
44
47
50
53
56
59
62
64 if not self.view.GetExportEvents() and not self.view.GetExportCategories():
65 self.view.DisplayInformationMessage(_("Invalid Data"), _("At least one Export Item must be selected"))
66 return False
67 if self.view.GetExportEvents() and self.event_fields == []:
68 self.view.DisplayInformationMessage(_("Invalid Data"), _("At least one Event Field must be selected"))
69 return False
70 if self.view.GetExportCategories() and self.category_fields == []:
71 self.view.DisplayInformationMessage(_("Invalid Data"), _("At least one Category Field must be selected"))
72 return False
73 return True
74
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Fri Jan 25 02:55:27 2019 | http://epydoc.sourceforge.net |