Skip to content

Commit

Permalink
Fix missing window title
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeans committed Oct 22, 2017
1 parent e914607 commit 44bbd78
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 21 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ![Alt text](img/icons/64x64.png "Simple DNSCrypt") Simple DNSCrypt

[![license](https://img.shields.io/github/license/bitbeans/SimpleDnsCrypt.svg?style=flat-square)](https://github.com/bitbeans/SimpleDnsCrypt/blob/master/LICENSE.md) [![Github All Releases](https://img.shields.io/github/release/bitbeans/SimpleDnsCrypt.svg?style=flat-square)](https://github.com/bitbeans/SimpleDnsCrypt/releases/latest) [![Github All Releases](https://img.shields.io/github/downloads/bitbeans/SimpleDnsCrypt/total.svg?style=flat-square)](https://github.com/bitbeans/SimpleDnsCrypt/releases/latest) [![donate PayPal](https://img.shields.io/badge/donate-PayPal-green.svg?style=flat-square)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donation+to+the+Simple+DNSCrypt+project) [![donate pledgie](https://img.shields.io/badge/donate-pledgie-green.svg?style=flat-square)](https://pledgie.com/campaigns/32588)
[![license](https://img.shields.io/github/license/bitbeans/SimpleDnsCrypt.svg?style=flat-square)](https://github.com/bitbeans/SimpleDnsCrypt/blob/master/LICENSE.md) [![Github All Releases](https://img.shields.io/github/release/bitbeans/SimpleDnsCrypt.svg?style=flat-square)](https://github.com/bitbeans/SimpleDnsCrypt/releases/latest) [![dnscrypt--proxy](https://img.shields.io/badge/dnscrypt--proxy-1.9.5-orange.svg?style=flat-square)](https://dnscrypt.org/) [![Github All Releases](https://img.shields.io/github/downloads/bitbeans/SimpleDnsCrypt/total.svg?style=flat-square)](https://github.com/bitbeans/SimpleDnsCrypt/releases/latest) [![donate PayPal](https://img.shields.io/badge/donate-PayPal-green.svg?style=flat-square)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donation+to+the+Simple+DNSCrypt+project) [![donate pledgie](https://img.shields.io/badge/donate-pledgie-green.svg?style=flat-square)](https://pledgie.com/campaigns/32588)

Simple DNSCrypt is a simple management tool to configure dnscrypt-proxy on windows based systems.

Expand All @@ -13,8 +13,6 @@ Missing features:

- IPv6 support - see [#1](https://github.com/bitbeans/SimpleDnsCrypt/issues/1)

dnscrypt-proxy version: **1.9.5**

# ![Alt text](img/icons/32x32.png "Installation") Installation

To install Simple DNSCrypt use the [latest MSI package](https://github.com/bitbeans/SimpleDnsCrypt/releases/download/0.4.2/SimpleDNSCrypt.msi).
Expand Down
2 changes: 1 addition & 1 deletion SimpleDnsCrypt/Tools/VersionUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static string PublishBuild
}
else
{
return ("(x32)");
return ("(x86)");
}
}
}
Expand Down
23 changes: 17 additions & 6 deletions SimpleDnsCrypt/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ public sealed class MainViewModel : Screen, IShell
private readonly BindableCollection<LocalNetworkInterface> _localNetworkInterfaces =
new BindableCollection<LocalNetworkInterface>();

public string WindowTitle
{
get { return _windowTitle; }
set
{
_windowTitle = value;
NotifyOfPropertyChange(() => WindowTitle);
}
}

private string _windowTitle;
private readonly UserData _userData;
private readonly IWindowManager _windowManager;
private bool _actAsGlobalGateway;
Expand Down Expand Up @@ -109,11 +120,11 @@ private MainViewModel(IWindowManager windowManager, IEventAggregator eventAggreg
}
if (_userData.UseIpv6)
{
DisplayName = string.Format("{0} {1} {2}", Global.ApplicationName, VersionUtilities.PublishVersion, VersionUtilities.PublishBuild);
WindowTitle = string.Format("{0} {1} {2}", Global.ApplicationName, VersionUtilities.PublishVersion, VersionUtilities.PublishBuild);
}
else
{
DisplayName = string.Format("{0} {1} {2} ({3})", Global.ApplicationName, VersionUtilities.PublishVersion, VersionUtilities.PublishBuild,
WindowTitle = string.Format("{0} {1} {2} ({3})", Global.ApplicationName, VersionUtilities.PublishVersion, VersionUtilities.PublishBuild,
LocalizationEx.GetUiString("global_ipv6_disabled", Thread.CurrentThread.CurrentCulture));
}

Expand Down Expand Up @@ -318,11 +329,11 @@ public Language SelectedLanguage
_userData.SaveConfigurationFile();
if (_userData.UseIpv6)
{
DisplayName = string.Format("{0} {1} {2}", Global.ApplicationName, VersionUtilities.PublishVersion, VersionUtilities.PublishBuild);
WindowTitle = string.Format("{0} {1} {2}", Global.ApplicationName, VersionUtilities.PublishVersion, VersionUtilities.PublishBuild);
}
else
{
DisplayName = string.Format("{0} {1} {2} ({3})", Global.ApplicationName, VersionUtilities.PublishVersion, VersionUtilities.PublishBuild,
WindowTitle = string.Format("{0} {1} {2} ({3})", Global.ApplicationName, VersionUtilities.PublishVersion, VersionUtilities.PublishBuild,
LocalizationEx.GetUiString("global_ipv6_disabled", Thread.CurrentThread.CurrentCulture));
}
if (_actAsGlobalGateway)
Expand Down Expand Up @@ -597,7 +608,7 @@ private async void UpdateAsync()
if (userResult != MessageBoxResult.Yes) return;
var updateViewModel = new UpdateViewModel(update.Update)
{
DisplayName =
WindowTitle =
LocalizationEx.GetUiString("window_update_title", Thread.CurrentThread.CurrentCulture)
};
dynamic settings = new ExpandoObject();
Expand Down Expand Up @@ -1126,7 +1137,7 @@ public void OpenPluginManager()
{
var win = new PluginManagerViewModel
{
DisplayName = LocalizationEx.GetUiString("window_plugin_title", Thread.CurrentThread.CurrentCulture)
WindowTitle = LocalizationEx.GetUiString("window_plugin_title", Thread.CurrentThread.CurrentCulture)
};
win.SetPlugins(Plugins);
dynamic settings = new ExpandoObject();
Expand Down
11 changes: 11 additions & 0 deletions SimpleDnsCrypt/ViewModels/PluginManagerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public sealed class PluginManagerViewModel : Screen
private bool _cachePlugin;
private int _cachePluginTtl;
private List<string> _plugins;
private string _windowTitle;

/// <summary>
/// PluginManagerViewModel constructor.
Expand All @@ -34,6 +35,16 @@ public PluginManagerViewModel()
_cachePluginTtl = 60;
}

public string WindowTitle
{
get { return _windowTitle; }
set
{
_windowTitle = value;
NotifyOfPropertyChange(() => WindowTitle);
}
}

/// <summary>
/// List of plugins.
/// </summary>
Expand Down
28 changes: 19 additions & 9 deletions SimpleDnsCrypt/ViewModels/UpdateViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ public class UpdateViewModel : Screen
private bool _isUpdatingSignature;

private string _signature;
private string _windowTitle;

/// <summary>
/// Xaml constructor.
/// </summary>
public UpdateViewModel()
/// <summary>
/// Xaml constructor.
/// </summary>
public UpdateViewModel()
{
}

Expand All @@ -45,11 +46,20 @@ public UpdateViewModel(Update update)
StartUpdateAsync(update);
}


/// <summary>
/// The path of the downloaded and validated installer file.
/// </summary>
public string InstallerPath
public string WindowTitle
{
get { return _windowTitle; }
set
{
_windowTitle = value;
NotifyOfPropertyChange(() => WindowTitle);
}
}

/// <summary>
/// The path of the downloaded and validated installer file.
/// </summary>
public string InstallerPath
{
get { return _installerPath; }
set
Expand Down
2 changes: 1 addition & 1 deletion SimpleDnsCrypt/Windows/BaseDialogWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
Title="SimpleDnsCrypt" GlowBrush="{DynamicResource AccentColorBrush}" ShowInTaskbar="False" ShowIconOnTitleBar="False" WindowStartupLocation="CenterScreen" ShowMinButton="False" ShowMaxRestoreButton="False" ResizeMode="NoResize" TitleCaps="False">
Title="{Binding WindowTitle}" GlowBrush="{DynamicResource AccentColorBrush}" ShowInTaskbar="False" ShowIconOnTitleBar="False" WindowStartupLocation="CenterScreen" ShowMinButton="False" ShowMaxRestoreButton="False" ResizeMode="NoResize" TitleCaps="False">
</controls:MetroWindow>
2 changes: 1 addition & 1 deletion SimpleDnsCrypt/Windows/BaseWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
Title="SimpleDnsCrypt" MinWidth="800" Width="800" MinHeight="360" SizeToContent="WidthAndHeight"
Title="{Binding WindowTitle}" MinWidth="800" Width="800" MinHeight="360" SizeToContent="WidthAndHeight"
GlowBrush="{DynamicResource AccentColorBrush}"
Icon="../Images/simplednscrypt.ico" ShowIconOnTitleBar="False"
WindowStartupLocation="CenterScreen" TitleCaps="False" Topmost="False"
Expand Down

0 comments on commit 44bbd78

Please sign in to comment.