Skip to content
This repository was archived by the owner on Jan 8, 2022. It is now read-only.

Commit a9a6199

Browse files
committed
Added License agreement for MCCI's USB drivers
1 parent a3a6300 commit a9a6199

File tree

13 files changed

+36
-173
lines changed

13 files changed

+36
-173
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System.Collections.Generic;
2+
using System.Threading.Tasks;
3+
using Deployer;
4+
5+
namespace Deployment.Console
6+
{
7+
internal class ConsoleMarkdownDialog : IMarkdownDialog
8+
{
9+
public Task<Option> PickOptions(string markdown, IEnumerable<Option> options)
10+
{
11+
System.Console.WriteLine(
12+
@"By continuing you are accepting the following license below.
13+
If you decline it, press Control+C anytime during the deployment process.
14+
" + markdown);
15+
return Task.FromResult(new Option("Accept", DialogValue.OK));
16+
}
17+
}
18+
}

Source/Deployer.Raspberry.Console/Deployer.Raspberry.Console.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<Link>Properties\SharedAssemblyInfo.cs</Link>
5353
</Compile>
5454
<Compile Include="ConsoleDisplayUpdater.cs" />
55+
<Compile Include="ConsoleMarkdownDialog.cs" />
5556
<Compile Include="ConsoleMarkdownDisplayer.cs" />
5657
<Compile Include="Options\NonWindowsDeploymentCmdOptions.cs" />
5758
<Compile Include="Resources.Designer.cs">

Source/Deployer.Raspberry.Console/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ private static IWoaDeployer GetDeployer(WindowsDeploymentOptionsProvider op, int
7777
container.Configure(x =>
7878
{
7979
x.Configure(op);
80+
x.Export<ConsoleMarkdownDialog>().As<IMarkdownDialog>();
8081
x.ExportFactory((ILowLevelApi lla) => new DeviceProvider() { Device = new RaspberryPi(lla, diskNumber)}).As<IDeviceProvider>().Lifestyle.Singleton();
8182
x.Export<ConsoleMarkdownDisplayer>().As<IMarkdownDisplayer>();
8283
x.ExportInstance(progress).As<IObserver<double>>();

Source/Deployer.Raspberry.Gui/Deployer.Raspberry.Gui.csproj

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@
8686
</Compile>
8787
<Compile Include="Specifics\SettingsService.cs" />
8888
<Compile Include="Specifics\WpfMarkdownDisplayer.cs" />
89-
<Page Include="Views\MainWindow.xaml">
90-
<Generator>MSBuild:Compile</Generator>
91-
<SubType>Designer</SubType>
92-
</Page>
9389
<Compile Include="App.xaml.cs">
9490
<DependentUpon>App.xaml</DependentUpon>
9591
<SubType>Code</SubType>
@@ -98,15 +94,7 @@
9894
<Compile Include="ViewModels\WimPickViewModel.cs" />
9995
<Compile Include="Locator.cs" />
10096
<Compile Include="ViewModels\MainViewModel.cs" />
101-
<Compile Include="Views\MainWindow.xaml.cs">
102-
<DependentUpon>MainWindow.xaml</DependentUpon>
103-
<SubType>Code</SubType>
104-
</Compile>
105-
<Page Include="Views\Markdown.Styles.Default.xaml">
106-
<SubType>Designer</SubType>
107-
<Generator>MSBuild:Compile</Generator>
108-
</Page>
109-
<Page Include="Views\MarkdownViewerWindow.xaml">
97+
<Page Include="Views\MainWindow.xaml">
11098
<Generator>MSBuild:Compile</Generator>
11199
<SubType>Designer</SubType>
112100
</Page>
@@ -136,8 +124,8 @@
136124
</Page>
137125
</ItemGroup>
138126
<ItemGroup>
139-
<Compile Include="Views\MarkdownViewerWindow.xaml.cs">
140-
<DependentUpon>MarkdownViewerWindow.xaml</DependentUpon>
127+
<Compile Include="Views\MainWindow.xaml.cs">
128+
<DependentUpon>MainWindow.xaml</DependentUpon>
141129
</Compile>
142130
<Compile Include="Views\Parts\AdvancedPart.xaml.cs">
143131
<DependentUpon>AdvancedPart.xaml</DependentUpon>

Source/Deployer.Raspberry.Gui/Locator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public Locator()
2525
IObservable<LogEvent> logEvents = null;
2626

2727
IViewService viewService = new ViewService();
28-
viewService.Register("MarkdownViewer", typeof(MarkdownViewerWindow));
2928

3029
Log.Logger = new LoggerConfiguration()
3130
.WriteTo.RollingFile(@"Logs\Log-{Date}.txt")
@@ -50,7 +49,7 @@ public Locator()
5049
x.Export<DeploymentViewModel>().ByInterfaces().As<DeploymentViewModel>().Lifestyle.Singleton();
5150
x.Export<UIServices>();
5251
x.ExportFactory(() => viewService).As<IViewService>();
53-
x.Export<DialogService>().As<IDialogService>();
52+
x.Export<Dialog>().ByInterfaces();
5453
x.Export<FilePicker>().As<IFilePicker>();
5554
x.Export<SettingsService>().As<ISettingsService>();
5655
x.ExportFactory(() => DialogCoordinator.Instance).As<IDialogCoordinator>();

Source/Deployer.Raspberry.Gui/ViewModels/DeploymentViewModel.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ public DeploymentViewModel(IDeviceProvider deviceProvider,
3737
.Select(metadata => metadata != null);
3838

3939
FullInstallWrapper = new CommandWrapper<Unit, Unit>(this,
40-
ReactiveCommand.CreateFromTask(Deploy, isSelectedWim), uiServices.DialogService);
40+
ReactiveCommand.CreateFromTask(Deploy, isSelectedWim), uiServices.Dialog);
4141
IsBusyObservable = FullInstallWrapper.Command.IsExecuting;
4242
isBusy = IsBusyObservable.ToProperty(this, model => model.IsBusy);
4343

4444
RefreshDisksCommandWrapper = new CommandWrapper<Unit, ICollection<Disk>>(this,
45-
ReactiveCommand.CreateFromTask(lowLevelApi.GetDisks), uiServices.DialogService);
45+
ReactiveCommand.CreateFromTask(lowLevelApi.GetDisks), uiServices.Dialog);
4646
disks = RefreshDisksCommandWrapper.Command
4747
.Select(x => x.Select(disk => new DiskViewModel(disk)))
4848
.ToProperty(this, x => x.Disks);
@@ -64,7 +64,7 @@ public DiskViewModel SelectedDisk
6464

6565
private async Task Deploy()
6666
{
67-
if (await uiServices.DialogService.ShowConfirmation(this, Resources.DeploymentConfirmationTitle, string.Format(Resources.DeploymentConfirmationMessage, SelectedDisk)) == DialogResult.No)
67+
if (await uiServices.Dialog.ShowConfirmation(this, Resources.DeploymentConfirmationTitle, string.Format(Resources.DeploymentConfirmationMessage, SelectedDisk)) == DialogResult.No)
6868
{
6969
return;
7070
}
@@ -81,8 +81,10 @@ private async Task Deploy()
8181

8282
await deployer.Deploy();
8383

84-
var messageViewModel = new MessageViewModel(Resources.WindowsDeployedSuccessfullyTitle, Resources.WindowsDeployedSuccessfully);
85-
uiServices.ViewService.Show("MarkdownViewer", messageViewModel);
84+
await uiServices.Dialog.PickOptions(Resources.WindowsDeployedSuccessfully, new List<Option>()
85+
{
86+
new Option("Close")
87+
});
8688
}
8789

8890
public CommandWrapper<Unit, Unit> FullInstallWrapper { get; set; }

Source/Deployer.Raspberry.Gui/ViewModels/DiskViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public DiskViewModel(Disk disk)
1515
public uint Number => disk.Number + 1;
1616
public string FriendlyName => disk.FriendlyName;
1717
public ByteSize Size => disk.Size;
18-
public bool IsUsualTarget => Size > ByteSize.FromGigaBytes(14) && Size < ByteSize.FromGigaBytes(200);
18+
public bool IsUsualTarget => Size > ByteSize.FromGigaBytes(1) && Size < ByteSize.FromGigaBytes(200);
1919
public Disk Disk => disk;
2020

2121
public override string ToString()

Source/Deployer.Raspberry.Gui/ViewModels/WimPickViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public WimPickViewModel(UIServices uiServices, ISettingsService settingsService)
3131
PickWimFileCommand.ThrownExceptions.Subscribe(e =>
3232
{
3333
Log.Error(e, "WIM file error");
34-
this.uiServices.DialogService.ShowAlert(this, Resources.InvalidWimFile, e.Message);
34+
this.uiServices.Dialog.ShowAlert(this, Resources.InvalidWimFile, e.Message);
3535
});
3636

3737
hasWimHelper = this.WhenAnyValue(model => model.WimMetadata, (WimMetadataViewModel x) => x != null)

Source/Deployer.Raspberry.Gui/Views/Markdown.Styles.Default.xaml

Lines changed: 0 additions & 71 deletions
This file was deleted.

Source/Deployer.Raspberry.Gui/Views/MarkdownViewerWindow.xaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)