mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-22 18:15:47 +02:00
Make spell check option not require a restart
This commit is contained in:
parent
edb40adaa1
commit
17d762ce91
Core
@ -3,12 +3,20 @@
|
||||
|
||||
namespace TweetDuck.Core.Handling.General{
|
||||
sealed class BrowserProcessHandler : IBrowserProcessHandler{
|
||||
void IBrowserProcessHandler.OnContextInitialized(){
|
||||
public static void UpdatePrefs(){
|
||||
Cef.UIThreadTaskFactory.StartNew(UpdatePrefsInternal);
|
||||
}
|
||||
|
||||
private static void UpdatePrefsInternal(){
|
||||
using(IRequestContext ctx = Cef.GetGlobalRequestContext()){
|
||||
ctx.SetPreference("browser.enable_spellchecking", Program.UserConfig.EnableSpellCheck, out string _);
|
||||
}
|
||||
}
|
||||
|
||||
void IBrowserProcessHandler.OnContextInitialized(){
|
||||
UpdatePrefsInternal();
|
||||
}
|
||||
|
||||
void IBrowserProcessHandler.OnScheduleMessagePumpWork(long delay){}
|
||||
void IDisposable.Dispose(){}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using TweetDuck.Core.Controls;
|
||||
using TweetDuck.Core.Handling.General;
|
||||
using TweetDuck.Core.Notification.Example;
|
||||
using TweetDuck.Core.Other.Analytics;
|
||||
using TweetDuck.Core.Other.Settings;
|
||||
@ -66,7 +67,8 @@ private void btnManageOptions_Click(object sender, EventArgs e){
|
||||
|
||||
if (dialog.ShowDialog() == DialogResult.OK){
|
||||
browser.ResumeNotification();
|
||||
|
||||
|
||||
BrowserProcessHandler.UpdatePrefs();
|
||||
ShouldReloadBrowser = dialog.ShouldReloadBrowser;
|
||||
Close();
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using TweetDuck.Core.Controls;
|
||||
using TweetDuck.Core.Handling.General;
|
||||
using TweetDuck.Updates;
|
||||
|
||||
namespace TweetDuck.Core.Other.Settings{
|
||||
@ -61,7 +62,7 @@ private void checkBestImageQuality_CheckedChanged(object sender, EventArgs e){
|
||||
|
||||
private void checkSpellCheck_CheckedChanged(object sender, EventArgs e){
|
||||
Config.EnableSpellCheck = checkSpellCheck.Checked;
|
||||
PromptRestart();
|
||||
BrowserProcessHandler.UpdatePrefs();
|
||||
}
|
||||
|
||||
private void trackBarZoom_ValueChanged(object sender, EventArgs e){
|
||||
|
Loading…
Reference in New Issue
Block a user