Changeset 12
- Timestamp:
- 05/01/08 17:55:18 (16 years ago)
- Location:
- trunk/src/org/expeditee/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Browser.java
r10 r12 78 78 UserSettings.Init(); 79 79 UserSettings.Username = System.getProperty("user.name"); 80 Frame profile = FrameIO.LoadProfile(UserSettings.Username); 80 String userName = FrameIO.ConvertToValidFramesetName(UserSettings.Username); 81 Frame profile = FrameIO.LoadProfile(userName); 81 82 if (profile == null) { 82 83 try { 83 profile = FrameIO.CreateNewProfile( UserSettings.Username);84 profile = FrameIO.CreateNewProfile(userName); 84 85 } catch (Exception e) { 85 86 //TODO tell the user that there was a problem creating the profile frame and close nicely -
trunk/src/org/expeditee/gui/FrameIO.java
r10 r12 774 774 } 775 775 776 p rivate static String NameValidation(String toValidate) throws Exception{776 public static String ConvertToValidFramesetName(String toValidate) { 777 777 String result = ""; 778 778 … … 781 781 char cur = toValidate.charAt(i); 782 782 783 // check for illegal characters784 if (ILLEGAL_CHARS.contains("" + cur)) {785 throw new Exception(786 "Frameset name contains illegal character '" + cur787 + "' at position " + (i + 1));788 }789 790 783 // capitalize all characters after spaces 791 if (cur == ' ') { 792 capital = true; 793 } else { 784 if (Character.isLetterOrDigit(cur)) { 794 785 if (capital) { 795 786 capital = false; … … 799 790 800 791 if (result.length() >= MAX_NAME_LENGTH) { 801 throw new Exception("Frameset name is too long (Max " 802 + MAX_NAME_LENGTH + " characters)"); 792 result = result.substring(0,MAX_NAME_LENGTH); 803 793 } 804 } 805 } 806 794 } else { 795 capital = true; 796 } 797 } 798 807 799 return result; 808 800 } … … 900 892 901 893 // ensure the framename is valid 902 frameset = NameValidation(frameset);894 frameset = ConvertToValidFramesetName(frameset); 903 895 904 896 if (frameset == null) … … 970 962 if (!FrameIO.DoesFramesetExist(framesetName)) 971 963 return false; 972 964 973 965 for (String path : UserSettings.FrameDirs) { 974 966 String source = path + framesetName.toLowerCase() + File.separator; -
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r8 r12 1323 1323 Frame linkTo = FrameIO.CreateNewFrameset(text.getFirstLine()); 1324 1324 DisplayIO.setCursor(Item.DEFAULT_CURSOR); 1325 1326 1325 text.setLink(linkTo.getFrameName()); 1327 1328 1326 text.getParent().setChanged(true); 1329 1327 FrameUtils.DisplayFrame(linkTo, true);
Note:
See TracChangeset
for help on using the changeset viewer.