mirror of
https://github.com/4sval/FModel.git
synced 2026-05-14 08:29:53 -05:00
Removed HttpRequestTimeout setting from ui
This commit is contained in:
parent
f9fedae1a0
commit
c21004c2d1
|
|
@ -545,11 +545,11 @@ namespace FModel.Settings
|
|||
set => SetProperty(ref _previewTexturesAssetExplorer, value);
|
||||
}
|
||||
|
||||
private int _httpRequestTimeout = 30;
|
||||
private int _httpRequestTimeout = 60;
|
||||
public int HttpRequestTimeout
|
||||
{
|
||||
get => _httpRequestTimeout;
|
||||
set => SetProperty(ref _httpRequestTimeout, Math.Max(value, 30));
|
||||
set => SetProperty(ref _httpRequestTimeout, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,7 +198,6 @@ public class SettingsViewModel : ViewModel
|
|||
private string _codeSnapshot;
|
||||
private string _modelSnapshot;
|
||||
private string _gameSnapshot;
|
||||
private int _httpRequestTimeout;
|
||||
private ETexturePlatform _uePlatformSnapshot;
|
||||
private EGame _ueGameSnapshot;
|
||||
private IList<FCustomVersion> _customVersionsSnapshot;
|
||||
|
|
@ -232,7 +231,6 @@ public class SettingsViewModel : ViewModel
|
|||
_codeSnapshot = UserSettings.Default.CodeDirectory;
|
||||
_modelSnapshot = UserSettings.Default.ModelDirectory;
|
||||
_gameSnapshot = UserSettings.Default.GameDirectory;
|
||||
_httpRequestTimeout = UserSettings.Default.HttpRequestTimeout;
|
||||
_uePlatformSnapshot = UserSettings.Default.CurrentDir.TexturePlatform;
|
||||
_ueGameSnapshot = UserSettings.Default.CurrentDir.UeVersion;
|
||||
_customVersionsSnapshot = UserSettings.Default.CurrentDir.Versioning.CustomVersions;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
|
@ -268,29 +267,6 @@
|
|||
TextAlignment="Right"
|
||||
TextChanged="CriwareKeyBox_TextChanged"
|
||||
Loaded="CriwareKeyBox_Loaded"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="21"
|
||||
Grid.Column="0"
|
||||
Text="HTTP Request Timeout"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0 0 0 10" />
|
||||
|
||||
<TextBox x:Name="HttpRequestTimeoutBox"
|
||||
Grid.Row="21"
|
||||
Grid.Column="2"
|
||||
Grid.ColumnSpan="5"
|
||||
Margin="0 5 0 10"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
MaxLength="10"
|
||||
ToolTip="Maximum time in seconds to wait for HTTP requests to complete before aborting."
|
||||
TextAlignment="Right"
|
||||
PreviewTextInput="HttpRequestTimeoutBox_PreviewTextInput"
|
||||
DataObject.Pasting="HttpRequestTimeoutBox_Pasting"
|
||||
Loaded="HttpRequestTimeoutBox_Loaded"
|
||||
TextChanged="HttpRequestTimeoutBox_TextChanged"/>
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="CreatorTemplate">
|
||||
|
|
|
|||
|
|
@ -275,46 +275,4 @@ public partial class SettingsView
|
|||
|
||||
Process.Start(new ProcessStartInfo(hyperlink.NavigateUri.AbsoluteUri) { UseShellExecute = true });
|
||||
}
|
||||
|
||||
private void HttpRequestTimeoutBox_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is not TextBox textBox)
|
||||
return;
|
||||
textBox.Text = UserSettings.Default.HttpRequestTimeout.ToString();
|
||||
}
|
||||
|
||||
private void HttpRequestTimeoutBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
if (sender is not TextBox textBox)
|
||||
return;
|
||||
|
||||
string input = textBox.Text?.Trim() ?? string.Empty;
|
||||
|
||||
if (string.IsNullOrEmpty(input))
|
||||
return;
|
||||
|
||||
if (int.TryParse(input, out int seconds))
|
||||
UserSettings.Default.HttpRequestTimeout = seconds;
|
||||
else
|
||||
textBox.Text = int.MaxValue.ToString();
|
||||
}
|
||||
|
||||
private void HttpRequestTimeoutBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
e.Handled = !e.Text.All(char.IsDigit);
|
||||
}
|
||||
|
||||
private void HttpRequestTimeoutBox_Pasting(object sender, DataObjectPastingEventArgs e)
|
||||
{
|
||||
if (e.DataObject.GetDataPresent(typeof(string)))
|
||||
{
|
||||
var text = (string)e.DataObject.GetData(typeof(string));
|
||||
if (!text.All(char.IsDigit))
|
||||
e.CancelCommand();
|
||||
}
|
||||
else
|
||||
{
|
||||
e.CancelCommand();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user