Changeset 1539


Ignore:
Timestamp:
11/02/20 15:41:32 (4 years ago)
Author:
bnemhaus
Message:

Moved the HomeFrame settings to be prior to the ProfileName and UserName setting because the HomeFrame setting CAN be dependent on having a profile name already set.

Added code to deal with legacy framesets that will still have HomeFrame setting appearing before ProfileName and UserName.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/settings/UserSettings.java

    r1474 r1539  
    3131import org.expeditee.agents.wordprocessing.JSpellChecker;
    3232import org.expeditee.auth.AuthenticatorBrowser;
     33import org.expeditee.gui.Browser;
    3334import org.expeditee.gui.Frame;
    3435import org.expeditee.gui.FrameIO;
     
    3637import org.expeditee.gui.MessageBay;
    3738import org.expeditee.gui.management.ProfileManager;
     39import org.expeditee.gui.management.ResourceUtil;
    3840import org.expeditee.items.Text;
    3941import org.expeditee.setting.BooleanSetting;
     
    5961        public static final IntegerSetting Gravity = new IntegerSetting("Distance the cursor has to be from a text item to select the text item", "Gravity", 3);
    6062       
     63        public static final StringSetting UserName = new StringSetting("User name", ProfileManager.USER_NAME_FLAG);
     64       
     65        public static final StringSetting ProfileName = new StringSetting("Profile name", ProfileManager.PROFILE_NAME_FLAG);
     66
    6167        public static final StringSetting StartFrame = new StringSetting("The frame to go to when Expeditee is started (defaults to the profile frame)", null);
    6268       
     
    6874                public boolean setSetting(Text text) {
    6975                String profileName = UserSettings.ProfileName.get();
     76               
     77                if (profileName == null) { profileName = Browser.getExpediteeUserProfileName(); }
     78                else {
     79                        // Legacy case for if the order of the settings frame causes HomeFrame to be parsed before the UserName and ProfileName.
     80                        profileName = ResourceUtil.substitute(profileName, ProfileManager.PROFILE_NAME_FLAG, Browser.getExpediteeUserProfileName());
     81                }
     82               
    7083                        if(text.getText().indexOf(':') == -1 || !text.hasLink()) {
    7184                                //if (!profileName.equals(ProfileManager.USER_NAME_FLAG)) {
    72                                 if (profileName != null) {
    73                                         text.setLink(profileName + "1");
    74                                 }
     85                                text.setLink(profileName + "1");
    7586                        //text.setLink(FrameIO.LoadProfile(UserSettings.ProfileName.get()).getName());
    7687                }
     
    108119       
    109120        public static final IntegerSetting TitlePosition = new IntegerSetting("Position of title item in frame (TODO: find whether this is x-offset or y-offset)", "TitlePosition", 150);
    110                
    111         public static final StringSetting UserName = new StringSetting("User name", ProfileManager.USER_NAME_FLAG);
    112        
    113 //      public static final StringSetting ProfileName = new StringSetting("Profile name", ProfileManager.USER_NAME_FLAG); // FrameIO.ConvertToValidFramesetName(System.getProperty("user.name"))
    114         public static final StringSetting ProfileName = new StringSetting("Profile name", null); // FrameIO.ConvertToValidFramesetName(System.getProperty("user.name"))
    115                
     121                               
    116122        public static final BooleanSetting AntiAlias = new BooleanSetting("Whether anti-aliasing should be enabled", "AntiAlias", false);
    117123
Note: See TracChangeset for help on using the changeset viewer.