Skip to content

Commit

Permalink
Merge pull request #128 from MacTee/dev
Browse files Browse the repository at this point in the history
Dev merge - Version 2.3.0.2
  • Loading branch information
MacTee committed Jun 9, 2015
2 parents 07dd9d4 + 8c37d0c commit 5f32d13
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 17 deletions.
39 changes: 32 additions & 7 deletions KSPModAdmin.Core/Controller/MainController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ protected static void LoadLanguages()
try
{
Localizer.GlobalInstance.DefaultLanguage = "eng";
langLoadFailed = !Localizer.GlobalInstance.LoadLanguages(new []
langLoadFailed = !Localizer.GlobalInstance.LoadLanguages(new[]
{
KSPPathHelper.GetPath(KSPPaths.LanguageFolder),
Path.Combine(KSPPathHelper.GetPath(KSPPaths.KSPMA_Plugins), Constants.LANGUAGE_FOLDER)
Expand Down Expand Up @@ -333,6 +333,7 @@ protected static void Initialize()
EventDistributor.LanguageChanged += LanguageChanged;
EventDistributor.KSPRootChanging += KSPRootChanging;
EventDistributor.KSPRootChanged += KSPRootChanged;
EventDistributor.KSPMAStarted += KSPMAStarted;

CreateConfigDir();
LoadConfigs();
Expand All @@ -359,12 +360,6 @@ protected static void Initialize()
OptionsController.SelectedKSPPath = dlg.KSPPath;
}

// Auto KSP MA update check.
OptionsController.Check4AppUpdates();

// Auto mod update check.
OptionsController.Check4ModUpdates(true);

// Initializing is done.
EventDistributor.InvokeKSPMAStarted(Instance);
}
Expand Down Expand Up @@ -699,6 +694,7 @@ protected static void KSPRootChanging(string oldKSPPath, string newKSPPath)

/// <summary>
/// Event handler for the KSPPathChanged event from OptionsController.
/// Loads the new KSPConfig from the new ksp path.
/// </summary>
/// <param name="kspPath">the new selected ksp path.</param>
protected static void KSPRootChanged(string kspPath)
Expand All @@ -709,6 +705,35 @@ protected static void KSPRootChanged(string kspPath)
_SelectedKSPPath = kspPath;
}

/// <summary>
/// Event handler for the KSPMAStarted event.
/// Starts the app and mod update checks.
/// </summary>
protected static void KSPMAStarted(object sender)
{
EventDistributor.InvokeAsyncTaskStarted(Instance);
ModSelectionController.View.ShowBusy = true;

AsyncTask<bool>.DoWork(() =>
{
// Auto KSP MA update check.
OptionsController.Check4AppUpdates();

// Auto mod update check.
OptionsController.Check4ModUpdates(true);

return true;
},
(result, ex) =>
{
EventDistributor.InvokeAsyncTaskDone(Instance);
ModSelectionController.View.ShowBusy = false;
if (ex != null)
Messenger.AddError(string.Format("Error during startup update checks! {0}", ex.Message), ex);
}
);
}

#endregion
}
}
2 changes: 1 addition & 1 deletion KSPModAdmin.Core/Utils/KSPPathHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static string GetPath(KSPPaths kspPath)
path = Path.Combine(Environment.GetEnvironmentVariable(Constants.HOME), Constants.LINUX_PATH, Constants.APP_CONFIG_FILE);
break;
case Platform.OsX:
path = Path.Combine(Assembly.GetExecutingAssembly().Location, Constants.APP_CONFIG_FILE);
path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Constants.APP_CONFIG_FILE);
break;
default:
path = Path.Combine(Application.CommonAppDataPath.Replace(VersionHelper.GetAssemblyVersion(), string.Empty), Constants.APP_CONFIG_FILE);
Expand Down
1 change: 1 addition & 0 deletions KSPModAdmin.Core/Utils/Misc/PluginLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public static List<T_Interface> LoadPlugins<T_Interface>(string path)
foreach (string dllFile in dllFileNames)
{
////AssemblyName assemblyName = AssemblyName.GetAssemblyName(dllFile);
Messenger.AddDebug("Loading plugin file: " + Path.GetFileName(dllFile));
Assembly assembly = Assembly.LoadFile(dllFile);
assemblies.Add(assembly);
}
Expand Down
10 changes: 5 additions & 5 deletions KSPModAdmin.Updater/KSPModAdmin.Updater.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\KSPModAdmin\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\KSPModAdmin\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
Expand All @@ -72,15 +72,15 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug MONO|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug MONO\</OutputPath>
<OutputPath>..\KSPModAdmin\bin\Debug MONO\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release MONO|AnyCPU'">
<OutputPath>bin\Release MONO\</OutputPath>
<OutputPath>..\KSPModAdmin\bin\Release MONO\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
Expand Down Expand Up @@ -114,7 +114,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Import Project="..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets" Condition="Exists('..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
7 changes: 5 additions & 2 deletions KSPModAdmin/KSPModAdmin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,13 @@
</PropertyGroup>
<Import Project="..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets" Condition="Exists('..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Other similar extension points exist, see Microsoft.Common.targets. -->
<Target Name="BeforeBuild">
<!-- Remove obj folder -->
<RemoveDir Directories="$(BaseIntermediateOutputPath)" />
<!-- Remove bin folder -->
<RemoveDir Directories="$(BaseOutputPath)" />
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
4 changes: 2 additions & 2 deletions KSPModAdmin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.0.1")]
[assembly: AssemblyFileVersion("2.3.0.1")]
[assembly: AssemblyVersion("2.3.0.2")]
[assembly: AssemblyFileVersion("2.3.0.2")]

0 comments on commit 5f32d13

Please sign in to comment.