Move last selected profile management into ProfileManager
- Multi-user support: store the value in a user specific key
This commit is contained in:
parent
a8598abafe
commit
be3eed0f5d
3 changed files with 28 additions and 6 deletions
|
|
@ -135,7 +135,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
string[] comportNames = FrostedSerialPort.GetPortNames();
|
||||
|
||||
var startupProfile = ProfileManager.LoadProfile(UserSettings.Instance.get("ActiveProfileID"));
|
||||
var startupProfile = ProfileManager.Instance.LoadLastProfile();
|
||||
if (startupProfile != null)
|
||||
{
|
||||
portExists = comportNames.Contains(startupProfile.ComPort());
|
||||
|
|
@ -162,9 +162,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
var profile = ProfileManager.LoadProfile(printerID);
|
||||
|
||||
UserSettings.Instance.set("ActiveProfileID", printerID);
|
||||
|
||||
UserSettings.Instance.set("ActiveUserName", ApplicationController.Instance.GetSessionUsernameForFileSystem());
|
||||
ProfileManager.Instance.SetLastProfile(printerID);
|
||||
|
||||
Instance = profile ?? ProfileManager.LoadEmptyProfile();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue