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 import os 20 21 import wx 22 23 from timelinelib.wxgui.components.font import deserialize_font 24 from timelinelib.wxgui.framework import Controller 25 from timelinelib.config.paths import EVENT_ICONS_DIR 26 272919531 self.config = config 32 self.experimental_features = experimental_features 33 self.weeks_map = ((0, "monday"), (1, "sunday")) 34 self._set_initial_values()3537 self.config.minor_strip_divider_line_colour = str(self.view.GetMinorStripColor()) 38 self.config.major_strip_divider_line_colour = str(self.view.GetMajorStripColor()) 39 self.config.now_line_colour = str(self.view.GetNowLineColor()) 40 self.config.weekend_colour = str(self.view.GetWeekendColor()) 41 self.config.bg_colour = str(self.view.GetBgColor()) 42 self.config.legend_pos = self.view.GetLegendPos() 43 self.config.time_scale_pos = self.view.GetTimeScalePos() 44 self.config.default_year = self.view.GetDefaultYear() 45 self.config.default_month = self.view.GetDefaultMonth() 46 self.config.default_day = self.view.GetDefaultDay()47 50 53 56 59 62 6567 self.view.ShowSelectDateFormatDialog(self.config) 68 self.view.SetCurrentDateFormat("%s: %s" % (_("Current"), self.config.date_format))69 72 75 78 8183 font = deserialize_font(self.config.balloon_font) 84 if self.view.ShowEditFontDialog(font): 85 self.config.balloon_font = font.serialize() 86 self.view.SetBalloonFont(font)8789 font = deserialize_font(self.config.major_strip_font) 90 if self.view.ShowEditFontDialog(font): 91 self.config.major_strip_font = font.serialize() 92 self.view.SetMajorStripFont(font)9395 font = deserialize_font(self.config.minor_strip_font) 96 if self.view.ShowEditFontDialog(font): 97 self.config.minor_strip_font = font.serialize() 98 self.view.SetMinorStripFont(font)99101 font = deserialize_font(self.config.legend_font) 102 if self.view.ShowEditFontDialog(font): 103 self.config.legend_font = font.serialize() 104 self.view.SetLegendFont(font)105107 self.experimental_features.set_active_state_on_feature_by_name( 108 event.GetEventObject().GetLabel(), event.IsChecked()) 109 self.config.experimental_features = str(self.experimental_features)110 114 118 122 125 128 131 134 137 140 143145 self.view.SetOpenRecentCheckboxValue(self.config.open_recent_at_startup) 146 self.view.SetInertialScrollingCheckboxValue(self.config.use_inertial_scrolling) 147 self.view.SetNeverPeriodPointCheckboxValue(self.config.never_show_period_events_as_point_events) 148 self.view.SetCenterTextCheckboxValue(self.config.center_event_texts) 149 self.view.SetWeekStartSelection(self._week_index(self.config.get_week_start())) 150 self.view.AddExperimentalFeatures(self.experimental_features.get_all_features()) 151 self.view.SetUncheckTimeForNewEventsCheckboxValue(self.config.uncheck_time_for_new_events) 152 self.view.SetTextBelowIconCheckboxValue(self.config.text_below_icon) 153 self.view.SetFilteredListboxExport(self.config.filtered_listbox_export) 154 self.view.SetMinorStripColor(wx.Colour(*self.config.minor_strip_divider_line_colour)) 155 self.view.SetMajorStripColor(wx.Colour(*self.config.major_strip_divider_line_colour)) 156 self.view.SetNowLineColor(wx.Colour(*self.config.now_line_colour)) 157 self.view.SetWeekendColor(wx.Colour(*self.config.weekend_colour)) 158 self.view.SetBgColor(wx.Colour(*self.config.bg_colour)) 159 choices = [f for f in os.listdir(EVENT_ICONS_DIR) if f.endswith(".png")] 160 self.view.SetIconsChoices(choices) 161 self.view.SetFuzzyIcon(self.config.fuzzy_icon) 162 self.view.SetLockedIcon(self.config.locked_icon) 163 self.view.SetHyperlinkIcon(self.config.hyperlink_icon) 164 self.view.SetCurrentDateFormat("%s: %s" % (_("Current"), self.config.date_format)) 165 self.view.DisplayIcons() 166 self.view.SetVerticalSpaceBetweenEvents(self.config.vertical_space_between_events) 167 self.view.SetColorizeWeekends(self.config.colorize_weekends) 168 self.view.SetUseBoldNowline(self.config.use_bold_nowline) 169 self.view.SetSkipSInDecadeText(self.config.skip_s_in_decade_text) 170 self.view.SetDisplayCheckmarkOnEventsDone(self.config.display_checkmark_on_events_done) 171 self.view.SetNeverUseTime(self.config.never_use_time) 172 self.view.SetUseSecond(self.config.use_second) 173 self.view.SetUseDateDefaultValues(self.config.use_date_default_values) 174 self.view.SetDefaultYear(self.config.default_year) 175 self.view.SetDefaultMonth(self.config.default_month) 176 self.view.SetDefaultDay(self.config.default_day) 177 self.view.SetMajorStripFont(deserialize_font(self.config.major_strip_font)) 178 self.view.SetMinorStripFont(deserialize_font(self.config.minor_strip_font)) 179 self.view.SetLegendFont(deserialize_font(self.config.legend_font)) 180 self.view.SetBalloonFont(deserialize_font(self.config.balloon_font)) 181 self.view.SetLegendPos(self.config.legend_pos) 182 self.view.SetTimeScalePos(self.config.time_scale_pos)183185 for (i, w) in self.weeks_map: 186 if w == week: 187 return i 188 raise ValueError("Unknown week '%s'." % week)189
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jun 26 01:55:29 2020 | http://epydoc.sourceforge.net |