chiark / gitweb /
Remove 'this dialog is shown only once' from new version dialog
[cura.git] / Cura / gui / newVersionDialog.py
1 __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
2
3 import wx
4 from Cura.util import version
5
6 class newVersionDialog(wx.Dialog):
7         url = "code.alephobjects.com/w/cura/release-notes/"
8
9         def __init__(self):
10                 super(newVersionDialog, self).__init__(None, title="Welcome to the new version!")
11
12                 wx.EVT_CLOSE(self, self.OnClose)
13
14                 p = wx.Panel(self)
15                 self.panel = p
16                 s = wx.BoxSizer(wx.VERTICAL)
17                 p.SetSizer(s)
18
19                 title_text = 'Cura - ' + version.getVersion()
20                 title = wx.StaticText(p, -1, title_text)
21                 font = wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD)
22                 title.SetFont(font)
23                 dc = wx.ScreenDC()
24                 dc.SetFont(font)
25                 title.SetMinSize(dc.GetTextExtent(title_text))
26                 s.Add(title, flag=wx.ALIGN_CENTRE|wx.EXPAND|wx.BOTTOM, border=5)
27                 s.Add(wx.StaticText(p, -1, _('Welcome to the new release of Cura LulzBot Edition!')))
28                 s.Add(wx.StaticLine(p), flag=wx.EXPAND|wx.TOP|wx.BOTTOM, border=10)
29                 s.Add(wx.StaticText(p, -1, _('Want to know what is new and cool in this version?')))
30                 s.Add(wx.StaticText(p, -1, _('Click here for a list of changes:')))
31                 s.Add(wx.HyperlinkCtrl(p, -1, newVersionDialog.url, newVersionDialog.url))
32
33                 s.Add(wx.StaticLine(p), flag=wx.EXPAND|wx.TOP|wx.BOTTOM, border=10)
34                 button = wx.Button(p, -1, _('OK'))
35                 self.Bind(wx.EVT_BUTTON, self.OnOk, button)
36                 s.Add(button, flag=wx.TOP|wx.ALIGN_RIGHT, border=5)
37
38                 s = wx.BoxSizer()
39                 s.Add(p, flag=wx.ALL, border=15)
40
41                 self.Layout()
42                 self.SetSizerAndFit(s)
43                 self.Centre()
44
45         def OnOk(self, e):
46                 self.Close()
47
48         def OnClose(self, e):
49                 self.Destroy()