Skip to content

Commit

Permalink
Can disable Magpie branding.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashokgelal committed Mar 16, 2017
1 parent 9d21602 commit 1ab5f61
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 45 deletions.
1 change: 1 addition & 0 deletions src/Magpie/Magpie/Services/AppInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class AppInfo
public string AppCastUrl { get; private set; }
public string PublicSignatureFilename { get; set; }
public int SubscribedChannel { get; set; }
public bool DisableMagpieBranding { get; set; }

public void SetAppIcon(string imageNamespace, string imagePath)
{
Expand Down
8 changes: 8 additions & 0 deletions src/Magpie/Magpie/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,20 @@ internal class MainWindowViewModel : BindableBase
private string _appIconPath;
private string _remoteVersion;
private Channel _channel;
private bool _enableMagpieBranding;

public string ReleaseNotes
{
get { return _releaseNotes; }
set { SetProperty(ref _releaseNotes, value); }
}

public bool EnableMagpieBranding
{
get { return _enableMagpieBranding; }
set { SetProperty(ref _enableMagpieBranding, value); }
}

public ICommand DownloadNowCommand { get; set; }
public ICommand SkipThisVersionCommand { get; set; }
public ICommand RemindMeLaterCommand { get; set; }
Expand Down Expand Up @@ -68,6 +75,7 @@ public MainWindowViewModel(AppInfo appInfo, IDebuggingInfoLogger logger,
IRemoteContentDownloader contentDownloader, IAnalyticsLogger analyticsLogger)
{
AppIconPath = appInfo.AppIconPath;
EnableMagpieBranding = !appInfo.DisableMagpieBranding;
_logger = logger;
_contentDownloader = contentDownloader;
_analyticsLogger = analyticsLogger;
Expand Down
12 changes: 0 additions & 12 deletions src/Magpie/Magpie/Views/DownloadWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,5 @@
Command="{Binding ContinueWithInstallationCommand}"
Content="{x:Static prop:Resources.RunInstaller}"
Padding="4" />
<Label Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
FontSize="13">
<Hyperlink Foreground="#BBBBBB"
NavigateUri="https://github.com/ashokgelal/Magpie"
RequestNavigate="PoweredBy_RequestNavigate"
TextDecorations="None">
<Run Text="{x:Static prop:Resources.PoweredByMagpie}" />
</Hyperlink>
</Label>
</Grid>
</Window>
10 changes: 1 addition & 9 deletions src/Magpie/Magpie/Views/DownloadWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Diagnostics;
using System.Windows.Navigation;


namespace MagpieUpdater.Views
{
public partial class DownloadWindow
Expand All @@ -10,11 +8,5 @@ public DownloadWindow()
InitializeComponent();
SetValue(NoIconBehavior.ShowIconProperty, false);
}

private void PoweredBy_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}
6 changes: 4 additions & 2 deletions src/Magpie/Magpie/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<ResourceDictionary Source="pack://application:,,,/Magpie;component/Resources/Styles.xaml" />
<ResourceDictionary Source="pack://application:,,,/Magpie;component/Resources/Strings.xaml" />
</ResourceDictionary.MergedDictionaries>
<BooleanToVisibilityConverter x:Key="_boolToVisibilityConverter"/>
</ResourceDictionary>
</Window.Resources>
<Grid Margin="5" Background="{DynamicResource _magpieContainerBgBrush}">
Expand Down Expand Up @@ -95,7 +96,7 @@

<DockPanel Grid.Row="4"
Grid.Column="0"
Margin="10 0"
Margin="10"
HorizontalAlignment="Stretch"
LastChildFill="False">
<Button Click="SkipThisVersion_OnClick"
Expand All @@ -122,7 +123,8 @@

<Label Grid.Row="5"
HorizontalAlignment="Center"
FontSize="13">
FontSize="13"
Visibility="{Binding EnableMagpieBranding, Converter={StaticResource _boolToVisibilityConverter}}">
<Hyperlink Foreground="#BBBBBB"
NavigateUri="https://github.com/ashokgelal/Magpie"
RequestNavigate="PoweredBy_RequestNavigate"
Expand Down
12 changes: 0 additions & 12 deletions src/Magpie/Magpie/Views/NoUpdatesWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,5 @@
Content="OK"
IsCancel="True"
Padding="20,4" />
<Label Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
FontSize="13">
<Hyperlink Foreground="#BBBBBB"
NavigateUri="https://github.com/ashokgelal/Magpie"
RequestNavigate="PoweredBy_RequestNavigate"
TextDecorations="None">
<Run Text="{x:Static prop:Resources.PoweredByMagpie}" />
</Hyperlink>
</Label>
</Grid>
</Window>
11 changes: 1 addition & 10 deletions src/Magpie/Magpie/Views/NoUpdatesWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.Diagnostics;
using System.Windows.Navigation;

namespace MagpieUpdater.Views
namespace MagpieUpdater.Views
{
public partial class NoUpdatesWindow
{
Expand All @@ -10,11 +7,5 @@ public NoUpdatesWindow()
InitializeComponent();
SetValue(NoIconBehavior.ShowIconProperty, false);
}

private void PoweredBy_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}

0 comments on commit 1ab5f61

Please sign in to comment.