Skip to content

Commit

Permalink
imp - bkp - Improved quiet mode for splashes
Browse files Browse the repository at this point in the history
---

We've improved the quiet mode by not showing any progress in the kernel splash when quiet mode is enabled.

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: True
Part: 1/1
  • Loading branch information
AptiviCEO committed Jun 20, 2024
1 parent 510e210 commit e7867cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion public/Nitrocid/Kernel/Starting/KernelInitializers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ internal static void ResetEverything()
try
{
// Reset every variable below
KernelEntry.QuietKernel = false;
SplashReport._Progress = 0;
SplashReport._ProgressText = "";
SplashReport._KernelBooted = false;
Expand Down Expand Up @@ -420,6 +419,9 @@ internal static void ResetEverything()

// Unload the assembly resolver
AppDomain.CurrentDomain.AssemblyResolve -= AssemblyLookup.LoadFromAssemblySearchPaths;

// Reset quiet state
KernelEntry.QuietKernel = false;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions public/Nitrocid/Misc/Splash/SplashReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public static void ReportProgress(string Text, int Progress, bool force = false,
severity == SplashReportSeverity.Warning ? KernelColorType.Warning :
severity == SplashReportSeverity.Error ? KernelColorType.Error :
KernelColorType.Tip;
if (!KernelBooted && (SplashManager.EnableSplash && InSplash || !SplashManager.EnableSplash && !KernelEntry.QuietKernel) || force)
if (!KernelBooted && !KernelEntry.QuietKernel && (SplashManager.EnableSplash && InSplash || !SplashManager.EnableSplash) || force)
{
// Check the progress value
if (Progress < 0)
Expand Down Expand Up @@ -248,7 +248,7 @@ public static void ReportProgress(string Text, int Progress, bool force = false,
// Add to the log buffer
logBuffer.Add($"[{TimeDateRenderers.Render(FormatType.Short)}] [{_Progress}%] {severity.ToString()[0]}: {TextTools.FormatString(Text, Vars)}");
}
else if (KernelBooted || SplashManager.EnableSplash && !InSplash || !SplashManager.EnableSplash && !KernelEntry.QuietKernel || !SplashManager.EnableSplash)
else if (KernelBooted && !KernelEntry.QuietKernel && (SplashManager.EnableSplash && !InSplash || !SplashManager.EnableSplash))
{
DebugWriter.WriteDebug(DebugLevel.I, "Kernel booted or not in splash. Reporting {0}...", Text);
TextWriters.Write(Text, true, finalColor, Vars);
Expand Down

0 comments on commit e7867cf

Please sign in to comment.