mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Code refactoring
This commit is contained in:
parent
ee1462fafd
commit
ed49b5fbe6
1 changed files with 15 additions and 8 deletions
|
@ -118,9 +118,10 @@ public static string TitleShort
|
|||
public static bool IsAdmin { get; private set; }
|
||||
public static bool SteamFirstTimeConfig { get; private set; }
|
||||
public static bool IgnoreHotkeyWarning { get; private set; }
|
||||
public static bool SystemDisableUpload { get; private set; }
|
||||
public static bool PuushMode { get; private set; }
|
||||
|
||||
public static bool SystemDisableUpload { get; private set; }
|
||||
|
||||
internal static ApplicationConfig Settings { get; set; }
|
||||
internal static TaskSettings DefaultTaskSettings { get; set; }
|
||||
internal static UploadersConfig UploadersConfig { get; set; }
|
||||
|
@ -359,7 +360,7 @@ private static void Run()
|
|||
IgnoreHotkeyWarning = CLI.IsCommandExist("NoHotkeys");
|
||||
|
||||
CreateParentFolders();
|
||||
CheckSystemDisableUpload();
|
||||
CheckSystemFlags();
|
||||
RegisterExtensions();
|
||||
CheckPuushMode();
|
||||
DebugWriteFlags();
|
||||
|
@ -622,26 +623,32 @@ public static bool WritePersonalPathConfig(string path)
|
|||
return false;
|
||||
}
|
||||
|
||||
private static void CheckSystemDisableUpload()
|
||||
private static void CheckSystemFlags()
|
||||
{
|
||||
SystemDisableUpload = CheckSystemFlag("DisableUpload");
|
||||
}
|
||||
|
||||
private static bool CheckSystemFlag(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
string path = @"SOFTWARE\ShareX";
|
||||
string name = "DisableUpload";
|
||||
const string path = @"SOFTWARE\ShareX";
|
||||
|
||||
if (RegistryHelpers.CheckRegistry(path, name, null, RegistryHive.CurrentUser))
|
||||
if (RegistryHelpers.CheckRegistry(path, name, null, RegistryHive.LocalMachine))
|
||||
{
|
||||
SystemDisableUpload = RegistryHelpers.CheckRegistry(path, name, "true", RegistryHive.CurrentUser);
|
||||
return RegistryHelpers.CheckRegistry(path, name, "true", RegistryHive.LocalMachine);
|
||||
}
|
||||
else
|
||||
{
|
||||
SystemDisableUpload = RegistryHelpers.CheckRegistry(path, name, "true", RegistryHive.LocalMachine);
|
||||
return RegistryHelpers.CheckRegistry(path, name, "true", RegistryHive.CurrentUser);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugHelper.WriteException(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
||||
|
|
Loading…
Reference in a new issue