chiark / gitweb /
e6d9936b4cea3f671600ec29eb342b76b89fbff3
[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()
17                 self.SetSizer(s)
18                 s.Add(p, flag=wx.ALL, border=15)
19                 s = wx.BoxSizer(wx.VERTICAL)
20                 p.SetSizer(s)
21
22                 title_text = 'Cura - ' + version.getVersion()
23                 title = wx.StaticText(p, -1, title_text)
24                 font = wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD)
25                 title.SetFont(font)
26                 dc = wx.ScreenDC()
27                 dc.SetFont(font)
28                 title.SetMinSize(dc.GetTextExtent(title_text))
29                 s.Add(title, flag=wx.ALIGN_CENTRE|wx.EXPAND|wx.BOTTOM, border=5)
30                 s.Add(wx.StaticText(p, -1, _('Welcome to the new release of Cura LulzBot Edition!')))
31                 s.Add(wx.StaticText(p, -1, _('(This dialog is only shown once)')))
32                 s.Add(wx.StaticLine(p), flag=wx.EXPAND|wx.TOP|wx.BOTTOM, border=10)
33                 s.Add(wx.StaticText(p, -1, _('Want to know what is new and cool in this version?')))
34                 s.Add(wx.StaticText(p, -1, _('Click here for a list of changes:')))
35                 s.Add(wx.HyperlinkCtrl(p, -1, newVersionDialog.url))
36
37                 s.Add(wx.StaticLine(p), flag=wx.EXPAND|wx.TOP|wx.BOTTOM, border=10)
38                 button = wx.Button(p, -1, _('OK'))
39                 self.Bind(wx.EVT_BUTTON, self.OnOk, button)
40                 s.Add(button, flag=wx.TOP|wx.ALIGN_RIGHT, border=5)
41
42                 self.Fit()
43                 self.Centre()
44                 self.Layout()
45
46         def OnOk(self, e):
47                 self.Close()
48
49         def OnClose(self, e):
50                 self.Destroy()