Skip to content

Commit

Permalink
changed donations request
Browse files Browse the repository at this point in the history
  • Loading branch information
csoltenborn committed Apr 28, 2019
1 parent 053b516 commit 15d479c
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.IO;
using System.Threading;
using GoogleTestAdapter.Common;
using GoogleTestAdapter.VsPackage.GTA.ReleaseNotes;
using GoogleTestAdapter.VsPackage.Helpers;

namespace GoogleTestAdapter.VsPackage
Expand Down Expand Up @@ -71,7 +70,6 @@ private void DisplayReleaseNotes(string html)
HtmlFile = new Uri($"file://{htmlFile}")
})
{
dialog.AddExternalUri(Donations.Uri);
dialog.Closed += (sender, args) => File.Delete(htmlFile);
dialog.ShowDialog();
}
Expand Down
13 changes: 0 additions & 13 deletions GoogleTestAdapter/VsPackage.GTA/ReleaseNotes/Donations.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.IO;
using CommonMark;
using GoogleTestAdapter.VsPackage.GTA.ReleaseNotes;

namespace GoogleTestAdapter.VsPackage.ReleaseNotes
{
Expand All @@ -23,9 +22,7 @@ private string CreateMarkdown()
if (_formerlyInstalledVersion == _currentVersion)
return "";

string releaseNotes = Donations.Header;

releaseNotes += Environment.NewLine + CreateHeader();
string releaseNotes = CreateHeader();

int startIndex = Array.IndexOf(Versions, _currentVersion);
int endIndex = _formerlyInstalledVersion == null ? -1 : Array.IndexOf(Versions, _formerlyInstalledVersion);
Expand Down

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

15 changes: 4 additions & 11 deletions GoogleTestAdapter/VsPackage.GTA/ReleaseNotes/ReleaseNotesDialog.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;
using GoogleTestAdapter.VsPackage.GTA.ReleaseNotes;

namespace GoogleTestAdapter.VsPackage.ReleaseNotes
{
public partial class ReleaseNotesDialog : Form
{
private readonly ISet<Uri> _externalUris = new HashSet<Uri>();
private static readonly Uri DonationsUri = new Uri("https://github.com/csoltenborn/GoogleTestAdapter#donations");

public ReleaseNotesDialog()
{
InitializeComponent();

Load += (sender, args) => DonateButton.Select();
Load += (sender, args) => OkButton.Select();

WebBrowser.CanGoBackChanged += (sender, args) => BackButton.Enabled = WebBrowser.CanGoBack;
BackButton.Click += (sender, args) => WebBrowser.GoBack();
Expand All @@ -25,7 +23,7 @@ public ReleaseNotesDialog()
OkButton.Click += (sender, args) => Close();
DonateButton.Click += (sender, args) =>
{
OpenUriInDefaultBrowser(Donations.Uri);
OpenUriInDefaultBrowser(DonationsUri);
Close();
};
}
Expand All @@ -36,14 +34,9 @@ internal Uri HtmlFile
set => WebBrowser.Url = value;
}

internal void AddExternalUri(Uri externalUri)
{
_externalUris.Add(externalUri);
}

private void WebBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
if (_externalUris.Contains(e.Url))
if (DonationsUri.Equals(e.Url))
{
e.Cancel = true;
OpenUriInDefaultBrowser(e.Url);
Expand Down
1 change: 0 additions & 1 deletion GoogleTestAdapter/VsPackage.GTA/VsPackage.GTA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
<Compile Include="AsyncPackage\ProvideAutoLoadAttribute.cs" />
<Compile Include="GoogleTestExtensionOptionsPage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReleaseNotes\Donations.cs" />
<Compile Include="ReleaseNotes\ReleaseNotesCreator.cs" />
<Compile Include="ReleaseNotes\ReleaseNotesDialog.cs">
<SubType>Form</SubType>
Expand Down

0 comments on commit 15d479c

Please sign in to comment.