Backward compatibility for few settings to not reset

This commit is contained in:
Jaex 2015-12-06 01:39:19 +02:00
parent 1507660816
commit a441a1de1e
5 changed files with 28 additions and 4 deletions

View file

@ -188,7 +188,7 @@ internal static string AfterCaptureTasks_ShowAfterCaptureWindow {
}
/// <summary>
/// Looks up a localized string similar to Show &quot;Destinations&quot; window.
/// Looks up a localized string similar to Show &quot;Before upload&quot; window.
/// </summary>
internal static string AfterCaptureTasks_ShowBeforeUploadWindow {
get {

View file

@ -855,7 +855,7 @@ Would you like to download it?</value>
<value>Show "After capture" window</value>
</data>
<data name="AfterCaptureTasks_ShowBeforeUploadWindow" xml:space="preserve">
<value>Show "Destinations" window</value>
<value>Show "Before upload" window</value>
</data>
<data name="AfterUploadTasks_ShowAfterUploadWindow" xml:space="preserve">
<value>Show "After upload" window</value>

View file

@ -51,7 +51,7 @@ public bool IsFirstTimeRun
}
[Browsable(false)]
public bool IsPreviousVersion
public bool IsUpgrade
{
get
{

View file

@ -280,7 +280,7 @@
<value>CenterScreen</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>ShareX - Destinations</value>
<value>ShareX - Before upload</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>BeforeUploadForm</value>

View file

@ -382,6 +382,30 @@ public static void LoadProgramSettings()
{
Settings = ApplicationConfig.Load(ApplicationConfigFilePath);
DefaultTaskSettings = Settings.DefaultTaskSettings;
TaskSettingsBackwardCompatibility();
}
private static void TaskSettingsBackwardCompatibility()
{
// TODO: Remove these next version
if (Settings.IsUpgrade)
{
if (DefaultTaskSettings.GeneralSettings.ShowAfterCaptureTasksForm)
{
DefaultTaskSettings.AfterCaptureJob.Add(AfterCaptureTasks.ShowAfterCaptureWindow);
}
if (DefaultTaskSettings.GeneralSettings.ShowBeforeUploadForm)
{
DefaultTaskSettings.AfterCaptureJob.Add(AfterCaptureTasks.ShowBeforeUploadWindow);
}
if (DefaultTaskSettings.GeneralSettings.ShowAfterUploadForm)
{
DefaultTaskSettings.AfterUploadJob.Add(AfterUploadTasks.ShowAfterUploadWindow);
}
}
}
public static void LoadUploadersConfig()