private void UpdateBrowserMonitoringConfig() { Config.Instance.FileExtensions = TxtDefaultFileTypes.Text.Split(',').Select(x => x.Trim()).Where(x => x.Length > 0).ToArray(); Config.Instance.VideoExtensions = TxtDefaultVideoFormats.Text.Split(',').Select(x => x.Trim()).Where(x => x.Length > 0).ToArray(); Config.Instance.BlockedHosts = TxtExceptions.Text.Split(',').Select(x => x.Trim()).Where(x => x.Length > 0).ToArray(); Config.Instance.FetchServerTimeStamp = ChkTimestamp.Active; Config.Instance.MonitorClipboard = ChkMonitorClipboard.Active; Config.Instance.MinVideoSize = GtkHelper.GetSelectedComboBoxValue <int>(CmbMinVidSize); }
private void BtnOk_Clicked(object?sender, EventArgs e) { Result = true; var name = GtkHelper.GetSelectedComboBoxValue <string>(CmbLanguage); if (!string.IsNullOrEmpty(name)) { Config.Instance.Language = name; Config.SaveConfig(); } this.group.RemoveWindow(this); Dispose(); }
private void UpdateGeneralSettingsConfig() { Config.Instance.ShowProgressWindow = ChkShowPrg.Active; Config.Instance.ShowDownloadCompleteWindow = ChkShowComplete.Active; Config.Instance.StartDownloadAutomatically = ChkStartAuto.Active; Config.Instance.FileConflictResolution = ChkOverwrite.Active ? FileConflictResolution.Overwrite : FileConflictResolution.AutoRename; Config.Instance.TempDir = TxtTempFolder.Text; Config.Instance.MaxParallelDownloads = GtkHelper.GetSelectedComboBoxValue <int>(CmbMaxParallalDownloads); Config.Instance.Categories = GtkHelper.GetListStoreValues <Category>(categoryStore, 3); Config.Instance.FolderSelectionMode = ChkAutoCat.Active ? FolderSelectionMode.Auto : FolderSelectionMode.Manual; Config.Instance.DefaultDownloadFolder = TxtDownloadFolder.Text; Config.Instance.AllowSystemDarkTheme = ChkDarkTheme.Active; Config.Instance.DoubleClickOpenFile = CmbDblClickAction.Active == 1; }
private void UpdateNetworkSettingsConfig() { Config.Instance.NetworkTimeout = GtkHelper.GetSelectedComboBoxValue <int>(CmbTimeOut); Config.Instance.MaxSegments = GtkHelper.GetSelectedComboBoxValue <int>(CmbMaxSegments); Config.Instance.MaxRetry = GtkHelper.GetSelectedComboBoxValue <int>(CmbMaxRetry); if (Int32.TryParse(TxtMaxSpeedLimit.Text, out int speed)) { Config.Instance.DefaltDownloadSpeed = speed; } Config.Instance.EnableSpeedLimit = ChkEnableSpeedLimit.Active; Int32.TryParse(TxtProxyPort.Text, out int port); Config.Instance.Proxy = new ProxyInfo { ProxyType = (ProxyType)CmbProxyType.Active, Host = TxtProxyHost.Text, UserName = TxtProxyUser.Text, Password = TxtProxyPassword.Text, Port = port }; }