Skip to content

Commit 238ab9d

Browse files
committed
Finished adding new buttons, fixed the bug where the settings button would disappear after clicking download (NCX-Core Updater)
1 parent 2379724 commit 238ab9d

5 files changed

Lines changed: 38 additions & 21 deletions

File tree

NCX-Installer/Settings.xaml.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,6 @@ private void btn6_Click(object sender, RoutedEventArgs e)
6464
btn6.Foreground = Brushes.White; btn7.Foreground = Brushes.White; checkBox1.Foreground = Brushes.White;
6565
checkBox2.Foreground = Brushes.White; radioButton1.Foreground = Brushes.White; radioButton2.Foreground = Brushes.White;
6666
}
67-
68-
string message = "Your settings have been saved. Some changes might require a restart to take effect.";
69-
string caption = "Changes Saved";
70-
MessageBoxButton buttons = MessageBoxButton.OK;
71-
MessageBoxImage icon = MessageBoxImage.Information;
72-
if (MessageBox.Show(message, caption, buttons, icon) == MessageBoxResult.OK)
73-
{
74-
75-
}
7667
}
7768

7869
private void btn7_Click(object sender, RoutedEventArgs e)

NCX-Installer/XWareNews.xaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,18 @@
4747
<ImageBrush ImageSource="image/button/source.png"/>
4848
</Button.Background>
4949
</Button>
50-
<ProgressBar x:Name="progressBar1" HorizontalAlignment="Left" Height="20" Margin="248,82,0,0" VerticalAlignment="Top" Width="175" Foreground="#FF00FFC9"/>
51-
<Label x:Name="label1" Content="Downloading... Please wait." HorizontalAlignment="Left" Margin="336,98,0,0" VerticalAlignment="Top" Width="174" FontSize="13" Visibility="Hidden" Foreground="White"/>
50+
<ProgressBar x:Name="progressBar1" HorizontalAlignment="Left" Height="20" Margin="248,82,0,0" VerticalAlignment="Top" Width="175" Foreground="#FF00FFC9" Visibility="Hidden"/>
51+
<Label x:Name="label1" Content="Downloading... Please wait." HorizontalAlignment="Left" Margin="243,98,0,0" VerticalAlignment="Top" Width="174" FontSize="13" Visibility="Hidden" Foreground="White"/>
5252
<Button x:Name="btn8" Content="" HorizontalAlignment="Left" Margin="243,75,0,0" VerticalAlignment="Top" Height="35" Width="35" Click="Button_Click_4" Foreground="White" BorderBrush="#00707070">
5353
<Button.Background>
5454
<ImageBrush ImageSource="image/button/download.png"/>
5555
</Button.Background>
5656
</Button>
5757
<TextBlock x:Name="label3" HorizontalAlignment="Left" Margin="73,118,0,0" Text="NCX-News+ is the best place to read full length NCX-News stories with information about things like software updates. News kindly written by IanSkinner1982." TextWrapping="Wrap" VerticalAlignment="Top" Height="96" Width="388" FontSize="18" Foreground="White"/>
58-
<Button x:Name="btn7" Content="Launch" HorizontalAlignment="Left" Margin="73,214,0,0" VerticalAlignment="Top" Width="74" Height="24" Click="btn7_Click" Background="{x:Null}" Visibility="Hidden" Foreground="White"/>
58+
<Button x:Name="btn7" Content="" HorizontalAlignment="Left" Margin="73,214,0,0" VerticalAlignment="Top" Width="35" Height="35" Click="btn7_Click" Visibility="Hidden" Foreground="White" BorderBrush="#00000000">
59+
<Button.Background>
60+
<ImageBrush ImageSource="image/button/launch.png"/>
61+
</Button.Background>
62+
</Button>
5963
</Grid>
6064
</Page>

