Skip to content

Commit

Permalink
Update version and enhance UX features
Browse files Browse the repository at this point in the history
- Incremented the project version in `Elite Dangerous Addon Launcher V2.csproj` from `1.1.5.405` to `1.1.5.407`, preparing for a new release.
- Added a feature in `MainWindow.xaml.cs` to prompt the user to create a new profile through `AddProfileDialog` if no profiles exist at application startup, improving the initial user experience.
- Introduced a `ModifyTheme(Uri newThemeUri)` method in `MainWindow.xaml.cs` for dynamic theme changing, enhancing customization options for the user.
  • Loading branch information
jimmyeao committed Jul 14, 2024
1 parent 46ae45f commit c473387
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 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_Launcher_V2</RootNamespace>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AssemblyVersion>1.1.5.405</AssemblyVersion>
<FileVersion>1.1.5.405</FileVersion>
<AssemblyVersion>1.1.5.407</AssemblyVersion>
<FileVersion>1.1.5.407</FileVersion>
<ApplicationIcon>elite-dangerous-icon.ico</ApplicationIcon>
<PackageIcon>app.png</PackageIcon>
<PackageProjectUrl>https://github.com/jimmyeao/Elite-Dangerous-Addon-Launcher-V2</PackageProjectUrl>
Expand Down
30 changes: 30 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,34 @@ private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
isDarkTheme = settings.Theme == "Dark";
ApplyTheme(settings.Theme);
AppState.Instance.CloseAllAppsOnExit = settings.CloseAllAppsOnExit;

// Check if there are no profiles and invoke AddProfileDialog if none exist
if (AppState.Instance.Profiles == null || AppState.Instance.Profiles.Count == 0)
{
var window = new AddProfileDialog();
// Center the dialog within the owner window
window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
window.Owner = this; // Or replace 'this' with reference to the main window

if (window.ShowDialog() == true)
{
string profileName = window.ProfileName;
var newProfile = new Profile { Name = profileName, IsDefault = true };

// Unmark any existing default profiles
foreach (var profile in AppState.Instance.Profiles)
{
profile.IsDefault = false;
}

AppState.Instance.Profiles.Add(newProfile);
AppState.Instance.CurrentProfile = newProfile;

await SaveProfilesAsync();
UpdateDataGrid();
}
}

if (App.AutoLaunch)
{
foreach (var app in AppState.Instance.CurrentProfile.Apps)
Expand All @@ -668,6 +696,8 @@ private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
ShowWhatsNewIfUpdated();
}



private void ModifyTheme(Uri newThemeUri)
{
var appResources = Application.Current.Resources;
Expand Down

0 comments on commit c473387

Please sign in to comment.