Skip to content

Commit

Permalink
Merge pull request #133 from MacTee/dev
Browse files Browse the repository at this point in the history
Dev merge - Version 2.3.0.3
  • Loading branch information
MacTee committed Jun 22, 2015
2 parents 5f32d13 + 5ac4a22 commit 83329d8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
20 changes: 16 additions & 4 deletions KSPModAdmin.Core/Utils/SiteHandler/KerbalStuffHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ namespace KSPModAdmin.Core.Utils.SiteHandler
public class KerbalStuffHandler : ISiteHandler
{
private const string NAME = "KerbalStuff";
private const string URL = "http://kerbalstuff.com/";
private const string URL2 = "https://kerbalstuff.com/";
private const string URL3 = "http://beta.kerbalstuff.com/"; // some mods still have this as the link
private const string MODINFO_URL = "https://kerbalstuff.com/api/mod/";
private static string[] VALIDURLS = new string[]
{
"http://www.kerbalstuff.com/",
"http://kerbalstuff.com/",
"https://www.kerbalstuff.com/",
"https://kerbalstuff.com/",
// some mods still have this as the link
"http://www.beta.kerbalstuff.com/",
"http://beta.kerbalstuff.com/",
"https://www.beta.kerbalstuff.com/",
"https://beta.kerbalstuff.com/"
};


/// <summary>
Expand All @@ -36,7 +45,10 @@ public class KerbalStuffHandler : ISiteHandler
public bool IsValidURL(string url)
{
// Should we perhaps put valid hostnames into an array? Would keep the next line growing out of control
return (!string.IsNullOrEmpty(url) && (url.ToLower().StartsWith(URL) || url.ToLower().StartsWith(URL2) || url.ToLower().StartsWith(URL3)));
// return (!string.IsNullOrEmpty(url) && (url.ToLower().StartsWith(URL) || url.ToLower().StartsWith(URL2) || url.ToLower().StartsWith(URL3)));

// yes ;)
return (!string.IsNullOrEmpty(url) && VALIDURLS.Any(x => url.StartsWith(x, StringComparison.CurrentCultureIgnoreCase)));
}

/// <summary>
Expand Down
8 changes: 2 additions & 6 deletions KSPModAdmin.Core/Views/frmImExport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,12 @@ private void btnImport_Click(object sender, EventArgs e)

private void cbDownloadIfNeeded_CheckedChanged(object sender, EventArgs e)
{
rbInstall.Enabled = (cbExtract.Checked) && (cbDownloadIfNeeded.Checked);
rbAddOnly.Enabled = rbInstall.Enabled;
btnImport.Enabled = rbInstall.Enabled;
btnImport.Enabled = (cbExtract.Checked || cbDownloadIfNeeded.Checked);
}

private void cbExtract_CheckedChanged(object sender, EventArgs e)
{
rbInstall.Enabled = (cbExtract.Checked) && (cbDownloadIfNeeded.Checked);
rbAddOnly.Enabled = rbInstall.Enabled;
btnImport.Enabled = rbInstall.Enabled;
btnImport.Enabled = (cbExtract.Checked || cbDownloadIfNeeded.Checked);
}

#endregion
Expand Down
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.2")]
[assembly: AssemblyFileVersion("2.3.0.2")]
[assembly: AssemblyVersion("2.3.0.3")]
[assembly: AssemblyFileVersion("2.3.0.3")]

0 comments on commit 83329d8

Please sign in to comment.