Auto-updating: add text for "Last checked" (#8645)

This commit is contained in:
Andrey Nekrasov
2020-12-17 19:38:23 +03:00
committed by GitHub
parent 24141abde2
commit e58ff6c71c
5 changed files with 75 additions and 6 deletions

View File

@@ -99,6 +99,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
private bool _autoDownloadUpdates;
private string _latestAvailableVersion = string.Empty;
private string _updateCheckedDate = string.Empty;
// Gets or sets a value indicating whether packaged.
public bool Packaged
@@ -333,6 +334,24 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
}
}
public string UpdateCheckedDate
{
get
{
RequestUpdateCheckedDate();
return _updateCheckedDate;
}
set
{
if (_updateCheckedDate != value)
{
_updateCheckedDate = value;
NotifyPropertyChanged();
}
}
}
// Temp string. Appears when a user clicks "Check for updates" button and shows latest version available on the Github.
public string LatestAvailableVersion
{
@@ -368,6 +387,17 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(GeneralSettingsConfig);
GeneralSettingsCustomAction customaction = new GeneralSettingsCustomAction(outsettings);
SendCheckForUpdatesConfigMSG(customaction.ToString());
RequestUpdateCheckedDate();
}
private void RequestUpdateCheckedDate()
{
GeneralSettingsConfig.CustomActionName = "request_update_state_date";
OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(GeneralSettingsConfig);
GeneralSettingsCustomAction customaction = new GeneralSettingsCustomAction(outsettings);
SendCheckForUpdatesConfigMSG(customaction.ToString());
}