[ui] exact check for update timestamp in tooltip

This commit is contained in:
Roman Shevchenko
2017-04-06 15:55:55 +02:00
parent 5739000732
commit 5c556d9db0
2 changed files with 12 additions and 8 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -120,11 +120,7 @@ object UpdateChecker {
indicator?.text = IdeBundle.message("updates.checking.platform")
val result = checkPlatformUpdate(updateSettings)
if (manualCheck && result.state == UpdateStrategy.State.LOADED) {
UpdateSettings.getInstance().saveLastCheckedInfo()
}
else if (result.state == UpdateStrategy.State.CONNECTION_ERROR) {
if (result.state == UpdateStrategy.State.CONNECTION_ERROR) {
val e = result.error
if (e != null) LOG.debug(e)
showErrorMessage(manualCheck, IdeBundle.message("updates.error.connection.failed", e?.message ?: "internal error"))
@@ -151,6 +147,8 @@ object UpdateChecker {
// show result
UpdateSettings.getInstance().saveLastCheckedInfo()
ApplicationManager.getApplication().invokeLater({
showUpdateResult(project, result, updateSettings, updatedPlugins, incompatiblePlugins, externalUpdates, !fromSettings, manualCheck)
callback?.setDone()
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -210,7 +210,13 @@ public class UpdateSettingsConfigurable extends BaseConfigurable implements Sear
private void updateLastCheckedLabel() {
long time = mySettings.getLastTimeChecked();
myLastCheckedDate.setText(time == 0 ? IdeBundle.message("updates.last.check.never") : DateFormatUtil.formatPrettyDateTime(time));
if (time <= 0) {
myLastCheckedDate.setText(IdeBundle.message("updates.last.check.never"));
}
else {
myLastCheckedDate.setText(DateFormatUtil.formatPrettyDateTime(time));
myLastCheckedDate.setToolTipText(DateFormatUtil.formatDate(time) + ' ' + DateFormatUtil.formatTimeWithSeconds(time));
}
}
public ChannelStatus getSelectedChannelType() {