Exemplo n.º 1
0
        public TabSettingsAdvanced(Action <string> reinjectBrowserCSS, Action openDevTools)
        {
            InitializeComponent();

            this.reinjectBrowserCSS = reinjectBrowserCSS;
            this.openDevTools       = openDevTools;

            // application

            toolTip.SetToolTip(btnOpenAppFolder, "Opens the folder where the app is located.");
            toolTip.SetToolTip(btnOpenDataFolder, "Opens the folder where your profile data is located.");
            toolTip.SetToolTip(btnRestart, "Restarts the program using the same command\r\nline arguments that were used at launch.");
            toolTip.SetToolTip(btnRestartArgs, "Restarts the program with customizable\r\ncommand line arguments.");

            // browser cache

            toolTip.SetToolTip(btnClearCache, "Clearing cache will free up space taken by downloaded images and other resources.");
            toolTip.SetToolTip(checkClearCacheAuto, "Automatically clears cache when its size exceeds the set threshold. Note that cache can only be cleared when closing TweetDuck.");

            checkClearCacheAuto.Checked    = SysConfig.ClearCacheAutomatically;
            numClearCacheThreshold.Enabled = checkClearCacheAuto.Checked;
            numClearCacheThreshold.SetValueSafe(SysConfig.ClearCacheThreshold);

            BrowserCache.GetCacheSize(task => {
                string text = task.Status == TaskStatus.RanToCompletion ? (int)Math.Ceiling(task.Result / (1024.0 * 1024.0)) + " MB" : "unknown";
                this.InvokeSafe(() => btnClearCache.Text = $"Clear Cache ({text})");
            });

            // configuration

            toolTip.SetToolTip(btnEditCefArgs, "Set custom command line arguments for Chromium Embedded Framework.");
            toolTip.SetToolTip(btnEditCSS, "Set custom CSS for browser and notification windows.");
        }
Exemplo n.º 2
0
        public TabSettingsAdvanced(Action <string> reinjectBrowserCSS, Action openDevTools)
        {
            InitializeComponent();

            this.reinjectBrowserCSS = reinjectBrowserCSS;
            this.openDevTools       = openDevTools;

            // application

            toolTip.SetToolTip(btnOpenAppFolder, "Opens the folder where the app is located.");
            toolTip.SetToolTip(btnOpenDataFolder, "Opens the folder where your profile data is located.");
            toolTip.SetToolTip(btnRestart, "Restarts the program using the same command\r\nline arguments that were used at launch.");
            toolTip.SetToolTip(btnRestartArgs, "Restarts the program with customizable\r\ncommand line arguments.");

            // browser settings

            toolTip.SetToolTip(checkTouchAdjustment, "Toggles Chromium touch screen adjustment.\r\nDisabled by default, because it is very imprecise with TweetDeck.");
            toolTip.SetToolTip(checkAutomaticallyDetectColorProfile, "Automatically detects the color profile of your system.\r\nUses the sRGB profile if disabled.");
            toolTip.SetToolTip(checkHardwareAcceleration, "Uses graphics card to improve performance.\r\nDisable if you experience visual glitches, or to save a small amount of RAM.");

            checkTouchAdjustment.Checked = SysConfig.EnableTouchAdjustment;
            checkAutomaticallyDetectColorProfile.Checked = SysConfig.EnableColorProfileDetection;
            checkHardwareAcceleration.Checked            = SysConfig.HardwareAcceleration;

            // browser cache

            toolTip.SetToolTip(btnClearCache, "Clearing cache will free up space taken by downloaded images and other resources.");
            toolTip.SetToolTip(checkClearCacheAuto, "Automatically clears cache when its size exceeds the set threshold. Note that cache can only be cleared when closing TweetDuck.");

            checkClearCacheAuto.Checked    = SysConfig.ClearCacheAutomatically;
            numClearCacheThreshold.Enabled = checkClearCacheAuto.Checked;
            numClearCacheThreshold.SetValueSafe(SysConfig.ClearCacheThreshold);

            BrowserCache.GetCacheSize(task => {
                string text = task.Status == TaskStatus.RanToCompletion ? (int)Math.Ceiling(task.Result / (1024.0 * 1024.0)) + " MB" : "unknown";
                this.InvokeSafe(() => btnClearCache.Text = $"Clear Cache ({text})");
            });

            // configuration

            toolTip.SetToolTip(btnEditCefArgs, "Set custom command line arguments for Chromium Embedded Framework.");
            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 = SysConfig.UseSystemProxyForAllConnections;

            // development tools

            toolTip.SetToolTip(checkDevToolsInContextMenu, "Sets whether all context menus include an option to open dev tools.");
            toolTip.SetToolTip(checkDevToolsWindowOnTop, "Sets whether dev tool windows appears on top of other windows.");

            checkDevToolsInContextMenu.Checked = Config.DevToolsInContextMenu;
            checkDevToolsWindowOnTop.Checked   = Config.DevToolsWindowOnTop;
        }