mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Project cleanup
This commit is contained in:
1 parent
f5e95e43be
commit
3aa9a632ea
51 files changed
+440
-490
No files matched your search
@@ -71,22 +71,6 @@ namespace Artemis.UI.Screens.Module.ProfileEditor
|
||||
|
||||
public bool CanDeleteActiveProfile => SelectedProfile != null && Profiles.Count > 1;
|
||||
|
||||
private void ChangeSelectedProfile(Profile profile)
|
||||
{
|
||||
if (profile == Module.ActiveProfile)
|
||||
return;
|
||||
|
||||
var oldProfile = Module.ActiveProfile;
|
||||
_profileService.ActivateProfile(Module, profile);
|
||||
|
||||
if (oldProfile != null)
|
||||
_profileService.UpdateProfile(oldProfile, false);
|
||||
if (profile != null)
|
||||
_profileService.UpdateProfile(profile, false);
|
||||
|
||||
_profileEditorService.ChangeSelectedProfile(profile);
|
||||
}
|
||||
|
||||
public Profile CreateProfile(string name)
|
||||
{
|
||||
var profile = _profileService.CreateProfile(Module, name);
|
||||
@@ -135,14 +119,6 @@ namespace Artemis.UI.Screens.Module.ProfileEditor
|
||||
_profileEditorService.RedoUpdateProfile(Module);
|
||||
}
|
||||
|
||||
private void ModuleOnActiveProfileChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (SelectedProfile == Module.ActiveProfile)
|
||||
return;
|
||||
|
||||
SelectedProfile = Profiles.FirstOrDefault(p => p == Module.ActiveProfile);
|
||||
}
|
||||
|
||||
protected override void OnActivate()
|
||||
{
|
||||
LoadWorkspaceSettings();
|
||||
@@ -158,6 +134,30 @@ namespace Artemis.UI.Screens.Module.ProfileEditor
|
||||
base.OnDeactivate();
|
||||
}
|
||||
|
||||
private void ChangeSelectedProfile(Profile profile)
|
||||
{
|
||||
if (profile == Module.ActiveProfile)
|
||||
return;
|
||||
|
||||
var oldProfile = Module.ActiveProfile;
|
||||
_profileService.ActivateProfile(Module, profile);
|
||||
|
||||
if (oldProfile != null)
|
||||
_profileService.UpdateProfile(oldProfile, false);
|
||||
if (profile != null)
|
||||
_profileService.UpdateProfile(profile, false);
|
||||
|
||||
_profileEditorService.ChangeSelectedProfile(profile);
|
||||
}
|
||||
|
||||
private void ModuleOnActiveProfileChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (SelectedProfile == Module.ActiveProfile)
|
||||
return;
|
||||
|
||||
SelectedProfile = Profiles.FirstOrDefault(p => p == Module.ActiveProfile);
|
||||
}
|
||||
|
||||
private void LoadWorkspaceSettings()
|
||||
{
|
||||
SidePanelsWidth = _settingsService.GetSetting("ProfileEditor.SidePanelsWidth", new GridLength(385));
|
||||
|
||||
Reference in new issue
Block a user