Skip to content

Portable Tool for an Ideal Windows Setup

-changed delay for noty

Greedeksfd968f5a6659
diff --git a/.Source/GTweak/Utilities/SearchUpdates.cs b/.Source/GTweak/Utilities/SearchUpdates.cs
index 47b85ed7..4fe981c1 100644
--- a/.Source/GTweak/Utilities/SearchUpdates.cs
+++ b/.Source/GTweak/Utilities/SearchUpdates.cs
@@ -30,7 +30,6 @@ namespace GTweak.Utilities
string DataAsJson = sreader.ReadToEnd();
GitVersionUtility gitVersionUtility = JsonConvert.DeserializeObject<GitVersionUtility>(DataAsJson);
-
if (!string.IsNullOrEmpty(gitVersionUtility.СurrentVersion) && gitVersionUtility.СurrentVersion.CompareTo(Settings.currentRelease) > 0)
{
IsNeedUpdate = true;
diff --git a/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs b/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
index d6852270..884f64ab 100644
--- a/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
@@ -620,6 +620,7 @@ namespace GTweak.Utilities.Tweaks
break;
case "TglButton15":
BlockWindowsUpdate(isChoose);
+ ChangeAccessUpdateFolders(isChoose);
using (BackgroundWorker backgroundWorker = new BackgroundWorker())
{
@@ -662,7 +663,6 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\UsoSvc", "Start", 2, RegistryValueKind.DWord);
RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\WindowsUpdate");
}
- ChangeAccessUpdateFolders(isChoose);
break;
case "TglButton16":
if (isChoose)
diff --git a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs
index 6bb78103..5f371a07 100644
--- a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs
@@ -419,7 +419,7 @@ namespace GTweak.Utilities.Tweaks
else
new WindowsDefender().Enable();
};
- backgroundWorker.RunWorkerCompleted += delegate { isTweakWorkingAntivirus = false; new ViewNotification().Show("restart"); };
+ backgroundWorker.RunWorkerCompleted += delegate { isTweakWorkingAntivirus = false; new ViewNotification(300).Show("restart"); };
backgroundWorker.RunWorkerAsync();
BlockWDefender(isChoose);
break;
diff --git a/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs b/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs
index ba1b4460..7ee9adf6 100644
--- a/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs
+++ b/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs
@@ -95,9 +95,9 @@ namespace GTweak.Utilities.Tweaks
waitingWindow.Close();
if (IsWindowsActivated)
- new ViewNotification().Show("restart", "warn", (string)Application.Current.Resources["successactivate_notification"]);
+ new ViewNotification(300).Show("restart", "warn", (string)Application.Current.Resources["successactivate_notification"]);
else
- new ViewNotification().Show("", "warn", (string)Application.Current.Resources["notsuccessactivate_notification"]);
+ new ViewNotification(300).Show("", "warn", (string)Application.Current.Resources["notsuccessactivate_notification"]);
}
}
diff --git a/.Source/GTweak/Utilities/ViewNotification.cs b/.Source/GTweak/Utilities/ViewNotification.cs
index 0a8c356f..5fe69e2f 100644
--- a/.Source/GTweak/Utilities/ViewNotification.cs
+++ b/.Source/GTweak/Utilities/ViewNotification.cs
@@ -7,6 +7,9 @@ namespace GTweak.Utilities
internal sealed class ViewNotification
{
private static bool isAlreadyLaunch = false;
+ private readonly int msec = default;
+
+ internal ViewNotification(int delay = 100) => msec = delay;
internal void Show(string action, string tittle = "", string content = "")
{
@@ -34,7 +37,7 @@ namespace GTweak.Utilities
TextNotice = content,
ActionNotice = action,
};
- await Task.Delay(200);
+ await Task.Delay(msec);
notificationWindow.Show();
notificationWindow.Closed += delegate { isAlreadyLaunch = false; };
});
diff --git a/.Source/GTweak/View/ConfidentialityView.xaml.cs b/.Source/GTweak/View/ConfidentialityView.xaml.cs
index 89e2cc91..21d4af5e 100644
--- a/.Source/GTweak/View/ConfidentialityView.xaml.cs
+++ b/.Source/GTweak/View/ConfidentialityView.xaml.cs
@@ -34,7 +34,7 @@ namespace GTweak.View
new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(250));
}
- private async void TglButton_ChangedState(object sender, EventArgs e)
+ private void TglButton_ChangedState(object sender, EventArgs e)
{
ToggleButton toggleButton = (ToggleButton)sender;
@@ -44,12 +44,11 @@ namespace GTweak.View
{
case "TglButton8":
case "TglButton15":
- new ViewNotification().Show("restart");
+ new ViewNotification(300).Show("restart");
break;
}
- await Task.Delay(500);
- Parallel.Invoke(() => new ConfidentialityTweaks().ViewСonfidentiality(this));
+ Parallel.Invoke(async delegate { await Task.Delay(500); new ConfidentialityTweaks().ViewСonfidentiality(this); });
}
private void Page_Loaded(object sender, RoutedEventArgs e)
diff --git a/.Source/GTweak/View/InterfaceView.xaml.cs b/.Source/GTweak/View/InterfaceView.xaml.cs
index 88085a77..c3e527e5 100644
--- a/.Source/GTweak/View/InterfaceView.xaml.cs
+++ b/.Source/GTweak/View/InterfaceView.xaml.cs
@@ -56,7 +56,7 @@ namespace GTweak.View
new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(250));
}
- private async void TglButton_ChangedState(object sender, EventArgs e)
+ private void TglButton_ChangedState(object sender, EventArgs e)
{
ToggleButton toggleButton = (ToggleButton)sender;
Parallel.Invoke(() => InterfaceTweaks.UseInterface(toggleButton.Name, toggleButton.State));
@@ -73,16 +73,15 @@ namespace GTweak.View
case "TglButton12":
case "TglButton26":
case "TglButton27":
- new ViewNotification().Show("logout");
+ new ViewNotification(300).Show("logout");
break;
case "TglButton22":
case "TglButton20":
- new ViewNotification().Show("restart");
+ new ViewNotification(300).Show("restart");
break;
}
- await Task.Delay(500);
- Parallel.Invoke(() => new InterfaceTweaks().ViewInterface(this));
+ Parallel.Invoke(async delegate { await Task.Delay(500); new InterfaceTweaks().ViewInterface(this); });
}
private void Page_Loaded(object sender, RoutedEventArgs e)
diff --git a/.Source/GTweak/View/MoreView.xaml.cs b/.Source/GTweak/View/MoreView.xaml.cs
index f5f096ee..dad10b10 100644
--- a/.Source/GTweak/View/MoreView.xaml.cs
+++ b/.Source/GTweak/View/MoreView.xaml.cs
@@ -39,11 +39,11 @@ namespace GTweak.View
{
try { RecoveryPoint.Create((string)FindResource("textpoint_more")); }
catch { new ViewNotification().Show("", "warn", (string)FindResource("notsuccessfulpoint_notification")); }
- finally { new ViewNotification().Show("", "info", (string)FindResource("successpoint_notification")); };
+ finally { new ViewNotification(300).Show("", "info", (string)FindResource("successpoint_notification")); };
};
backgroundWorker.RunWorkerCompleted += delegate
{
- new ViewNotification().Show("", "info", (string)FindResource("successpoint_notification"));
+ new ViewNotification(300).Show("", "info", (string)FindResource("successpoint_notification"));
};
backgroundWorker.RunWorkerAsync();
}
@@ -70,7 +70,7 @@ namespace GTweak.View
};
backgroundWorker.RunWorkerCompleted += delegate
{
- new ViewNotification().Show("", "info", (string)FindResource("disable_recovery_notification"));
+ new ViewNotification(300).Show("", "info", (string)FindResource("disable_recovery_notification"));
};
backgroundWorker.RunWorkerAsync();
}
diff --git a/.Source/GTweak/View/ServicesView.xaml.cs b/.Source/GTweak/View/ServicesView.xaml.cs
index b6b756b4..bc903ada 100644
--- a/.Source/GTweak/View/ServicesView.xaml.cs
+++ b/.Source/GTweak/View/ServicesView.xaml.cs
@@ -33,15 +33,14 @@ namespace GTweak.View
new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(250));
}
- private async void TglButton_ChangedState(object sender, EventArgs e)
+ private void TglButton_ChangedState(object sender, EventArgs e)
{
ToggleButton toggleButton = (ToggleButton)sender;
Parallel.Invoke(() => ServicesTweaks.UseServices(toggleButton.Name, toggleButton.State));
- new ViewNotification().Show("restart");
+ new ViewNotification(300).Show("restart");
- await Task.Delay(500);
- Parallel.Invoke(() => new ServicesTweaks().ViewServices(this));
+ Parallel.Invoke(async delegate { await Task.Delay(500); new ServicesTweaks().ViewServices(this); });
}
private void Page_Loaded(object sender, System.Windows.RoutedEventArgs e)
diff --git a/.Source/GTweak/View/SystemView.xaml.cs b/.Source/GTweak/View/SystemView.xaml.cs
index 1165aa11..f2b2dd4a 100644
--- a/.Source/GTweak/View/SystemView.xaml.cs
+++ b/.Source/GTweak/View/SystemView.xaml.cs
@@ -56,7 +56,7 @@ namespace GTweak.View
SystemTweaks.UseSystemSliders(slider.Name, (uint)slider.Value);
}
- private async void TglButton_ChangedState(object sender, EventArgs e)
+ private void TglButton_ChangedState(object sender, EventArgs e)
{
ToggleButton toggleButton = (ToggleButton)sender;
if (toggleButton.Name != "TglButton8")
@@ -73,15 +73,14 @@ namespace GTweak.View
case "TglButton14":
case "TglButton15":
case "TglButton20":
- new ViewNotification().Show("restart");
+ new ViewNotification(300).Show("restart");
break;
case "TglButton2":
- new ViewNotification().Show("logout");
+ new ViewNotification(300).Show("logout");
break;
}
- await Task.Delay(500);
- Parallel.Invoke(() => new SystemTweaks().ViewSystem(this));
+ Parallel.Invoke(async delegate { await Task.Delay(500); new SystemTweaks().ViewSystem(this); });
}
else
{