Skip to content

Commit

Permalink
Fix wrong version on splash screen. Add messageBox title.
Browse files Browse the repository at this point in the history
  • Loading branch information
JetStream96 committed Aug 10, 2016
1 parent 016706b commit f444dde
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
7 changes: 2 additions & 5 deletions src/QSP/UI/Forms/Splash.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.Reflection;

namespace QSP.UI.Forms
Expand All @@ -18,10 +17,8 @@ private void Splash_Load(object sender, EventArgs e)

public static string AppProductVersion()
{
var assembly = Assembly.GetExecutingAssembly();
var version = FileVersionInfo.GetVersionInfo(assembly.Location);
return $"{version.ProductMajorPart}.{version.ProductMinorPart}" +
$".{version.ProductBuildPart}";
var ver = Assembly.GetEntryAssembly().GetName().Version;
return $"{ver.Major}.{ver.Minor}.{ver.Build}";
}
}
}
3 changes: 1 addition & 2 deletions src/QSP/UI/ToLdgModule/AboutPage/AboutPageControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public void Init(string appName)
panel1.BackColor = Color.FromArgb(160, Color.White);

var ver = Assembly.GetEntryAssembly().GetName().Version;
versionLbl.Text =
$"v{ver.Major}.{ver.Minor}.{ver.Build}";
versionLbl.Text = $"v{ver.Major}.{ver.Minor}.{ver.Build}";
}

private void TryOpenFile(string fileName)
Expand Down
13 changes: 10 additions & 3 deletions src/QSP/UI/UserControls/FuelPlanningControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,15 @@ private void Calculate(object sender, EventArgs e)

if (fuelReport.TotalFuelKG > data.MaxFuelKg)
{
ShowInfo(InsufficientFuelMsg(
fuelReport.TotalFuelKG, data.MaxFuelKg, WeightUnit));
var msg = InsufficientFuelMsg(
fuelReport.TotalFuelKG, data.MaxFuelKg, WeightUnit);

MessageBox.Show(
msg,
"Insufficient fuel",
MessageBoxButtons.OK,
MessageBoxIcon.Information);

return;
}

Expand Down Expand Up @@ -505,7 +512,7 @@ private static string InsufficientFuelMsg(
fuelCapacityInt = RoundToInt(fuelCapacityKG * KgLbRatio);
}

return "Insufficient fuel\n" +
return
$"Fuel required for this flight is {fuelReqInt} {wtUnit}. " +
$"Maximum fuel tank capacity is {fuelCapacityInt} {wtUnit}.";
}
Expand Down
6 changes: 3 additions & 3 deletions src/QSimPlanner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[assembly: AssemblyTitle("QSimPlanner")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("QSimPlanner")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
[assembly: AssemblyTrademark("")]
Expand All @@ -31,5 +31,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("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]
2 changes: 1 addition & 1 deletion src/QSimPlanner/QSimPlanner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<ApplicationVersion>0.2.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
Expand Down

0 comments on commit f444dde

Please sign in to comment.