mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve function names for code quality
This commit is contained in:
parent
2a445e3ed4
commit
96305166e8
3 changed files with 55 additions and 11 deletions
|
|
@ -119,7 +119,14 @@ namespace Flow.Launcher
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Helper.AutoStartup.Enable(_settings.UseLogonTaskForStartup);
|
if (_settings.UseLogonTaskForStartup)
|
||||||
|
{
|
||||||
|
Helper.AutoStartup.EnableViaLogonTask();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Helper.AutoStartup.EnableViaRegistry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,35 @@ public class AutoStartup
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Disable(bool logonTask)
|
public static void DisableViaLogonTaskAndRegistry()
|
||||||
|
{
|
||||||
|
Disable(true);
|
||||||
|
Disable(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void EnableViaLogonTask()
|
||||||
|
{
|
||||||
|
Enable(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void EnableViaRegistry()
|
||||||
|
{
|
||||||
|
Enable(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ChangeToViaLogonTask()
|
||||||
|
{
|
||||||
|
Disable(false);
|
||||||
|
Enable(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ChangeToViaRegistry()
|
||||||
|
{
|
||||||
|
Disable(true);
|
||||||
|
Enable(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Disable(bool logonTask)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -89,7 +117,7 @@ public class AutoStartup
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Enable(bool logonTask)
|
private static void Enable(bool logonTask)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,14 +43,18 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
|
||||||
{
|
{
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
// Enable either registry or task scheduler
|
if (UseLogonTaskForStartup)
|
||||||
AutoStartup.Enable(UseLogonTaskForStartup);
|
{
|
||||||
|
AutoStartup.EnableViaLogonTask();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AutoStartup.EnableViaRegistry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Disable both registry and task scheduler
|
AutoStartup.DisableViaLogonTaskAndRegistry();
|
||||||
AutoStartup.Disable(true);
|
|
||||||
AutoStartup.Disable(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
@ -72,9 +76,14 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Disable and enable to update the startup method
|
if (UseLogonTaskForStartup)
|
||||||
AutoStartup.Disable(!UseLogonTaskForStartup);
|
{
|
||||||
AutoStartup.Enable(UseLogonTaskForStartup);
|
AutoStartup.ChangeToViaLogonTask();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AutoStartup.ChangeToViaRegistry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue