Skip to content

Commit

Permalink
Fixed dependency licenses and initialization of the browser
Browse files Browse the repository at this point in the history
  • Loading branch information
microdee committed Dec 22, 2016
1 parent 12d10fd commit cb7593c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/vpm/UserAgree.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<cefSharp:ChromiumWebBrowser x:Name="Browser" Address="http://www.imxprs.com/free/microdee/vpmnolicense" LoadingStateChanged="Browser_OnLoadingStateChanged"/>
<cefSharp:ChromiumWebBrowser x:Name="Browser" LoadingStateChanged="Browser_OnLoadingStateChanged" />
<CheckBox x:Name="AgreeAndInstall" FlowDirection="RightToLeft" Content="Agree and install" Margin="0,10,246,10" Grid.Row="1" Checked="AgreeAndInstall_OnChecked" HorizontalAlignment="Right" Width="109" RenderTransformOrigin="1.006,0.495"/>
<Button x:Name="NextPack" Content="Next &gt;" Grid.Row="1" HorizontalAlignment="Right" Width="75" IsDefault="True" Click="NextPack_OnClick" Margin="0,0,155,0"/>
<Button x:Name="ContinueInstall" Content="Continue" Height="40" VerticalAlignment="Bottom" Click="ContinueInstall_Click" IsEnabled="False" Grid.Row="1" HorizontalAlignment="Right" Width="155"/>
Expand Down
16 changes: 11 additions & 5 deletions src/vpm/UserAgree.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
Expand Down Expand Up @@ -50,11 +51,16 @@ private void UserAgree_OnInitialized(object sender, EventArgs e)
};
VPackList.Items.Add(item);
}
VPackList.SelectedIndex = 0;
SelectedPack = (ListBoxItem)VPackList.Items[0];
var pack = (VPack)SelectedPack.Content;
AgreeAndInstall.IsChecked = pack.Agreed;
Browser.Load(pack.LicenseUrl);
var delay = new Timer { Interval = 1500 };
delay.Elapsed += (o, ee) =>
{
Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
{
VPackList.SelectedIndex = 0;
delay.Stop();
}));
};
delay.Start();
}

private void VPackList_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
Expand Down
5 changes: 3 additions & 2 deletions src/vpm/vpack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public VPack(string name, string source, IEnumerable<string> aliases = null, Xml

var authornode = srcxml?.SelectSingleNode("/vpack/meta/author");
if (authornode != null) Author = authornode.InnerText.Trim();
var licensenode = srcxml?.SelectSingleNode("/vpack/meta/license");
LicenseUrl = licensenode != null ? licensenode.InnerText.Trim() : "http://www.imxprs.com/free/microdee/vpmnolicense";

Directory.CreateDirectory(TempDir);

Expand All @@ -60,6 +58,9 @@ public VPack(string name, string source, IEnumerable<string> aliases = null, Xml
}
if (xmldoc != null)
{
var licensenode = xmldoc.SelectSingleNode("/vpack/meta/license");
LicenseUrl = licensenode != null ? licensenode.InnerText.Trim() : "http://www.imxprs.com/free/microdee/vpmnolicense";

var namenode = xmldoc.SelectSingleNode("/vpack/meta/name");
if (namenode == null)
{
Expand Down

0 comments on commit cb7593c

Please sign in to comment.