Skip to content

Commit

Permalink
Merge pull request #16 from jimmyeao/dev
Browse files Browse the repository at this point in the history
fixed copy profile bug
  • Loading branch information
jimmyeao authored Aug 7, 2023
2 parents 3d3fdfb + ada2fe4 commit 8ad4b19
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Elite Dangerous Addon Launcher V2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RootNamespace>Elite_Dangerous_Addon_Launcer_V2</RootNamespace>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AssemblyVersion>1.1.2.335</AssemblyVersion>
<FileVersion>1.1.2.335</FileVersion>
<AssemblyVersion>1.1.2.341</AssemblyVersion>
<FileVersion>1.1.2.341</FileVersion>
<ApplicationIcon>elite-dangerous-icon.ico</ApplicationIcon>
<PackageIcon>app.png</PackageIcon>
<PackageProjectUrl>https://github.com/jimmyeao/Elite-Dangerous-Addon-Launcher-V2</PackageProjectUrl>
Expand Down
16 changes: 8 additions & 8 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,17 +390,17 @@ public void ShowWhatsNew()

List list = new List();

ListItem listItem1 = new ListItem(new Paragraph(new Run("Launch Options For Elite")));
ListItem listItem1 = new ListItem(new Paragraph(new Run("Fixed bug with copying profiles")));
list.ListItems.Add(listItem1);

ListItem listItem2 = new ListItem(new Paragraph(new Run("Profile Options for import/export and copy/rename/delete")));
list.ListItems.Add(listItem2);
// ListItem listItem2 = new ListItem(new Paragraph(new Run("Profile Options for import/export and copy/rename/delete")));
// list.ListItems.Add(listItem2);

ListItem listItem3 = new ListItem(new Paragraph(new Run("Added themed dialogs")));
list.ListItems.Add(listItem3);
// ListItem listItem3 = new ListItem(new Paragraph(new Run("Added themed dialogs")));
// list.ListItems.Add(listItem3);

ListItem listItem4 = new ListItem(new Paragraph(new Run("Fly safe, Cmdr! o7")));
list.ListItems.Add(listItem4);
// ListItem listItem4 = new ListItem(new Paragraph(new Run("Fly safe, Cmdr! o7")));
// list.ListItems.Add(listItem4);

whatsNewWindow.WhatsNewText.Document.Blocks.Add(list);

Expand Down Expand Up @@ -1003,7 +1003,7 @@ private void Bt_CopyProfile_Click(object sender, RoutedEventArgs e)
var newProfile = new Profile
{
Name = newName,
Apps = new ObservableCollection<MyApp>(currentProfile.Apps)
Apps = new ObservableCollection<MyApp>(currentProfile.Apps.Select(app => app.DeepCopy()))
};
AppState.Instance.Profiles.Add(newProfile);
AppState.Instance.CurrentProfile = newProfile; // switch to the new profile
Expand Down
14 changes: 14 additions & 0 deletions MyApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ public class MyApp : INotifyPropertyChanged
#endregion Private Fields

#region Public Events
public MyApp DeepCopy()
{
return new MyApp
{
Args = this.Args,
ExeName = this.ExeName,
InstallationURL = this.InstallationURL,
IsEnabled = this.IsEnabled,
Name = this.Name,
Order = this.Order,
Path = this.Path,
WebAppURL = this.WebAppURL
};
}

public event PropertyChangedEventHandler PropertyChanged;

Expand Down

0 comments on commit 8ad4b19

Please sign in to comment.