Ignore:
Timestamp:
01/07/14 10:59:52 (10 years ago)
Author:
jts21
Message:

Switch to using specialised objects for settings so they make more a bit more sense (now each setting is a single object instead of multiple, and setter functions and default values are less hackish)
Also added tooltips (help strings) to settings, will need to add a way of displaying these (maybe add the idea of a tooltip which is a text item which only appears when hovering over another item?)
Converted all settings over to new format, everything seems to be working fine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/FrameIO.java

    r614 r655  
    215215                } else {
    216216
    217                         for (String path : UserSettings.FrameDirs) {
     217                        for (String path : UserSettings.FrameDirs.get()) {
    218218                                loaded = LoadKnowPath(path, framename);
    219219                                if (loaded != null) {
     
    243243                StringBuffer list = new StringBuffer();
    244244
    245                 for (String path : UserSettings.FrameDirs) {
     245                for (String path : UserSettings.FrameDirs.get()) {
    246246                        File files = new File(path);
    247247                        if (!files.exists())
     
    305305                }
    306306
    307                 for (String path : UserSettings.FrameDirs) {
     307                for (String path : UserSettings.FrameDirs.get()) {
    308308                        if (getFrameFullPathName(path, frameName) != null)
    309309                                return true;
     
    316316                String fullPath = null;
    317317                if (path == null) {
    318                         for (String possiblePath : UserSettings.FrameDirs) {
     318                        for (String possiblePath : UserSettings.FrameDirs.get()) {
    319319                                fullPath = getFrameFullPathName(possiblePath, frameName);
    320320                                if (fullPath != null)
     
    666666                                + template.getName() + " from TDFC");
    667667
    668                 template.setOwner(UserSettings.UserName);
     668                template.setOwner(UserSettings.UserName.get());
    669669                template.reset();
    670670                template.resetDateCreated();
     
    12421242        public static Boolean canAccessFrameset(String framesetName) {
    12431243                framesetName = framesetName.toLowerCase();
    1244                 for (String path : UserSettings.FrameDirs) {
     1244                for (String path : UserSettings.FrameDirs.get()) {
    12451245                        if ((new File(path + framesetName)).exists())
    12461246                                return true;
     
    13001300                Frame base = null;
    13011301                try {
    1302                         base = LoadFrame(UserSettings.DefaultFrame);
     1302                        base = LoadFrame(UserSettings.DefaultFrame.get());
    13031303                } catch (Exception e) {
    13041304                }
     
    13181318                base.setPath(path);
    13191319                base.change();
    1320                 base.setOwner(UserSettings.UserName);
     1320                base.setOwner(UserSettings.UserName.get());
    13211321                SaveFrame(base, false);
    13221322
     
    13261326                base.setTitle(frameset);
    13271327                base.change();
    1328                 base.setOwner(UserSettings.UserName);
     1328                base.setOwner(UserSettings.UserName.get());
    13291329                SaveFrame(base, true);
    13301330
     
    13791379
    13801380                // Search all the available directories for the directory
    1381                 for (String path : UserSettings.FrameDirs) {
     1381                for (String path : UserSettings.FrameDirs.get()) {
    13821382                        String source = path + framesetName.toLowerCase() + File.separator;
    13831383                        File framesetDirectory = new File(source);
     
    14191419                // search through all the directories to find the frameset we are
    14201420                // copying
    1421                 for (String path : UserSettings.FrameDirs) {
     1421                for (String path : UserSettings.FrameDirs.get()) {
    14221422                        String source = path + framesetToCopy.toLowerCase()
    14231423                                        + File.separator;
     
    15761576        public static void setSavedProperties(Frame toSave) {
    15771577                toSave.setLastModifyDate(Formatter.getDateTime());
    1578                 toSave.setLastModifyUser(UserSettings.UserName);
     1578                toSave.setLastModifyUser(UserSettings.UserName.get());
    15791579                toSave.setVersion(toSave.getVersion() + 1);
    15801580                Time darkTime = new Time(SessionStats.getFrameDarkTime().getTime()
Note: See TracChangeset for help on using the changeset viewer.