# =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pyfa is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pyfa. If not, see
This is a pre-release, be prepared for unstable features
" if version.is_prerelease else "", release_markup ), "") notesSizer.Add(self.browser, 1, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) mainSizer.Add(notesSizer, 1, wx.EXPAND, 5) self.supressCheckbox = wx.CheckBox(self, wx.ID_ANY, _t("Don't remind me again for this release"), wx.DefaultPosition, wx.DefaultSize, 0) self.supressCheckbox.Bind(wx.EVT_CHECKBOX, self.SuppressChange) mainSizer.Add(self.supressCheckbox, 0, wx.ALL, 5) mainSizer.Add(wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0, wx.EXPAND | wx.ALL, 5) actionSizer = wx.BoxSizer(wx.HORIZONTAL) goSizer = wx.BoxSizer(wx.VERTICAL) self.downloadButton = wx.Button(self, wx.ID_ANY, _t("Download"), wx.DefaultPosition, wx.DefaultSize, 0) self.downloadButton.Bind(wx.EVT_BUTTON, self.OnDownload) goSizer.Add(self.downloadButton, 0, wx.ALL, 5) actionSizer.Add(goSizer, 1, wx.EXPAND, 5) self.closeButton = wx.Button(self, wx.ID_CLOSE) self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose) actionSizer.Add(self.closeButton, 0, wx.ALL, 5) mainSizer.Add(actionSizer, 0, wx.EXPAND, 5) self.SetSizer(mainSizer) self.Layout() # Handle use-case of suppressing a release, then a new version becoming available. # If that new version is not suppressed, the old version will remain in the preferences and # may cause confusion. If this dialog box is popping up for any reason, that mean we can # safely reset this setting self.UpdateSettings.set('version', None) self.Centre(wx.BOTH) def OnClose(self, e): self.Close() def OnNewWindow(self, event): url = event.GetURL() webbrowser.open(url) def SuppressChange(self, e): if self.supressCheckbox.IsChecked(): self.UpdateSettings.set('version', self.releaseInfo['tag_name']) else: self.UpdateSettings.set('version', None) def OnDownload(self, e): wx.LaunchDefaultBrowser('https://github.com/pyfa-org/Pyfa/releases/tag/' + self.releaseInfo['tag_name']) self.OnClose(e)