Ignore:
Timestamp:
10/02/19 14:19:48 (5 years ago)
Author:
bln4
Message:

Implementation of ProfileManager. Refactor + additional content for how new profiles are created. The refactoring split out the creation of the default profile from user profiles. Refactoring revealed a long term bug that was causing user profiles to generate with incorrect information. The additional content fixed this bug by introducing the ${USER.NAME} variable, so that the default profile frameset can specify resource locations located in the users resource directory.

org.expeditee.auth.AuthenticatorBrowser
org.expeditee.auth.account.Create
org.expeditee.gui.Browser
org.expeditee.gui.management.ProfileManager
org.expeditee.setting.DirectoryListSetting
org.expeditee.setting.ListSetting
org.expeditee.settings.UserSettings

Implementation of ResourceManager as a core location to get resources from the file system. Also the additional variable ${CURRENT_FRAMESET} to represent the current frameset, so that images can be stored in the directory of the current frameset. This increases portability of framesets.

org.expeditee.gui.FrameIO
org.expeditee.gui.management.ResourceManager
org.expeditee.gui.management.ResourceUtil
Audio:

#NB: Audio used to only operate on a single directory. This has been updated to work in a same way as images. That is: when you ask for a specific resouce, it looks to the user settings to find a sequence of directories to look at in order until it manages to find the desired resource.


There is still need however for a single(ish) source of truth for the .banks and .mastermix file. Therefore these files are now always located in resource-<username>\audio.
org.apollo.agents.MelodySearch
org.apollo.audio.structure.AudioStructureModel
org.apollo.audio.util.MultiTrackPlaybackController
org.apollo.audio.util.SoundDesk
org.apollo.gui.FrameLayoutDaemon
org.apollo.io.AudioPathManager
org.apollo.util.AudioPurger
org.apollo.widgets.FramePlayer
org.apollo.widgets.SampledTrack

Images:

org.expeditee.items.ItemUtils

Frames:

org.expeditee.gui.FrameIO

Fixed a error in the FramePlayer class caused by an incorrect use of toArray().

org.apollo.widgets.FramePlayer


Added several short cut keys to allow for the Play/Pause (Ctrl + P), mute (Ctrl + M) and volume up/down (Ctrl + +/-) when hovering over SampledTrack widgets.

org.apollo.widgets.SampledTrack


Changed the way that Authenticate.login parses the new users profile to be more consistance with other similar places in code.

org.expeditee.auth.account.Authenticate


Encapsulated _body, _surrogateItemsBody and _primaryItemsBody in Frame class. Also changed getBody function to take a boolean flag as to if it should respect the current surrogate mode. If it should then it makes sure that labels have not changed since last time getBody was called.

org.expeditee.gui.Frame

File:
1 edited

Legend:

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

    r1415 r1434  
    3535import org.expeditee.gui.FrameUtils;
    3636import org.expeditee.gui.MessageBay;
     37import org.expeditee.gui.management.ProfileManager;
    3738import org.expeditee.items.Text;
    3839import org.expeditee.setting.BooleanSetting;
     
    4243import org.expeditee.setting.IntegerSetting;
    4344import org.expeditee.setting.ListSetting;
     45import org.expeditee.setting.Setting;
    4446import org.expeditee.setting.StringSetting;
    4547import org.expeditee.settings.folders.FolderSettings;
     
    5254public abstract class UserSettings {
    5355       
    54         public static String DEFAULT_PROFILE_NAME = "default";
     56        public static final String DEFAULT_PROFILE_NAME = "default";
    5557         
    5658        public static Boolean PublicAndPrivateResources;
     
    6668                @Override
    6769                public boolean setSetting(Text text) {
    68                 if(text.getText().indexOf(':') == -1 || !text.hasLink()) {
    69                         text.setLink(UserSettings.ProfileName.get() + "1");
     70                String profileName = UserSettings.ProfileName.get();
     71                        if(text.getText().indexOf(':') == -1 || !text.hasLink()) {
     72                                if (!profileName.equals(ProfileManager.USER_NAME_PATTERN)) {
     73                                        text.setLink(profileName + "1");
     74                                }
    7075                        //text.setLink(FrameIO.LoadProfile(UserSettings.ProfileName.get()).getName());
    7176                }
     
    7984                        // MessageBay.warningMessage("Home frame: " + first
    8085                        // + " is not a valid frame.");
    81                         _value = FrameIO.LoadProfile(UserSettings.ProfileName.get()).getName();
     86                        _value = profileName + "1";//FrameIO.LoadProfile(UserSettings.ProfileName.get()).getName();
    8287                }
    8388                return true;
     
    104109        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);
    105110               
    106         public static final StringSetting UserName = new StringSetting("Profile name", FrameIO.ConvertToValidFramesetName(System.getProperty("user.name")));
    107        
    108         public static final StringSetting ProfileName = new StringSetting("Profile name", UserName.get());
     111        public static final StringSetting UserName = new StringSetting("User name", "${USER.NAME}"); // FrameIO.ConvertToValidFramesetName(System.getProperty("user.name"))
     112       
     113        public static final StringSetting ProfileName = new StringSetting("Profile name", "${USER.NAME}");
    109114               
    110115        public static final BooleanSetting AntiAlias = new BooleanSetting("Whether anti-aliasing should be enabled", "AntiAlias", false);
     
    246251                if (PublicAndPrivateResources) {
    247252                        FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.HELP_PATH);
    248                         FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.HELP_PRIVATE_PATH);
     253                        FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.HELP_USERNAME_PRIVATE_PATH);
    249254                        FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.FRAME_PATH);
    250                         FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.FRAME_PRIVATE_PATH);
     255                        FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.FRAME_USERNAME_PRIVATE_PATH);
    251256                        FolderSettings.FrameDirs.addAbsoluteDir(FrameIO.MESSAGES_PATH);
    252257                        if (AuthenticatorBrowser.isAuthenticated()) {
     
    258263                       
    259264                        FolderSettings.ImageDirs.addAbsoluteDir(FrameIO.IMAGES_PATH);
    260                         FolderSettings.ImageDirs.addAbsoluteDir(FrameIO.IMAGES_PRIVATE_PATH);
     265                        FolderSettings.ImageDirs.addAbsoluteDir(FrameIO.IMAGES_USERNAME_PRIVATE_PATH);
    261266                        FolderSettings.ImageDirs.setDefault(FolderSettings.ImageDirs.get());
    262267                       
    263268                        FolderSettings.AudioDirs.addAbsoluteDir(FrameIO.AUDIO_PATH);
    264                         FolderSettings.AudioDirs.addAbsoluteDir(FrameIO.AUDIO_PRIVATE_PATH);
     269                        FolderSettings.AudioDirs.addAbsoluteDir(FrameIO.AUDIO_USERNAME_PRIVATE_PATH);
    265270                        FolderSettings.AudioDirs.setDefault(FolderSettings.AudioDirs.get());
    266271                } else {
Note: See TracChangeset for help on using the changeset viewer.