Skip to content

Commit cdd1595

Browse files
committed
Fixed window not being moved to foreground on tray icon click.
Added version label to options form. Added settings upgrade support.
1 parent 1095fa0 commit cdd1595

File tree

9 files changed

+53
-3
lines changed

9 files changed

+53
-3
lines changed

Source/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<setting name="NotificationHoldTime" serializeAs="String">
1717
<value>3</value>
1818
</setting>
19+
<setting name="Upgraded" serializeAs="String">
20+
<value>False</value>
21+
</setting>
1922
</ScriptFUSION.WarframeAlertTracker.Properties.Settings>
2023
</userSettings>
2124
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>

Source/Forms/OptionsForm.Designer.cs

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Forms/OptionsForm.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ internal OptionsForm(Settings settings, RegistrySettings registrySettings, Fissu
1919
InitializeComponent();
2020
ReadSettings(Settings = settings, RegistrySettings = registrySettings);
2121

22+
version.Text = $"v{WatApplication.CanonicalProductVersion}";
23+
2224
imageRepository = dummyFissureControl.ImageRepository;
2325
dummyFissureControl.Size = sample.Size;
2426
sample.Image = dummyFissureControl.Snapshot();

Source/Forms/WatForm.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ private void ToggleWindowVisibility() {
6262
if (Visible = !Visible) {
6363
// Restore previous state.
6464
WindowState = LastWindowState;
65+
// Set as foreground window, otherwise it can be restored behind other windows.
66+
Activate();
6567
}
6668
}
6769

Source/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.0.0.0")]
35-
[assembly: AssemblyFileVersion("1.0.0.0")]
34+
[assembly: AssemblyVersion("1.0.1.0")]
35+
[assembly: AssemblyFileVersion("1.0.1.0")]

Source/Properties/Settings.Designer.cs

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Properties/Settings.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,21 @@ internal sealed partial class Settings {
99
public event Action<int> RefreshRateUpdate;
1010

1111
public Settings() {
12+
TryUpgrade();
13+
1214
if (Alerts == null) Alerts = new AlertCollection();
1315

1416
PropertyChanged += Settings_PropertyChanged;
1517
}
1618

19+
private void TryUpgrade() {
20+
if (Upgraded) return;
21+
22+
Upgrade();
23+
Upgraded = true;
24+
Save();
25+
}
26+
1727
private void Settings_PropertyChanged(object sender, PropertyChangedEventArgs e) {
1828
switch (e.PropertyName) {
1929
case "Alerts":

Source/Properties/Settings.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
<Setting Name="NotificationHoldTime" Type="System.Double" Scope="User">
1515
<Value Profile="(Default)">3</Value>
1616
</Setting>
17+
<Setting Name="Upgraded" Type="System.Boolean" Scope="User">
18+
<Value Profile="(Default)">False</Value>
19+
</Setting>
1720
</Settings>
1821
</SettingsFile>

Source/WatApplication.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Threading.Tasks;
1+
using System.Linq;
2+
using System.Threading.Tasks;
23
using ScriptFUSION.WarframeAlertTracker.Forms;
34
using ScriptFUSION.WarframeAlertTracker.Resource;
45
using ScriptFUSION.WarframeAlertTracker.Warframe;
@@ -41,6 +42,9 @@ internal sealed class WatApplication : ApplicationContext {
4142

4243
private SolNodesDownloader SolNodesDownloader { get; } = new SolNodesDownloader(Downloader);
4344

45+
public static string CanonicalProductVersion { get; } =
46+
string.Join(".", Application.ProductVersion.Split('.').TakeWhile((_, i) => i < 3));
47+
4448
public WatApplication() {
4549
CurrentWorldState = new CurrentWorldState(new WorldStateDownloader(Downloader), Settings);
4650
MainForm = new WatForm(this);

0 commit comments

Comments
 (0)