aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-12-08 00:19:54 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-12-08 00:19:54 +0200
commit3cd59dd3b04168ad91cb1fe51231e9b3ddd74705 (patch)
treeb7431f7fcdf3336a1811140a4e84d3660009d5f1 /Software/Visual_Studio/PPC/Tango.PPC.UI
parent00f7facd947e0e8ce05a43d4f9d036e8f9a6a69e (diff)
downloadTango-3cd59dd3b04168ad91cb1fe51231e9b3ddd74705.tar.gz
Tango-3cd59dd3b04168ad91cb1fe51231e9b3ddd74705.zip
Implemented fast database update detection of RMLL, Hardware Versions & Color Catalogs.
Related Work Items: #1622
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItem.cs10
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs13
3 files changed, 32 insertions, 7 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItem.cs
index 4dea142b0..9e336f276 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItem.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItem.cs
@@ -31,6 +31,16 @@ namespace Tango.PPC.UI.Notifications.NotificationItems
set { _version = value; RaisePropertyChangedAuto(); }
}
+ private bool _isDatabaseUpdate;
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is database update.
+ /// </summary>
+ public bool IsDatabaseUpdate
+ {
+ get { return _isDatabaseUpdate; }
+ set { _isDatabaseUpdate = value; RaisePropertyChangedAuto(); }
+ }
+
/// <summary>
/// Gets or sets the view type.
/// </summary>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml
index c4533b843..fc9b05b9b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/UpdateAvailableNotificationItemView.xaml
@@ -14,12 +14,16 @@
<Border BorderThickness="0 0 0 2" BorderBrush="{StaticResource TangoPrimaryAccentBrush}" Padding="15">
<DockPanel>
<Image Source="/Images/update_available.png" MaxHeight="50" />
- <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">
- <Run>Version</Run>
- <Run Foreground="{StaticResource TangoPrimaryAccentBrush}" FontWeight="SemiBold" Text="{Binding Version,FallbackValue='1.0.0.0',TargetNullValue='1.0.0.0'}"></Run>
- <Run>is available!</Run>
- <Run>Tap to start updating your system.</Run>
- </TextBlock>
+
+ <Grid>
+ <TextBlock Margin="20 0 0 0" VerticalAlignment="Center" Visibility="{Binding IsDatabaseUpdate,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ <Run>Version</Run>
+ <Run Foreground="{StaticResource TangoPrimaryAccentBrush}" FontWeight="SemiBold" Text="{Binding Version,FallbackValue='1.0.0.0',TargetNullValue='1.0.0.0'}"></Run>
+ <Run>is available!</Run>
+ <Run>Tap to start updating your system.</Run>
+ </TextBlock>
+ <TextBlock Margin="20 0 0 0" VerticalAlignment="Center" Text="Database updates are available. Tap to start updating your system." Visibility="{Binding IsDatabaseUpdate,Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock>
+ </Grid>
</DockPanel>
</Border>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
index 25a4f8c4b..0371e94da 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
@@ -162,6 +162,16 @@ namespace Tango.PPC.UI.ViewModels
LatestVersion = response.Version;
await NavigateTo(MachineUpdateView.UpdateAvailableView);
}
+ else if (response.IsDatabaseUpdateAvailable)
+ {
+ IsDbUpdate = true;
+ _db_compare_result = new DbCompareResult()
+ {
+ RequiresUpdate = true,
+ UpdateDBResponse = response.UpdateDBResponse
+ };
+ await NavigateTo(MachineUpdateView.UpdateAvailableView);
+ }
else
{
_db_compare_result = await MachineUpdateManager.UpdateDBCheck(MachineProvider.Machine.SerialNumber);
@@ -418,12 +428,13 @@ namespace Tango.PPC.UI.ViewModels
{
if (!IsVisible && _updateNotificationItem == null)
{
- LogManager.Log($"New application version detected ({e.Version}). Pushing notification...");
+ LogManager.Log($"New {(e.IsDatabaseUpdateAvailable ? "database updates" : "application version")} detected ({e.Version}). Pushing notification...");
InvokeUI(() =>
{
_updateNotificationItem = new UpdateAvailableNotificationItem();
_updateNotificationItem.Version = Version.Parse(e.Version).ToString(3);
+ _updateNotificationItem.IsDatabaseUpdate = e.IsDatabaseUpdateAvailable && !e.IsUpdateAvailable;
_updateNotificationItem.Pressed += (_, __) =>
{
_updateNotificationItem = null;