mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Save settings outside ResetSettings
This commit is contained in:
parent
d577112377
commit
7cea6afbd2
5 changed files with 20 additions and 21 deletions
|
@ -64,7 +64,7 @@ public ApplicationInstanceManager(bool isSingleInstance, string[] args, EventHan
|
|||
catch (AbandonedMutexException)
|
||||
{
|
||||
// Log the mutex was abandoned in another process, it will still get acquired
|
||||
DebugHelper.WriteLine("Single instance mutex found abandoned from another process");
|
||||
DebugHelper.WriteLine("Single instance mutex found abandoned from another process.");
|
||||
IsFirstInstance = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ private void btnContinue_Click(object sender, EventArgs e)
|
|||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
DebugHelper.WriteLine("ShareX closing. Reason: Unhandled exception");
|
||||
DebugHelper.WriteLine("ShareX closing. Reason: Unhandled exception.");
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
|
|
|
@ -572,6 +572,7 @@ private void btnResetSettings_Click(object sender, EventArgs e)
|
|||
if (MessageBox.Show("Would you like to reset ShareX settings?", "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
|
||||
{
|
||||
SettingManager.ResetSettings();
|
||||
SettingManager.SaveAllSettings();
|
||||
|
||||
UpdateControls();
|
||||
|
||||
|
|
|
@ -298,7 +298,7 @@ private void InitHotkeys()
|
|||
|
||||
Program.HotkeyManager.UpdateHotkeys(Program.HotkeysConfig.Hotkeys, !Program.IgnoreHotkeyWarning);
|
||||
|
||||
DebugHelper.WriteLine("HotkeyManager started");
|
||||
DebugHelper.WriteLine("HotkeyManager started.");
|
||||
|
||||
if (Program.WatchFolderManager == null)
|
||||
{
|
||||
|
@ -307,7 +307,7 @@ private void InitHotkeys()
|
|||
|
||||
Program.WatchFolderManager.UpdateWatchFolders();
|
||||
|
||||
DebugHelper.WriteLine("WatchFolderManager started");
|
||||
DebugHelper.WriteLine("WatchFolderManager started.");
|
||||
|
||||
UpdateWorkflowsMenu();
|
||||
});
|
||||
|
|
|
@ -258,8 +258,6 @@ public static void ResetSettings()
|
|||
{
|
||||
File.Delete(GreenshotImageEditorConfigFilePath);
|
||||
}
|
||||
|
||||
SaveAllSettings();
|
||||
}
|
||||
|
||||
public static bool Export(string exportPath)
|
||||
|
@ -311,21 +309,6 @@ public static bool Export(string exportPath)
|
|||
return false;
|
||||
}
|
||||
|
||||
private static void AddFileToDictionary(Dictionary<string, string> files, string filePath, string subFolder = null)
|
||||
{
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
string destinationPath = Path.GetFileName(filePath);
|
||||
|
||||
if (!string.IsNullOrEmpty(subFolder))
|
||||
{
|
||||
destinationPath = Path.Combine(subFolder, destinationPath);
|
||||
}
|
||||
|
||||
files.Add(destinationPath, filePath);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Import(string importPath)
|
||||
{
|
||||
try
|
||||
|
@ -359,5 +342,20 @@ private static void Set7ZipLibraryPath()
|
|||
SevenZipBase.SetLibraryPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "7z.dll"));
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddFileToDictionary(Dictionary<string, string> files, string filePath, string subFolder = null)
|
||||
{
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
string destinationPath = Path.GetFileName(filePath);
|
||||
|
||||
if (!string.IsNullOrEmpty(subFolder))
|
||||
{
|
||||
destinationPath = Path.Combine(subFolder, destinationPath);
|
||||
}
|
||||
|
||||
files.Add(destinationPath, filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue