Changeset 105 for trunk/src/org/expeditee/gui/FrameIO.java
- Timestamp:
- 06/20/08 12:55:35 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameIO.java
r104 r105 9 9 import java.io.FileWriter; 10 10 import java.io.IOException; 11 import java.sql.Time; 11 12 import java.util.HashMap; 12 13 … … 629 630 * 630 631 * @param toSave 631 * The Frame to save to disk in KMS format.632 * The Frame to save to disk 632 633 */ 633 634 public static String SaveFrame(Frame toSave) { … … 645 646 * 646 647 * @param toSave 647 * The Frame to save to disk in KMS format.648 * The Frame to save to disk 648 649 * @param inc 649 650 * True if the saved frames counter should be incremented, false … … 655 656 boolean checkBackup) { 656 657 657 if (toSave == null) 658 // TODO When loading a frame maybe append onto the event history too- with a 659 // break to indicate the end of a session 660 661 if (toSave == null ||!toSave.hasChanged() || toSave.isSaved()){ 662 SessionStats.NewFrameSession(); 658 663 return ""; 659 660 if (!toSave.hasChanged() || toSave.isSaved()) 661 return ""; 662 664 } 663 665 // Get the full path only to determine which format to use for saving 664 666 // the frame … … 672 674 && toSave.getNameItem().Permission < Item.PERMISSION_TDFC) { 673 675 _Cache.remove(toSave.getName().toLowerCase()); 676 SessionStats.NewFrameSession(); 674 677 return ""; 675 678 } … … 694 697 } 695 698 // Check if we are trying to save an out of date version 696 if (savedVersion > toSave.getVersion( false)699 if (savedVersion > toSave.getVersion() 697 700 && !toSave.getFramesetName().equalsIgnoreCase( 698 701 FrameGraphics.MESSAGES_FRAMESET_NAME)) { … … 741 744 ResumeCache(); 742 745 } 743 toSave.setActiveTime(SessionStats.getFrameActiveTime()); 744 toSave.setDarkTime(SessionStats.getFrameDarkTime()); 746 // Update general stuff about frame 745 747 toSave.setLastModifyDate(Logger.EasyDateFormat("ddMMMyyyy:HHmm")); 746 748 toSave.setLastModifyUser(UserSettings.Username); 749 toSave.setVersion(toSave.getVersion() + 1); 750 Time darkTime = new Time(SessionStats.getFrameDarkTime().getTime() 751 + toSave.getDarkTime().getTime()); 752 Time activeTime = new Time(SessionStats.getFrameActiveTime() 753 .getTime() 754 + toSave.getActiveTime().getTime()); 755 toSave.setDarkTime(darkTime); 756 toSave.setActiveTime(activeTime); 757 747 758 writer.writeFrame(toSave); 748 759 toSave.setSaved(); 749 if (inc) 760 if (inc) { 750 761 SessionStats.SavedFrame(toSave.getName()); 762 } 751 763 752 764 // avoid out-of-sync frames (when in TwinFrames mode)
Note:
See TracChangeset
for help on using the changeset viewer.