aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-11-26 17:33:02 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-11-26 17:33:02 +0200
commitca29510e1e336c4d68aaa926cfea6eb72ce42779 (patch)
tree298c10a1567df22cf594054271dd5ce656f09c12 /Software/Visual_Studio/PPC/Modules
parent6c43f97559613443e781917a827c3b644db03490 (diff)
downloadTango-ca29510e1e336c4d68aaa926cfea6eb72ce42779.tar.gz
Tango-ca29510e1e336c4d68aaa926cfea6eb72ce42779.zip
Working on backup/restore...
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Tango.PPC.BackupRestore.csproj7
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/ViewModels/BackupViewVM.cs6
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/ViewModels/RestoreViewVM.cs113
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/BackupView.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/MainView.xaml1
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreProgressView.xaml38
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreProgressView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreView.xaml166
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs14
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml4
10 files changed, 357 insertions, 22 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Tango.PPC.BackupRestore.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Tango.PPC.BackupRestore.csproj
index d32415e17..5e538ec89 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Tango.PPC.BackupRestore.csproj
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Tango.PPC.BackupRestore.csproj
@@ -69,6 +69,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Views\RestoreProgressView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\BackupProgressView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -113,6 +117,9 @@
<Compile Include="ViewModels\MainViewVM.cs" />
<Compile Include="ViewModels\RestoreViewVM.cs" />
<Compile Include="ViewModels\WelcomeViewVM.cs" />
+ <Compile Include="Views\RestoreProgressView.xaml.cs">
+ <DependentUpon>RestoreProgressView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\BackupProgressView.xaml.cs">
<DependentUpon>BackupProgressView.xaml</DependentUpon>
</Compile>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/ViewModels/BackupViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/ViewModels/BackupViewVM.cs
index dd561c5be..ab8d0248f 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/ViewModels/BackupViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/ViewModels/BackupViewVM.cs
@@ -71,14 +71,14 @@ namespace Tango.PPC.BackupRestore.ViewModels
public String BackupLocation
{
get { return _backupLocation; }
- set { _backupLocation = value; RaisePropertyChangedAuto(); }
+ set { _backupLocation = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
private String _backupName;
public String BackupName
{
get { return _backupName; }
- set { _backupName = value; RaisePropertyChangedAuto(); }
+ set { _backupName = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
public RelayCommand BackupCommand { get; set; }
@@ -88,7 +88,7 @@ namespace Tango.PPC.BackupRestore.ViewModels
public BackupViewVM()
{
BrowseBackupLocationCommand = new RelayCommand(BrowseBackupLocation);
- BackupCommand = new RelayCommand(StartBackup);
+ BackupCommand = new RelayCommand(StartBackup, () => !String.IsNullOrWhiteSpace(BackupName) && BackupLocation != null);
IsBackupJobs = true;
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/ViewModels/RestoreViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/ViewModels/RestoreViewVM.cs
index 904fd9e52..ec6083436 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/ViewModels/RestoreViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/ViewModels/RestoreViewVM.cs
@@ -3,15 +3,126 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.Core.Commands;
+using Tango.Core.DI;
+using Tango.Explorer;
+using Tango.PPC.BackupRestore.Views;
using Tango.PPC.Common;
+using Tango.PPC.Common.BackupRestore;
+using Tango.PPC.Storage;
namespace Tango.PPC.BackupRestore.ViewModels
{
public class RestoreViewVM : PPCViewModel
{
+ private string _backupFileLocation;
+
+ [TangoInject]
+ public IBackupManager BackupManager { get; set; }
+
+ private String _backupFileName;
+ public String BackupFileName
+ {
+ get { return _backupFileName; }
+ set { _backupFileName = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
+ }
+
+ private RestoreSettings _restoreSettings;
+ public RestoreSettings RestoreSettings
+ {
+ get { return _restoreSettings; }
+ set { _restoreSettings = value; RaisePropertyChangedAuto(); }
+ }
+
+ private BackupFile _backupFile;
+ public BackupFile BackupFile
+ {
+ get { return _backupFile; }
+ set { _backupFile = value; RaisePropertyChangedAuto(); }
+ }
+
+ private BackupRestoreProgressEventArgs _currentRestoreProgress;
+ public BackupRestoreProgressEventArgs CurrentRestoreProgress
+ {
+ get { return _currentRestoreProgress; }
+ set { _currentRestoreProgress = value; RaisePropertyChangedAuto(); }
+ }
+
+ public RelayCommand BrowseForBackupCommand { get; set; }
+
+ public RelayCommand RestoreCommand { get; set; }
+
+ public RestoreViewVM()
+ {
+ RestoreSettings = new RestoreSettings();
+ RestoreCommand = new RelayCommand(StartRestore, () => BackupFileName != null);
+ BrowseForBackupCommand = new RelayCommand(BrowseForBackup);
+ }
+
+ private async void StartRestore()
+ {
+ await NavigationManager.NavigateTo<BackupRestoreModule>(nameof(RestoreProgressView));
+
+ if (IsFree)
+ {
+ IsFree = false;
+ var result = await BackupManager.Restore(_backupFileLocation, RestoreSettings);
+ IsFree = true;
+ }
+ }
+
+ private async void BrowseForBackup()
+ {
+ var result = await NavigationManager.
+ NavigateForResult<StorageModule,
+ Storage.Views.MainView, ExplorerFileItem,
+ Storage.Models.StorageNavigationRequest>(
+ new Storage.Models.StorageNavigationRequest()
+ {
+ Intent = Storage.Models.StorageNavigationIntent.LoadFile,
+ Filter = ExplorerFileDefinition.Backup.Extension,
+ Title = "Select Backup File",
+ });
+
+ if (result != null)
+ {
+ _backupFileLocation = result.Path;
+
+ try
+ {
+ BackupFile = await BackupManager.ExtractBackupConfiguration(_backupFileLocation);
+ BackupFileName = System.IO.Path.GetFileName(result.Path);
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, $"Error extracting backup configuration from file '{_backupFileLocation}'.");
+ await NotificationProvider.ShowError($"Error occurred while trying to extract the backup file information\n{ex.FlattenMessage()}");
+ }
+ }
+ }
+
+ public override void OnNavigatedFrom()
+ {
+ base.OnNavigatedFrom();
+ BackupFileName = null;
+ BackupFile = null;
+ _backupFileLocation = null;
+ }
+
+ public override void OnApplicationReady()
+ {
+ base.OnApplicationReady();
+ BackupManager.Progress += BackupManager_Progress;
+ }
+
+ private void BackupManager_Progress(object sender, BackupRestoreProgressEventArgs e)
+ {
+ CurrentRestoreProgress = e;
+ }
+
public override void OnApplicationStarted()
{
-
+
}
}
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/BackupView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/BackupView.xaml
index 68c022766..52dd87d92 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/BackupView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/BackupView.xaml
@@ -34,7 +34,7 @@
<Run FontSize="{StaticResource TangoTitleFontSize}">Backup your system</Run>
<LineBreak/>
<LineBreak/>
- <Run>Select whether you would like to backup your jobs or the entire system and press 'Start Backup'.</Run>
+ <Run>Please specify the location and settings of your backup and press 'START'.</Run>
</TextBlock>
<touch:TouchDropShadowBorder Padding="10" Margin="0 50 0 0">
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/MainView.xaml
index 0f7667c4e..d9c4c06a3 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/MainView.xaml
@@ -25,6 +25,7 @@
<local:BackupView/>
<local:RestoreView/>
<local:BackupProgressView/>
+ <local:RestoreProgressView/>
</controls:NavigationControl>
</DockPanel>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreProgressView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreProgressView.xaml
new file mode 100644
index 000000000..f83bb0bd5
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreProgressView.xaml
@@ -0,0 +1,38 @@
+<UserControl x:Class="Tango.PPC.BackupRestore.Views.RestoreProgressView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:vm="clr-namespace:Tango.PPC.BackupRestore.ViewModels"
+ xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
+ xmlns:global="clr-namespace:Tango.PPC.BackupRestore"
+ xmlns:local="clr-namespace:Tango.PPC.BackupRestore.Views"
+ mc:Ignorable="d"
+ d:DesignHeight="700" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:RestoreViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.RestoreViewVM}">
+
+ <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
+ <DockPanel Margin="30 0 30 30">
+ <Grid DockPanel.Dock="Top">
+ <StackPanel>
+ <TextBlock TextWrapping="Wrap" FontSize="{StaticResource TangoDefaultFontSize}">
+ <Run FontSize="{StaticResource TangoTitleFontSize}">Restoring your system</Run>
+ <LineBreak/>
+ <LineBreak/>
+ <Run>This process may take several minutes, please wait.</Run>
+ </TextBlock>
+
+
+ </StackPanel>
+ </Grid>
+
+ <Grid>
+ <StackPanel VerticalAlignment="Center">
+ <TextBlock Text="{Binding CurrentRestoreProgress.Stage,Converter={StaticResource EnumToDescriptionConverter},FallbackValue='Restoring data'}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock>
+ <touch:TouchProgressBar Margin="0 20" Height="10" IsIndeterminate="{Binding CurrentRestoreProgress.IsIntermediate}" Maximum="{Binding CurrentRestoreProgress.Total}" Value="{Binding CurrentRestoreProgress.Progress,Mode=OneWay}" />
+ </StackPanel>
+ </Grid>
+
+ </DockPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreProgressView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreProgressView.xaml.cs
new file mode 100644
index 000000000..3b8b19fa9
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreProgressView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.PPC.BackupRestore.Views
+{
+ /// <summary>
+ /// Interaction logic for BackupView.xaml
+ /// </summary>
+ public partial class RestoreProgressView : UserControl
+ {
+ public RestoreProgressView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreView.xaml
index ef7dcbb58..0f91f8ae6 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BackupRestore/Views/RestoreView.xaml
@@ -9,22 +9,160 @@
xmlns:global="clr-namespace:Tango.PPC.BackupRestore"
xmlns:local="clr-namespace:Tango.PPC.BackupRestore.Views"
mc:Ignorable="d"
- d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:RestoreViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.RestoreViewVM}">
-
- <Grid>
- <StackPanel HorizontalAlignment="Left" Margin="50 20 50 0">
- <TextBlock TextWrapping="Wrap" FontSize="{StaticResource TangoDefaultFontSize}">
+ d:DesignHeight="700" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:RestoreViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.RestoreViewVM}">
+
+ <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
+ <DockPanel Margin="30 0 30 30">
+ <Grid DockPanel.Dock="Bottom">
+ <DockPanel>
+ <touch:TouchButton Command="{Binding RestoreCommand}" HorizontalAlignment="Right" Height="80" Width="300" CornerRadius="40">
+ <touch:TouchButton.Style>
+ <Style TargetType="touch:TouchButton" BasedOn="{StaticResource {x:Type touch:TouchButton}}">
+ <Setter Property="Content" Value="START"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsFree}" Value="False">
+ <Setter Property="Content" Value="IN PROGRESS"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </touch:TouchButton.Style>
+ </touch:TouchButton>
+ </DockPanel>
+ </Grid>
+ <StackPanel IsEnabled="{Binding IsFree}">
+ <TextBlock TextWrapping="Wrap" FontSize="{StaticResource TangoDefaultFontSize}">
<Run FontSize="{StaticResource TangoTitleFontSize}">Restore your system</Run>
<LineBreak/>
<LineBreak/>
- <Run>This wizard allows you to create a complete backup of your current machine state including software, firmware, data and user settings.</Run>
- <LineBreak/>
- <LineBreak/>
- <LineBreak/>
- <Run>For creating a complete backup of your system please press 'Backup'.</Run>
- <LineBreak/>
- <Run>In case you want to restore your system to a previous state, please press 'Restore'.</Run>
- </TextBlock>
- </StackPanel>
+ <Run>Please specify the location of your backup file and other options. Press 'START' when you are ready.</Run>
+ </TextBlock>
+
+ <touch:TouchDropShadowBorder Padding="10 10 10 20" Margin="0 50 0 0">
+ <StackPanel>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoPrimaryAccentBrush}">Location</TextBlock>
+ </StackPanel>
+
+ <StackPanel Margin="0 20 0 0">
+
+ <TextBlock>Please insert a storage device and select your backup file</TextBlock>
+ <DockPanel Height="50" Margin="0 20 0 0">
+ <touch:TouchButton Command="{Binding BrowseForBackupCommand}" Margin="20 0 0 0" Width="150" DockPanel.Dock="Right" Foreground="{StaticResource TangoDarkForegroundBrush}" BorderBrush="{StaticResource TangoDarkForegroundBrush}" Style="{StaticResource TangoHollowButton}">BROWSE</touch:TouchButton>
+ <touch:TouchTextBox Text="{Binding BackupFileName}" IsReadOnly="True" />
+ </DockPanel>
+ </StackPanel>
+ </StackPanel>
+ </touch:TouchDropShadowBorder>
+
+ <touch:TouchDropShadowBorder Padding="10" Margin="0 10 0 0">
+ <StackPanel>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoPrimaryAccentBrush}">Information</TextBlock>
+ </StackPanel>
+
+ <StackPanel Margin="0 20 0 0">
+
+ <StackPanel>
+ <controls:TableGrid RowHeight="20">
+ <TextBlock Text="Name:"></TextBlock>
+ <TextBlock Text="{Binding BackupFile.Name}"></TextBlock>
+
+ <TextBlock Text="Date:"></TextBlock>
+ <TextBlock Text="{Binding BackupFile.Date}"></TextBlock>
+
+ <TextBlock Text="Mode:"></TextBlock>
+ <TextBlock Text="{Binding BackupFile.Settings.Mode}"></TextBlock>
+ </controls:TableGrid>
+ </StackPanel>
+
+ <StackPanel Margin="0 -20 0 0">
+ <StackPanel.Style>
+ <Style TargetType="StackPanel">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding BackupFile.Settings.Mode}" Value="Jobs">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </StackPanel.Style>
+ <controls:TableGrid RowHeight="20">
+ <TextBlock Text="Jobs:"></TextBlock>
+ <TextBlock Text="{Binding BackupFile.JobFiles.Count}"></TextBlock>
+ </controls:TableGrid>
+ </StackPanel>
+
+ <StackPanel>
+ <StackPanel.Style>
+ <Style TargetType="StackPanel">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding BackupFile.Settings.Mode}" Value="Full">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </StackPanel.Style>
+ <controls:TableGrid RowHeight="20">
+ <TextBlock Text="Application Version:"></TextBlock>
+ <TextBlock Text="{Binding BackupFile.ApplicationVersion}"></TextBlock>
+
+ <TextBlock Text="Firmware Version:"></TextBlock>
+ <TextBlock Text="{Binding BackupFile.FirmwareVersion}"></TextBlock>
+ </controls:TableGrid>
+ </StackPanel>
+ </StackPanel>
+ </StackPanel>
+ </touch:TouchDropShadowBorder>
+
+ <touch:TouchDropShadowBorder Padding="10" Margin="0 10 0 0">
+ <touch:TouchDropShadowBorder.Style>
+ <Style TargetType="touch:TouchDropShadowBorder">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding BackupFile.Settings.Mode}" Value="Full">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </touch:TouchDropShadowBorder.Style>
+ <StackPanel>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoPrimaryAccentBrush}">Options</TextBlock>
+ </StackPanel>
+
+ <StackPanel Margin="0 20 0 0" TextElement.Foreground="{StaticResource TangoDarkForegroundBrush}" TextElement.FontSize="{StaticResource TangoTitleFontSize}">
+ <StackPanel.Resources>
+ <Style TargetType="touch:TouchCheckBox" BasedOn="{StaticResource {x:Type touch:TouchCheckBox}}">
+ <Setter Property="Margin" Value="0 0 0 10"></Setter>
+ <Setter Property="Foreground" Value="{StaticResource TangoDarkForegroundBrush}"></Setter>
+ </Style>
+
+ <Style x:Key="run" TargetType="Run">
+ <Setter Property="Foreground" Value="{StaticResource TangoGrayTextBrush}"></Setter>
+ <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"></Setter>
+ </Style>
+ </StackPanel.Resources>
+ <touch:TouchCheckBox IsChecked="{Binding RestoreSettings.OverwriteExistingJobs,Mode=TwoWay}">
+ <touch:TouchCheckBox.Content>
+ <TextBlock>
+ <Run>Overwrite existing jobs</Run>
+ <Run Style="{StaticResource run}">(existing jobs will not change)</Run>
+ </TextBlock>
+ </touch:TouchCheckBox.Content>
+ </touch:TouchCheckBox>
+ <touch:TouchCheckBox IsChecked="{Binding RestoreSettings.AllowDeleteJobs,Converter={StaticResource BooleanInverseConverter},Mode=TwoWay}">
+ <touch:TouchCheckBox.Content>
+ <TextBlock>
+ <Run>Do not remove existing jobs</Run>
+ <Run Style="{StaticResource run}">(existing jobs will not be deleted)</Run>
+ </TextBlock>
+ </touch:TouchCheckBox.Content>
+ </touch:TouchCheckBox>
+ </StackPanel>
+ </StackPanel>
+ </touch:TouchDropShadowBorder>
+ </StackPanel>
+ </DockPanel>
</Grid>
</UserControl>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs
index 4a756e7ea..507110942 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs
@@ -63,6 +63,14 @@ namespace Tango.PPC.Storage.ViewModels
}
}
+ private bool _displayItems;
+ public bool DisplayItems
+ {
+ get { return _displayItems; }
+ set { _displayItems = value; RaisePropertyChangedAuto(); }
+ }
+
+
public RelayCommand<ExplorerFileItem> FileSelectedCommand { get; set; }
public RelayCommand SaveCommand { get; set; }
@@ -104,6 +112,8 @@ namespace Tango.PPC.Storage.ViewModels
{
View.EditFileName();
}
+
+ DisplayItems = true;
}
else
{
@@ -116,6 +126,8 @@ namespace Tango.PPC.Storage.ViewModels
public override void OnNavigatedFrom()
{
base.OnNavigatedFrom();
+ DisplayItems = false;
+ Request = null;
Request = new StorageNavigationRequest();
}
@@ -158,7 +170,6 @@ namespace Tango.PPC.Storage.ViewModels
{
if (_allow_exit || CurrentPath == StorageProvider.Drive.RootDirectory.FullName)
{
- Request = null;
return Task.FromResult(true);
}
else
@@ -170,6 +181,7 @@ namespace Tango.PPC.Storage.ViewModels
private async void OnFileSelected(ExplorerFileItem fileItem)
{
+ _selectedItem = fileItem;
_allow_exit = true;
await NavigationManager.NavigateBack();
StorageProvider.SubmitFileSelection(fileItem);
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml
index 74307c9ce..25538a525 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml
@@ -38,7 +38,7 @@
<StackPanel>
<TextBlock Text="{Binding Request.Title}" FontSize="{StaticResource TangoHeaderFontSize}"></TextBlock>
<DockPanel Margin="0 10 0 0">
- <touch:TouchButton Command="{Binding SaveCommand}" Margin="20 0 0 0" Height="50" Width="200" Style="{StaticResource TangoHollowButton}" CornerRadius="0" DockPanel.Dock="Right">
+ <touch:TouchButton Command="{Binding SaveCommand}" Margin="20 0 0 0" Height="55" Width="200" Style="{StaticResource TangoHollowButton}" CornerRadius="25" DockPanel.Dock="Right">
<touch:TouchButton.Content>
SAVE
</touch:TouchButton.Content>
@@ -49,7 +49,7 @@
</Border>
</Grid>
- <explorer:ExplorerControl x:Name="explorer" CurrentPath="{Binding CurrentPath,Mode=TwoWay}" FileSelectedCommand="{Binding FileSelectedCommand}" Filter="{Binding Request.Filter}">
+ <explorer:ExplorerControl x:Name="explorer" CurrentPath="{Binding CurrentPath,Mode=TwoWay}" FileSelectedCommand="{Binding FileSelectedCommand}" Filter="{Binding Request.Filter}" Visibility="{Binding DisplayItems,Converter={StaticResource BooleanToVisibilityConverter}}">
<explorer:ExplorerControl.Style>
<Style TargetType="explorer:ExplorerControl" BasedOn="{StaticResource {x:Type explorer:ExplorerControl}}">
<Setter Property="EnableFileSelection" Value="True"></Setter>