Ignore:
Timestamp:
12/18/13 14:22:48 (11 years ago)
Author:
jts21
Message:

Generated settings frames now use capitalised setting names, and settings are generated/displayed in the order they were declared in code.
Settings with no value no longer have a ':' after their name (good for some things, however maybe we should be showing somehow that some settings can have a value set after a colon, and others use a frame linked from the setting item, and others just use the properties of the setting item?).
Password setting(s) now use the password widget.
Fixed some problems with settings that try to work without having a value set (SpellChecker, ColorWheels, HomeFrame).

File:
1 edited

Legend:

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

    r639 r641  
    9090        public static String HomeFrame = null;
    9191        public static void setHomeFrame(Text t) {
     92                if(t.getText().indexOf(':') == -1 || !t.hasLink()) {
     93                        t.setLink(FrameIO.LoadProfile(UserSettings.ProfileName).getName());
     94                }
    9295                String first = FrameUtils.getLink(t, UserSettings.HomeFrame);
    9396                // do not use non-existant frames as the first frame
     
    111114        }
    112115        public static void setFramesetDir(Text t) {
     116                if(t.getText().indexOf(':') == -1) {
     117                        return;
     118                }
    113119                String dir = null;
    114120                AttributeValuePair avp = new AttributeValuePair(t.getText());
     
    126132        }
    127133        public static void setImageDir(Text t) {
     134                if(t.getText().indexOf(':') == -1) {
     135                        return;
     136                }
    128137                String dir = null;
    129138                AttributeValuePair avp = new AttributeValuePair(t.getText());
     
    137146       
    138147        public static void setLogDir(Text t) {
     148                if(t.getText().indexOf(':') == -1) {
     149                        return;
     150                }
    139151                AttributeValuePair avp = new AttributeValuePair(t.getText());
    140152                if(avp.getValue().trim().length() != 0) {
     
    177189         */
    178190        public static void setColorWheel(Text t) {
    179                 Item.COLOR_WHEEL = FrameUtils.getColorWheel(t);
     191                if(t.getChild() != null) Item.COLOR_WHEEL = FrameUtils.getColorWheel(t);
    180192        }
    181193       
    182194        public static void setFillColorWheel(Text t) {
    183                 Item.FILL_COLOR_WHEEL = FrameUtils.getColorWheel(t);
     195                if(t.getChild() != null) Item.FILL_COLOR_WHEEL = FrameUtils.getColorWheel(t);
    184196        }
    185197       
    186198        public static void setBackgroundColorWheel(Text t) {
    187                 Frame.COLOR_WHEEL = FrameUtils.getColorWheel(t);
     199                if(t.getChild() != null) Frame.COLOR_WHEEL = FrameUtils.getColorWheel(t);
    188200        }
    189201       
     
    218230       
    219231        public static void setSpellChecker(Text t) {
    220                 try {
    221                         JSpellChecker.create();
    222                 } catch (FileNotFoundException e) {
    223                         MessageBay.errorMessage("Could not find dictionary: "
    224                                         + e.getMessage());
    225                 } catch (IOException e) {
    226                         e.printStackTrace();
     232                AttributeValuePair avp = new AttributeValuePair(t.getText());
     233                if(avp.getBooleanValue()) {
     234                try {
     235                        JSpellChecker.create();
     236                } catch (FileNotFoundException e) {
     237                        MessageBay.errorMessage("Could not find dictionary: "
     238                                        + e.getMessage());
     239                } catch (IOException e) {
     240                        e.printStackTrace();
     241                }
    227242                }
    228243        }
    229244        public static void setSpelling(Text t) {
    230                 try {
    231                 JSpellChecker.create(t.getChild());
    232         } catch (Exception e) {
    233                 e.printStackTrace();
    234         }
     245                if(t.hasLink()) {
     246                try {
     247                JSpellChecker.create(t.getChild());
     248            } catch (Exception e) {
     249                e.printStackTrace();
     250            }
     251                }
    235252        }
    236253       
Note: See TracChangeset for help on using the changeset viewer.