Skip to content

Commit

Permalink
Merge pull request #1 from pjf/394_tests
Browse files Browse the repository at this point in the history
Extra tests for GameData pathed installs
  • Loading branch information
Ippo343 committed Nov 18, 2014
2 parents 2e1a084 + d5e2393 commit fd3f99d
Show file tree
Hide file tree
Showing 20 changed files with 636 additions and 786 deletions.
9 changes: 7 additions & 2 deletions CKAN/CKAN/ModuleInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public static string CachedOrDownload(string identifier, Version version, Uri ur
// TODO: Break this up into smaller pieces! It's huge!
public void InstallList(
List<string> modules,
RelationshipResolverOptions options
RelationshipResolverOptions options,
NetAsyncDownloader downloader = null
)
{
onReportProgress = onReportProgress ?? ((message, progress) => { });
Expand Down Expand Up @@ -195,7 +196,11 @@ RelationshipResolverOptions options

if (downloads.Count > 0)
{
var downloader = new NetAsyncDownloader();
if (downloader == null)
{
downloader = new NetAsyncDownloader();
}

downloader.DownloadModules(ksp.Cache, downloads, onReportProgress);
}

Expand Down
13 changes: 9 additions & 4 deletions CKAN/CKAN/Net/NetAsyncDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ public void DownloadModules(
// If the user cancelled our progress, then signal that.
if (downloadCanceled)
{
foreach (var download in downloads)
{
download.agent.CancelAsync();
}

throw new CancelledActionKraken("Download cancelled by user");
}

Expand Down Expand Up @@ -242,17 +247,17 @@ public void CancelDownload()
{
log.Debug("Cancelling download");

foreach (var download in downloads)
downloadCanceled = true;

lock (download_complete_lock)
{
download.agent.CancelAsync();
Monitor.Pulse(download_complete_lock);
}

if (onCompleted != null)
{
onCompleted(null, null, null);
}

downloadCanceled = true;
}

/// <summary>
Expand Down
113 changes: 0 additions & 113 deletions CKAN/GUI/ApplyChangesDialog.Designer.cs

This file was deleted.

120 changes: 0 additions & 120 deletions CKAN/GUI/ApplyChangesDialog.resx

This file was deleted.

27 changes: 8 additions & 19 deletions CKAN/GUI/CKAN-GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ApplyChangesDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ApplyChangesDialog.Designer.cs">
<DependentUpon>ApplyChangesDialog.cs</DependentUpon>
</Compile>
<Compile Include="ChooseKSPInstance.cs">
<SubType>Form</SubType>
</Compile>
Expand All @@ -62,15 +56,22 @@
<Compile Include="KSPCommandLineOptionsDialog.Designer.cs">
<DependentUpon>KSPCommandLineOptionsDialog.cs</DependentUpon>
</Compile>
<Compile Include="MainChangeset.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainModInfo.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainWait.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="RenameInstanceDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="RenameInstanceDialog.Designer.cs">
<DependentUpon>RenameInstanceDialog.cs</DependentUpon>
</Compile>
<Compile Include="TabController.cs" />
<Compile Include="Util.cs" />
<Compile Include="Main.cs">
<SubType>Form</SubType>
Expand Down Expand Up @@ -104,21 +105,12 @@
<Compile Include="SettingsDialog.Designer.cs">
<DependentUpon>SettingsDialog.cs</DependentUpon>
</Compile>
<Compile Include="WaitDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="WaitDialog.Designer.cs">
<DependentUpon>WaitDialog.cs</DependentUpon>
</Compile>
<Compile Include="YesNoDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="YesNoDialog.Designer.cs">
<DependentUpon>YesNoDialog.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="ApplyChangesDialog.resx">
<DependentUpon>ApplyChangesDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ChooseKSPInstance.resx">
<DependentUpon>ChooseKSPInstance.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -151,9 +143,6 @@
<EmbeddedResource Include="SettingsDialog.resx">
<DependentUpon>SettingsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="WaitDialog.resx">
<DependentUpon>WaitDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="YesNoDialog.resx">
<DependentUpon>YesNoDialog.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -202,4 +191,4 @@
<ItemGroup>
<None Include="Resources\ksp.jpg" />
</ItemGroup>
</Project>
</Project>
Loading

0 comments on commit fd3f99d

Please sign in to comment.