chiark / gitweb /
52aeefa7d7d16f0c96f421c7b1c1a412cc0e3594
[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.gui import firmwareInstall
5 from Cura.util import version
6 from Cura.util import profile
7
8 class newVersionDialog(wx.Dialog):
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 = wx.StaticText(p, -1, 'Cura - ' + version.getVersion())
23                 title.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD))
24                 s.Add(title, flag=wx.ALIGN_CENTRE|wx.EXPAND|wx.BOTTOM, border=5)
25                 s.Add(wx.StaticText(p, -1, 'Welcome to the new version of Cura.'))
26                 s.Add(wx.StaticText(p, -1, '(This dialog is only shown once)'))
27                 s.Add(wx.StaticLine(p), flag=wx.EXPAND|wx.TOP|wx.BOTTOM, border=10)
28                 s.Add(wx.StaticText(p, -1, 'New in this version:'))
29                 s.Add(wx.StaticText(p, -1, '* Added an expert parameter for the wipe tower size, and made brim go around the wipe tower'))
30                 s.Add(wx.StaticText(p, -1, '* Added experimental support for printing with the Doodle3D WiFi box'))
31                 s.Add(wx.StaticText(p, -1, '* Updated object boundaries for multi-object prints, allows for tighter fitting of objects on the build platform'))
32                 s.Add(wx.StaticText(p, -1, '* Updated time-estimate to greatly improve accuracy of the estimate.'))
33                 s.Add(wx.StaticText(p, -1, '* Fixed problem with retractions not happening when they should.'))
34
35                 self.hasUltimaker = None
36                 self.hasUltimaker2 = None
37                 for n in xrange(0, profile.getMachineCount()):
38                         if profile.getMachineSetting('machine_type', n) == 'ultimaker':
39                                 self.hasUltimaker = n
40                         if profile.getMachineSetting('machine_type', n) == 'ultimaker2':
41                                 self.hasUltimaker2 = n
42                 if self.hasUltimaker is not None:
43                         s.Add(wx.StaticLine(p), flag=wx.EXPAND|wx.TOP|wx.BOTTOM, border=10)
44                         s.Add(wx.StaticText(p, -1, 'New firmware for your Ultimaker Original:'))
45                         s.Add(wx.StaticText(p, -1, '* Fixed bug in acceleration planning causing slow moves on rare occasions.'))
46                         s.Add(wx.StaticText(p, -1, '* Updated to new ErikZalm Marlin base, fixing the long standing slower retraction bug.'))
47                         button = wx.Button(p, -1, 'Install now')
48                         self.Bind(wx.EVT_BUTTON, self.OnUltimakerFirmware, button)
49                         s.Add(button, flag=wx.TOP, border=5)
50                 if self.hasUltimaker2 is not None:
51                         s.Add(wx.StaticLine(p), flag=wx.EXPAND|wx.TOP|wx.BOTTOM, border=10)
52                         s.Add(wx.StaticText(p, -1, 'New firmware for your Ultimaker2:'))
53                         s.Add(wx.StaticText(p, -1, '* Fixed bug in acceleration planning causing slow moves on rare occasions.'))
54                         s.Add(wx.StaticText(p, -1, '* Disabled normal LCD menu curing USB printing.'))
55                         button = wx.Button(p, -1, 'Install now')
56                         self.Bind(wx.EVT_BUTTON, self.OnUltimaker2Firmware, button)
57                         s.Add(button, flag=wx.TOP, border=5)
58
59                 s.Add(wx.StaticLine(p), flag=wx.EXPAND|wx.TOP|wx.BOTTOM, border=10)
60                 button = wx.Button(p, -1, 'Ok')
61                 self.Bind(wx.EVT_BUTTON, self.OnOk, button)
62                 s.Add(button, flag=wx.TOP|wx.ALIGN_RIGHT, border=5)
63
64                 self.Fit()
65                 self.Centre()
66
67         def OnUltimakerFirmware(self, e):
68                 firmwareInstall.InstallFirmware(machineIndex=self.hasUltimaker)
69
70         def OnUltimaker2Firmware(self, e):
71                 firmwareInstall.InstallFirmware(machineIndex=self.hasUltimaker2)
72
73         def OnOk(self, e):
74                 self.Close()
75
76         def OnClose(self, e):
77                 self.Destroy()