Merge branch 'refs/heads/develop'

This commit is contained in:
Ruud
2012-05-15 23:16:12 +02:00
3 changed files with 30 additions and 6 deletions

View File

@@ -349,7 +349,13 @@ class DesktopUpdater(Plugin):
self.desktop = Env.get('desktop')
def doUpdate(self):
pass
try:
self.desktop.CheckForUpdate(silentUnlessUpdate = True)
except:
log.error('Failed updating desktop: %s' % traceback.format_exc())
self.update_failed = True
return False
def info(self):
return {
@@ -360,12 +366,26 @@ class DesktopUpdater(Plugin):
}
def check(self):
self.desktop.CheckForUpdate(silentUnlessUpdate = True)
current_version = self.getVersion()
try:
latest = self.desktop._esky.find_update()
if latest and latest != current_version.get('hash'):
self.update_version = {
'hash': latest,
'date': None,
'changelog': self.desktop._changelogURL,
}
self.last_check = time.time()
except:
log.error('Failed updating desktop: %s' % traceback.format_exc())
return self.update_version is not None
def getVersion(self):
return {
'hash': self.desktop._esky.active_version,
'data': None,
'date': None,
'type': 'desktop',
}

View File

@@ -52,12 +52,16 @@ var UpdaterBase = new Class({
createMessage: function(data){
var self = this;
var changelog = 'https://github.com/'+data.repo_name+'/compare/'+data.version.hash+'...'+data.update_version.hash;
if(data.update_version.changelog)
changelog = data.update_version.changelog + '#' + data.version.hash+'...'+data.update_version.hash
self.message = new Element('div.message.update').adopt(
new Element('span', {
'text': 'A new version is available'
}),
new Element('a', {
'href': 'https://github.com/'+data.repo_name+'/compare/'+data.version.hash+'...'+data.update_version.hash,
'href': changelog,
'text': 'see what has changed',
'target': '_blank'
}),

View File

@@ -1 +1 @@
VERSION = '2.0.0-pre1'
VERSION = '2.0.0.pre1'