Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
msarilar committed Jan 2, 2019
1 parent 90a3bf8 commit b661e57
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion EDEngineer/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<value>True</value>
</setting>
<setting name="Version" serializeAs="String">
<value>1.1.4.1</value>
<value>1.1.4.2</value>
</setting>
<setting name="WindowWidth" serializeAs="String">
<value>0</value>
Expand Down
4 changes: 2 additions & 2 deletions EDEngineer/EDEngineer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.htm</WebPage>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.1.4.1</ApplicationVersion>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>1.1.4.2</ApplicationVersion>
<UseApplicationTrust>true</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
4 changes: 2 additions & 2 deletions EDEngineer/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion EDEngineer/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="Version" Type="System.String" Scope="User">
<Value Profile="(Default)">1.1.4.1</Value>
<Value Profile="(Default)">1.1.4.2</Value>
</Setting>
<Setting Name="WindowWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
Expand Down
4 changes: 4 additions & 0 deletions EDEngineer/Resources/Data/releaseNotes.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[
{
"Version": "1.1.4.2",
"Content": "* Added an Export/Import settings window to the menu allowing you to save your settings to file and load them somewhere else\r\n* Fixed a bug that made the application crash when reducing the font size on the right panel to the minimum"
},
{
"Version": "1.1.4.1",
"Content": "Lots of contributions for this update, thanks a ton to the kind souls who submit pull requests to keep the application up to date!\r\n\r\nHave a lovely end of the year holidays everyone!\r\n\r\n=====\r\n\r\n* @CMDR-Cometborne :\r\nadded group Guardian/Thargoid to all unknowns\r\nadded hints where/how to get Thargoid stuff\r\nCorrect rarity value of Ship Flight Data\r\nAll existing DSS blueprints have been replace with a single new blueprint named expanded probe scanning radius\r\n\r\n* @CmdrWode :\r\nSplit both Guardian and Thargoid items into two subgroups (4 groups total)\r\nFix to deal with Cargo events that contain no Inventory field\r\n\r\n* @JohnXaverius :\r\nczech localization update\r\n\r\n* @enachos71 :\r\nGuardian Gauss Cannon Munitions was missing Guardian Technology Components, 6 needed in the blueprint\r\n\r\n* @TheBlackbird123 :\r\nspanish localization update"
Expand Down
5 changes: 2 additions & 3 deletions EDEngineer/Views/Popups/ReleaseNotesWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<popups:ToolWindow x:Class="EDEngineer.Views.Popups.ReleaseNotesWindow"
<controls:MetroWindow x:Class="EDEngineer.Views.Popups.ReleaseNotesWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:popups="clr-namespace:EDEngineer.Views.Popups"
mc:Ignorable="d"
Title="ReleaseNotesWindow"
WindowStartupLocation="CenterScreen"
Expand Down Expand Up @@ -50,5 +49,5 @@
HorizontalAlignment="Right"
Click="CloseButtonClicked"/>
</Grid>
</popups:ToolWindow>
</controls:MetroWindow>

15 changes: 12 additions & 3 deletions EDEngineer/Views/Popups/SettingsExportWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition Height="0.4*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="0.3*"/>
<RowDefinition Height="0.3*"/>
<RowDefinition Height="0.3*"/>
<RowDefinition Height="0.1*"/>
</Grid.RowDefinitions>

<Grid Grid.Row="0"
Expand All @@ -35,6 +36,14 @@
</Grid>

<Grid Grid.Row="2"
Background="LightPink">
<Button Content="Reset ALL Settings"
BorderThickness="1"
HorizontalAlignment="Center"
VerticalAlignment="Center" Click="ResetSettingsButtonClicked"/>
</Grid>

<Grid Grid.Row="3"
Background="MistyRose">
<Button Content="Close"
BorderThickness="1"
Expand Down
16 changes: 15 additions & 1 deletion EDEngineer/Views/Popups/SettingsExportWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Forms;
using EDEngineer.Models.Utils;
Expand Down Expand Up @@ -40,7 +41,11 @@ private void LoadSettingsButtonClicked(object sender, RoutedEventArgs e)
try
{
var newSettings = JsonConvert.DeserializeObject<Settings>(File.ReadAllText(dialog.FileName));
foreach (var property in typeof(Settings).GetProperties().Where(p => p.CanWrite))
foreach (var property in typeof(Settings)
.GetProperties(
BindingFlags.DeclaredOnly |
BindingFlags.Instance |
BindingFlags.Public).Where(p => p.CanWrite && p.Name != "Version" && p.Name != "CurrentVersion"))
{
try
{
Expand Down Expand Up @@ -80,9 +85,18 @@ private void ExportSettingsButtonClicked(object sender, RoutedEventArgs e)
Formatting = Formatting.Indented
};

Settings.Default.UpgradeRequired = true;
File.WriteAllText(dialog.FileName, JsonConvert.SerializeObject(Settings.Default, settings));
}
}
}

private void ResetSettingsButtonClicked(object sender, RoutedEventArgs e)
{
Settings.Default.Reset();
Settings.Default.Save();
Close();
loadedCallback();
}
}
}

0 comments on commit b661e57

Please sign in to comment.