NCX-Installer/XWareNews.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ private void Button_Click_4(object sender, RoutedEventArgs e)
6868
{
6969
btn8.Visibility = Visibility.Hidden;
7070
label1.Visibility = Visibility.Visible;
71+
progressBar1.Visibility = Visibility.Visible;
7172
wc.DownloadProgressChanged += wc_DownloadProgressChanged;
7273
wc.DownloadFileCompleted += DownloadCompleted;
7374
wc.DownloadFileAsync(
@@ -85,6 +86,7 @@ private void Button_Click_4(object sender, RoutedEventArgs e)
8586
{
8687
btn8.Visibility = Visibility.Hidden;
8788
label1.Visibility = Visibility.Visible;
89+
progressBar1.Visibility = Visibility.Visible;
8890
wc.DownloadProgressChanged += wc_DownloadProgressChanged;
8991
wc.DownloadFileCompleted += DownloadCompleted;
9092
wc.DownloadFileAsync(
@@ -104,6 +106,7 @@ private void Button_Click_4(object sender, RoutedEventArgs e)
104106
{
105107
btn8.Visibility = Visibility.Hidden;
106108
label1.Visibility = Visibility.Visible;
109+
progressBar1.Visibility = Visibility.Visible;
107110
wc.DownloadProgressChanged += wc_DownloadProgressChanged;
108111
wc.DownloadFileCompleted += DownloadCompleted;
109112
wc.DownloadFileAsync(

NCX-Installer/XWareUpdater.xaml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,29 @@
3737
<Image HorizontalAlignment="Left" Height="100" Margin="73,10,0,0" VerticalAlignment="Top" Width="100" Source="image/coreupdater.png"/>
3838
<Label x:Name="label2" Content="NCX-Core Updater" HorizontalAlignment="Left" Margin="173,4,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="32" Foreground="White"/>
3939
<Label x:Name="label3" Content="By NinjaCheetah" HorizontalAlignment="Left" Margin="173,40,0,0" VerticalAlignment="Top" FontSize="23" Foreground="White"/>
40-
<Button x:Name="btn6" Content="User Page" HorizontalAlignment="Left" Margin="178,78,0,0" VerticalAlignment="Top" Width="74" Height="23" Click="Button_Click_1" Background="{x:Null}" Foreground="White"/>
41-
<Button x:Name="btn9" Content="GitHub" HorizontalAlignment="Left" Margin="257,78,0,0" VerticalAlignment="Top" Width="74" Height="23" Click="Button_Click" Background="{x:Null}" Foreground="White"/>
42-
<ProgressBar x:Name="progressBar1" HorizontalAlignment="Left" Height="20" Margin="336,80,0,0" VerticalAlignment="Top" Width="175" Background="#FF323232"/>
43-
<Label x:Name="label1" Content="Downloading... Please wait." HorizontalAlignment="Left" Margin="336,98,0,0" VerticalAlignment="Top" Width="174" FontSize="13" Visibility="Hidden" Foreground="White"/>
44-
<Button x:Name="btn8" Content="Add to NCX-Core" HorizontalAlignment="Left" Margin="336,78,0,0" VerticalAlignment="Top" Height="23" Width="174" Click="Button_Click_4" Foreground="White" Background="Black"/>
40+
<Button x:Name="btn6" Content="" HorizontalAlignment="Left" Margin="173,75,0,0" VerticalAlignment="Top" Width="35" Height="35" Click="Button_Click_1" Foreground="White" BorderBrush="#00000000">
41+
<Button.Background>
42+
<ImageBrush ImageSource="image/button/user.png"/>
43+
</Button.Background>
44+
</Button>
45+
<Button x:Name="btn9" Content="" HorizontalAlignment="Left" Margin="208,75,0,0" VerticalAlignment="Top" Width="35" Height="35" Click="Button_Click" Foreground="White" BorderBrush="#00707070">
46+
<Button.Background>
47+
<ImageBrush ImageSource="image/button/source.png"/>
48+
</Button.Background>
49+
</Button>
50+
<ProgressBar x:Name="progressBar1" HorizontalAlignment="Left" Height="20" Margin="248,82,0,0" VerticalAlignment="Top" Width="175" Foreground="#FF00FFC9" Visibility="Hidden"/>
51+
<Label x:Name="label1" Content="Downloading... Please wait." HorizontalAlignment="Left" Margin="243,98,0,0" VerticalAlignment="Top" Width="174" FontSize="13" Visibility="Hidden" Foreground="White"/>
52+
<Button x:Name="btn8" Content="" HorizontalAlignment="Left" Margin="243,75,0,0" VerticalAlignment="Top" Height="35" Width="35" Click="Button_Click_4" Foreground="White" BorderBrush="#00707070">
53+
<Button.Background>
54+
<ImageBrush ImageSource="image/button/download.png"/>
55+
</Button.Background>
56+
</Button>
4557
<TextBlock x:Name="label4" HorizontalAlignment="Left" Margin="73,118,0,0" Text="NCX-Core Updater is the (much better) replacement for the built-in update menu, with a full interface and an option to download the latest nightly build." TextWrapping="Wrap" VerticalAlignment="Top" Height="96" Width="388" FontSize="18" Foreground="White"/>
46-
<Button x:Name="btn7" Content="Launch" HorizontalAlignment="Left" Margin="73,219,0,0" VerticalAlignment="Top" Width="74" Height="24" Click="btn7_Click" Background="{x:Null}" Visibility="Visible" Foreground="White"/>
58+
<Button x:Name="btn7" Content="" HorizontalAlignment="Left" Margin="73,219,0,0" VerticalAlignment="Top" Width="35" Height="35" Click="btn7_Click" Visibility="Hidden" Foreground="White" BorderBrush="#00707070">
59+
<Button.Background>
60+
<ImageBrush ImageSource="image/button/launch.png"/>
61+
</Button.Background>
62+
</Button>
4763

4864
</Grid>
4965
</Page>

NCX-Installer/XWareUpdater.xaml.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ private void Button_Click_4(object sender, RoutedEventArgs e)
6262
{
6363
using (WebClient wc = new WebClient())
6464
{
65-
btn5.Visibility = Visibility.Hidden;
65+
btn8.Visibility = Visibility.Hidden;
6666
label1.Visibility = Visibility.Visible;
67+
progressBar1.Visibility = Visibility.Visible;
6768
wc.DownloadProgressChanged += wc_DownloadProgressChanged;
6869
wc.DownloadFileCompleted += DownloadCompleted;
6970
wc.DownloadFileAsync(
@@ -79,8 +80,9 @@ private void Button_Click_4(object sender, RoutedEventArgs e)
7980
Directory.CreateDirectory(System.IO.Path.Combine(SavePath, "NCX-Core/NCXCoreUpdater"));
8081
using (WebClient wc = new WebClient())
8182
{
82-
btn5.Visibility = Visibility.Hidden;
83+
btn8.Visibility = Visibility.Hidden;
8384
label1.Visibility = Visibility.Visible;
85+
progressBar1.Visibility = Visibility.Visible;
8486
wc.DownloadProgressChanged += wc_DownloadProgressChanged;
8587
wc.DownloadFileCompleted += DownloadCompleted;
8688
wc.DownloadFileAsync(
@@ -98,8 +100,9 @@ private void Button_Click_4(object sender, RoutedEventArgs e)
98100
Directory.CreateDirectory(System.IO.Path.Combine(SavePath, "NCX-Core/NCXCoreUpdater"));
99101
using (WebClient wc = new WebClient())
100102
{
101-
btn5.Visibility = Visibility.Hidden;
103+
btn8.Visibility = Visibility.Hidden;
102104
label1.Visibility = Visibility.Visible;
105+
progressBar1.Visibility = Visibility.Visible;
103106
wc.DownloadProgressChanged += wc_DownloadProgressChanged;
104107
wc.DownloadFileCompleted += DownloadCompleted;
105108
wc.DownloadFileAsync(

0 commit comments

Comments
 (0)