mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +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 IsAdmin { get; private set; }
|
||||||
public static bool SteamFirstTimeConfig { get; private set; }
|
public static bool SteamFirstTimeConfig { get; private set; }
|
||||||
public static bool IgnoreHotkeyWarning { 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 PuushMode { get; private set; }
|
||||||
|
|
||||||
|
public static bool SystemDisableUpload { get; private set; }
|
||||||
|
|
||||||
internal static ApplicationConfig Settings { get; set; }
|
internal static ApplicationConfig Settings { get; set; }
|
||||||
internal static TaskSettings DefaultTaskSettings { get; set; }
|
internal static TaskSettings DefaultTaskSettings { get; set; }
|
||||||
internal static UploadersConfig UploadersConfig { get; set; }
|
internal static UploadersConfig UploadersConfig { get; set; }
|
||||||
|
@ -359,7 +360,7 @@ private static void Run()
|
||||||
IgnoreHotkeyWarning = CLI.IsCommandExist("NoHotkeys");
|
IgnoreHotkeyWarning = CLI.IsCommandExist("NoHotkeys");
|
||||||
|
|
||||||
CreateParentFolders();
|
CreateParentFolders();
|
||||||
CheckSystemDisableUpload();
|
CheckSystemFlags();
|
||||||
RegisterExtensions();
|
RegisterExtensions();
|
||||||
CheckPuushMode();
|
CheckPuushMode();
|
||||||
DebugWriteFlags();
|
DebugWriteFlags();
|
||||||
|
@ -622,26 +623,32 @@ public static bool WritePersonalPathConfig(string path)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CheckSystemDisableUpload()
|
private static void CheckSystemFlags()
|
||||||
|
{
|
||||||
|
SystemDisableUpload = CheckSystemFlag("DisableUpload");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool CheckSystemFlag(string name)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string path = @"SOFTWARE\ShareX";
|
const string path = @"SOFTWARE\ShareX";
|
||||||
string name = "DisableUpload";
|
|
||||||
|
|
||||||
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
|
else
|
||||||
{
|
{
|
||||||
SystemDisableUpload = RegistryHelpers.CheckRegistry(path, name, "true", RegistryHive.LocalMachine);
|
return RegistryHelpers.CheckRegistry(path, name, "true", RegistryHive.CurrentUser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
DebugHelper.WriteException(e);
|
DebugHelper.WriteException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
||||||
|
|
Loading…
Reference in a new issue