chiark / gitweb /
bb36d54082a8ef15c1109e795dd3a8305300cffd
[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, '* Fixed the problem where aborting a print did not always home the head.'))
55                         s.Add(wx.StaticText(p, -1, '* Disabled normal LCD menu curing USB printing.'))
56                         s.Add(wx.StaticText(p, -1, '* Disable stepper drivers after print is finished or aborted, so you can manually move the head.'))
57                         button = wx.Button(p, -1, 'Install now')
58                         self.Bind(wx.EVT_BUTTON, self.OnUltimaker2Firmware, button)
59                         s.Add(button, flag=wx.TOP, border=5)
60
61                 s.Add(wx.StaticLine(p), flag=wx.EXPAND|wx.TOP|wx.BOTTOM, border=10)
62                 button = wx.Button(p, -1, 'Ok')
63                 self.Bind(wx.EVT_BUTTON, self.OnOk, button)
64                 s.Add(button, flag=wx.TOP|wx.ALIGN_RIGHT, border=5)
65
66                 self.Fit()
67                 self.Centre()
68
69         def OnUltimakerFirmware(self, e):
70                 firmwareInstall.InstallFirmware(machineIndex=self.hasUltimaker)
71
72         def OnUltimaker2Firmware(self, e):
73                 firmwareInstall.InstallFirmware(machineIndex=self.hasUltimaker2)
74
75         def OnOk(self, e):
76                 self.Close()
77
78         def OnClose(self, e):
79                 self.Destroy()