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
|
||||
{
|
||||
Helper.AutoStartup.Enable(_settings.UseLogonTaskForStartup);
|
||||
if (_settings.UseLogonTaskForStartup)
|
||||
{
|
||||
Helper.AutoStartup.EnableViaLogonTask();
|
||||
}
|
||||
else
|
||||
{
|
||||
Helper.AutoStartup.EnableViaRegistry();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -68,7 +68,35 @@ public class AutoStartup
|
|||
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
|
||||
{
|
||||
|
|
@ -89,7 +117,7 @@ public class AutoStartup
|
|||
}
|
||||
}
|
||||
|
||||
internal static void Enable(bool logonTask)
|
||||
private static void Enable(bool logonTask)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,14 +43,18 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
|
|||
{
|
||||
if (value)
|
||||
{
|
||||
// Enable either registry or task scheduler
|
||||
AutoStartup.Enable(UseLogonTaskForStartup);
|
||||
if (UseLogonTaskForStartup)
|
||||
{
|
||||
AutoStartup.EnableViaLogonTask();
|
||||
}
|
||||
else
|
||||
{
|
||||
AutoStartup.EnableViaRegistry();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable both registry and task scheduler
|
||||
AutoStartup.Disable(true);
|
||||
AutoStartup.Disable(false);
|
||||
AutoStartup.DisableViaLogonTaskAndRegistry();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
@ -72,9 +76,14 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
|
|||
{
|
||||
try
|
||||
{
|
||||
// Disable and enable to update the startup method
|
||||
AutoStartup.Disable(!UseLogonTaskForStartup);
|
||||
AutoStartup.Enable(UseLogonTaskForStartup);
|
||||
if (UseLogonTaskForStartup)
|
||||
{
|
||||
AutoStartup.ChangeToViaLogonTask();
|
||||
}
|
||||
else
|
||||
{
|
||||
AutoStartup.ChangeToViaRegistry();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue