mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-16 06:31:42 +02:00
@@ -82,6 +82,8 @@ namespace TweetDuck.Configuration {
|
|||||||
public string CustomBrowserCSS { get; set; } = null;
|
public string CustomBrowserCSS { get; set; } = null;
|
||||||
public string CustomNotificationCSS { get; set; } = null;
|
public string CustomNotificationCSS { get; set; } = null;
|
||||||
|
|
||||||
|
private bool _useSystemProxyForAllConnections;
|
||||||
|
|
||||||
public bool DevToolsInContextMenu { get; set; } = false;
|
public bool DevToolsInContextMenu { get; set; } = false;
|
||||||
public bool DevToolsWindowOnTop { get; set; } = true;
|
public bool DevToolsWindowOnTop { get; set; } = true;
|
||||||
|
|
||||||
@@ -133,6 +135,11 @@ namespace TweetDuck.Configuration {
|
|||||||
set => UpdatePropertyWithRestartRequest(ref _enableColorProfileDetection, value);
|
set => UpdatePropertyWithRestartRequest(ref _enableColorProfileDetection, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool UseSystemProxyForAllConnections {
|
||||||
|
get => _useSystemProxyForAllConnections;
|
||||||
|
set => UpdatePropertyWithRestartRequest(ref _useSystemProxyForAllConnections, value);
|
||||||
|
}
|
||||||
|
|
||||||
public string CustomCefArgs {
|
public string CustomCefArgs {
|
||||||
get => _customCefArgs;
|
get => _customCefArgs;
|
||||||
set => UpdatePropertyWithRestartRequest(ref _customCefArgs, value);
|
set => UpdatePropertyWithRestartRequest(ref _customCefArgs, value);
|
||||||
|
77
Dialogs/Settings/TabSettingsAdvanced.Designer.cs
generated
77
Dialogs/Settings/TabSettingsAdvanced.Designer.cs
generated
@@ -41,10 +41,12 @@
|
|||||||
this.panelConfiguration = new System.Windows.Forms.Panel();
|
this.panelConfiguration = new System.Windows.Forms.Panel();
|
||||||
this.labelConfiguration = new System.Windows.Forms.Label();
|
this.labelConfiguration = new System.Windows.Forms.Label();
|
||||||
this.flowPanel = new System.Windows.Forms.FlowLayoutPanel();
|
this.flowPanel = new System.Windows.Forms.FlowLayoutPanel();
|
||||||
|
this.labelProxy = new System.Windows.Forms.Label();
|
||||||
|
this.checkUseSystemProxyForAllConnections = new System.Windows.Forms.CheckBox();
|
||||||
this.labelDevTools = new System.Windows.Forms.Label();
|
this.labelDevTools = new System.Windows.Forms.Label();
|
||||||
this.checkDevToolsInContextMenu = new System.Windows.Forms.CheckBox();
|
this.checkDevToolsInContextMenu = new System.Windows.Forms.CheckBox();
|
||||||
this.checkDevToolsWindowOnTop = new System.Windows.Forms.CheckBox();
|
this.checkDevToolsWindowOnTop = new System.Windows.Forms.CheckBox();
|
||||||
((System.ComponentModel.ISupportInitialize) (this.numClearCacheThreshold)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.numClearCacheThreshold)).BeginInit();
|
||||||
this.panelAppButtons.SuspendLayout();
|
this.panelAppButtons.SuspendLayout();
|
||||||
this.panelClearCacheAuto.SuspendLayout();
|
this.panelClearCacheAuto.SuspendLayout();
|
||||||
this.panelConfiguration.SuspendLayout();
|
this.panelConfiguration.SuspendLayout();
|
||||||
@@ -128,16 +130,32 @@
|
|||||||
// numClearCacheThreshold
|
// numClearCacheThreshold
|
||||||
//
|
//
|
||||||
this.numClearCacheThreshold.Font = new System.Drawing.Font("Segoe UI", 9F);
|
this.numClearCacheThreshold.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||||
this.numClearCacheThreshold.Increment = new decimal(new int[] { 50, 0, 0, 0 });
|
this.numClearCacheThreshold.Increment = new decimal(new int[] {
|
||||||
|
50,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
this.numClearCacheThreshold.Location = new System.Drawing.Point(210, 5);
|
this.numClearCacheThreshold.Location = new System.Drawing.Point(210, 5);
|
||||||
this.numClearCacheThreshold.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
|
this.numClearCacheThreshold.Maximum = new decimal(new int[] {
|
||||||
this.numClearCacheThreshold.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
|
1000,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.numClearCacheThreshold.Minimum = new decimal(new int[] {
|
||||||
|
100,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
this.numClearCacheThreshold.Name = "numClearCacheThreshold";
|
this.numClearCacheThreshold.Name = "numClearCacheThreshold";
|
||||||
this.numClearCacheThreshold.Size = new System.Drawing.Size(89, 23);
|
this.numClearCacheThreshold.Size = new System.Drawing.Size(89, 23);
|
||||||
this.numClearCacheThreshold.TabIndex = 1;
|
this.numClearCacheThreshold.TabIndex = 1;
|
||||||
this.numClearCacheThreshold.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
this.numClearCacheThreshold.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||||
this.numClearCacheThreshold.TextSuffix = " MB";
|
this.numClearCacheThreshold.TextSuffix = " MB";
|
||||||
this.numClearCacheThreshold.Value = new decimal(new int[] { 250, 0, 0, 0 });
|
this.numClearCacheThreshold.Value = new decimal(new int[] {
|
||||||
|
250,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
//
|
//
|
||||||
// checkClearCacheAuto
|
// checkClearCacheAuto
|
||||||
//
|
//
|
||||||
@@ -218,7 +236,8 @@
|
|||||||
//
|
//
|
||||||
// flowPanel
|
// flowPanel
|
||||||
//
|
//
|
||||||
this.flowPanel.Anchor = ((System.Windows.Forms.AnchorStyles) (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left)));
|
this.flowPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.flowPanel.Controls.Add(this.labelApp);
|
this.flowPanel.Controls.Add(this.labelApp);
|
||||||
this.flowPanel.Controls.Add(this.panelAppButtons);
|
this.flowPanel.Controls.Add(this.panelAppButtons);
|
||||||
this.flowPanel.Controls.Add(this.labelCache);
|
this.flowPanel.Controls.Add(this.labelCache);
|
||||||
@@ -226,6 +245,8 @@
|
|||||||
this.flowPanel.Controls.Add(this.panelClearCacheAuto);
|
this.flowPanel.Controls.Add(this.panelClearCacheAuto);
|
||||||
this.flowPanel.Controls.Add(this.labelConfiguration);
|
this.flowPanel.Controls.Add(this.labelConfiguration);
|
||||||
this.flowPanel.Controls.Add(this.panelConfiguration);
|
this.flowPanel.Controls.Add(this.panelConfiguration);
|
||||||
|
this.flowPanel.Controls.Add(this.labelProxy);
|
||||||
|
this.flowPanel.Controls.Add(this.checkUseSystemProxyForAllConnections);
|
||||||
this.flowPanel.Controls.Add(this.labelDevTools);
|
this.flowPanel.Controls.Add(this.labelDevTools);
|
||||||
this.flowPanel.Controls.Add(this.checkDevToolsInContextMenu);
|
this.flowPanel.Controls.Add(this.checkDevToolsInContextMenu);
|
||||||
this.flowPanel.Controls.Add(this.checkDevToolsWindowOnTop);
|
this.flowPanel.Controls.Add(this.checkDevToolsWindowOnTop);
|
||||||
@@ -236,26 +257,49 @@
|
|||||||
this.flowPanel.TabIndex = 0;
|
this.flowPanel.TabIndex = 0;
|
||||||
this.flowPanel.WrapContents = false;
|
this.flowPanel.WrapContents = false;
|
||||||
//
|
//
|
||||||
|
// labelProxy
|
||||||
|
//
|
||||||
|
this.labelProxy.AutoSize = true;
|
||||||
|
this.labelProxy.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
|
||||||
|
this.labelProxy.Location = new System.Drawing.Point(0, 302);
|
||||||
|
this.labelProxy.Margin = new System.Windows.Forms.Padding(0, 30, 0, 1);
|
||||||
|
this.labelProxy.Name = "labelProxy";
|
||||||
|
this.labelProxy.Size = new System.Drawing.Size(54, 19);
|
||||||
|
this.labelProxy.TabIndex = 7;
|
||||||
|
this.labelProxy.Text = "PROXY";
|
||||||
|
//
|
||||||
|
// checkUseSystemProxyForAllConnections
|
||||||
|
//
|
||||||
|
this.checkUseSystemProxyForAllConnections.AutoSize = true;
|
||||||
|
this.checkUseSystemProxyForAllConnections.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||||
|
this.checkUseSystemProxyForAllConnections.Location = new System.Drawing.Point(6, 328);
|
||||||
|
this.checkUseSystemProxyForAllConnections.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2);
|
||||||
|
this.checkUseSystemProxyForAllConnections.Name = "checkUseSystemProxyForAllConnections";
|
||||||
|
this.checkUseSystemProxyForAllConnections.Size = new System.Drawing.Size(223, 19);
|
||||||
|
this.checkUseSystemProxyForAllConnections.TabIndex = 8;
|
||||||
|
this.checkUseSystemProxyForAllConnections.Text = "Use System Proxy for All Connections";
|
||||||
|
this.checkUseSystemProxyForAllConnections.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
// labelDevTools
|
// labelDevTools
|
||||||
//
|
//
|
||||||
this.labelDevTools.AutoSize = true;
|
this.labelDevTools.AutoSize = true;
|
||||||
this.labelDevTools.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
|
this.labelDevTools.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
|
||||||
this.labelDevTools.Location = new System.Drawing.Point(0, 302);
|
this.labelDevTools.Location = new System.Drawing.Point(0, 379);
|
||||||
this.labelDevTools.Margin = new System.Windows.Forms.Padding(0, 30, 0, 1);
|
this.labelDevTools.Margin = new System.Windows.Forms.Padding(0, 30, 0, 1);
|
||||||
this.labelDevTools.Name = "labelDevTools";
|
this.labelDevTools.Name = "labelDevTools";
|
||||||
this.labelDevTools.Size = new System.Drawing.Size(156, 19);
|
this.labelDevTools.Size = new System.Drawing.Size(156, 19);
|
||||||
this.labelDevTools.TabIndex = 7;
|
this.labelDevTools.TabIndex = 9;
|
||||||
this.labelDevTools.Text = "DEVELOPMENT TOOLS";
|
this.labelDevTools.Text = "DEVELOPMENT TOOLS";
|
||||||
//
|
//
|
||||||
// checkDevToolsInContextMenu
|
// checkDevToolsInContextMenu
|
||||||
//
|
//
|
||||||
this.checkDevToolsInContextMenu.AutoSize = true;
|
this.checkDevToolsInContextMenu.AutoSize = true;
|
||||||
this.checkDevToolsInContextMenu.Font = new System.Drawing.Font("Segoe UI", 9F);
|
this.checkDevToolsInContextMenu.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||||
this.checkDevToolsInContextMenu.Location = new System.Drawing.Point(6, 328);
|
this.checkDevToolsInContextMenu.Location = new System.Drawing.Point(6, 405);
|
||||||
this.checkDevToolsInContextMenu.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2);
|
this.checkDevToolsInContextMenu.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2);
|
||||||
this.checkDevToolsInContextMenu.Name = "checkDevToolsInContextMenu";
|
this.checkDevToolsInContextMenu.Name = "checkDevToolsInContextMenu";
|
||||||
this.checkDevToolsInContextMenu.Size = new System.Drawing.Size(201, 19);
|
this.checkDevToolsInContextMenu.Size = new System.Drawing.Size(201, 19);
|
||||||
this.checkDevToolsInContextMenu.TabIndex = 8;
|
this.checkDevToolsInContextMenu.TabIndex = 10;
|
||||||
this.checkDevToolsInContextMenu.Text = "Show Dev Tools in Context Menu";
|
this.checkDevToolsInContextMenu.Text = "Show Dev Tools in Context Menu";
|
||||||
this.checkDevToolsInContextMenu.UseVisualStyleBackColor = true;
|
this.checkDevToolsInContextMenu.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
@@ -263,11 +307,11 @@
|
|||||||
//
|
//
|
||||||
this.checkDevToolsWindowOnTop.AutoSize = true;
|
this.checkDevToolsWindowOnTop.AutoSize = true;
|
||||||
this.checkDevToolsWindowOnTop.Font = new System.Drawing.Font("Segoe UI", 9F);
|
this.checkDevToolsWindowOnTop.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||||
this.checkDevToolsWindowOnTop.Location = new System.Drawing.Point(6, 352);
|
this.checkDevToolsWindowOnTop.Location = new System.Drawing.Point(6, 429);
|
||||||
this.checkDevToolsWindowOnTop.Margin = new System.Windows.Forms.Padding(6, 3, 3, 2);
|
this.checkDevToolsWindowOnTop.Margin = new System.Windows.Forms.Padding(6, 3, 3, 2);
|
||||||
this.checkDevToolsWindowOnTop.Name = "checkDevToolsWindowOnTop";
|
this.checkDevToolsWindowOnTop.Name = "checkDevToolsWindowOnTop";
|
||||||
this.checkDevToolsWindowOnTop.Size = new System.Drawing.Size(168, 19);
|
this.checkDevToolsWindowOnTop.Size = new System.Drawing.Size(168, 19);
|
||||||
this.checkDevToolsWindowOnTop.TabIndex = 9;
|
this.checkDevToolsWindowOnTop.TabIndex = 11;
|
||||||
this.checkDevToolsWindowOnTop.Text = "Dev Tools Window On Top";
|
this.checkDevToolsWindowOnTop.Text = "Dev Tools Window On Top";
|
||||||
this.checkDevToolsWindowOnTop.UseVisualStyleBackColor = true;
|
this.checkDevToolsWindowOnTop.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
@@ -278,7 +322,7 @@
|
|||||||
this.Controls.Add(this.flowPanel);
|
this.Controls.Add(this.flowPanel);
|
||||||
this.Name = "TabSettingsAdvanced";
|
this.Name = "TabSettingsAdvanced";
|
||||||
this.Size = new System.Drawing.Size(631, 480);
|
this.Size = new System.Drawing.Size(631, 480);
|
||||||
((System.ComponentModel.ISupportInitialize) (this.numClearCacheThreshold)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.numClearCacheThreshold)).EndInit();
|
||||||
this.panelAppButtons.ResumeLayout(false);
|
this.panelAppButtons.ResumeLayout(false);
|
||||||
this.panelClearCacheAuto.ResumeLayout(false);
|
this.panelClearCacheAuto.ResumeLayout(false);
|
||||||
this.panelClearCacheAuto.PerformLayout();
|
this.panelClearCacheAuto.PerformLayout();
|
||||||
@@ -286,8 +330,11 @@
|
|||||||
this.flowPanel.ResumeLayout(false);
|
this.flowPanel.ResumeLayout(false);
|
||||||
this.flowPanel.PerformLayout();
|
this.flowPanel.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.Button btnClearCache;
|
private System.Windows.Forms.Button btnClearCache;
|
||||||
private System.Windows.Forms.ToolTip toolTip;
|
private System.Windows.Forms.ToolTip toolTip;
|
||||||
private System.Windows.Forms.Button btnEditCefArgs;
|
private System.Windows.Forms.Button btnEditCefArgs;
|
||||||
@@ -308,7 +355,7 @@
|
|||||||
private System.Windows.Forms.Label labelDevTools;
|
private System.Windows.Forms.Label labelDevTools;
|
||||||
private System.Windows.Forms.CheckBox checkDevToolsInContextMenu;
|
private System.Windows.Forms.CheckBox checkDevToolsInContextMenu;
|
||||||
private System.Windows.Forms.CheckBox checkDevToolsWindowOnTop;
|
private System.Windows.Forms.CheckBox checkDevToolsWindowOnTop;
|
||||||
|
private System.Windows.Forms.Label labelProxy;
|
||||||
#endregion
|
private System.Windows.Forms.CheckBox checkUseSystemProxyForAllConnections;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -44,6 +44,12 @@ namespace TweetDuck.Dialogs.Settings {
|
|||||||
toolTip.SetToolTip(btnEditCefArgs, "Set custom command line arguments for Chromium Embedded Framework.");
|
toolTip.SetToolTip(btnEditCefArgs, "Set custom command line arguments for Chromium Embedded Framework.");
|
||||||
toolTip.SetToolTip(btnEditCSS, "Set custom CSS for browser and notification windows.");
|
toolTip.SetToolTip(btnEditCSS, "Set custom CSS for browser and notification windows.");
|
||||||
|
|
||||||
|
// proxy
|
||||||
|
|
||||||
|
toolTip.SetToolTip(checkUseSystemProxyForAllConnections, "Sets whether all connections should automatically detect and use the system proxy.\r\nBy default, only the browser component uses the system proxy, while other parts (such as update checks) ignore it.\r\nDisabled by default because Windows' proxy detection can be really slow.");
|
||||||
|
|
||||||
|
checkUseSystemProxyForAllConnections.Checked = Config.UseSystemProxyForAllConnections;
|
||||||
|
|
||||||
// development tools
|
// development tools
|
||||||
|
|
||||||
toolTip.SetToolTip(checkDevToolsInContextMenu, "Sets whether all context menus include an option to open dev tools.");
|
toolTip.SetToolTip(checkDevToolsInContextMenu, "Sets whether all context menus include an option to open dev tools.");
|
||||||
@@ -65,6 +71,8 @@ namespace TweetDuck.Dialogs.Settings {
|
|||||||
btnEditCefArgs.Click += btnEditCefArgs_Click;
|
btnEditCefArgs.Click += btnEditCefArgs_Click;
|
||||||
btnEditCSS.Click += btnEditCSS_Click;
|
btnEditCSS.Click += btnEditCSS_Click;
|
||||||
|
|
||||||
|
checkUseSystemProxyForAllConnections.CheckedChanged += checkUseSystemProxyForAllConnections_CheckedChanged;
|
||||||
|
|
||||||
checkDevToolsWindowOnTop.CheckedChanged += checkDevToolsWindowOnTop_CheckedChanged;
|
checkDevToolsWindowOnTop.CheckedChanged += checkDevToolsWindowOnTop_CheckedChanged;
|
||||||
checkDevToolsInContextMenu.CheckedChanged += checkDevToolsInContextMenuOnCheckedChanged;
|
checkDevToolsInContextMenu.CheckedChanged += checkDevToolsInContextMenuOnCheckedChanged;
|
||||||
}
|
}
|
||||||
@@ -162,6 +170,14 @@ namespace TweetDuck.Dialogs.Settings {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Proxy
|
||||||
|
|
||||||
|
private void checkUseSystemProxyForAllConnections_CheckedChanged(object sender, EventArgs e) {
|
||||||
|
Config.UseSystemProxyForAllConnections = checkUseSystemProxyForAllConnections.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Development Tools
|
#region Development Tools
|
||||||
|
|
||||||
private void checkDevToolsInContextMenuOnCheckedChanged(object sender, EventArgs e) {
|
private void checkDevToolsInContextMenuOnCheckedChanged(object sender, EventArgs e) {
|
||||||
|
@@ -111,6 +111,10 @@ namespace TweetDuck {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Config.User.UseSystemProxyForAllConnections) {
|
||||||
|
WebUtils.EnableSystemProxy();
|
||||||
|
}
|
||||||
|
|
||||||
BrowserCache.RefreshTimer();
|
BrowserCache.RefreshTimer();
|
||||||
|
|
||||||
CefSharpSettings.WcfEnabled = false;
|
CefSharpSettings.WcfEnabled = false;
|
||||||
|
@@ -6,6 +6,7 @@ using System.Net;
|
|||||||
namespace TweetLib.Core.Utils {
|
namespace TweetLib.Core.Utils {
|
||||||
public static class WebUtils {
|
public static class WebUtils {
|
||||||
private static bool hasMicrosoftBeenBroughtTo2008Yet;
|
private static bool hasMicrosoftBeenBroughtTo2008Yet;
|
||||||
|
private static bool hasSystemProxyBeenEnabled;
|
||||||
|
|
||||||
private static void EnsureTLS12() {
|
private static void EnsureTLS12() {
|
||||||
if (!hasMicrosoftBeenBroughtTo2008Yet) {
|
if (!hasMicrosoftBeenBroughtTo2008Yet) {
|
||||||
@@ -15,10 +16,24 @@ namespace TweetLib.Core.Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool UseSystemProxy { get; set; } = false;
|
||||||
|
|
||||||
|
public static void EnableSystemProxy() {
|
||||||
|
if (!hasSystemProxyBeenEnabled) {
|
||||||
|
UseSystemProxy = true;
|
||||||
|
hasSystemProxyBeenEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static WebClient NewClient(string userAgent) {
|
public static WebClient NewClient(string userAgent) {
|
||||||
EnsureTLS12();
|
EnsureTLS12();
|
||||||
|
|
||||||
WebClient client = new WebClient { Proxy = null };
|
WebClient client = new WebClient();
|
||||||
|
|
||||||
|
if (!UseSystemProxy) {
|
||||||
|
client.Proxy = null;
|
||||||
|
}
|
||||||
|
|
||||||
client.Headers[HttpRequestHeader.UserAgent] = userAgent;
|
client.Headers[HttpRequestHeader.UserAgent] = userAgent;
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user