- Save available unsigned version across restarts

- Fix status display after downloaded
- Don't display update buttons unless HTTP proxy is up
- Pass the manager down thru the constructors
This commit is contained in:
zzz
2012-10-19 20:26:08 +00:00
parent 4f936f958d
commit fea3bb63c1
15 changed files with 160 additions and 94 deletions

View File

@@ -38,9 +38,11 @@ import net.i2p.util.VersionComparator;
*/
class UpdateHandler implements Updater {
protected final RouterContext _context;
protected final ConsoleUpdateManager _mgr;
public UpdateHandler(RouterContext ctx) {
public UpdateHandler(RouterContext ctx, ConsoleUpdateManager mgr) {
_context = ctx;
_mgr = mgr;
}
/**
@@ -56,7 +58,9 @@ class UpdateHandler implements Updater {
if ((type != UpdateType.ROUTER_SIGNED && type != UpdateType.ROUTER_SIGNED_PACK200) ||
method != UpdateMethod.HTTP || updateSources.isEmpty())
return null;
UpdateRunner update = new UpdateRunner(_context, updateSources);
UpdateRunner update = new UpdateRunner(_context, _mgr, updateSources);
// set status before thread to ensure UI feedback
_mgr.notifyProgress(update, "<b>" + _mgr._("Updating") + "</b>");
update.start();
return update;
}