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 272917531 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 46 49 52 55 58 6163 self.view.ShowSelectDateFormatDialog(self.config) 64 self.view.SetCurrentDateFormat("%s: %s" % (_("Current"), self.config.date_format))65 68 71 74 7779 font = deserialize_font(self.config.balloon_font) 80 if self.view.ShowEditFontDialog(font): 81 self.config.balloon_font = font.serialize() 82 self.view.SetBalloonFont(font)8385 font = deserialize_font(self.config.major_strip_font) 86 if self.view.ShowEditFontDialog(font): 87 self.config.major_strip_font = font.serialize() 88 self.view.SetMajorStripFont(font)8991 font = deserialize_font(self.config.minor_strip_font) 92 if self.view.ShowEditFontDialog(font): 93 self.config.minor_strip_font = font.serialize() 94 self.view.SetMinorStripFont(font)9597 font = deserialize_font(self.config.legend_font) 98 if self.view.ShowEditFontDialog(font): 99 self.config.legend_font = font.serialize() 100 self.view.SetLegendFont(font)101103 self.experimental_features.set_active_state_on_feature_by_name( 104 event.GetEventObject().GetLabel(), event.IsChecked()) 105 self.config.experimental_features = str(self.experimental_features)106 110 114 118 121 124 127 130132 self.view.SetOpenRecentCheckboxValue(self.config.open_recent_at_startup) 133 self.view.SetInertialScrollingCheckboxValue(self.config.use_inertial_scrolling) 134 self.view.SetNeverPeriodPointCheckboxValue(self.config.never_show_period_events_as_point_events) 135 self.view.SetCenterTextCheckboxValue(self.config.center_event_texts) 136 self.view.SetWeekStartSelection(self._week_index(self.config.get_week_start())) 137 self.view.AddExperimentalFeatures(self.experimental_features.get_all_features()) 138 self.view.SetUncheckTimeForNewEventsCheckboxValue(self.config.uncheck_time_for_new_events) 139 self.view.SetTextBelowIconCheckboxValue(self.config.text_below_icon) 140 self.view.SetFilteredListboxExport(self.config.filtered_listbox_export) 141 self.view.SetMinorStripColor(wx.Colour(*self.config.minor_strip_divider_line_colour)) 142 self.view.SetMajorStripColor(wx.Colour(*self.config.major_strip_divider_line_colour)) 143 self.view.SetNowLineColor(wx.Colour(*self.config.now_line_colour)) 144 self.view.SetWeekendColor(wx.Colour(*self.config.weekend_colour)) 145 self.view.SetBgColor(wx.Colour(*self.config.bg_colour)) 146 choices = [f for f in os.listdir(EVENT_ICONS_DIR) if f.endswith(".png")] 147 self.view.SetIconsChoices(choices) 148 self.view.SetFuzzyIcon(self.config.fuzzy_icon) 149 self.view.SetLockedIcon(self.config.locked_icon) 150 self.view.SetHyperlinkIcon(self.config.hyperlink_icon) 151 self.view.SetCurrentDateFormat("%s: %s" % (_("Current"), self.config.date_format)) 152 self.view.DisplayIcons() 153 self.view.SetVerticalSpaceBetweenEvents(self.config.vertical_space_between_events) 154 self.view.SetColorizeWeekends(self.config.colorize_weekends) 155 self.view.SetSkipSInDecadeText(self.config.skip_s_in_decade_text) 156 self.view.SetDisplayCheckmarkOnEventsDone(self.config.display_checkmark_on_events_done) 157 self.view.SetNeverUseTime(self.config.never_use_time) 158 self.view.SetMajorStripFont(deserialize_font(self.config.major_strip_font)) 159 self.view.SetMinorStripFont(deserialize_font(self.config.minor_strip_font)) 160 self.view.SetLegendFont(deserialize_font(self.config.legend_font)) 161 self.view.SetBalloonFont(deserialize_font(self.config.balloon_font)) 162 self.view.SetLegendPos(self.config.legend_pos)163165 for (i, w) in self.weeks_map: 166 if w == week: 167 return i 168 raise ValueError("Unknown week '%s'." % week)169
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu May 10 01:55:20 2018 | http://epydoc.sourceforge.net |