Commit 845b60ed authored by Pavel's avatar Pavel

Fixed two bugs with version management

parent 425ab3ff
......@@ -208,6 +208,7 @@
<Button Background="{Binding isSelected, Converter={StaticResource ButtonBgColorConverter}}" Click="changeVersion_Click">
<StackPanel Orientation="Horizontal" ToolTip="{Binding Enabled, Converter={StaticResource UnableToChangeThisConverter}}">
<CheckBox IsChecked="{Binding isModsEnabled}" Command="{Binding Path=ToggleModsCommand}" CommandParameter="{Binding IsChecked, RelativeSource={RelativeSource Self}, Mode=OneWay}" />
<Label Content="{Binding modsPersistentDir}" Visibility="Collapsed" />
<Label Content="{Binding version}" Foreground="{Binding isSelected, Converter={StaticResource ButtonTextColorConverter}}" />
</StackPanel>
</Button>
......
......@@ -254,7 +254,7 @@ namespace VivaldiModManager
{
var toApp = this.modman.vivaldiInstallations.Where(f => f.version == toVersion.version).First();
toApp.migrateFrom(fromVersion, mwiz.deletePrevious, mwiz.clearTarget);
this.modman.selectVivaldiVersion(toApp.version);
this.modman.selectVivaldiVersion(toApp.modsPersistentDir);
this.reconnectUI(true);
}
}
......@@ -367,7 +367,7 @@ namespace VivaldiModManager
this.setman.Settings.versionsDirectories.Remove(
System.IO.Path.Combine(this.modman.selectedVersion.installPath, this.modman.selectedVersion.version));
this.modman.vivaldiInstallations.Remove(this.modman.selectedVersion);
this.modman.selectVivaldiVersion(this.modman.vivaldiInstallations.First().version);
this.modman.selectVivaldiVersion(this.modman.vivaldiInstallations.First().modsPersistentDir);
this.reconnectUI(true);
}
}
......@@ -385,7 +385,7 @@ namespace VivaldiModManager
}
if (this.modman.vivaldiInstallations.Count() == 1)
{
this.modman.selectVivaldiVersion(this.modman.vivaldiInstallations.First().version);
this.modman.selectVivaldiVersion(this.modman.vivaldiInstallations.First().modsPersistentDir);
}
this.reconnectUI(true);
}
......
......@@ -445,7 +445,7 @@ namespace VivaldiModManager
if (installPathGlobal != null) this.addVivaldiVersion(installPathGlobal);
var firstInList = this.vivaldiInstallations.FirstOrDefault();
if (firstInList != null) this.selectVivaldiVersion(firstInList.version);
if (firstInList != null) this.selectVivaldiVersion(firstInList.modsPersistentDir);
}
public bool addVivaldiVersion(string path, bool versionDirectory = false)
......@@ -489,10 +489,10 @@ namespace VivaldiModManager
return false;
}
public void selectVivaldiVersion(string version)
public void selectVivaldiVersion(string modsPersistentDir)
{
if (this.selectedVersion != null) this.selectedVersion.isSelected = false;
this.vivaldiInstallations.Where(f => f.version == version).Single().isSelected = true;
this.vivaldiInstallations.Where(f => f.modsPersistentDir == modsPersistentDir).Single().isSelected = true;
}
}
}
......@@ -51,7 +51,7 @@ using System.Windows;
// Можно задать все значения или принять номер сборки и номер редакции по умолчанию.
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]
[assembly: AssemblyVersion("0.2.1.0")]
[assembly: AssemblyFileVersion("0.2.1.0")]
[assembly: Guid("40ad3bd5-c96a-4dbf-93d5-450b68c3c8ed")]
......@@ -52,7 +52,7 @@ public class SettingsManager
[XmlAttribute]
public WindowState EditorState { get; set; }
[XmlAttribute]
[XmlArray("versionsDirectories")]
public List<string> versionsDirectories { get; set; }
[XmlAttribute]
public string Culture { get; set; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment