From c21004c2d14d7db4bc26e4e444d2ba10732de213 Mon Sep 17 00:00:00 2001 From: SternI Date: Fri, 3 Apr 2026 21:25:59 +0200 Subject: [PATCH] Removed HttpRequestTimeout setting from ui --- FModel/Settings/UserSettings.cs | 4 +-- FModel/ViewModels/SettingsViewModel.cs | 2 -- FModel/Views/SettingsView.xaml | 24 --------------- FModel/Views/SettingsView.xaml.cs | 42 -------------------------- 4 files changed, 2 insertions(+), 70 deletions(-) diff --git a/FModel/Settings/UserSettings.cs b/FModel/Settings/UserSettings.cs index 5f90cde3..7c67942a 100644 --- a/FModel/Settings/UserSettings.cs +++ b/FModel/Settings/UserSettings.cs @@ -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); } } } diff --git a/FModel/ViewModels/SettingsViewModel.cs b/FModel/ViewModels/SettingsViewModel.cs index 0ea9e52d..0ca1c3ea 100644 --- a/FModel/ViewModels/SettingsViewModel.cs +++ b/FModel/ViewModels/SettingsViewModel.cs @@ -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 _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; diff --git a/FModel/Views/SettingsView.xaml b/FModel/Views/SettingsView.xaml index e0382da8..e9591468 100644 --- a/FModel/Views/SettingsView.xaml +++ b/FModel/Views/SettingsView.xaml @@ -44,7 +44,6 @@ - @@ -268,29 +267,6 @@ TextAlignment="Right" TextChanged="CriwareKeyBox_TextChanged" Loaded="CriwareKeyBox_Loaded"/> - - - - - - diff --git a/FModel/Views/SettingsView.xaml.cs b/FModel/Views/SettingsView.xaml.cs index 4e95522c..b600177d 100644 --- a/FModel/Views/SettingsView.xaml.cs +++ b/FModel/Views/SettingsView.xaml.cs @@ -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(); - } - } }