Browse Source

ForwardProxyView: disable TextBox when no proxy + add timeout unit

- Thanks @DuckSoft for the review suggestions
tags/4.3.0.0
database64128 3 years ago
parent
commit
11af88fe07
No known key found for this signature in database GPG Key ID: 1CA27546BEDB8B01
10 changed files with 26 additions and 8 deletions
  1. +1
    -1
      shadowsocks-csharp/Localization/Strings.Designer.cs
  2. +1
    -1
      shadowsocks-csharp/Localization/Strings.fr.resx
  3. +1
    -1
      shadowsocks-csharp/Localization/Strings.ja.resx
  4. +1
    -1
      shadowsocks-csharp/Localization/Strings.ko.resx
  5. +1
    -1
      shadowsocks-csharp/Localization/Strings.resx
  6. +1
    -1
      shadowsocks-csharp/Localization/Strings.ru.resx
  7. +1
    -1
      shadowsocks-csharp/Localization/Strings.zh-Hans.resx
  8. +1
    -1
      shadowsocks-csharp/Localization/Strings.zh-Hant.resx
  9. +6
    -0
      shadowsocks-csharp/ViewModels/ForwardProxyViewModel.cs
  10. +12
    -0
      shadowsocks-csharp/Views/ForwardProxyView.xaml.cs

+ 1
- 1
shadowsocks-csharp/Localization/Strings.Designer.cs View File

@@ -340,7 +340,7 @@ namespace Shadowsocks.Localization {
}
/// <summary>
/// Looks up a localized string similar to Timeout.
/// Looks up a localized string similar to Timeout (sec).
/// </summary>
internal static string Timeout {
get {


+ 1
- 1
shadowsocks-csharp/Localization/Strings.fr.resx View File

@@ -130,7 +130,7 @@
<value>adresse</value>
</data>
<data name="Timeout" xml:space="preserve">
<value>Délai d'attente</value>
<value>Délai d'attente (sec)</value>
</data>
<data name="cancelButton_Content" xml:space="preserve">
<value>Annuler</value>


+ 1
- 1
shadowsocks-csharp/Localization/Strings.ja.resx View File

@@ -130,7 +130,7 @@
<value>ポート</value>
</data>
<data name="Timeout" xml:space="preserve">
<value>タイムアウト</value>
<value>タイムアウト (秒)</value>
</data>
<data name="cancelButton_Content" xml:space="preserve">
<value>キャンセル</value>


+ 1
- 1
shadowsocks-csharp/Localization/Strings.ko.resx View File

@@ -130,7 +130,7 @@
<value>포트</value>
</data>
<data name="Timeout" xml:space="preserve">
<value>시간 초과</value>
<value>시간 초과 (초)</value>
</data>
<data name="cancelButton_Content" xml:space="preserve">
<value>취소</value>


+ 1
- 1
shadowsocks-csharp/Localization/Strings.resx View File

@@ -139,7 +139,7 @@
<value>Port</value>
</data>
<data name="Timeout" xml:space="preserve">
<value>Timeout</value>
<value>Timeout (sec)</value>
</data>
<data name="CredentialsOptional" xml:space="preserve">
<value>Credentials (optional)</value>


+ 1
- 1
shadowsocks-csharp/Localization/Strings.ru.resx View File

@@ -130,7 +130,7 @@
<value>порт</value>
</data>
<data name="Timeout" xml:space="preserve">
<value>Таймаут</value>
<value>Таймаут (сек)</value>
</data>
<data name="cancelButton_Content" xml:space="preserve">
<value>Отмена</value>


+ 1
- 1
shadowsocks-csharp/Localization/Strings.zh-Hans.resx View File

@@ -148,7 +148,7 @@
<value>端口</value>
</data>
<data name="Timeout" xml:space="preserve">
<value>超时</value>
<value>超时 (秒)</value>
</data>
<data name="okButton_Content" xml:space="preserve">
<value>确定</value>


+ 1
- 1
shadowsocks-csharp/Localization/Strings.zh-Hant.resx View File

@@ -130,7 +130,7 @@
<value>位址</value>
</data>
<data name="Timeout" xml:space="preserve">
<value>逾時</value>
<value>逾時 (秒)</value>
</data>
<data name="cancelButton_Content" xml:space="preserve">
<value>取消</value>


+ 6
- 0
shadowsocks-csharp/ViewModels/ForwardProxyViewModel.cs View File

@@ -33,6 +33,9 @@ namespace Shadowsocks.ViewModels
Username = _config.proxy.authUser;
Password = _config.proxy.authPwd;

this.WhenAnyValue(x => x.NoProxy, x => !x)
.ToPropertyEx(this, x => x.CanModifyDetails);

AddressRule = this.ValidationRule(
viewModel => viewModel.Address,
address => !string.IsNullOrWhiteSpace(address),
@@ -73,6 +76,9 @@ namespace Shadowsocks.ViewModels
public ReactiveCommand<Unit, Unit> Save { get; }
public ReactiveCommand<Unit, Unit> Cancel { get; }

[ObservableAsProperty]
public bool CanModifyDetails { get; }

[Reactive]
public bool NoProxy { get; set; }



+ 12
- 0
shadowsocks-csharp/Views/ForwardProxyView.xaml.cs View File

@@ -40,6 +40,18 @@ namespace Shadowsocks.Views
viewModel => viewModel.Timeout,
view => view.timeoutTextBox.Text)
.DisposeWith(disposables);
this.OneWayBind(ViewModel,
viewModel => viewModel.CanModifyDetails,
view => view.addressTextBox.IsEnabled)
.DisposeWith(disposables);
this.OneWayBind(ViewModel,
viewModel => viewModel.CanModifyDetails,
view => view.portTextBox.IsEnabled)
.DisposeWith(disposables);
this.OneWayBind(ViewModel,
viewModel => viewModel.CanModifyDetails,
view => view.timeoutTextBox.IsEnabled)
.DisposeWith(disposables);

this.Bind(ViewModel,
viewModel => viewModel.Username,


Loading…
Cancel
Save