chiark / gitweb /
Added "Check for update..." menu item
authorsmorloc <smorloc@gmail.com>
Thu, 17 Jan 2013 05:48:31 +0000 (00:48 -0500)
committersmorloc <smorloc@gmail.com>
Thu, 17 Jan 2013 05:48:31 +0000 (00:48 -0500)
Cura/gui/mainWindow.py

index 72d04d6f78615370562ccc85a68d7722ae5c6e79..16e61fa3e78540c599114387fc5aa9b9d93c8e7a 100644 (file)
@@ -142,6 +142,8 @@ class mainWindow(wx.Frame):
                self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('http://daid.github.com/Cura'), i)
                i = helpMenu.Append(-1, 'Report a problem...')
                self.Bind(wx.EVT_MENU, lambda e: webbrowser.open('https://github.com/daid/Cura/issues'), i)
+               i = helpMenu.Append(-1, 'Check for update...')
+               self.Bind(wx.EVT_MENU, self.OnCheckForUpdate, i)
                self.menubar.Append(helpMenu, 'Help')
                self.SetMenuBar(self.menubar)
 
@@ -483,6 +485,14 @@ class mainWindow(wx.Frame):
                svgSlicer.Centre()
                svgSlicer.Show(True)
 
+       def OnCheckForUpdate(self, e):
+               newVersion = version.checkForNewerVersion()
+               if newVersion is not None:
+                       if wx.MessageBox('A new version of Cura is available, would you like to download?', 'New version available', wx.YES_NO | wx.ICON_INFORMATION) == wx.YES:
+                               webbrowser.open(newVersion)
+               else:
+                       wx.MessageBox('You are running the latest version of Cura!', 'Awesome!', wx.ICON_INFORMATION)
+
        def OnClose(self, e):
                profile.saveGlobalProfile(profile.getDefaultProfilePath())