Skip to content

Commit

Permalink
Update Window Always Fix (#76)
Browse files Browse the repository at this point in the history
Also Removed Misc Prints
  • Loading branch information
random-facades authored Mar 8, 2020
1 parent c9a673c commit 08955ce
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
1 change: 0 additions & 1 deletion WFInfo/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public Main()

private void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args)
{
Console.WriteLine("Looks like you want to update");
update = new UpdateDialogue(args);
}

Expand Down
2 changes: 0 additions & 2 deletions WFInfo/TreeNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ public void MakeClickable(string eqmtRef)

public void DecrementPartFunc()
{
Console.WriteLine("Decrementing " + GetFullName());
if (Parent.dataRef != null)
{
JObject job = Main.dataBase.equipmentData[Parent.dataRef]["parts"][dataRef] as JObject;
Expand All @@ -750,7 +749,6 @@ public void DecrementPartFunc()

public void IncrementPartFunc()
{
Console.WriteLine("Incrementing " + GetFullName());
if (Parent.dataRef != null)
{
JObject job = Main.dataBase.equipmentData[Parent.dataRef]["parts"][dataRef] as JObject;
Expand Down
10 changes: 5 additions & 5 deletions WFInfo/UpdateDialogue.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WFInfo"
mc:Ignorable="d"
Title="New Update Found" Height="400" Width="500" BorderBrush="#FF707070" WindowStyle="None" ResizeMode="NoResize">
Title="New Update Found" Height="320" Width="420" BorderBrush="#FF707070" WindowStyle="None" ResizeMode="NoResize">
<Window.Resources>
<Style TargetType="TextBlock" BasedOn="{StaticResource baseStyle}">

Expand Down Expand Up @@ -34,13 +34,13 @@
</TransformGroup>
</Image.RenderTransform>
</Image>
<TextBlock x:Name="NewVersionText" Text="WFInfo version 9.0.0 has been released!" HorizontalAlignment="Left" Margin="8,5,0,0" Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Top" FontFamily="{StaticResource Roboto_Black}"/>
<TextBlock x:Name="OldVersionText" Text="You have version 9.0.0 installed." HorizontalAlignment="Left" Margin="8,26,0,0" Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Top"/>
<TextBlock Text="Would you like to download it now?" HorizontalAlignment="Left" Margin="8,40,0,0" Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Top"/>
<TextBlock x:Name="NewVersionText" Text="WFInfo version 9.0.0 has been released!" HorizontalAlignment="Left" Margin="17,9,0,0" Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Top" FontFamily="{StaticResource Roboto_Black}"/>
<TextBlock x:Name="OldVersionText" Text="You have version 9.0.0 installed." HorizontalAlignment="Left" Margin="17,30,0,0" Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Top"/>
<TextBlock Text="Would you like to download it now?" HorizontalAlignment="Left" Margin="17,44,0,0" Grid.ColumnSpan="2" Grid.Row="1" VerticalAlignment="Top"/>
<Button Content="No" Margin="143,76,101,0" VerticalAlignment="Top" Background="#FF0F0F0F" Click="Skip" Grid.Column="1" Height="0" Grid.Row="1"/>
<TextBlock x:Name="TitleText" Text="New Update is Available!" Margin="7,3,0,0" Background="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontFamily="{StaticResource Roboto_Black}" Grid.Column="1" Height="19" Width="178" />
<Label MouseLeftButtonDown="Exit" Content="x" Style="{StaticResource Label_Button}" Margin="0,0,0,0" Grid.Column="2"/>
<TextBlock x:Name="ReleaseNotes_Header" Text="Release Notes:" HorizontalAlignment="Left" Margin="8,65,0,0" Grid.ColumnSpan="2" Grid.Row="1" FontFamily="{StaticResource Roboto_Black}" Height="14" VerticalAlignment="Top"/>
<TextBlock x:Name="ReleaseNotes_Header" Text="Release Notes:" HorizontalAlignment="Left" Margin="17,68,0,0" Grid.ColumnSpan="2" Grid.Row="1" FontFamily="{StaticResource Roboto_Black}" Height="14" VerticalAlignment="Top"/>
<Border BorderBrush="#646464" BorderThickness="1" Margin="17,93,17,45" Grid.Row="1" Grid.ColumnSpan="3">
<ScrollViewer Padding="5,5,5,5">
<StackPanel x:Name="ReleaseNotes">
Expand Down
5 changes: 1 addition & 4 deletions WFInfo/UpdateDialogue.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ public UpdateDialogue(UpdateInfoEventArgs args)
updateInfo = args;

string version = args.CurrentVersion.ToString();
if(Settings.settingsObj.TryGetValue("ignored", out JToken val) && val.ToString() == version)
if(!args.IsUpdateAvailable || (Settings.settingsObj.TryGetValue("ignored", out JToken val) && val.ToString() == version))
return;
version = version.Substring(0, version.LastIndexOf("."));
Console.WriteLine(version);
//TitleText.Text = "WFInfo " + version + " is available";

NewVersionText.Text = "WFInfo version " + version + " has been released!";
OldVersionText.Text = "You have version " + Main.BuildVersion + " installed.";
Expand All @@ -54,7 +52,6 @@ public UpdateDialogue(UpdateInfoEventArgs args)
tag.Text = tag_name;
tag.FontWeight = FontWeights.Bold;
ReleaseNotes.Children.Add(tag);
Console.WriteLine(prop["body"]);
TextBlock body = new TextBlock();
body.Text = prop["body"].ToString() + "\n";
body.Padding = new Thickness(10, 0, 0, 0);
Expand Down

0 comments on commit 08955ce

Please sign in to comment.