1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 12:35:22 +02:00

[189271] [team] New Profile's are always active

This commit is contained in:
David McKnight 2007-10-02 13:28:33 +00:00
parent 66a3ca2e50
commit 165efc470f

View file

@ -14,6 +14,8 @@
* David Dykstal (IBM) - created and used RSEPreferencesManager * David Dykstal (IBM) - created and used RSEPreferencesManager
* - moved SystemPreferencesManager to a new plugin * - moved SystemPreferencesManager to a new plugin
* Kevin Doyle (IBM) - [197199] Renaming a Profile doesn't cause a save * Kevin Doyle (IBM) - [197199] Renaming a Profile doesn't cause a save
* Yu-Fen Kuo (MontaVista) - [189271] [team] New Profile's are always active
* - [189219] [team] Inactive Profiles become active after workbench restart
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core.model; package org.eclipse.rse.internal.core.model;
@ -88,9 +90,9 @@ public class SystemProfileManager implements ISystemProfileManager {
deleteSystemProfile(existingProfile, false); // replace the existing one with a new profile deleteSystemProfile(existingProfile, false); // replace the existing one with a new profile
} }
ISystemProfile newProfile = internalCreateSystemProfile(name); ISystemProfile newProfile = internalCreateSystemProfile(name);
newProfile.setActive(makeActive);
if (makeActive) { if (makeActive) {
RSEPreferencesManager.addActiveProfile(name); RSEPreferencesManager.addActiveProfile(name);
((SystemProfile) newProfile).setActive(makeActive);
} }
newProfile.commit(); newProfile.commit();
return newProfile; return newProfile;
@ -103,8 +105,10 @@ public class SystemProfileManager implements ISystemProfileManager {
boolean wasActive = isSystemProfileActive(profile.getName()); boolean wasActive = isSystemProfileActive(profile.getName());
if (wasActive && !makeActive) if (wasActive && !makeActive)
RSEPreferencesManager.deleteActiveProfile(profile.getName()); RSEPreferencesManager.deleteActiveProfile(profile.getName());
else if (makeActive && !wasActive) RSEPreferencesManager.addActiveProfile(profile.getName()); else if (makeActive && !wasActive)
((SystemProfile) profile).setActive(makeActive); RSEPreferencesManager.addActiveProfile(profile.getName());
profile.setActive(makeActive);
profile.commit();
} }
/* (non-Javadoc) /* (non-Javadoc)