Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Dec 1, 2019
1 parent f0602ef commit be4c2cb
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 14 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).


## [0.60.1] - 2019-12-01

### Added
- added process monitor, using ETW events to aid resolving PID to program, when the prgram in question already exited.
- added upstream dns diplay to the dns proxy page

### Changed

### Fixed
- fixed critical hang issue when not using the system event log
- issue where a custom upstream dns would not be displayed
- fixed issues with copying text from datagrids


## [0.60] - 2019-11-30

### Added
Expand Down
4 changes: 3 additions & 1 deletion PrivateWin10/App.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Application x:Class="PrivateWin10.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PrivateWin10">
xmlns:local="clr-namespace:PrivateWin10"
DispatcherUnhandledException="Application_DispatcherUnhandledException"
>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down
9 changes: 9 additions & 0 deletions PrivateWin10/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,15 @@ static private void FirstChanceExceptionHandler(object source, FirstChanceExcept
AppLog.Debug("FirstChanceException event raised in {0}: {1}\r\n{2}", AppDomain.CurrentDomain.FriendlyName, e.Exception.Message, e.Exception.StackTrace);
}

//https://stackoverflow.com/questions/12769264/openclipboard-failed-when-copy-pasting-data-from-wpf-datagrid
void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
var comException = e.Exception as System.Runtime.InteropServices.COMException;

if (comException != null && comException.ErrorCode == -2147221040)
e.Handled = true;
}

static bool ExecuteCommands()
{
if (TestArg("-help") || TestArg("/?"))
Expand Down
12 changes: 12 additions & 0 deletions PrivateWin10/Common/DataGridExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;

namespace PrivateWin10
{
Expand Down Expand Up @@ -38,8 +39,19 @@ public DataGridExt(DataGrid dataGrid)
dataGrid.ContextMenuOpening += (sender, e) => { };

dataGrid.ColumnReordered += (sender, e) => { if (!Hold) CreateHeaderMenu(); };

//dataGrid.PreviewKeyDown += DataGrid_KeyDown;
}

/*private void DataGrid_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.C && Keyboard.Modifiers == ModifierKeys.Control)
{
//MiscFunc.ClipboardNative.CopyTextToClipboard("test");
//e.Handled = true;
}
}*/

private void CreateHeaderMenu()
{
headerMenu.Items.Clear();
Expand Down
2 changes: 1 addition & 1 deletion PrivateWin10/Controls/DnsBlockListsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Width="*" Header="List">
<DataGridTemplateColumn Width="*" Header="List" ClipboardContentBinding="{Binding Url}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
Expand Down
2 changes: 1 addition & 1 deletion PrivateWin10/Controls/DnsFilterListControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Width="*" Header="Domain">
<DataGridTemplateColumn Width="*" Header="Domain" ClipboardContentBinding="{Binding Domain}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
Expand Down
1 change: 1 addition & 0 deletions PrivateWin10/Controls/DnsLogList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<DataGrid Name="dnsGrid" AutoGenerateColumns="False" IsReadOnly="true" GridLinesVisibility="All" SelectionChanged="DnsGrid_SelectionChanged">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Ico">
<!-- ClipboardContentBinding="{Binding Name}"-->
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
Expand Down
1 change: 1 addition & 0 deletions PrivateWin10/Controls/FirewallLogList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
<DataGrid Name="logGrid" AutoGenerateColumns="False" IsReadOnly="true" GridLinesVisibility="All" SelectionChanged="ConsGrid_SelectionChanged">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Ico">
<!-- ClipboardContentBinding="{Binding Name}"-->
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
Expand Down
1 change: 1 addition & 0 deletions PrivateWin10/Controls/FirewallRuleList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<DataGrid Name="rulesGrid" AutoGenerateColumns="False" IsReadOnly="true" MouseDoubleClick="ruleGrid_MouseDoubleClick" GridLinesVisibility="All" SelectionChanged="RuleGrid_SelectionChanged" ContextMenuOpening="RulesGrid_ContextMenuOpening">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Ico">
<!-- ClipboardContentBinding="{Binding Name}"-->
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
Expand Down
1 change: 1 addition & 0 deletions PrivateWin10/Controls/NetworkSocketList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<DataGrid Name="socksGrid" AutoGenerateColumns="False" IsReadOnly="true" GridLinesVisibility="All" SelectionChanged="SockGrid_SelectionChanged">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Ico">
<!-- ClipboardContentBinding="{Binding Name}"-->
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
Expand Down
1 change: 1 addition & 0 deletions PrivateWin10/Controls/ProgramControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
<DataGrid x:Name="progGrid" AutoGenerateColumns="False" IsReadOnly="true" HorizontalScrollBarVisibility="Visible" MouseDoubleClick="progGrid_MouseDoubleClick" GridLinesVisibility="All">
<DataGrid.Columns>
<DataGridTemplateColumn Header="">
<!-- ClipboardContentBinding="{Binding Name}"-->
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
Expand Down
2 changes: 1 addition & 1 deletion PrivateWin10/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

</FrameworkElement.Resources>

<Grid x:Name="Main" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Background="White">
<Grid Name="Main" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" Background="White">
<Grid Width="48" HorizontalAlignment="Left" Background="{StaticResource SidePanel.Back}"/>
<TabControl x:Name="SidePanel" Width="50" Margin="-2,-1,0,0" HorizontalAlignment="Left" VerticalAlignment="Stretch" TabStripPlacement="Left">

Expand Down
19 changes: 14 additions & 5 deletions PrivateWin10/Pages/DnsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local">
<Grid KeyboardNavigation.TabNavigation="Local" x:Name="test">
<Grid.ColumnDefinitions>
<!--ColumnDefinition Width="Auto" /-->
<ColumnDefinition Width="150" />
Expand Down Expand Up @@ -43,10 +43,19 @@
ContentSource="SelectedContent" />

<StackPanel Margin="0,0,4,-1">
<StackPanel x:Name="StatusPanel" MinHeight="40">

</StackPanel>
<Label Content="Navigation Menu" FontSize="14" Foreground="DarkGray"/>
<Grid Height="80">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<Label x:Name="lblUpstreamDns" Content="Upstream DNS:" Grid.Row="0" Foreground="DarkGray" />
<TextBlock x:Name="txtUpstreamDns" Text="8.8.8.8; 8.8.4.4" Grid.Row="1" Margin="15,-2,5,0" TextWrapping="Wrap" Foreground="DarkGray" HorizontalAlignment="Left" />

<Label x:Name="lblNavMenu" Content="Navigation Menu" Grid.Row="3" FontSize="14" Foreground="DarkGray"/>
</Grid>
<StackPanel x:Name="HeaderPanel"
Grid.Row="0"
Panel.ZIndex="1"
Expand Down
17 changes: 17 additions & 0 deletions PrivateWin10/Pages/DnsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ public DnsPage()
{
InitializeComponent();

tabs.Loaded += (sender, e) => {

// todo: localize

UpdateStats();
};

try {
tabs.SelectedIndex = App.GetConfigInt("GUI", "DnsPage", 0);
} catch { }
Expand All @@ -37,6 +44,8 @@ public DnsPage()

public void OnShow()
{
UpdateStats();

Tabs_SelectionChanged(null, null);
}

Expand All @@ -49,6 +58,14 @@ public void OnClose()
App.SetConfig("GUI", "DnsPage", tabs.SelectedIndex);
}

public void UpdateStats()
{
var txtUpstreamDns = tabs.Template.FindName("txtUpstreamDns", tabs) as TextBlock;
if (txtUpstreamDns == null)
return;
txtUpstreamDns.Text = App.GetConfig("DNSProxy", "UpstreamDNS", "");
}

//
private void Tabs_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Expand Down
2 changes: 1 addition & 1 deletion PrivateWin10/Pages/OverviewPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<GroupBox Grid.Row="3" Name="grpLog" Header="Privacy Log">
<DataGrid Name="logGrid" AutoGenerateColumns="False" IsReadOnly="true" GridLinesVisibility="All" SelectionChanged="LogGrid_SelectionChanged">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Level">
<DataGridTemplateColumn Header="Level" ClipboardContentBinding="{Binding Level}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
Expand Down
2 changes: 1 addition & 1 deletion PrivateWin10/Pages/OverviewPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public OverviewPage()
}

App.Log.LogEvent += (object sender, AppLog.LogEventArgs args) => {
this.Dispatcher.Invoke(new Action(()=> {
this.Dispatcher.InvokeAsync(new Action(()=> {
OnLogEvent(args.entry);
}));
};
Expand Down
4 changes: 3 additions & 1 deletion PrivateWin10/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ public void Refresh()

// DNS
chkLocalDNS.IsChecked = App.GetConfigInt("DnsProxy", "SetLocal", 0) != 0;
WpfFunc.CmbSelect(cmbRootDNS, App.GetConfig("DNSProxy", "UpstreamDNS", "8.8.8.8"));
string UpstreamDNS = App.GetConfig("DNSProxy", "UpstreamDNS", "8.8.8.8");
if (!WpfFunc.CmbSelect(cmbRootDNS, UpstreamDNS))
cmbRootDNS.Text = UpstreamDNS;
CheckDNS();

bHold = false;
Expand Down
4 changes: 2 additions & 2 deletions PrivateWin10/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.60.0.2")]
[assembly: AssemblyFileVersion("0.60.0.2")]
[assembly: AssemblyVersion("0.60.1.0")]
[assembly: AssemblyFileVersion("0.60.1.0")]

0 comments on commit be4c2cb

Please sign in to comment.