From: smorloc Date: Thu, 17 Jan 2013 05:48:31 +0000 (-0500) Subject: Added "Check for update..." menu item X-Git-Tag: 13.03~93^2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d7f9006ee06989c0a66b125f375efc6ec59d857b;p=cura.git Added "Check for update..." menu item --- diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index 72d04d6f..16e61fa3 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -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())